Skip to content

Commit 4eb33a1

Browse files
committed
Added support for custom app_conf.h
Signed-off-by: Alexandre Bourdiol <[email protected]>
1 parent 882adda commit 4eb33a1

File tree

1 file changed

+47
-24
lines changed

1 file changed

+47
-24
lines changed

src/utility/STM32Cube_FW/app_conf_default.h

+47-24
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
******************************************************************************
3-
* @file app_conf.h
3+
* @file app_conf_default.h
44
* @author MCD Application Team
5-
* @brief Application configuration file for STM32WPAN Middleware.
5+
* @brief Default application configuration file for STM32WPAN Middleware.
66
******************************************************************************
77
* @attention
88
*
@@ -17,11 +17,8 @@
1717
*/
1818

1919
/* 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
2522

2623
/******************************************************************************
2724
* Application Config
@@ -44,7 +41,9 @@
4441
/**
4542
* Define Tx Power
4643
*/
47-
#define CFG_TX_POWER (0x18) /* -0.15dBm */
44+
#ifndef CFG_TX_POWER
45+
#define CFG_TX_POWER (0x18) /* -0.15dBm */
46+
#endif
4847

4948
/******************************************************************************
5049
* BLE Stack
@@ -53,13 +52,17 @@
5352
* Maximum number of simultaneous connections that the device will support.
5453
* Valid values are from 1 to 8
5554
*/
56-
#define CFG_BLE_NUM_LINK 8
55+
#ifndef CFG_BLE_NUM_LINK
56+
#define CFG_BLE_NUM_LINK 8
57+
#endif
5758

5859
/**
5960
* Maximum number of Services that can be stored in the GATT database.
6061
* Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services
6162
*/
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
6366

6467
/**
6568
* Maximum number of Attributes
@@ -68,13 +71,17 @@
6871
* Note that certain characteristics and relative descriptors are added automatically during device initialization
6972
* so this parameters should be 9 plus the number of user Attributes
7073
*/
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
7277

7378
/**
7479
* Maximum supported ATT_MTU size
7580
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
7681
*/
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
7885

7986
/**
8087
* Size of the storage area for Attribute values
@@ -87,14 +94,18 @@
8794
* The total amount of memory needed is the sum of the above quantities for each attribute.
8895
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
8996
*/
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
91100

92101
/**
93102
* Prepare Write List size in terms of number of packet
94103
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
95104
*/
96105
// #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
98109

99110
/**
100111
* Number of allocated memory blocks
@@ -106,12 +117,16 @@
106117
/**
107118
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
108119
*/
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
110123

111124
/**
112125
* Sleep clock accuracy in Slave mode (ppm value)
113126
*/
114-
#define CFG_BLE_SLAVE_SCA 500
127+
#ifndef CFG_BLE_SLAVE_SCA
128+
#define CFG_BLE_SLAVE_SCA 500
129+
#endif
115130

116131
/**
117132
* Sleep clock accuracy in Master mode
@@ -124,29 +139,37 @@
124139
* 6 : 21 ppm to 30 ppm
125140
* 7 : 0 ppm to 20 ppm
126141
*/
127-
#define CFG_BLE_MASTER_SCA 0
142+
#ifndef CFG_BLE_MASTER_SCA
143+
#define CFG_BLE_MASTER_SCA 0
144+
#endif
128145

129146
/**
130147
* LsSource
131148
* Some information for Low speed clock mapped in bits field
132149
* - bit 0: 1: Calibration for the RF system wakeup clock source 0: No calibration for the RF system wakeup clock source
133150
* - bit 1: 1: STM32W5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module
134151
*/
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
139158
#endif
140159

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

146167
/**
147168
* Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us)
148169
*/
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
150173

151174
/**
152175
* Viterbi Mode
@@ -234,5 +257,5 @@
234257

235258
#define CFG_BLE_RX_PATH_COMPENS (0)
236259

237-
#endif /*APP_CONF_H */
260+
#endif /* APP_CONF_DEFAULT_H */
238261

0 commit comments

Comments
 (0)