|
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 2 |
| 55 | +#ifndef CFG_BLE_NUM_LINK |
| 56 | + #define CFG_BLE_NUM_LINK 2 |
| 57 | +#endif |
57 | 58 |
|
58 | 59 | /**
|
59 | 60 | * Maximum number of Services that can be stored in the GATT database.
|
60 |
| - * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services |
| 61 | + * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user |
| 62 | + * services |
61 | 63 | */
|
| 64 | +#ifndef CFG_BLE_NUM_GATT_SERVICES |
62 | 65 | #define CFG_BLE_NUM_GATT_SERVICES 8
|
| 66 | +#endif |
63 | 67 |
|
64 | 68 | /**
|
65 | 69 | * Maximum number of Attributes
|
66 |
| - * (i.e. the number of characteristic + the number of characteristic values + the number of descriptors, excluding the services) |
67 |
| - * that can be stored in the GATT database. |
68 |
| - * Note that certain characteristics and relative descriptors are added automatically during device initialization |
69 |
| - * so this parameters should be 9 plus the number of user Attributes |
| 70 | + * (i.e. the number of characteristic + the number of characteristic values + the number of descriptors, excluding the |
| 71 | + * services) that can be stored in the GATT database. Note that certain characteristics and relative descriptors are |
| 72 | + * added automatically during device initialization 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 is set to 1"
|
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
|
81 |
| - * This value depends on the number of attributes used by application. In particular the sum of the following quantities (in octets) should be made for each attribute: |
| 88 | + * This value depends on the number of attributes used by application. In particular the sum of the following |
| 89 | + * quantities (in octets) should be made for each attribute: |
82 | 90 | * - attribute value length
|
83 | 91 | * - 5, if UUID is 16 bit; 19, if UUID is 128 bit
|
84 | 92 | * - 2, if server configuration descriptor is used
|
|
87 | 95 | * The total amount of memory needed is the sum of the above quantities for each attribute.
|
88 | 96 | * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1"
|
89 | 97 | */
|
| 98 | +#ifndef CFG_BLE_ATT_VALUE_ARRAY_SIZE |
90 | 99 | #define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344)
|
| 100 | +#endif |
91 | 101 |
|
92 | 102 | /**
|
93 | 103 | * Prepare Write List size in terms of number of packet
|
94 | 104 | * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1"
|
95 | 105 | */
|
96 | 106 | // #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) |
| 107 | +#ifndef CFG_BLE_PREPARE_WRITE_LIST_SIZE |
| 108 | + #define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A) |
| 109 | +#endif |
98 | 110 |
|
99 | 111 | /**
|
100 | 112 | * Number of allocated memory blocks
|
|
106 | 118 | /**
|
107 | 119 | * Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
|
108 | 120 | */
|
109 |
| -#define CFG_BLE_DATA_LENGTH_EXTENSION 1 |
| 121 | +#ifndef CFG_BLE_DATA_LENGTH_EXTENSION |
| 122 | + #define CFG_BLE_DATA_LENGTH_EXTENSION 1 |
| 123 | +#endif |
110 | 124 |
|
111 | 125 | /**
|
112 | 126 | * Sleep clock accuracy in Slave mode (ppm value)
|
113 | 127 | */
|
114 |
| -#define CFG_BLE_SLAVE_SCA 500 |
| 128 | +#ifndef CFG_BLE_SLAVE_SCA |
| 129 | + #define CFG_BLE_SLAVE_SCA 500 |
| 130 | +#endif |
115 | 131 |
|
116 | 132 | /**
|
117 | 133 | * Sleep clock accuracy in Master mode
|
|
124 | 140 | * 6 : 21 ppm to 30 ppm
|
125 | 141 | * 7 : 0 ppm to 20 ppm
|
126 | 142 | */
|
127 |
| -#define CFG_BLE_MASTER_SCA 0 |
| 143 | +#ifndef CFG_BLE_MASTER_SCA |
| 144 | + #define CFG_BLE_MASTER_SCA 0 |
| 145 | +#endif |
128 | 146 |
|
129 | 147 | /**
|
130 | 148 | * Source for the low speed clock for RF wake-up
|
131 | 149 | * 1 : external high speed crystal HSE/32/32
|
132 | 150 | * 0 : external low speed crystal ( no calibration )
|
133 | 151 | */
|
134 |
| -#define CFG_BLE_LSE_SOURCE 0 |
| 152 | +#ifndef CFG_BLE_LSE_SOURCE |
| 153 | + #define CFG_BLE_LSE_SOURCE 0 |
| 154 | +#endif |
135 | 155 |
|
136 | 156 | /**
|
137 | 157 | * Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
|
138 | 158 | */
|
139 |
| -#define CFG_BLE_HSE_STARTUP_TIME 0x148 |
| 159 | +#ifndef CFG_BLE_HSE_STARTUP_TIME |
| 160 | + #define CFG_BLE_HSE_STARTUP_TIME 0x148 |
| 161 | +#endif |
140 | 162 |
|
141 | 163 | /**
|
142 | 164 | * Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us)
|
143 | 165 | */
|
144 |
| -#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) |
| 166 | +#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH |
| 167 | + #define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) |
| 168 | +#endif |
145 | 169 |
|
146 | 170 | /**
|
147 | 171 | * Viterbi Mode
|
|
199 | 223 |
|
200 | 224 | #define CFG_BLE_RX_MODEL_CONFIG SHCI_C2_BLE_INIT_RX_MODEL_AGC_RSSI_LEGACY
|
201 | 225 |
|
202 |
| - |
203 |
| -#endif /*APP_CONF_H */ |
| 226 | +#endif /* APP_CONF_DEFAULT_H */ |
0 commit comments