|
1 | 1 | /** |
2 | 2 | ****************************************************************************** |
3 | | - * @file app_conf.h |
| 3 | + * @file app_conf_default.h |
4 | 4 | * @author MCD Application Team |
5 | | - * @brief Application configuration file for STM32WPAN Middleware. |
| 5 | + * @brief Default application configuration file for STM32WPAN Middleware. |
6 | 6 | ****************************************************************************** |
7 | 7 | * @attention |
8 | 8 | * |
|
17 | 17 | */ |
18 | 18 |
|
19 | 19 | /* Define to prevent recursive inclusion -------------------------------------*/ |
20 | | -#ifndef APP_CONF_H |
21 | | -#define APP_CONF_H |
22 | | - |
23 | | -#include "hw.h" |
24 | | -#include "ble_bufsize.h" |
| 20 | +#ifndef APP_CONF_DEFAULT_H |
| 21 | +#define APP_CONF_DEFAULT_H |
25 | 22 |
|
26 | 23 | /****************************************************************************** |
27 | 24 | * Application Config |
|
44 | 41 | /** |
45 | 42 | * Define Tx Power |
46 | 43 | */ |
47 | | -#define CFG_TX_POWER (0x18) /* -0.15dBm */ |
| 44 | +#ifndef CFG_TX_POWER |
| 45 | + #define CFG_TX_POWER (0x18) /* -0.15dBm */ |
| 46 | +#endif |
48 | 47 |
|
49 | 48 | /****************************************************************************** |
50 | 49 | * BLE Stack |
|
53 | 52 | * Maximum number of simultaneous connections that the device will support. |
54 | 53 | * Valid values are from 1 to 8 |
55 | 54 | */ |
56 | | -#define CFG_BLE_NUM_LINK 8 |
| 55 | +#ifndef CFG_BLE_NUM_LINK |
| 56 | + #define CFG_BLE_NUM_LINK 8 |
| 57 | +#endif |
57 | 58 |
|
58 | 59 | /** |
59 | 60 | * Maximum number of Services that can be stored in the GATT database. |
60 | 61 | * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services |
61 | 62 | */ |
62 | | -#define CFG_BLE_NUM_GATT_SERVICES 8 |
| 63 | +#ifndef CFG_BLE_NUM_GATT_SERVICES |
| 64 | + #define CFG_BLE_NUM_GATT_SERVICES 8 |
| 65 | +#endif |
63 | 66 |
|
64 | 67 | /** |
65 | 68 | * Maximum number of Attributes |
|
68 | 71 | * Note that certain characteristics and relative descriptors are added automatically during device initialization |
69 | 72 | * so this parameters should be 9 plus the number of user Attributes |
70 | 73 | */ |
71 | | -#define CFG_BLE_NUM_GATT_ATTRIBUTES 68 |
| 74 | +#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES |
| 75 | + #define CFG_BLE_NUM_GATT_ATTRIBUTES 68 |
| 76 | +#endif |
72 | 77 |
|
73 | 78 | /** |
74 | 79 | * Maximum supported ATT_MTU size |
75 | 80 | * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set |
76 | 81 | */ |
77 | | -#define CFG_BLE_MAX_ATT_MTU (156) |
| 82 | +#ifndef CFG_BLE_MAX_ATT_MTU |
| 83 | + #define CFG_BLE_MAX_ATT_MTU (156) |
| 84 | +#endif |
78 | 85 |
|
79 | 86 | /** |
80 | 87 | * Size of the storage area for Attribute values |
|
87 | 94 | * The total amount of memory needed is the sum of the above quantities for each attribute. |
88 | 95 | * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set |
89 | 96 | */ |
90 | | -#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) |
| 97 | +#ifndef CFG_BLE_ATT_VALUE_ARRAY_SIZE |
| 98 | + #define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) |
| 99 | +#endif |
91 | 100 |
|
92 | 101 | /** |
93 | 102 | * Prepare Write List size in terms of number of packet |
94 | 103 | * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set |
95 | 104 | */ |
96 | 105 | // #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) |
97 | | -#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A) |
| 106 | +#ifndef CFG_BLE_PREPARE_WRITE_LIST_SIZE |
| 107 | + #define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A) |
| 108 | +#endif |
98 | 109 |
|
99 | 110 | /** |
100 | 111 | * Number of allocated memory blocks |
|
106 | 117 | /** |
107 | 118 | * Enable or disable the Extended Packet length feature. Valid values are 0 or 1. |
108 | 119 | */ |
109 | | -#define CFG_BLE_DATA_LENGTH_EXTENSION 1 |
| 120 | +#ifndef CFG_BLE_DATA_LENGTH_EXTENSION |
| 121 | + #define CFG_BLE_DATA_LENGTH_EXTENSION 1 |
| 122 | +#endif |
110 | 123 |
|
111 | 124 | /** |
112 | 125 | * Sleep clock accuracy in Slave mode (ppm value) |
113 | 126 | */ |
114 | | -#define CFG_BLE_SLAVE_SCA 500 |
| 127 | +#ifndef CFG_BLE_SLAVE_SCA |
| 128 | + #define CFG_BLE_SLAVE_SCA 500 |
| 129 | +#endif |
115 | 130 |
|
116 | 131 | /** |
117 | 132 | * Sleep clock accuracy in Master mode |
|
124 | 139 | * 6 : 21 ppm to 30 ppm |
125 | 140 | * 7 : 0 ppm to 20 ppm |
126 | 141 | */ |
127 | | -#define CFG_BLE_MASTER_SCA 0 |
| 142 | +#ifndef CFG_BLE_MASTER_SCA |
| 143 | + #define CFG_BLE_MASTER_SCA 0 |
| 144 | +#endif |
128 | 145 |
|
129 | 146 | /** |
130 | 147 | * LsSource |
131 | 148 | * Some information for Low speed clock mapped in bits field |
132 | 149 | * - bit 0: 1: Calibration for the RF system wakeup clock source 0: No calibration for the RF system wakeup clock source |
133 | 150 | * - bit 1: 1: STM32W5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module |
134 | 151 | */ |
135 | | -#if defined(STM32WB5Mxx) |
136 | | - #define CFG_BLE_LSE_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LSE_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LSE_MOD5MM_DEV) |
137 | | -#else |
138 | | - #define CFG_BLE_LSE_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LSE_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LSE_OTHER_DEV) |
| 152 | +#ifndef CFG_BLE_LSE_SOURCE |
| 153 | + #if defined(STM32WB5Mxx) |
| 154 | + #define CFG_BLE_LSE_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LSE_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LSE_MOD5MM_DEV) |
| 155 | + #else |
| 156 | + #define CFG_BLE_LSE_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LSE_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LSE_OTHER_DEV) |
| 157 | + #endif |
139 | 158 | #endif |
140 | 159 |
|
141 | 160 | /** |
142 | 161 | * Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us) |
143 | 162 | */ |
144 | | -#define CFG_BLE_HSE_STARTUP_TIME 0x148 |
| 163 | +#ifndef CFG_BLE_HSE_STARTUP_TIME |
| 164 | + #define CFG_BLE_HSE_STARTUP_TIME 0x148 |
| 165 | +#endif |
145 | 166 |
|
146 | 167 | /** |
147 | 168 | * Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us) |
148 | 169 | */ |
149 | | -#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) |
| 170 | +#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH |
| 171 | + #define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) |
| 172 | +#endif |
150 | 173 |
|
151 | 174 | /** |
152 | 175 | * Viterbi Mode |
|
234 | 257 |
|
235 | 258 | #define CFG_BLE_RX_PATH_COMPENS (0) |
236 | 259 |
|
237 | | -#endif /*APP_CONF_H */ |
| 260 | +#endif /* APP_CONF_DEFAULT_H */ |
238 | 261 |
|
0 commit comments