|
SmartSnippets DA1459x SDK
|
Go to the documentation of this file.
56 #define mainBIT_BLE_GEN_IRQ (1 << 0)
57 #define mainBIT_COMMAND_QUEUE (1 << 1)
58 #define mainBIT_EVENT_QUEUE_AVAIL (1 << 2)
59 #define mainBIT_EVENT_LPCLOCK_AVAIL (1 << 3)
60 #define mainBIT_STAY_ACTIVE_UPDATED (1 << 4)
61 #define mainBIT_BLE_CMAC_IRQ (1 << 5)
62 #define mainBIT_BLE_TIMER_EXPIRED (1 << 6)
63 #define mainBIT_BLE_STACK_READ_CB (1 << 7)
64 #define mainBIT_TEMP_MONITOR_ENABLE (1 << 9)
65 #define mainBIT_TEMP_MONITOR_DISABLE (1 << 10)
66 #define mainBIT_BLE_RF_CALIBRATION (1 << 11)
67 #if (dg_configBLE_ADV_STOP_DELAY_ENABLE == 1)
68 #define mainBIT_EVENT_ADV_END (1 << 31)
72 #define HCI_CMD_HEADER_LENGTH 3
73 #define HCI_ACL_HEADER_LENGTH 4
74 #define HCI_SCO_HEADER_LENGTH 3
75 #define HCI_EVT_HEADER_LENGTH 2
76 #define GTL_MSG_HEADER_LENGTH 8
78 #define HCI_CMD_PARAM_LEN_OFFSET 3
79 #define HCI_ACL_PARAM_LEN_OFFSET 3
80 #define HCI_SCO_PARAM_LEN_OFFSET 3
81 #define HCI_EVT_PARAM_LEN_OFFSET 2
82 #define GTL_MSG_PARAM_LEN_OFFSET 7
84 #define HCI_RESET_CMD_OP_CODE (0x0C03)
87 #define MAX_WAIT_TIME portMAX_DELAY
90 typedef enum ad_ble_op_codes {
91 AD_BLE_OP_CODE_STACK_MSG = 0x00,
92 AD_BLE_OP_CODE_ADAPTER_MSG = 0x01,
101 typedef enum ad_ble_operations {
102 AD_BLE_OP_CMP_EVT = 0x00,
103 AD_BLE_OP_INIT_CMD = 0x01,
104 AD_BLE_OP_RESET_CMD = 0x02,
110 } ad_ble_operation_t;
113 typedef enum ad_ble_statuses {
114 AD_BLE_STATUS_NO_ERROR = 0x00,
115 AD_BLE_STATUS_TIMEOUT = 0x01,
124 enum ad_ble_stack_statuses {
125 BLE_STACK_IO_OK = 0x00,
126 BLE_STACK_IO_ERROR = 0x01,
135 BLE_HCI_CMD_MSG = 0x01,
136 BLE_HCI_ACL_MSG = 0x02,
137 BLE_HCI_SCO_MSG = 0x03,
138 BLE_HCI_EVT_MSG = 0x04,
140 #ifdef CONFIG_USE_FTDF
145 typedef uint16_t hci_cmd_op_code_t;
146 typedef uint16_t hci_cmd_op_code_t;
157 uint16_t handle_flags;
158 uint16_t data_length;
163 uint16_t conn_handle_flags;
176 uint8_t param_length;
182 uint16_t handle_flags;
183 uint16_t param_length;
189 uint16_t handle_flags;
190 uint8_t param_length;
197 uint8_t param_length;
216 uint16_t param_length;
232 ad_ble_operation_t operation;
359 #if dg_configNVPARAM_ADAPTER
374 #if (dg_configRF_ENABLE_RECALIBRATION == 1)
381 void ad_ble_notify_rf_calibration(
void);
389 #if (USE_BLE_SLEEP == 1)
393 void ad_ble_update_wakeup_time(
void);
401 #if (dg_configUSE_SYS_TCS == 1)
405 void ad_ble_tcs_config(
void);
408 #if (dg_configRF_ENABLE_RECALIBRATION == 1)
412 void ad_ble_rf_calibration_info(
void);
422 void ad_ble_set_rf_calibration_info(
const uint32_t value);
430 uint32_t conn_evt_counter[BLE_CONNECTION_MAX_USER];
432 uint32_t conn_evt_counter_non_apfm[BLE_CONNECTION_MAX_USER];
434 uint32_t adv_evt_counter;
436 uint32_t adv_evt_counter_non_apfm;
444 #if (USE_BLE_SLEEP == 1)
445 #if (dg_configUSE_LP_CLK == LP_CLK_RCX)
449 void ad_ble_update_rcx(
void);
struct ad_ble_msg ad_ble_msg_t
BLE configuration options.
BLE Adapter configuration.
OS_QUEUE evt_q
Definition: ad_ble.h:247
struct hci_acl_msg hci_acl_msg_t
struct ble_hci_acl_msg_hdr ble_hci_acl_hdr_t
void ad_ble_sys_tcs_config(void)
Configure CMAC SYS TCS table.
OS_BASE_TYPE ad_ble_command_queue_send(const void *item, OS_TICK_TIME wait_ticks)
Send a message to the BLE adapter command queue.
Structure for low level driver statistics.
Definition: ad_ble.h:428
struct hci_cmd_msg hci_cmd_msg_t
struct ble_hci_evt_hdr ble_hci_evt_hdr_t
OS abstraction layer API.
void ad_ble_get_irk(uint8_t irk[KEY_LEN])
Get device's IRK.
void ad_ble_get_lld_stats(struct ad_ble_lld_stats *stats)
Gets low level driver statistics.
void ad_ble_lpclock_available(void)
Notify the BLE adapter that LP clock is available.
struct ble_hci_cmd_hdr ble_hci_cmd_hdr_t
void ad_ble_init(void)
Initialize BLE adapter - create command and event queues.
bool ad_ble_read_nvms_param(uint8_t *param, uint8_t len, uint8_t nvparam_tag, uint32_t nvms_addr)
Read configuration parameters form NVMS parameter area.
struct ble_hci_msg ble_hci_msg_t
OS_BASE_TYPE ad_ble_event_queue_send(const void *item, OS_TICK_TIME wait_ticks)
Send a message to the BLE adapter event queue.
void ad_ble_task_notify(uint32_t value)
Notify BLE adapter.
OS_QUEUE cmd_q
Definition: ad_ble.h:246
struct hci_sco_msg hci_sco_msg_t
void ad_ble_stay_active(bool status)
Force BLE to stay active.
OS_TASK task
Definition: ad_ble.h:245
bool ad_ble_non_retention_heap_in_use(void)
Check if the non retention BLE heap is in use.
struct hci_evt_msg hci_evt_msg_t
struct ble_stack_msg ble_stack_msg_t
void ad_ble_notify_event_queue_avail(void)
Notifies BLE adapter that there is free space on the event queue.
struct ble_hci_sco_hdr ble_hci_sco_hdr_t
struct ad_ble_hdr ad_ble_hdr_t
void ad_ble_get_public_address(uint8_t address[BD_ADDR_LEN])
Get public static address.
OS_BASE_TYPE ad_ble_event_queue_register(const OS_TASK task_handle)
Register task for BLE Adapter's event Queue notifications.
void * nvparam_t
NV-Parameters area handle.
Definition: ad_nvparam.h:72
NV Parameters adapter API.
struct ble_gtl_msg ble_gtl_msg_t
const ad_ble_interface_t * ad_ble_get_interface(void)
Get BLE Adapter interface.
nvparam_t ad_ble_get_nvparam_handle(void)
Get non-volatile parameter handle.