ST / X_NUCLEO_IDB0XA1

Dependents:   Nucleo_Zumo_BLE_IDB04A1 contest_IOT5 contest_IOT6 contest_IOT_10 ... more

Fork of X_NUCLEO_IDB0XA1 by ST Expansion SW Team

Arduino Connector Compatibility Warning

X-NUCLEO-IDB04A1 and X-NUCLEO-IDB05A1 are Arduino compatible with an exception: instead of using pin D13 for the SPI clock, they use pin D3. The default configuration for this library is having the SPI clock on pin D3.

To be fully Arduino compatible, X-NUCLEO-IDB04A1 and X-NUCLEO-IDB05A1 need a small HW patch.

For X-NUCLEO-IDB04A1 this patch consists in removing zero resistor R10 and instead soldering zero resistor R11. For X-NUCLEO-IDB05A1 this patch consists in removing zero resistor R4 and instead soldering zero resistor R6.

In case you patch your board, then you also have to configure this library to use pin D13 to drive the SPI clock (see macro IDB0XA1_D13_PATCH in file x_nucleo_idb0xa1_targets.h).

If you use pin D13 for the SPI clock, please be aware that on STM32 Nucleo boards you may not drive the LED, otherwise you will get a conflict: the LED on STM32 Nucleo boards is connected to pin D13.

Referring to the current list of tested platforms (see X-NUCLEO-IDB04A1 and X-NUCLEO-IDB05A1 pages), the patch is required by ST-Nucleo-F103RB; ST-Nucleo-F302R8; ST-Nucleo-F411RE; and ST-Nucleo-F446RE.

Committer:
Wolfgang Betz
Date:
Tue Oct 06 14:25:08 2015 +0200
Revision:
130:770ce14d3d15
Include mbed-classic version

Derived from
- repo (on Codex): gitolite@codex.cro.st.com:x-nucleodev/X-NUCLEO-IKC01A1-MBED.git
- branch: ble_wb
- SHA1 ID: 5ccc73e35868169e42132c0d1c056f908a6d70c0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wolfgang Betz 130:770ce14d3d15 1 /******************** (C) COPYRIGHT 2012 STMicroelectronics ********************
Wolfgang Betz 130:770ce14d3d15 2 * File Name : bluenrg_gap.h
Wolfgang Betz 130:770ce14d3d15 3 * Author : AMS - HEA&RF BU
Wolfgang Betz 130:770ce14d3d15 4 * Version : V1.0.0
Wolfgang Betz 130:770ce14d3d15 5 * Date : 19-July-2012
Wolfgang Betz 130:770ce14d3d15 6 * Description : Header file for BlueNRG's GAP layer.
Wolfgang Betz 130:770ce14d3d15 7 ********************************************************************************
Wolfgang Betz 130:770ce14d3d15 8 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
Wolfgang Betz 130:770ce14d3d15 9 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
Wolfgang Betz 130:770ce14d3d15 10 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
Wolfgang Betz 130:770ce14d3d15 11 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
Wolfgang Betz 130:770ce14d3d15 12 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
Wolfgang Betz 130:770ce14d3d15 13 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
Wolfgang Betz 130:770ce14d3d15 14 *******************************************************************************/
Wolfgang Betz 130:770ce14d3d15 15 #ifndef __BNRG_GAP_H__
Wolfgang Betz 130:770ce14d3d15 16 #define __BNRG_GAP_H__
Wolfgang Betz 130:770ce14d3d15 17
Wolfgang Betz 130:770ce14d3d15 18 #include <link_layer.h>
Wolfgang Betz 130:770ce14d3d15 19
Wolfgang Betz 130:770ce14d3d15 20 /**
Wolfgang Betz 130:770ce14d3d15 21 *@addtogroup GAP GAP
Wolfgang Betz 130:770ce14d3d15 22 *@brief API for GAP layer.
Wolfgang Betz 130:770ce14d3d15 23 *@{
Wolfgang Betz 130:770ce14d3d15 24 */
Wolfgang Betz 130:770ce14d3d15 25
Wolfgang Betz 130:770ce14d3d15 26 /**
Wolfgang Betz 130:770ce14d3d15 27 * @name GAP UUIDs
Wolfgang Betz 130:770ce14d3d15 28 * @{
Wolfgang Betz 130:770ce14d3d15 29 */
Wolfgang Betz 130:770ce14d3d15 30 #define GAP_SERVICE_UUID (0x1800)
Wolfgang Betz 130:770ce14d3d15 31 #define DEVICE_NAME_UUID (0x2A00)
Wolfgang Betz 130:770ce14d3d15 32 #define APPEARANCE_UUID (0x2A01)
Wolfgang Betz 130:770ce14d3d15 33 #define PERIPHERAL_PRIVACY_FLAG_UUID (0x2A02)
Wolfgang Betz 130:770ce14d3d15 34 #define RECONNECTION_ADDR_UUID (0x2A03)
Wolfgang Betz 130:770ce14d3d15 35 #define PERIPHERAL_PREFERRED_CONN_PARAMS_UUID (0x2A04)
Wolfgang Betz 130:770ce14d3d15 36 /**
Wolfgang Betz 130:770ce14d3d15 37 * @}
Wolfgang Betz 130:770ce14d3d15 38 */
Wolfgang Betz 130:770ce14d3d15 39
Wolfgang Betz 130:770ce14d3d15 40 /**
Wolfgang Betz 130:770ce14d3d15 41 * @name Characteristic value lengths
Wolfgang Betz 130:770ce14d3d15 42 * @{
Wolfgang Betz 130:770ce14d3d15 43 */
Wolfgang Betz 130:770ce14d3d15 44 #define DEVICE_NAME_CHARACTERISTIC_LEN (8)
Wolfgang Betz 130:770ce14d3d15 45 #define APPEARANCE_CHARACTERISTIC_LEN (2)
Wolfgang Betz 130:770ce14d3d15 46 #define PERIPHERAL_PRIVACY_CHARACTERISTIC_LEN (1)
Wolfgang Betz 130:770ce14d3d15 47 #define RECONNECTION_ADDR_CHARACTERISTIC_LEN (6)
Wolfgang Betz 130:770ce14d3d15 48 #define PERIPHERAL_PREF_CONN_PARAMS_CHARACTERISTIC_LEN (8)
Wolfgang Betz 130:770ce14d3d15 49 /**
Wolfgang Betz 130:770ce14d3d15 50 * @}
Wolfgang Betz 130:770ce14d3d15 51 */
Wolfgang Betz 130:770ce14d3d15 52
Wolfgang Betz 130:770ce14d3d15 53 /*------------- AD types for adv data and scan response data ----------------*/
Wolfgang Betz 130:770ce14d3d15 54
Wolfgang Betz 130:770ce14d3d15 55 /**
Wolfgang Betz 130:770ce14d3d15 56 * @defgroup AD_Types AD Types
Wolfgang Betz 130:770ce14d3d15 57 * @brief AD Types
Wolfgang Betz 130:770ce14d3d15 58 * @{
Wolfgang Betz 130:770ce14d3d15 59 */
Wolfgang Betz 130:770ce14d3d15 60
Wolfgang Betz 130:770ce14d3d15 61 /* FLAGS AD type */
Wolfgang Betz 130:770ce14d3d15 62 #define AD_TYPE_FLAGS (0x01)
Wolfgang Betz 130:770ce14d3d15 63 /* flag bits */
Wolfgang Betz 130:770ce14d3d15 64 /**
Wolfgang Betz 130:770ce14d3d15 65 * @anchor Flags_AD_Type_bits
Wolfgang Betz 130:770ce14d3d15 66 * @name Flags AD Type bits
Wolfgang Betz 130:770ce14d3d15 67 * @brief Bits in Flags AD Type
Wolfgang Betz 130:770ce14d3d15 68 * @{
Wolfgang Betz 130:770ce14d3d15 69 */
Wolfgang Betz 130:770ce14d3d15 70 #define FLAG_BIT_LE_LIMITED_DISCOVERABLE_MODE (0x01)
Wolfgang Betz 130:770ce14d3d15 71 #define FLAG_BIT_LE_GENERAL_DISCOVERABLE_MODE (0x02)
Wolfgang Betz 130:770ce14d3d15 72 #define FLAG_BIT_BR_EDR_NOT_SUPPORTED (0x04)
Wolfgang Betz 130:770ce14d3d15 73 #define FLAG_BIT_LE_BR_EDR_CONTROLLER (0x08)
Wolfgang Betz 130:770ce14d3d15 74 #define FLAG_BIT_LE_BR_EDR_HOST (0x10)
Wolfgang Betz 130:770ce14d3d15 75 /**
Wolfgang Betz 130:770ce14d3d15 76 * @}
Wolfgang Betz 130:770ce14d3d15 77 */
Wolfgang Betz 130:770ce14d3d15 78
Wolfgang Betz 130:770ce14d3d15 79 /**
Wolfgang Betz 130:770ce14d3d15 80 * @name Service UUID AD types
Wolfgang Betz 130:770ce14d3d15 81 * @{
Wolfgang Betz 130:770ce14d3d15 82 */
Wolfgang Betz 130:770ce14d3d15 83 #define AD_TYPE_16_BIT_SERV_UUID (0x02)
Wolfgang Betz 130:770ce14d3d15 84 #define AD_TYPE_16_BIT_SERV_UUID_CMPLT_LIST (0x03)
Wolfgang Betz 130:770ce14d3d15 85 #define AD_TYPE_32_BIT_SERV_UUID (0x04)
Wolfgang Betz 130:770ce14d3d15 86 #define AD_TYPE_32_BIT_SERV_UUID_CMPLT_LIST (0x05)
Wolfgang Betz 130:770ce14d3d15 87 #define AD_TYPE_128_BIT_SERV_UUID (0x06)
Wolfgang Betz 130:770ce14d3d15 88 #define AD_TYPE_128_BIT_SERV_UUID_CMPLT_LIST (0x07)
Wolfgang Betz 130:770ce14d3d15 89 /**
Wolfgang Betz 130:770ce14d3d15 90 * @}
Wolfgang Betz 130:770ce14d3d15 91 */
Wolfgang Betz 130:770ce14d3d15 92
Wolfgang Betz 130:770ce14d3d15 93 /* LOCAL NAME AD types */
Wolfgang Betz 130:770ce14d3d15 94 /**
Wolfgang Betz 130:770ce14d3d15 95 * @name Local name AD types
Wolfgang Betz 130:770ce14d3d15 96 * @{
Wolfgang Betz 130:770ce14d3d15 97 */
Wolfgang Betz 130:770ce14d3d15 98 #define AD_TYPE_SHORTENED_LOCAL_NAME (0x08)
Wolfgang Betz 130:770ce14d3d15 99 #define AD_TYPE_COMPLETE_LOCAL_NAME (0x09)
Wolfgang Betz 130:770ce14d3d15 100 /**
Wolfgang Betz 130:770ce14d3d15 101 * @}
Wolfgang Betz 130:770ce14d3d15 102 */
Wolfgang Betz 130:770ce14d3d15 103
Wolfgang Betz 130:770ce14d3d15 104 /* TX power level AD type*/
Wolfgang Betz 130:770ce14d3d15 105 #define AD_TYPE_TX_POWER_LEVEL (0x0A)
Wolfgang Betz 130:770ce14d3d15 106
Wolfgang Betz 130:770ce14d3d15 107 /* Class of device */
Wolfgang Betz 130:770ce14d3d15 108 #define AD_TYPE_CLASS_OF_DEVICE (0x0D)
Wolfgang Betz 130:770ce14d3d15 109
Wolfgang Betz 130:770ce14d3d15 110 /* security manager TK value AD type */
Wolfgang Betz 130:770ce14d3d15 111 #define AD_TYPE_SEC_MGR_TK_VALUE (0x10)
Wolfgang Betz 130:770ce14d3d15 112
Wolfgang Betz 130:770ce14d3d15 113 /* security manager OOB flags */
Wolfgang Betz 130:770ce14d3d15 114 #define AD_TYPE_SEC_MGR_OOB_FLAGS (0x11)
Wolfgang Betz 130:770ce14d3d15 115
Wolfgang Betz 130:770ce14d3d15 116 /* slave connection interval AD type */
Wolfgang Betz 130:770ce14d3d15 117 #define AD_TYPE_SLAVE_CONN_INTERVAL (0x12)
Wolfgang Betz 130:770ce14d3d15 118
Wolfgang Betz 130:770ce14d3d15 119 /* service solicitation UUID list Ad types*/
Wolfgang Betz 130:770ce14d3d15 120 /**
Wolfgang Betz 130:770ce14d3d15 121 * @name Service solicitation UUID list AD types
Wolfgang Betz 130:770ce14d3d15 122 * @{
Wolfgang Betz 130:770ce14d3d15 123 */
Wolfgang Betz 130:770ce14d3d15 124 #define AD_TYPE_SERV_SOLICIT_16_BIT_UUID_LIST (0x14)
Wolfgang Betz 130:770ce14d3d15 125 #define AD_TYPE_SERV_SOLICIT_32_BIT_UUID_LIST (0x1F)
Wolfgang Betz 130:770ce14d3d15 126 #define AD_TYPE_SERV_SOLICIT_128_BIT_UUID_LIST (0x15)
Wolfgang Betz 130:770ce14d3d15 127 /**
Wolfgang Betz 130:770ce14d3d15 128 * @}
Wolfgang Betz 130:770ce14d3d15 129 */
Wolfgang Betz 130:770ce14d3d15 130
Wolfgang Betz 130:770ce14d3d15 131 /* service data AD type */
Wolfgang Betz 130:770ce14d3d15 132 #define AD_TYPE_SERVICE_DATA (0x16)
Wolfgang Betz 130:770ce14d3d15 133
Wolfgang Betz 130:770ce14d3d15 134 /* manufaturer specific data AD type */
Wolfgang Betz 130:770ce14d3d15 135 #define AD_TYPE_MANUFACTURER_SPECIFIC_DATA (0xFF)
Wolfgang Betz 130:770ce14d3d15 136
Wolfgang Betz 130:770ce14d3d15 137 /**
Wolfgang Betz 130:770ce14d3d15 138 * @}
Wolfgang Betz 130:770ce14d3d15 139 */
Wolfgang Betz 130:770ce14d3d15 140
Wolfgang Betz 130:770ce14d3d15 141 #define MAX_ADV_DATA_LEN (31)
Wolfgang Betz 130:770ce14d3d15 142
Wolfgang Betz 130:770ce14d3d15 143 #define DEVICE_NAME_LEN (7)
Wolfgang Betz 130:770ce14d3d15 144 #define BD_ADDR_SIZE (6)
Wolfgang Betz 130:770ce14d3d15 145
Wolfgang Betz 130:770ce14d3d15 146 /**
Wolfgang Betz 130:770ce14d3d15 147 * @name Privacy flag values
Wolfgang Betz 130:770ce14d3d15 148 * @{
Wolfgang Betz 130:770ce14d3d15 149 */
Wolfgang Betz 130:770ce14d3d15 150 #define PRIVACY_ENABLED (0x01)
Wolfgang Betz 130:770ce14d3d15 151 #define PRIVACY_DISABLED (0x00)
Wolfgang Betz 130:770ce14d3d15 152 /**
Wolfgang Betz 130:770ce14d3d15 153 * @}
Wolfgang Betz 130:770ce14d3d15 154 */
Wolfgang Betz 130:770ce14d3d15 155
Wolfgang Betz 130:770ce14d3d15 156 /**
Wolfgang Betz 130:770ce14d3d15 157 * @name Intervals
Wolfgang Betz 130:770ce14d3d15 158 * Intervals in terms of 625 micro sec
Wolfgang Betz 130:770ce14d3d15 159 * @{
Wolfgang Betz 130:770ce14d3d15 160 */
Wolfgang Betz 130:770ce14d3d15 161 #define DIR_CONN_ADV_INT_MIN (0x190)/*250ms*/
Wolfgang Betz 130:770ce14d3d15 162 #define DIR_CONN_ADV_INT_MAX (0x320)/*500ms*/
Wolfgang Betz 130:770ce14d3d15 163 #define UNDIR_CONN_ADV_INT_MIN (0x800)/*1.28s*/
Wolfgang Betz 130:770ce14d3d15 164 #define UNDIR_CONN_ADV_INT_MAX (0x1000)/*2.56s*/
Wolfgang Betz 130:770ce14d3d15 165 #define LIM_DISC_ADV_INT_MIN (0x190)/*250ms*/
Wolfgang Betz 130:770ce14d3d15 166 #define LIM_DISC_ADV_INT_MAX (0x320)/*500ms*/
Wolfgang Betz 130:770ce14d3d15 167 #define GEN_DISC_ADV_INT_MIN (0x800)/*1.28s*/
Wolfgang Betz 130:770ce14d3d15 168 #define GEN_DISC_ADV_INT_MAX (0x1000)/*2.56s*/
Wolfgang Betz 130:770ce14d3d15 169 /**
Wolfgang Betz 130:770ce14d3d15 170 * @}
Wolfgang Betz 130:770ce14d3d15 171 */
Wolfgang Betz 130:770ce14d3d15 172
Wolfgang Betz 130:770ce14d3d15 173 /**
Wolfgang Betz 130:770ce14d3d15 174 * @name Timeout values
Wolfgang Betz 130:770ce14d3d15 175 * @{
Wolfgang Betz 130:770ce14d3d15 176 */
Wolfgang Betz 130:770ce14d3d15 177 #define LIM_DISC_MODE_TIMEOUT (180000)/* 180 seconds. according to the errata published */
Wolfgang Betz 130:770ce14d3d15 178 #define PRIVATE_ADDR_INT_TIMEOUT (900000)/* 15 minutes */
Wolfgang Betz 130:770ce14d3d15 179 /**
Wolfgang Betz 130:770ce14d3d15 180 * @}
Wolfgang Betz 130:770ce14d3d15 181 */
Wolfgang Betz 130:770ce14d3d15 182
Wolfgang Betz 130:770ce14d3d15 183 /**
Wolfgang Betz 130:770ce14d3d15 184 * @anchor gap_roles
Wolfgang Betz 130:770ce14d3d15 185 * @name GAP Roles
Wolfgang Betz 130:770ce14d3d15 186 * @{
Wolfgang Betz 130:770ce14d3d15 187 */
Wolfgang Betz 130:770ce14d3d15 188 #define GAP_PERIPHERAL_ROLE_IDB05A1 (0x01)
Wolfgang Betz 130:770ce14d3d15 189 #define GAP_BROADCASTER_ROLE_IDB05A1 (0x02)
Wolfgang Betz 130:770ce14d3d15 190 #define GAP_CENTRAL_ROLE_IDB05A1 (0x04)
Wolfgang Betz 130:770ce14d3d15 191 #define GAP_OBSERVER_ROLE_IDB05A1 (0x08)
Wolfgang Betz 130:770ce14d3d15 192
Wolfgang Betz 130:770ce14d3d15 193 #define GAP_PERIPHERAL_ROLE_IDB04A1 (0x01)
Wolfgang Betz 130:770ce14d3d15 194 #define GAP_BROADCASTER_ROLE_IDB04A1 (0x02)
Wolfgang Betz 130:770ce14d3d15 195 #define GAP_CENTRAL_ROLE_IDB04A1 (0x03)
Wolfgang Betz 130:770ce14d3d15 196 #define GAP_OBSERVER_ROLE_IDB04A1 (0x04)
Wolfgang Betz 130:770ce14d3d15 197 /**
Wolfgang Betz 130:770ce14d3d15 198 * @}
Wolfgang Betz 130:770ce14d3d15 199 */
Wolfgang Betz 130:770ce14d3d15 200
Wolfgang Betz 130:770ce14d3d15 201 /**
Wolfgang Betz 130:770ce14d3d15 202 * @anchor gap_procedure_codes
Wolfgang Betz 130:770ce14d3d15 203 * @name GAP procedure codes
Wolfgang Betz 130:770ce14d3d15 204 * Procedure codes for EVT_BLUE_GAP_PROCEDURE_COMPLETE event
Wolfgang Betz 130:770ce14d3d15 205 * and aci_gap_terminate_gap_procedure() command.
Wolfgang Betz 130:770ce14d3d15 206 * @{
Wolfgang Betz 130:770ce14d3d15 207 */
Wolfgang Betz 130:770ce14d3d15 208 #define GAP_LIMITED_DISCOVERY_PROC (0x01)
Wolfgang Betz 130:770ce14d3d15 209 #define GAP_GENERAL_DISCOVERY_PROC (0x02)
Wolfgang Betz 130:770ce14d3d15 210 #define GAP_NAME_DISCOVERY_PROC (0x04)
Wolfgang Betz 130:770ce14d3d15 211 #define GAP_AUTO_CONNECTION_ESTABLISHMENT_PROC (0x08)
Wolfgang Betz 130:770ce14d3d15 212 #define GAP_GENERAL_CONNECTION_ESTABLISHMENT_PROC (0x10)
Wolfgang Betz 130:770ce14d3d15 213 #define GAP_SELECTIVE_CONNECTION_ESTABLISHMENT_PROC (0x20)
Wolfgang Betz 130:770ce14d3d15 214 #define GAP_DIRECT_CONNECTION_ESTABLISHMENT_PROC (0x40)
Wolfgang Betz 130:770ce14d3d15 215 #define GAP_OBSERVATION_PROC_IDB05A1 (0x80)
Wolfgang Betz 130:770ce14d3d15 216 /**
Wolfgang Betz 130:770ce14d3d15 217 * @}
Wolfgang Betz 130:770ce14d3d15 218 */
Wolfgang Betz 130:770ce14d3d15 219
Wolfgang Betz 130:770ce14d3d15 220 /**
Wolfgang Betz 130:770ce14d3d15 221 * @}
Wolfgang Betz 130:770ce14d3d15 222 */
Wolfgang Betz 130:770ce14d3d15 223
Wolfgang Betz 130:770ce14d3d15 224 #endif /* __BNRG_GAP_H__ */