forked from stm32duino/STM32duinoBLE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_conf_default.h
185 lines (162 loc) · 5.36 KB
/
app_conf_default.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/**
******************************************************************************
* File Name : app_conf.h
* Description : Application configuration file for STM32WPAN Middleware.
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
* SLA0044, the "License"; You may not use this file except in compliance with
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef APP_CONF_DEFAULT_H
#define APP_CONF_DEFAULT_H
/******************************************************************************
* Application Config
******************************************************************************/
/**< generic parameters ******************************************************/
/* HCI related defines */
#define ACI_HAL_SET_TX_POWER_LEVEL 0xFC0F
#define ACI_WRITE_CONFIG_DATA_OPCODE 0xFC0C
#define ACI_READ_CONFIG_DATA_OPCODE 0xFC0D
#define MAX_HCI_ACL_PACKET_SIZE (sizeof(TL_PacketHeader_t) + 5 + 251)
#define HCI_RESET 0x0C03
#ifndef BLE_SHARED_MEM_BYTE_ORDER
#define BLE_SHARED_MEM_BYTE_ORDER MSBFIRST
#endif
#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128
/**
* Define Tx Power
*/
#ifndef CFG_TX_POWER
#define CFG_TX_POWER (0x18) /* -0.15dBm */
#endif
/******************************************************************************
* BLE Stack
******************************************************************************/
/**
* Maximum number of simultaneous connections that the device will support.
* Valid values are from 1 to 8
*/
#ifndef CFG_BLE_NUM_LINK
#define CFG_BLE_NUM_LINK 8
#endif
/**
* Maximum number of Services that can be stored in the GATT database.
* Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user
* services
*/
#ifndef CFG_BLE_NUM_GATT_SERVICES
#define CFG_BLE_NUM_GATT_SERVICES 8
#endif
/**
* Maximum number of Attributes
* (i.e. the number of characteristic + the number of characteristic values + the number of descriptors, excluding the
* services) that can be stored in the GATT database. Note that certain characteristics and relative descriptors are
* added automatically during device initialization so this parameters should be 9 plus the number of user Attributes
*/
#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES
#define CFG_BLE_NUM_GATT_ATTRIBUTES 68
#endif
/**
* Maximum supported ATT_MTU size
*/
#ifndef CFG_BLE_MAX_ATT_MTU
#define CFG_BLE_MAX_ATT_MTU (156)
#endif
/**
* Size of the storage area for Attribute values
* 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:
* - attribute value length
* - 5, if UUID is 16 bit; 19, if UUID is 128 bit
* - 2, if server configuration descriptor is used
* - 2*DTM_NUM_LINK, if client configuration descriptor is used
* - 2, if extended properties is used
* The total amount of memory needed is the sum of the above quantities for each attribute.
*/
#ifndef CFG_BLE_ATT_VALUE_ARRAY_SIZE
#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344)
#endif
/**
* Prepare Write List size in terms of number of packet
*/
//#define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)
#ifndef CFG_BLE_PREPARE_WRITE_LIST_SIZE
#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A)
#endif
/**
* Number of allocated memory blocks
*/
//#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU,
// CFG_BLE_NUM_LINK))
#ifndef CFG_BLE_MBLOCK_COUNT
#define CFG_BLE_MBLOCK_COUNT (0x79)
#endif
/**
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
*/
#ifndef CFG_BLE_DATA_LENGTH_EXTENSION
#define CFG_BLE_DATA_LENGTH_EXTENSION 1
#endif
/**
* Sleep clock accuracy in Slave mode (ppm value)
*/
#ifndef CFG_BLE_SLAVE_SCA
#define CFG_BLE_SLAVE_SCA 500
#endif
/**
* Sleep clock accuracy in Master mode
* 0 : 251 ppm to 500 ppm
* 1 : 151 ppm to 250 ppm
* 2 : 101 ppm to 150 ppm
* 3 : 76 ppm to 100 ppm
* 4 : 51 ppm to 75 ppm
* 5 : 31 ppm to 50 ppm
* 6 : 21 ppm to 30 ppm
* 7 : 0 ppm to 20 ppm
*/
#ifndef CFG_BLE_MASTER_SCA
#define CFG_BLE_MASTER_SCA 0
#endif
/**
* Source for the 32 kHz slow speed clock
* 1 : internal RO
* 0 : external crystal ( no calibration )
*/
#ifndef CFG_BLE_LSE_SOURCE
#define CFG_BLE_LSE_SOURCE 0
#endif
/**
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
*/
#ifndef CFG_BLE_HSE_STARTUP_TIME
#define CFG_BLE_HSE_STARTUP_TIME 0x148
#endif
/**
* Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us)
*/
#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH
#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF)
#endif
/**
* Viterbi Mode
* 1 : enabled
* 0 : disabled
*/
#define CFG_BLE_VITERBI_MODE 1
/**
* LL Only Mode
* 1 : LL Only
* 0 : LL + Host
*/
#define CFG_BLE_LL_ONLY 1
#endif /* APP_CONF_DEFAULT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/