Skip to content

Commit 6a6c550

Browse files
committed
Revert "Added support for custom app_conf.h (stm32duino#35)"
This reverts commit 095fe18.
1 parent 095fe18 commit 6a6c550

File tree

3 files changed

+150
-202
lines changed

3 files changed

+150
-202
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ https://github.com/stm32duino/wiki/wiki/STM32duinoBLE#stm32duinoble-with-x-nucle
1616
For more information about ArduinoBLE library please visit the official web page at:
1717
https://github.com/arduino-libraries/ArduinoBLE
1818

19-
# Configuration
20-
STM32Cube_WPAN has several configuration options, which are set in the `app_conf.h`.
21-
This package has a default configuration named `app_conf_default.h`.
22-
The user can include the file `app_conf_custom.h` to customize the ble application. Options wrapped in `#ifndef, #endif` in `app_conf_default.h` can be overwritten. Additional options can be added.
23-
2419
## License
2520

2621
```

src/utility/STM32Cube_FW/app_conf.h

Lines changed: 150 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,158 @@
1-
//-----------------------------
2-
// @file app_conf.h
3-
// @author Kasper Meldgaard
4-
// @brief Wrapper for BLE app configuration based on comment by fpistm
5-
// (https://github.com/stm32duino/STM32duinoBLE/issues/34).
6-
// @date 15-11-2021
7-
// @copyright Copyright (c) 2021
1+
/**
2+
******************************************************************************
3+
* File Name : app_conf.h
4+
* Description : Application configuration file for STM32WPAN Middleware.
5+
******************************************************************************
6+
* @attention
7+
*
8+
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
9+
* All rights reserved.</center></h2>
10+
*
11+
* This software component is licensed by ST under Ultimate Liberty license
12+
* SLA0044, the "License"; You may not use this file except in compliance with
13+
* the License. You may obtain a copy of the License at:
14+
* www.st.com/SLA0044
15+
*
16+
******************************************************************************
17+
*/
818

19+
/* Define to prevent recursive inclusion -------------------------------------*/
920
#ifndef APP_CONF_H
1021
#define APP_CONF_H
1122

12-
#include "ble_bufsize.h"
1323
#include "hw.h"
24+
#include "ble_bufsize.h"
25+
26+
27+
/******************************************************************************
28+
* Application Config
29+
******************************************************************************/
30+
31+
/**< generic parameters ******************************************************/
32+
/* HCI related defines */
33+
34+
#define ACI_HAL_SET_TX_POWER_LEVEL 0xFC0F
35+
#define ACI_WRITE_CONFIG_DATA_OPCODE 0xFC0C
36+
#define ACI_READ_CONFIG_DATA_OPCODE 0xFC0D
37+
#define MAX_HCI_ACL_PACKET_SIZE (sizeof(TL_PacketHeader_t) + 5 + 251)
38+
#define HCI_RESET 0x0C03
1439

15-
#if __has_include("app_conf_custom.h")
16-
#include "app_conf_custom.h"
40+
#ifndef BLE_SHARED_MEM_BYTE_ORDER
41+
#define BLE_SHARED_MEM_BYTE_ORDER MSBFIRST
1742
#endif
18-
#include "app_conf_default.h"
43+
#define BLE_MODULE_SHARED_MEM_BUFFER_SIZE 128
44+
45+
/**
46+
* Define Tx Power
47+
*/
48+
#define CFG_TX_POWER (0x18) /* -0.15dBm */
49+
50+
/******************************************************************************
51+
* BLE Stack
52+
******************************************************************************/
53+
/**
54+
* Maximum number of simultaneous connections that the device will support.
55+
* Valid values are from 1 to 8
56+
*/
57+
#define CFG_BLE_NUM_LINK 8
58+
59+
/**
60+
* Maximum number of Services that can be stored in the GATT database.
61+
* Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services
62+
*/
63+
#define CFG_BLE_NUM_GATT_SERVICES 8
64+
65+
/**
66+
* Maximum number of Attributes
67+
* (i.e. the number of characteristic + the number of characteristic values + the number of descriptors, excluding the services)
68+
* that can be stored in the GATT database.
69+
* Note that certain characteristics and relative descriptors are added automatically during device initialization
70+
* so this parameters should be 9 plus the number of user Attributes
71+
*/
72+
#define CFG_BLE_NUM_GATT_ATTRIBUTES 68
73+
74+
/**
75+
* Maximum supported ATT_MTU size
76+
*/
77+
#define CFG_BLE_MAX_ATT_MTU (156)
78+
79+
/**
80+
* 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:
82+
* - attribute value length
83+
* - 5, if UUID is 16 bit; 19, if UUID is 128 bit
84+
* - 2, if server configuration descriptor is used
85+
* - 2*DTM_NUM_LINK, if client configuration descriptor is used
86+
* - 2, if extended properties is used
87+
* The total amount of memory needed is the sum of the above quantities for each attribute.
88+
*/
89+
#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344)
90+
91+
/**
92+
* Prepare Write List size in terms of number of packet
93+
*/
94+
//#define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)
95+
#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A)
96+
97+
/**
98+
* Number of allocated memory blocks
99+
*/
100+
//#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK))
101+
#define CFG_BLE_MBLOCK_COUNT (0x79)
102+
/**
103+
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
104+
*/
105+
#define CFG_BLE_DATA_LENGTH_EXTENSION 1
106+
107+
/**
108+
* Sleep clock accuracy in Slave mode (ppm value)
109+
*/
110+
#define CFG_BLE_SLAVE_SCA 500
111+
112+
/**
113+
* Sleep clock accuracy in Master mode
114+
* 0 : 251 ppm to 500 ppm
115+
* 1 : 151 ppm to 250 ppm
116+
* 2 : 101 ppm to 150 ppm
117+
* 3 : 76 ppm to 100 ppm
118+
* 4 : 51 ppm to 75 ppm
119+
* 5 : 31 ppm to 50 ppm
120+
* 6 : 21 ppm to 30 ppm
121+
* 7 : 0 ppm to 20 ppm
122+
*/
123+
#define CFG_BLE_MASTER_SCA 0
124+
125+
/**
126+
* Source for the 32 kHz slow speed clock
127+
* 1 : internal RO
128+
* 0 : external crystal ( no calibration )
129+
*/
130+
#define CFG_BLE_LSE_SOURCE 0
131+
132+
/**
133+
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
134+
*/
135+
#define CFG_BLE_HSE_STARTUP_TIME 0x148
136+
137+
/**
138+
* Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us)
139+
*/
140+
#define CFG_BLE_MAX_CONN_EVENT_LENGTH ( 0xFFFFFFFF )
141+
142+
/**
143+
* Viterbi Mode
144+
* 1 : enabled
145+
* 0 : disabled
146+
*/
147+
#define CFG_BLE_VITERBI_MODE 1
148+
149+
/**
150+
* LL Only Mode
151+
* 1 : LL Only
152+
* 0 : LL + Host
153+
*/
154+
#define CFG_BLE_LL_ONLY 1
155+
156+
#endif /* APP_CONF_H */
19157

20-
#endif /* APP_CONF_H */
158+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

src/utility/STM32Cube_FW/app_conf_default.h

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)