Skip to content

Commit 5a5dc8e

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

File tree

1 file changed

+45
-13
lines changed

1 file changed

+45
-13
lines changed

src/utility/STM32_WPAN/app_conf_default.h

+45-13
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
/**
5151
* Define Tx Power
5252
*/
53-
#define CFG_TX_POWER (0x18) /* -0.15dBm */
53+
#ifndef CFG_TX_POWER
54+
#define CFG_TX_POWER (0x18) /* -0.15dBm */
55+
#endif
5456

5557
#if 0
5658
/**
@@ -135,13 +137,25 @@
135137
* Maximum number of simultaneous connections that the device will support.
136138
* Valid values are from 1 to 8
137139
*/
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
139147

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

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

155175
/**
156176
* Maximum supported ATT_MTU size
@@ -186,12 +206,16 @@
186206
/**
187207
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
188208
*/
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
190212

191213
/**
192214
* Sleep clock accuracy in Peripheral mode (ppm value)
193215
*/
194-
#define CFG_BLE_PERIPHERAL_SCA 500
216+
#ifndef CFG_BLE_PERIPHERAL_SCA
217+
#define CFG_BLE_PERIPHERAL_SCA 500
218+
#endif
195219

196220
/**
197221
* Sleep clock accuracy in Central mode
@@ -204,7 +228,9 @@
204228
* 6 : 21 ppm to 30 ppm
205229
* 7 : 0 ppm to 20 ppm
206230
*/
207-
#define CFG_BLE_CENTRAL_SCA 0
231+
#ifndef CFG_BLE_CENTRAL_SCA
232+
#define CFG_BLE_CENTRAL_SCA 0
233+
#endif
208234

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

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

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

232264
/**
233265
* Viterbi Mode

0 commit comments

Comments
 (0)