Skip to content

Commit d7df1d4

Browse files
committed
chore: add support for customize app_conf_default.h
Signed-off-by: Frederic Pillon <[email protected]>
1 parent c059b82 commit d7df1d4

File tree

1 file changed

+45
-13
lines changed

1 file changed

+45
-13
lines changed

src/utility/STM32_WPAN/app_conf_default.h

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
/**
5252
* Define Tx Power
5353
*/
54-
#define CFG_TX_POWER (0x18) /* -0.15dBm */
54+
#ifndef CFG_TX_POWER
55+
#define CFG_TX_POWER (0x18) /* -0.15dBm */
56+
#endif
5557

5658
#if 0
5759
/**
@@ -136,13 +138,25 @@
136138
* Maximum number of simultaneous connections that the device will support.
137139
* Valid values are from 1 to 8
138140
*/
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
140148

141149
/**
142150
* Maximum number of Services that can be stored in the GATT database.
143151
* Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services
144152
*/
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
146160

147161
/**
148162
* Maximum number of Attributes
@@ -151,7 +165,13 @@
151165
* Note that certain characteristics and relative descriptors are added automatically during device initialization
152166
* so this parameters should be 9 plus the number of user Attributes
153167
*/
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
155175

156176
/**
157177
* Maximum supported ATT_MTU size
@@ -187,12 +207,16 @@
187207
/**
188208
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
189209
*/
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
191213

192214
/**
193215
* Sleep clock accuracy in Peripheral mode (ppm value)
194216
*/
195-
#define CFG_BLE_PERIPHERAL_SCA 500
217+
#ifndef CFG_BLE_SLAVE_SCA
218+
#define CFG_BLE_PERIPHERAL_SCA 500
219+
#endif
196220

197221
/**
198222
* Sleep clock accuracy in Central mode
@@ -205,7 +229,9 @@
205229
* 6 : 21 ppm to 30 ppm
206230
* 7 : 0 ppm to 20 ppm
207231
*/
208-
#define CFG_BLE_CENTRAL_SCA 0
232+
#ifndef CFG_BLE_CENTRAL_SCA
233+
#define CFG_BLE_CENTRAL_SCA 0
234+
#endif
209235

210236
/**
211237
* LsSource
@@ -214,21 +240,27 @@
214240
* - bit 1: 1: STM32WB5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module
215241
* - bit 2: 1: HSE/1024 Clock config 0: LSE Clock config
216242
*/
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
221249
#endif
222250

223251
/**
224252
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
225253
*/
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
227257

228258
/**
229259
* Maximum duration of the connection event when the device is in Peripheral mode in units of 625/256 us (~2.44 us)
230260
*/
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
232264

233265
/**
234266
* Viterbi Mode

0 commit comments

Comments
 (0)