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