nuBorn Medical / Mbed 2 deprecated mbed-os-example-ble-master

Dependencies:   mbed

Committer:
bpd227
Date:
Fri Jun 29 01:19:08 2018 +0000
Revision:
0:599bc564478b
first

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bpd227 0:599bc564478b 1 /******************** (C) COPYRIGHT 2014 STMicroelectronics ********************
bpd227 0:599bc564478b 2 * File Name : bluenrg_hal_aci.h
bpd227 0:599bc564478b 3 * Author : AMS - AAS
bpd227 0:599bc564478b 4 * Version : V1.0.0
bpd227 0:599bc564478b 5 * Date : 26-Jun-2014
bpd227 0:599bc564478b 6 * Description : Header file with HCI commands for BlueNRG
bpd227 0:599bc564478b 7 ********************************************************************************
bpd227 0:599bc564478b 8 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
bpd227 0:599bc564478b 9 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
bpd227 0:599bc564478b 10 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
bpd227 0:599bc564478b 11 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
bpd227 0:599bc564478b 12 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
bpd227 0:599bc564478b 13 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
bpd227 0:599bc564478b 14 *******************************************************************************/
bpd227 0:599bc564478b 15
bpd227 0:599bc564478b 16 #ifndef __BLUENRG_HAL_ACI_H__
bpd227 0:599bc564478b 17 #define __BLUENRG_HAL_ACI_H__
bpd227 0:599bc564478b 18
bpd227 0:599bc564478b 19 /**
bpd227 0:599bc564478b 20 *@addtogroup HAL HAL
bpd227 0:599bc564478b 21 *@brief Hardware Abstraction Layer.
bpd227 0:599bc564478b 22 *@{
bpd227 0:599bc564478b 23 */
bpd227 0:599bc564478b 24
bpd227 0:599bc564478b 25 /**
bpd227 0:599bc564478b 26 * @defgroup HAL_Functions HAL functions
bpd227 0:599bc564478b 27 * @brief API for BlueNRG HAL layer.
bpd227 0:599bc564478b 28 * @{
bpd227 0:599bc564478b 29 */
bpd227 0:599bc564478b 30
bpd227 0:599bc564478b 31 /**
bpd227 0:599bc564478b 32 * @brief This command retrieves the buid number of the firmware.
bpd227 0:599bc564478b 33 * @param[out] build_number Build number identifying the firmware release.
bpd227 0:599bc564478b 34 * @return Value indicating success or error code.
bpd227 0:599bc564478b 35 */
bpd227 0:599bc564478b 36 tBleStatus aci_hal_get_fw_build_number(uint16_t *build_number);
bpd227 0:599bc564478b 37
bpd227 0:599bc564478b 38 /**
bpd227 0:599bc564478b 39 * @brief This command writes a value to a low level configure data structure.
bpd227 0:599bc564478b 40 * @note It is useful to setup directly some low level parameters for the system at runtime.
bpd227 0:599bc564478b 41 * @param offset Offset in the data structure. The starting member in the data structure will have an offset 0.\n
bpd227 0:599bc564478b 42 * See @ref Config_vals.
bpd227 0:599bc564478b 43 *
bpd227 0:599bc564478b 44 * @param len Length of data to be written
bpd227 0:599bc564478b 45 * @param[out] val Data to be written
bpd227 0:599bc564478b 46 * @return Value indicating success or error code.
bpd227 0:599bc564478b 47 */
bpd227 0:599bc564478b 48 tBleStatus aci_hal_write_config_data(uint8_t offset,
bpd227 0:599bc564478b 49 uint8_t len,
bpd227 0:599bc564478b 50 const uint8_t *val);
bpd227 0:599bc564478b 51
bpd227 0:599bc564478b 52 /**
bpd227 0:599bc564478b 53 * @brief This command requests the value in the low level configure data structure.
bpd227 0:599bc564478b 54 * The number of read bytes changes for different Offset.
bpd227 0:599bc564478b 55 * @param offset Offset in the data structure. The starting member in the data structure will have an offset 0.\n
bpd227 0:599bc564478b 56 * See @ref Config_vals.
bpd227 0:599bc564478b 57 * @param data_len Length of the data buffer
bpd227 0:599bc564478b 58 * @param[out] data_len_out_p length of the data returned by the read.
bpd227 0:599bc564478b 59 * @param[out] data Read data
bpd227 0:599bc564478b 60 * @return Value indicating success or error code.
bpd227 0:599bc564478b 61 */
bpd227 0:599bc564478b 62 tBleStatus aci_hal_read_config_data(uint8_t offset, uint16_t data_len, uint8_t *data_len_out_p, uint8_t *data);
bpd227 0:599bc564478b 63
bpd227 0:599bc564478b 64 /**
bpd227 0:599bc564478b 65 * @brief This command sets the TX power level of the BlueNRG.
bpd227 0:599bc564478b 66 * @note By controlling the EN_HIGH_POWER and the PA_LEVEL, the combination of the 2 determines
bpd227 0:599bc564478b 67 * the output power level (dBm).
bpd227 0:599bc564478b 68 * When the system starts up or reboots, the default TX power level will be used, which is
bpd227 0:599bc564478b 69 * the maximum value of 8dBm. Once this command is given, the output power will be changed
bpd227 0:599bc564478b 70 * instantly, regardless if there is Bluetooth communication going on or not. For example,
bpd227 0:599bc564478b 71 * for debugging purpose, the BlueNRG can be set to advertise all the time and use this
bpd227 0:599bc564478b 72 * command to observe the signal strength changing. The system will keep the last received
bpd227 0:599bc564478b 73 * TX power level from the command, i.e. the 2nd command overwrites the previous TX power
bpd227 0:599bc564478b 74 * level. The new TX power level remains until another Set TX Power command, or the system
bpd227 0:599bc564478b 75 * reboots.\n
bpd227 0:599bc564478b 76 * @param en_high_power Can be only 0 or 1. Set high power bit on or off. It is strongly adviced to use the
bpd227 0:599bc564478b 77 * right value, depending on the selected hardware configuration for the RF network:
bpd227 0:599bc564478b 78 * normal mode or high power mode.
bpd227 0:599bc564478b 79 * @param pa_level Can be from 0 to 7. Set the PA level value.
bpd227 0:599bc564478b 80 * @return Value indicating success or error code.
bpd227 0:599bc564478b 81 */
bpd227 0:599bc564478b 82 tBleStatus aci_hal_set_tx_power_level(uint8_t en_high_power, uint8_t pa_level);
bpd227 0:599bc564478b 83
bpd227 0:599bc564478b 84 /**
bpd227 0:599bc564478b 85 * @brief This command returns the number of packets sent in Direct Test Mode.
bpd227 0:599bc564478b 86 * @note When the Direct TX test is started, a 32-bit counter is used to count how many packets
bpd227 0:599bc564478b 87 * have been transmitted. This command can be used to check how many packets have been sent
bpd227 0:599bc564478b 88 * during the Direct TX test.\n
bpd227 0:599bc564478b 89 * The counter starts from 0 and counts upwards. The counter can wrap and start from 0 again.
bpd227 0:599bc564478b 90 * The counter is not cleared until the next Direct TX test starts.
bpd227 0:599bc564478b 91 * @param[out] number_of_packets Number of packets sent during the last Direct TX test.
bpd227 0:599bc564478b 92 * @return Value indicating success or error code.
bpd227 0:599bc564478b 93 */
bpd227 0:599bc564478b 94 tBleStatus aci_hal_le_tx_test_packet_number(uint32_t *number_of_packets);
bpd227 0:599bc564478b 95
bpd227 0:599bc564478b 96 /**
bpd227 0:599bc564478b 97 * @brief Put the device in standby mode.
bpd227 0:599bc564478b 98 * @note Normally the BlueNRG will automatically enter sleep mode to save power. This command puts the
bpd227 0:599bc564478b 99 * device into the Standby mode instead of the sleep mode. The difference is that, in sleep mode,
bpd227 0:599bc564478b 100 * the device can still wake up itself with the internal timer. But in standby mode, this timer is
bpd227 0:599bc564478b 101 * disabled. So the only possibility to wake up the device is by external signals, e.g. a HCI command
bpd227 0:599bc564478b 102 * sent via SPI bus.
bpd227 0:599bc564478b 103 * The command is only accepted when there is no other Bluetooth activity. Otherwise an error code
bpd227 0:599bc564478b 104 * ERR_COMMAND_DISALLOWED will be returned.
bpd227 0:599bc564478b 105 *
bpd227 0:599bc564478b 106 * @return Value indicating success or error code.
bpd227 0:599bc564478b 107 */
bpd227 0:599bc564478b 108 tBleStatus aci_hal_device_standby(void);
bpd227 0:599bc564478b 109
bpd227 0:599bc564478b 110 /**
bpd227 0:599bc564478b 111 * @brief This command starts a carrier frequency, i.e. a tone, on a specific channel.
bpd227 0:599bc564478b 112 * @note The frequency sine wave at the specific channel may be used for test purpose only.
bpd227 0:599bc564478b 113 * The channel ID is a parameter from 0 to 39 for the 40 BLE channels, e.g. 0 for 2.402GHz, 1 for 2.404GHz etc.
bpd227 0:599bc564478b 114 * This command shouldn't be used when normal Bluetooth activities are ongoing.
bpd227 0:599bc564478b 115 * The tone should be stopped by aci_hal_tone_stop() command.
bpd227 0:599bc564478b 116 *
bpd227 0:599bc564478b 117 * @param rf_channel BLE Channel ID, from 0 to 39 meaning (2.402 + 2*N) GHz. Actually the tone will be emitted at the
bpd227 0:599bc564478b 118 * channel central frequency minus 250 kHz.
bpd227 0:599bc564478b 119 * @return Value indicating success or error code.
bpd227 0:599bc564478b 120 */
bpd227 0:599bc564478b 121 tBleStatus aci_hal_tone_start(uint8_t rf_channel);
bpd227 0:599bc564478b 122
bpd227 0:599bc564478b 123 /**
bpd227 0:599bc564478b 124 * This command is used to stop the previously started aci_hal_tone_start() command.
bpd227 0:599bc564478b 125 * @return Value indicating success or error code.
bpd227 0:599bc564478b 126 */
bpd227 0:599bc564478b 127 tBleStatus aci_hal_tone_stop(void);
bpd227 0:599bc564478b 128
bpd227 0:599bc564478b 129 /**
bpd227 0:599bc564478b 130 * @brief This command returns the status of all the connections.
bpd227 0:599bc564478b 131 * @note This command returns the status of the 8 Bluetooth low energy links managed by the device.
bpd227 0:599bc564478b 132 * @param[out] link_status Array of link status (8 links). See @ref Link_Status.
bpd227 0:599bc564478b 133 * @param[out] conn_handle Array of connection handles for each link.
bpd227 0:599bc564478b 134 * @return Value indicating success or error code.
bpd227 0:599bc564478b 135 */
bpd227 0:599bc564478b 136 tBleStatus aci_hal_get_link_status(uint8_t link_status[8], uint16_t conn_handle[8]);
bpd227 0:599bc564478b 137
bpd227 0:599bc564478b 138 /**
bpd227 0:599bc564478b 139 * @brief This command returns the anchor period and the largest available slot.
bpd227 0:599bc564478b 140 * @note This command returns information about the anchor period to help application in selecting
bpd227 0:599bc564478b 141 * slot timings when operating in multi-link scenarios.
bpd227 0:599bc564478b 142 * @param anchor_period Current anchor period (multiple of 0.625 ms).
bpd227 0:599bc564478b 143 * @param max_free_slot Maximum available time (multiple of 0.625 ms) that can be allocated for a new slot.
bpd227 0:599bc564478b 144 * @return Value indicating success or error code.
bpd227 0:599bc564478b 145 */
bpd227 0:599bc564478b 146 tBleStatus aci_hal_get_anchor_period(uint32_t *anchor_period, uint32_t *max_free_slot);
bpd227 0:599bc564478b 147
bpd227 0:599bc564478b 148 /**
bpd227 0:599bc564478b 149 * @}
bpd227 0:599bc564478b 150 */
bpd227 0:599bc564478b 151
bpd227 0:599bc564478b 152 /**
bpd227 0:599bc564478b 153 * @defgroup HAL_Events HAL events
bpd227 0:599bc564478b 154 * The structures are the data field of @ref evt_blue_aci.
bpd227 0:599bc564478b 155 * @{
bpd227 0:599bc564478b 156 */
bpd227 0:599bc564478b 157
bpd227 0:599bc564478b 158 /** HCI vendor specific event, raised at BlueNRG power-up or reboot. */
bpd227 0:599bc564478b 159 #define EVT_BLUE_HAL_INITIALIZED (0x0001)
bpd227 0:599bc564478b 160 typedef __packed struct _evt_hal_initialized{
bpd227 0:599bc564478b 161 uint8_t reason_code; /**< Reset reason. See @ref Reset_Reasons */
bpd227 0:599bc564478b 162 } PACKED evt_hal_initialized;
bpd227 0:599bc564478b 163
bpd227 0:599bc564478b 164 /**
bpd227 0:599bc564478b 165 * This event is generated when an overflow occurs in the event queue read by the external microcontroller.
bpd227 0:599bc564478b 166 * This is normally caused when the external microcontroller does not read pending events.
bpd227 0:599bc564478b 167 * The returned bitmap indicates which event has been lost. Please note that one bit set to 1 indicates one or
bpd227 0:599bc564478b 168 * more occurrences of the particular events. The event EVT_BLUE_HAL_EVENTS_LOST cannot be lost and it will
bpd227 0:599bc564478b 169 * be inserted in the event queue as soon as a position is freed in the event queue. This event should not
bpd227 0:599bc564478b 170 * happen under normal operating condition where external microcontroller promptly reads events signaled by
bpd227 0:599bc564478b 171 * IRQ pin. It is provided to detected unexpected behavior of the external microcontroller or to allow
bpd227 0:599bc564478b 172 * application to recover situations where critical events are lost.
bpd227 0:599bc564478b 173 */
bpd227 0:599bc564478b 174 #define EVT_BLUE_HAL_EVENTS_LOST_IDB05A1 (0x0002)
bpd227 0:599bc564478b 175 typedef __packed struct _evt_hal_events_lost{
bpd227 0:599bc564478b 176 uint8_t lost_events[8]; /**< Bitmap of lost events. Each bit indicates one or more occurrences of the specific event. See @ref Lost_Events */
bpd227 0:599bc564478b 177 } PACKED evt_hal_events_lost_IDB05A1;
bpd227 0:599bc564478b 178
bpd227 0:599bc564478b 179
bpd227 0:599bc564478b 180 /**
bpd227 0:599bc564478b 181 * This event is given to the application after the @ref ACI_BLUE_INITIALIZED_EVENT
bpd227 0:599bc564478b 182 * when a system crash is detected. This events returns system crash information for debugging purposes.
bpd227 0:599bc564478b 183 * Information reported are useful to understand the root cause of the crash.
bpd227 0:599bc564478b 184 */
bpd227 0:599bc564478b 185 #define EVT_BLUE_HAL_CRASH_INFO_IDB05A1 (0x0003)
bpd227 0:599bc564478b 186 typedef __packed struct _evt_hal_crash_info{
bpd227 0:599bc564478b 187 uint8_t crash_type; /**< Type of crash: Assert failed (0), NMI Fault (1), Hard Fault (2) */
bpd227 0:599bc564478b 188 uint32_t sp; /**< SP register */
bpd227 0:599bc564478b 189 uint32_t r0; /**< R0 register */
bpd227 0:599bc564478b 190 uint32_t r1; /**< R1 register */
bpd227 0:599bc564478b 191 uint32_t r2; /**< R2 register */
bpd227 0:599bc564478b 192 uint32_t r3; /**< R3 register */
bpd227 0:599bc564478b 193 uint32_t r12; /**< R12 register */
bpd227 0:599bc564478b 194 uint32_t lr; /**< LR register */
bpd227 0:599bc564478b 195 uint32_t pc; /**< PC register */
bpd227 0:599bc564478b 196 uint32_t xpsr; /**< xPSR register */
bpd227 0:599bc564478b 197 uint8_t debug_data_len; /**< length of debug_data field */
bpd227 0:599bc564478b 198 uint8_t debug_data[VARIABLE_SIZE]; /**< Debug data */
bpd227 0:599bc564478b 199 } PACKED evt_hal_crash_info_IDB05A1;
bpd227 0:599bc564478b 200
bpd227 0:599bc564478b 201
bpd227 0:599bc564478b 202 /**
bpd227 0:599bc564478b 203 * @}
bpd227 0:599bc564478b 204 */
bpd227 0:599bc564478b 205
bpd227 0:599bc564478b 206
bpd227 0:599bc564478b 207 /**
bpd227 0:599bc564478b 208 * @anchor Reset_Reasons
bpd227 0:599bc564478b 209 * @name Reset Reasons
bpd227 0:599bc564478b 210 * See @ref EVT_BLUE_HAL_INITIALIZED.
bpd227 0:599bc564478b 211 * @{
bpd227 0:599bc564478b 212 */
bpd227 0:599bc564478b 213 #define RESET_NORMAL 1 /**< Normal startup. */
bpd227 0:599bc564478b 214 #define RESET_UPDATER_ACI 2 /**< Updater mode entered with ACI command */
bpd227 0:599bc564478b 215 #define RESET_UPDATER_BAD_FLAG 3 /**< Updater mode entered due to a bad BLUE flag */
bpd227 0:599bc564478b 216 #define RESET_UPDATER_PIN 4 /**< Updater mode entered with IRQ pin */
bpd227 0:599bc564478b 217 #define RESET_WATCHDOG 5 /**< Reset caused by watchdog */
bpd227 0:599bc564478b 218 #define RESET_LOCKUP 6 /**< Reset due to lockup */
bpd227 0:599bc564478b 219 #define RESET_BROWNOUT 7 /**< Brownout reset */
bpd227 0:599bc564478b 220 #define RESET_CRASH 8 /**< Reset caused by a crash (NMI or Hard Fault) */
bpd227 0:599bc564478b 221 #define RESET_ECC_ERR 9 /**< Reset caused by an ECC error */
bpd227 0:599bc564478b 222 /**
bpd227 0:599bc564478b 223 * @}
bpd227 0:599bc564478b 224 */
bpd227 0:599bc564478b 225
bpd227 0:599bc564478b 226
bpd227 0:599bc564478b 227 /**
bpd227 0:599bc564478b 228 * @defgroup Config_vals Offsets and lengths for configuration values.
bpd227 0:599bc564478b 229 * @brief Offsets and lengths for configuration values.
bpd227 0:599bc564478b 230 * See aci_hal_write_config_data().
bpd227 0:599bc564478b 231 * @{
bpd227 0:599bc564478b 232 */
bpd227 0:599bc564478b 233
bpd227 0:599bc564478b 234 /**
bpd227 0:599bc564478b 235 * @name Configuration values.
bpd227 0:599bc564478b 236 * See @ref aci_hal_write_config_data().
bpd227 0:599bc564478b 237 * @{
bpd227 0:599bc564478b 238 */
bpd227 0:599bc564478b 239 #define CONFIG_DATA_PUBADDR_OFFSET (0x00) /**< Bluetooth public address */
bpd227 0:599bc564478b 240 #define CONFIG_DATA_DIV_OFFSET (0x06) /**< DIV used to derive CSRK */
bpd227 0:599bc564478b 241 #define CONFIG_DATA_ER_OFFSET (0x08) /**< Encryption root key used to derive LTK and CSRK */
bpd227 0:599bc564478b 242 #define CONFIG_DATA_IR_OFFSET (0x18) /**< Identity root key used to derive LTK and CSRK */
bpd227 0:599bc564478b 243 #define CONFIG_DATA_LL_WITHOUT_HOST (0x2C) /**< Switch on/off Link Layer only mode. Set to 1 to disable Host.
bpd227 0:599bc564478b 244 It can be written only if aci_hal_write_config_data() is the first command after reset. */
bpd227 0:599bc564478b 245 #define CONFIG_DATA_RANDOM_ADDRESS (0x80) /**< Stored static random address. Read-only. */
bpd227 0:599bc564478b 246
bpd227 0:599bc564478b 247 /**
bpd227 0:599bc564478b 248 * Select the BlueNRG mode configurations.\n
bpd227 0:599bc564478b 249 * @li Mode 1: slave or master, 1 connection, RAM1 only (small GATT DB)
bpd227 0:599bc564478b 250 * @li Mode 2: slave or master, 1 connection, RAM1 and RAM2 (large GATT DB)
bpd227 0:599bc564478b 251 * @li Mode 3: master/slave, 8 connections, RAM1 and RAM2.
bpd227 0:599bc564478b 252 * @li Mode 4: master/slave, 4 connections, RAM1 and RAM2 simultaneous scanning and advertising.
bpd227 0:599bc564478b 253 */
bpd227 0:599bc564478b 254 #define CONFIG_DATA_MODE_OFFSET (0x2D)
bpd227 0:599bc564478b 255
bpd227 0:599bc564478b 256 #define CONFIG_DATA_WATCHDOG_DISABLE (0x2F) /**< Set to 1 to disable watchdog. It is enabled by default. */
bpd227 0:599bc564478b 257 /**
bpd227 0:599bc564478b 258 * @}
bpd227 0:599bc564478b 259 */
bpd227 0:599bc564478b 260
bpd227 0:599bc564478b 261 /**
bpd227 0:599bc564478b 262 * @name Length for configuration values.
bpd227 0:599bc564478b 263 * See @ref aci_hal_write_config_data().
bpd227 0:599bc564478b 264 * @{
bpd227 0:599bc564478b 265 */
bpd227 0:599bc564478b 266 #define CONFIG_DATA_PUBADDR_LEN (6)
bpd227 0:599bc564478b 267 #define CONFIG_DATA_DIV_LEN (2)
bpd227 0:599bc564478b 268 #define CONFIG_DATA_ER_LEN (16)
bpd227 0:599bc564478b 269 #define CONFIG_DATA_IR_LEN (16)
bpd227 0:599bc564478b 270 #define CONFIG_DATA_LL_WITHOUT_HOST_LEN (1)
bpd227 0:599bc564478b 271 #define CONFIG_DATA_MODE_LEN (1)
bpd227 0:599bc564478b 272 #define CONFIG_DATA_WATCHDOG_DISABLE_LEN (1)
bpd227 0:599bc564478b 273 /**
bpd227 0:599bc564478b 274 * @}
bpd227 0:599bc564478b 275 */
bpd227 0:599bc564478b 276
bpd227 0:599bc564478b 277 /**
bpd227 0:599bc564478b 278 * @anchor Link_Status
bpd227 0:599bc564478b 279 * @name Status of the link
bpd227 0:599bc564478b 280 * See @ref aci_hal_get_link_status().
bpd227 0:599bc564478b 281 * @{
bpd227 0:599bc564478b 282 */
bpd227 0:599bc564478b 283 #define STATUS_IDLE 0
bpd227 0:599bc564478b 284 #define STATUS_ADVERTISING 1
bpd227 0:599bc564478b 285 #define STATUS_CONNECTED_AS_SLAVE 2
bpd227 0:599bc564478b 286 #define STATUS_SCANNING 3
bpd227 0:599bc564478b 287 #define STATUS_CONNECTED_AS_MASTER 5
bpd227 0:599bc564478b 288 #define STATUS_TX_TEST 6
bpd227 0:599bc564478b 289 #define STATUS_RX_TEST 7
bpd227 0:599bc564478b 290 /**
bpd227 0:599bc564478b 291 * @}
bpd227 0:599bc564478b 292 */
bpd227 0:599bc564478b 293
bpd227 0:599bc564478b 294 /**
bpd227 0:599bc564478b 295 * @}
bpd227 0:599bc564478b 296 */
bpd227 0:599bc564478b 297
bpd227 0:599bc564478b 298 /**
bpd227 0:599bc564478b 299 * @anchor Lost_Events
bpd227 0:599bc564478b 300 * @name Lost events bitmap
bpd227 0:599bc564478b 301 * See @ref EVT_BLUE_HAL_EVENTS_LOST.
bpd227 0:599bc564478b 302 * @{
bpd227 0:599bc564478b 303 */
bpd227 0:599bc564478b 304 #define EVT_DISCONN_COMPLETE_BIT 0
bpd227 0:599bc564478b 305 #define EVT_ENCRYPT_CHANGE_BIT 1
bpd227 0:599bc564478b 306 #define EVT_READ_REMOTE_VERSION_COMPLETE_BIT 2
bpd227 0:599bc564478b 307 #define EVT_CMD_COMPLETE_BIT 3
bpd227 0:599bc564478b 308 #define EVT_CMD_STATUS_BIT 4
bpd227 0:599bc564478b 309 #define EVT_HARDWARE_ERROR_BIT 5
bpd227 0:599bc564478b 310 #define EVT_NUM_COMP_PKTS_BIT 6
bpd227 0:599bc564478b 311 #define EVT_ENCRYPTION_KEY_REFRESH_BIT 7
bpd227 0:599bc564478b 312 #define EVT_BLUE_HAL_INITIALIZED_BIT 8
bpd227 0:599bc564478b 313 #define EVT_BLUE_GAP_SET_LIMITED_DISCOVERABLE_BIT 9
bpd227 0:599bc564478b 314 #define EVT_BLUE_GAP_PAIRING_CMPLT_BIT 10
bpd227 0:599bc564478b 315 #define EVT_BLUE_GAP_PASS_KEY_REQUEST_BIT 11
bpd227 0:599bc564478b 316 #define EVT_BLUE_GAP_AUTHORIZATION_REQUEST_BIT 12
bpd227 0:599bc564478b 317 #define EVT_BLUE_GAP_SECURITY_REQ_INITIATED_BIT 13
bpd227 0:599bc564478b 318 #define EVT_BLUE_GAP_BOND_LOST_BIT 14
bpd227 0:599bc564478b 319 #define EVT_BLUE_GAP_PROCEDURE_COMPLETE_BIT 15
bpd227 0:599bc564478b 320 #define EVT_BLUE_GAP_ADDR_NOT_RESOLVED_BIT 16
bpd227 0:599bc564478b 321 #define EVT_BLUE_L2CAP_CONN_UPDATE_RESP_BIT 17
bpd227 0:599bc564478b 322 #define EVT_BLUE_L2CAP_PROCEDURE_TIMEOUT_BIT 18
bpd227 0:599bc564478b 323 #define EVT_BLUE_L2CAP_CONN_UPDATE_REQ_BIT 19
bpd227 0:599bc564478b 324 #define EVT_BLUE_GATT_ATTRIBUTE_MODIFIED_BIT 20
bpd227 0:599bc564478b 325 #define EVT_BLUE_GATT_PROCEDURE_TIMEOUT_BIT 21
bpd227 0:599bc564478b 326 #define EVT_BLUE_EXCHANGE_MTU_RESP_BIT 22
bpd227 0:599bc564478b 327 #define EVT_BLUE_ATT_FIND_INFORMATION_RESP_BIT 23
bpd227 0:599bc564478b 328 #define EVT_BLUE_ATT_FIND_BY_TYPE_VAL_RESP_BIT 24
bpd227 0:599bc564478b 329 #define EVT_BLUE_ATT_READ_BY_TYPE_RESP_BIT 25
bpd227 0:599bc564478b 330 #define EVT_BLUE_ATT_READ_RESP_BIT 26
bpd227 0:599bc564478b 331 #define EVT_BLUE_ATT_READ_BLOB_RESP_BIT 27
bpd227 0:599bc564478b 332 #define EVT_BLUE_ATT_READ_MULTIPLE_RESP_BIT 28
bpd227 0:599bc564478b 333 #define EVT_BLUE_ATT_READ_BY_GROUP_RESP_BIT 29
bpd227 0:599bc564478b 334 #define EVT_BLUE_ATT_WRITE_RESP_BIT 30
bpd227 0:599bc564478b 335 #define EVT_BLUE_ATT_PREPARE_WRITE_RESP_BIT 31
bpd227 0:599bc564478b 336 #define EVT_BLUE_ATT_EXEC_WRITE_RESP_BIT 32
bpd227 0:599bc564478b 337 #define EVT_BLUE_GATT_INDICATION_BIT 33
bpd227 0:599bc564478b 338 #define EVT_BLUE_GATT_NOTIFICATION_BIT 34
bpd227 0:599bc564478b 339 #define EVT_BLUE_GATT_PROCEDURE_COMPLETE_BIT 35
bpd227 0:599bc564478b 340 #define EVT_BLUE_GATT_ERROR_RESP_BIT 36
bpd227 0:599bc564478b 341 #define EVT_BLUE_GATT_DISC_READ_CHARAC_BY_UUID_RESP_BIT 37
bpd227 0:599bc564478b 342 #define EVT_BLUE_GATT_WRITE_PERMIT_REQ_BIT 38
bpd227 0:599bc564478b 343 #define EVT_BLUE_GATT_READ_PERMIT_REQ_BIT 39
bpd227 0:599bc564478b 344 #define EVT_BLUE_GATT_READ_MULTI_PERMIT_REQ_BIT 40
bpd227 0:599bc564478b 345 #define EVT_BLUE_GATT_TX_POOL_AVAILABLE_BIT 41
bpd227 0:599bc564478b 346 #define EVT_BLUE_GATT_SERVER_RX_CONFIRMATION_BIT 42
bpd227 0:599bc564478b 347 #define EVT_BLUE_GATT_PREPARE_WRITE_PERMIT_REQ_BIT 43
bpd227 0:599bc564478b 348 #define EVT_LL_CONNECTION_COMPLETE_BIT 44
bpd227 0:599bc564478b 349 #define EVT_LL_ADVERTISING_REPORT_BIT 45
bpd227 0:599bc564478b 350 #define EVT_LL_CONNECTION_UPDATE_COMPLETE_BIT 46
bpd227 0:599bc564478b 351 #define EVT_LL_READ_REMOTE_USED_FEATURES_BIT 47
bpd227 0:599bc564478b 352 #define EVT_LL_LTK_REQUEST_BIT 48
bpd227 0:599bc564478b 353 /**
bpd227 0:599bc564478b 354 * @}
bpd227 0:599bc564478b 355 */
bpd227 0:599bc564478b 356
bpd227 0:599bc564478b 357 /**
bpd227 0:599bc564478b 358 * @name Hardware error event codes
bpd227 0:599bc564478b 359 * See @ref EVT_HARDWARE_ERROR.
bpd227 0:599bc564478b 360 * @{
bpd227 0:599bc564478b 361 */
bpd227 0:599bc564478b 362 /**
bpd227 0:599bc564478b 363 * Error on the SPI bus has been detected, most likely caused by incorrect SPI configuration on the external micro-controller.
bpd227 0:599bc564478b 364 */
bpd227 0:599bc564478b 365 #define SPI_FRAMING_ERROR 0
bpd227 0:599bc564478b 366 /**
bpd227 0:599bc564478b 367 * Caused by a slow crystal startup and they are an indication that the HS_STARTUP_TIME
bpd227 0:599bc564478b 368 * in the device configuration needs to be tuned. After this event is recommended to hardware reset the device.
bpd227 0:599bc564478b 369 */
bpd227 0:599bc564478b 370 #define RADIO_STATE_ERROR 1
bpd227 0:599bc564478b 371 /**
bpd227 0:599bc564478b 372 * Caused by a slow crystal startup and they are an indication that the HS_STARTUP_TIME
bpd227 0:599bc564478b 373 * in the device configuration needs to be tuned. After this event is recommended to hardware reset the device.
bpd227 0:599bc564478b 374 */
bpd227 0:599bc564478b 375 #define TIMER_OVERRUN_ERROR 2
bpd227 0:599bc564478b 376
bpd227 0:599bc564478b 377 /**
bpd227 0:599bc564478b 378 * @}
bpd227 0:599bc564478b 379 */
bpd227 0:599bc564478b 380
bpd227 0:599bc564478b 381 /**
bpd227 0:599bc564478b 382 * @}
bpd227 0:599bc564478b 383 */
bpd227 0:599bc564478b 384
bpd227 0:599bc564478b 385 #endif /* __BLUENRG_HAL_ACI_H__ */