|
51 | 51 | /**
|
52 | 52 | * Define Tx Power
|
53 | 53 | */
|
54 |
| -#define CFG_TX_POWER (0x18) /* -0.15dBm */ |
| 54 | +#ifndef CFG_TX_POWER |
| 55 | + #define CFG_TX_POWER (0x18) /* -0.15dBm */ |
| 56 | +#endif |
55 | 57 |
|
56 | 58 | #if 0
|
57 | 59 | /**
|
|
136 | 138 | * Maximum number of simultaneous connections that the device will support.
|
137 | 139 | * Valid values are from 1 to 8
|
138 | 140 | */
|
139 |
| -#define CFG_BLE_NUM_LINK 8 |
| 141 | +#ifndef CFG_BLE_NUM_LINK |
| 142 | +#ifdef STM32WB15xx |
| 143 | + #define CFG_BLE_NUM_LINK 3 |
| 144 | +#else |
| 145 | + #define CFG_BLE_NUM_LINK 8 |
| 146 | +#endif |
| 147 | +#endif |
140 | 148 |
|
141 | 149 | /**
|
142 | 150 | * Maximum number of Services that can be stored in the GATT database.
|
143 | 151 | * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services
|
144 | 152 | */
|
145 |
| -#define CFG_BLE_NUM_GATT_SERVICES 8 |
| 153 | +#ifndef CFG_BLE_NUM_GATT_SERVICES |
| 154 | +#ifdef STM32WB15xx |
| 155 | + #define CFG_BLE_NUM_GATT_SERVICES 4 |
| 156 | +#else |
| 157 | + #define CFG_BLE_NUM_GATT_SERVICES 8 |
| 158 | +#endif |
| 159 | +#endif |
146 | 160 |
|
147 | 161 | /**
|
148 | 162 | * Maximum number of Attributes
|
|
151 | 165 | * Note that certain characteristics and relative descriptors are added automatically during device initialization
|
152 | 166 | * so this parameters should be 9 plus the number of user Attributes
|
153 | 167 | */
|
154 |
| -#define CFG_BLE_NUM_GATT_ATTRIBUTES 68 |
| 168 | +#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES |
| 169 | +#ifdef STM32WB15xx |
| 170 | + #define CFG_BLE_NUM_GATT_ATTRIBUTES 30 |
| 171 | +#else |
| 172 | + #define CFG_BLE_NUM_GATT_ATTRIBUTES 68 |
| 173 | +#endif |
| 174 | +#endif |
155 | 175 |
|
156 | 176 | /**
|
157 | 177 | * Maximum supported ATT_MTU size
|
|
187 | 207 | /**
|
188 | 208 | * Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
|
189 | 209 | */
|
190 |
| -#define CFG_BLE_DATA_LENGTH_EXTENSION 1 |
| 210 | +#ifndef CFG_BLE_DATA_LENGTH_EXTENSION |
| 211 | + #define CFG_BLE_DATA_LENGTH_EXTENSION 1 |
| 212 | +#endif |
191 | 213 |
|
192 | 214 | /**
|
193 | 215 | * Sleep clock accuracy in Peripheral mode (ppm value)
|
194 | 216 | */
|
195 |
| -#define CFG_BLE_PERIPHERAL_SCA 500 |
| 217 | +#ifndef CFG_BLE_SLAVE_SCA |
| 218 | + #define CFG_BLE_PERIPHERAL_SCA 500 |
| 219 | +#endif |
196 | 220 |
|
197 | 221 | /**
|
198 | 222 | * Sleep clock accuracy in Central mode
|
|
205 | 229 | * 6 : 21 ppm to 30 ppm
|
206 | 230 | * 7 : 0 ppm to 20 ppm
|
207 | 231 | */
|
208 |
| -#define CFG_BLE_CENTRAL_SCA 0 |
| 232 | +#ifndef CFG_BLE_CENTRAL_SCA |
| 233 | + #define CFG_BLE_CENTRAL_SCA 0 |
| 234 | +#endif |
209 | 235 |
|
210 | 236 | /**
|
211 | 237 | * LsSource
|
|
214 | 240 | * - bit 1: 1: STM32WB5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module
|
215 | 241 | * - bit 2: 1: HSE/1024 Clock config 0: LSE Clock config
|
216 | 242 | */
|
217 |
| -#if defined(STM32WB5Mxx) |
218 |
| - #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) |
219 |
| -#else |
220 |
| - #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) |
| 243 | +#ifndef CFG_BLE_LS_SOURCE |
| 244 | + #if defined(STM32WB5Mxx) |
| 245 | + #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) |
| 246 | + #else |
| 247 | + #define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE) |
| 248 | + #endif |
221 | 249 | #endif
|
222 | 250 |
|
223 | 251 | /**
|
224 | 252 | * Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
|
225 | 253 | */
|
226 |
| -#define CFG_BLE_HSE_STARTUP_TIME 0x148 |
| 254 | +#ifndef CFG_BLE_HSE_STARTUP_TIME |
| 255 | + #define CFG_BLE_HSE_STARTUP_TIME 0x148 |
| 256 | +#endif |
227 | 257 |
|
228 | 258 | /**
|
229 | 259 | * Maximum duration of the connection event when the device is in Peripheral mode in units of 625/256 us (~2.44 us)
|
230 | 260 | */
|
231 |
| -#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) |
| 261 | +#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH |
| 262 | + #define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) |
| 263 | +#endif |
232 | 264 |
|
233 | 265 | /**
|
234 | 266 | * Viterbi Mode
|
|
0 commit comments