|
1 | 1 | /* USER CODE BEGIN Header */
|
2 | 2 | /**
|
3 | 3 | ******************************************************************************
|
4 |
| - * @file app_conf_default.h |
| 4 | + * @file app_conf.h |
5 | 5 | * @author MCD Application Team
|
6 |
| - * @brief Default application configuration file for STM32WPAN Middleware. |
| 6 | + * @brief Application configuration file for STM32WPAN Middleware. |
7 | 7 | ******************************************************************************
|
8 | 8 | * @attention
|
9 | 9 | *
|
|
19 | 19 | /* USER CODE END Header */
|
20 | 20 |
|
21 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/
|
22 |
| -#ifndef APP_CONF_DEFAULT_H |
23 |
| -#define APP_CONF_DEFAULT_H |
24 |
| -#if 0 |
| 22 | +#ifndef APP_CONF_H |
| 23 | +#define APP_CONF_H |
| 24 | + |
25 | 25 | #include "hw.h"
|
26 | 26 | #include "hw_conf.h"
|
27 | 27 | #include "hw_if.h"
|
28 | 28 | #include "ble_bufsize.h"
|
29 |
| -#endif |
| 29 | + |
30 | 30 | /******************************************************************************
|
31 | 31 | * Application Config
|
32 | 32 | ******************************************************************************/
|
33 | 33 |
|
34 |
| -/**< generic parameters ******************************************************/ |
35 |
| -/* HCI related defines */ |
36 |
| - |
37 |
| -#define ACI_HAL_SET_TX_POWER_LEVEL 0xFC0F |
38 |
| -#define ACI_WRITE_CONFIG_DATA_OPCODE 0xFC0C |
39 |
| -#define ACI_READ_CONFIG_DATA_OPCODE 0xFC0D |
40 |
| -#define MAX_HCI_ACL_PACKET_SIZE (sizeof(TL_PacketHeader_t) + 5 + 251) |
41 |
| -#define HCI_RESET 0x0C03 |
42 |
| - |
43 |
| -#ifndef BLE_SHARED_MEM_BYTE_ORDER |
44 |
| - #define BLE_SHARED_MEM_BYTE_ORDER MSBFIRST |
45 |
| -#endif |
46 |
| -#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128 |
47 |
| - |
48 |
| -/** |
49 |
| - * Define Tx Power |
50 |
| - */ |
51 |
| -#ifndef CFG_TX_POWER |
52 |
| - #define CFG_TX_POWER (0x18) /* -0.15dBm */ |
53 |
| -#endif |
54 |
| - |
55 |
| -#if 0 |
56 | 34 | /**
|
57 | 35 | * Define Secure Connections Support
|
58 | 36 | */
|
|
126 | 104 | #define CFG_FW_SUBVERSION (1)
|
127 | 105 | #define CFG_FW_BRANCH (0)
|
128 | 106 | #define CFG_FW_BUILD (0)
|
129 |
| -#endif |
| 107 | + |
130 | 108 | /******************************************************************************
|
131 | 109 | * BLE Stack
|
132 | 110 | ******************************************************************************/
|
133 | 111 | /**
|
134 | 112 | * Maximum number of simultaneous connections that the device will support.
|
135 | 113 | * Valid values are from 1 to 8
|
136 | 114 | */
|
137 |
| -#ifndef CFG_BLE_NUM_LINK |
138 |
| -#ifdef STM32WB15xx |
139 |
| - #define CFG_BLE_NUM_LINK 3 |
140 |
| -#else |
141 |
| - #define CFG_BLE_NUM_LINK 8 |
142 |
| -#endif |
143 |
| -#endif |
| 115 | +#define CFG_BLE_NUM_LINK 8 |
144 | 116 |
|
145 | 117 | /**
|
146 | 118 | * Maximum number of Services that can be stored in the GATT database.
|
147 | 119 | * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services
|
148 | 120 | */
|
149 |
| -#ifndef CFG_BLE_NUM_GATT_SERVICES |
150 |
| -#ifdef STM32WB15xx |
151 |
| - #define CFG_BLE_NUM_GATT_SERVICES 4 |
152 |
| -#else |
153 |
| - #define CFG_BLE_NUM_GATT_SERVICES 8 |
154 |
| -#endif |
155 |
| -#endif |
| 121 | +#define CFG_BLE_NUM_GATT_SERVICES 8 |
156 | 122 |
|
157 | 123 | /**
|
158 | 124 | * Maximum number of Attributes
|
|
161 | 127 | * Note that certain characteristics and relative descriptors are added automatically during device initialization
|
162 | 128 | * so this parameters should be 9 plus the number of user Attributes
|
163 | 129 | */
|
164 |
| -#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES |
165 |
| -#ifdef STM32WB15xx |
166 |
| - #define CFG_BLE_NUM_GATT_ATTRIBUTES 30 |
167 |
| -#else |
168 |
| - #define CFG_BLE_NUM_GATT_ATTRIBUTES 68 |
169 |
| -#endif |
170 |
| -#endif |
| 130 | +#define CFG_BLE_NUM_GATT_ATTRIBUTES 68 |
171 | 131 |
|
172 | 132 | /**
|
173 | 133 | * Maximum supported ATT_MTU size
|
174 | 134 | * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
|
175 | 135 | */
|
176 |
| -#ifndef CFG_BLE_MAX_ATT_MTU |
177 |
| - #define CFG_BLE_MAX_ATT_MTU (156) |
178 |
| -#endif |
| 136 | +#define CFG_BLE_MAX_ATT_MTU (156) |
179 | 137 |
|
180 | 138 | /**
|
181 | 139 | * Size of the storage area for Attribute values
|
|
188 | 146 | * The total amount of memory needed is the sum of the above quantities for each attribute.
|
189 | 147 | * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
|
190 | 148 | */
|
191 |
| -#ifndef CFG_BLE_ATT_VALUE_ARRAY_SIZE |
192 |
| -#ifdef STM32WB15xx |
193 |
| - #define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1290) |
194 |
| -#else |
195 |
| - #define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) |
196 |
| -#endif |
197 |
| -#endif |
| 149 | +#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) |
198 | 150 |
|
199 | 151 | /**
|
200 | 152 | * Prepare Write List size in terms of number of packet
|
201 | 153 | * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
|
202 | 154 | */
|
203 |
| -// #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) |
204 |
| -#ifndef CFG_BLE_PREPARE_WRITE_LIST_SIZE |
205 |
| - #define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A) |
206 |
| -#endif |
| 155 | +#define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) |
207 | 156 |
|
208 | 157 | /**
|
209 | 158 | * Number of allocated memory blocks
|
210 | 159 | * This parameter is overwritten by the CPU2 with an hardcoded optimal value when the parameter CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
|
211 | 160 | */
|
212 |
| -//#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK)) |
213 |
| -#define CFG_BLE_MBLOCK_COUNT (0x79) |
| 161 | +#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK)) |
214 | 162 |
|
215 | 163 | /**
|
216 | 164 | * Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
|
217 | 165 | */
|
218 |
| -#ifndef CFG_BLE_DATA_LENGTH_EXTENSION |
219 |
| - #define CFG_BLE_DATA_LENGTH_EXTENSION 1 |
220 |
| -#endif |
| 166 | +#define CFG_BLE_DATA_LENGTH_EXTENSION 1 |
221 | 167 |
|
222 | 168 | /**
|
223 | 169 | * Sleep clock accuracy in Slave mode (ppm value)
|
224 | 170 | */
|
225 |
| -#ifndef CFG_BLE_SLAVE_SCA |
226 |
| - #define CFG_BLE_SLAVE_SCA 500 |
227 |
| -#endif |
| 171 | +#define CFG_BLE_SLAVE_SCA 500 |
228 | 172 |
|
229 | 173 | /**
|
230 | 174 | * Sleep clock accuracy in Master mode
|
|
237 | 181 | * 6 : 21 ppm to 30 ppm
|
238 | 182 | * 7 : 0 ppm to 20 ppm
|
239 | 183 | */
|
240 |
| -#ifndef CFG_BLE_MASTER_SCA |
241 |
| - #define CFG_BLE_MASTER_SCA 0 |
242 |
| -#endif |
| 184 | +#define CFG_BLE_MASTER_SCA 0 |
243 | 185 |
|
244 | 186 | /**
|
245 | 187 | * LsSource
|
|
248 | 190 | * - bit 1: 1: STM32WB5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module
|
249 | 191 | * - bit 2: 1: HSE/1024 Clock config 0: LSE Clock config
|
250 | 192 | */
|
251 |
| -#ifndef CFG_BLE_LS_SOURCE |
252 |
| - #if defined(STM32WB5Mxx) |
253 |
| - #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) |
254 |
| - #else |
255 |
| - #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) |
256 |
| - #endif |
| 193 | +#if defined(STM32WB5Mxx) |
| 194 | + #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) |
| 195 | +#else |
| 196 | + #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) |
257 | 197 | #endif
|
258 | 198 |
|
259 | 199 | /**
|
260 | 200 | * Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
|
261 | 201 | */
|
262 |
| -#ifndef CFG_BLE_HSE_STARTUP_TIME |
263 |
| - #define CFG_BLE_HSE_STARTUP_TIME 0x148 |
264 |
| -#endif |
| 202 | +#define CFG_BLE_HSE_STARTUP_TIME 0x148 |
265 | 203 |
|
266 | 204 | /**
|
267 | 205 | * Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us)
|
268 | 206 | */
|
269 |
| -#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH |
270 |
| - #define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) |
271 |
| -#endif |
| 207 | +#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) |
272 | 208 |
|
273 | 209 | /**
|
274 | 210 | * Viterbi Mode
|
|
314 | 250 | * 0: LE Power Class 2-3
|
315 | 251 | * other bits: complete with Options_extension flag
|
316 | 252 | */
|
317 |
| -#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY) |
| 253 | +#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_HOST | SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC | SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW | SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV | SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2 | SHCI_C2_BLE_INIT_OPTIONS_FULL_GATTDB_NVM | SHCI_C2_BLE_INIT_OPTIONS_GATT_CACHING_NOTUSED | SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3) |
318 | 254 |
|
319 | 255 | /**
|
320 | 256 | * BLE stack Options_extension flags to be configured with:
|
|
356 | 292 | * This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
|
357 | 293 | */
|
358 | 294 |
|
359 |
| -#if defined(STM32WB15xx) |
360 |
| - #define CFG_BLE_MAX_ADV_SET_NBR (3) |
361 |
| -#else |
362 |
| - #define CFG_BLE_MAX_ADV_SET_NBR (8) |
363 |
| -#endif |
| 295 | +#define CFG_BLE_MAX_ADV_SET_NBR (8) |
364 | 296 |
|
365 | 297 | /* Maximum advertising data length (in bytes)
|
366 | 298 | * Range: 31 .. 1650 with limitation:
|
|
369 | 301 | * This parameter is considered by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV flag set
|
370 | 302 | */
|
371 | 303 |
|
372 |
| -#if defined(STM32WB15xx) |
373 |
| - #define CFG_BLE_MAX_ADV_DATA_LEN (414) |
374 |
| -#else |
375 |
| - #define CFG_BLE_MAX_ADV_DATA_LEN (207) |
376 |
| -#endif |
| 304 | +#define CFG_BLE_MAX_ADV_DATA_LEN (207) |
377 | 305 |
|
378 | 306 | /* RF TX Path Compensation Value (16-bit signed integer). Units: 0.1 dB.
|
379 | 307 | * Range: -1280 .. 1280
|
|
395 | 323 |
|
396 | 324 | #define CFG_BLE_CORE_VERSION (SHCI_C2_BLE_INIT_BLE_CORE_5_3)
|
397 | 325 |
|
398 |
| -#if 0 |
399 | 326 | /******************************************************************************
|
400 | 327 | * Transport Layer
|
401 | 328 | ******************************************************************************/
|
@@ -730,5 +657,5 @@ typedef enum
|
730 | 657 | #define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE
|
731 | 658 |
|
732 | 659 | #define CFG_OTP_END_ADRESS OTP_AREA_END_ADDR
|
733 |
| -#endif |
734 |
| -#endif /*APP_CONF_DEFAULT_H */ |
| 660 | + |
| 661 | +#endif /*APP_CONF_H */ |
0 commit comments