xref: /btstack/port/esp32/components/btstack/include/btstack_config.h (revision ccf14bf41887a4924029061b00038e44d73cbb87)
16f952a23SMatthias Ringwald //
26f952a23SMatthias Ringwald // btstack_config.h for esp32 port
36f952a23SMatthias Ringwald //
4077fecbbSMilanka Ringwald // Documentation: https://bluekitchen-gmbh.com/btstack/#how_to/
5077fecbbSMilanka Ringwald //
66f952a23SMatthias Ringwald 
736327e5aSMilanka Ringwald #ifndef BTSTACK_CONFIG_H
836327e5aSMilanka Ringwald #define BTSTACK_CONFIG_H
96f952a23SMatthias Ringwald 
106f952a23SMatthias Ringwald // Port related features
11d7b812f0SMatthias Ringwald #define HAVE_ASSERT
126f952a23SMatthias Ringwald #define HAVE_BTSTACK_STDIN
1336327e5aSMilanka Ringwald #define HAVE_EMBEDDED_TIME_MS
146d23ba05SMatthias Ringwald #define HAVE_FREERTOS_INCLUDE_PREFIX
1536327e5aSMilanka Ringwald #define HAVE_FREERTOS_TASK_NOTIFICATIONS
1636327e5aSMilanka Ringwald #define HAVE_MALLOC
176f952a23SMatthias Ringwald 
18*ccf14bf4SMatthias Ringwald #define HAVE_BTSTACK_AUDIO_EFFECTIVE_SAMPLERATE
19*ccf14bf4SMatthias Ringwald 
20c50041a4SMatthias Ringwald // HCI Controller to Host Flow Control
21c50041a4SMatthias Ringwald #define ENABLE_HCI_CONTROLLER_TO_HOST_FLOW_CONTROL
2236327e5aSMilanka Ringwald 
23c50041a4SMatthias Ringwald // BTstack features that can be enabled
24c50041a4SMatthias Ringwald #define ENABLE_PRINTF_HEXDUMP
256f952a23SMatthias Ringwald #define ENABLE_LOG_ERROR
266f952a23SMatthias Ringwald #define ENABLE_LOG_INFO
27c50041a4SMatthias Ringwald 
28c50041a4SMatthias Ringwald // Enable Classic/LE based on esp-idf sdkconfig
29c50041a4SMatthias Ringwald #include "sdkconfig.h"
3040da0d63SMatthias Ringwald #ifdef CONFIG_IDF_TARGET_ESP32
31c50041a4SMatthias Ringwald // ESP32 as dual-mode Controller
32c50041a4SMatthias Ringwald #define ENABLE_CLASSIC
33c50041a4SMatthias Ringwald #define ENABLE_BLE
3440da0d63SMatthias Ringwald #else /* CONFIG_IDF_TARGET_ESP32 */
3540da0d63SMatthias Ringwald // ESP32-C3 and ESP32-S3 with LE-only Controller
3640da0d63SMatthias Ringwald #define ENABLE_BLE
37c50041a4SMatthias Ringwald #endif
38c50041a4SMatthias Ringwald 
39c50041a4SMatthias Ringwald // Classic configuration
40c50041a4SMatthias Ringwald #ifdef ENABLE_CLASSIC
41c50041a4SMatthias Ringwald 
42eaffacf9SMatthias Ringwald #define ENABLE_HFP_WIDE_BAND_SPEECH
43c50041a4SMatthias Ringwald 
4436327e5aSMilanka Ringwald #define ENABLE_SCO_OVER_HCI
456f952a23SMatthias Ringwald 
46c518ce54SMatthias Ringwald // mainly needed for AVRCP Browsing, can be removed otherwise to reduce code size
47c518ce54SMatthias Ringwald #define ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE
48c518ce54SMatthias Ringwald 
49eaffacf9SMatthias Ringwald // work around to link layer issues in ESP32
50eaffacf9SMatthias Ringwald // https://github.com/espressif/esp-idf/issues/5494
51eaffacf9SMatthias Ringwald #define ENABLE_CLASSIC_LEGACY_CONNECTIONS_FOR_SCO_DEMOS
52eaffacf9SMatthias Ringwald 
532cbd4c4fSMatthias Ringwald // support CTKD if LE is available, too
542cbd4c4fSMatthias Ringwald #ifdef ENABLE_BLE
552cbd4c4fSMatthias Ringwald #define ENABLE_CROSS_TRANSPORT_KEY_DERIVATION
562cbd4c4fSMatthias Ringwald #endif
572cbd4c4fSMatthias Ringwald 
5836327e5aSMilanka Ringwald #define NVM_NUM_LINK_KEYS 16
5994dc8eb3SMatthias Ringwald 
60c50041a4SMatthias Ringwald #endif
61c50041a4SMatthias Ringwald 
62c50041a4SMatthias Ringwald // LE configuration
63c50041a4SMatthias Ringwald #ifdef ENABLE_BLE
64c50041a4SMatthias Ringwald 
65c50041a4SMatthias Ringwald #define ENABLE_L2CAP_LE_CREDIT_BASED_FLOW_CONTROL_MODE
66c50041a4SMatthias Ringwald #define ENABLE_LE_CENTRAL
67c50041a4SMatthias Ringwald #define ENABLE_LE_DATA_LENGTH_EXTENSION
68c50041a4SMatthias Ringwald #define ENABLE_LE_PERIPHERAL
69c50041a4SMatthias Ringwald #define ENABLE_LE_SECURE_CONNECTIONS
70c50041a4SMatthias Ringwald // ESP32 supports ECDH HCI Commands, but micro-ecc lib is already provided anyway
71c50041a4SMatthias Ringwald #define ENABLE_MICRO_ECC_FOR_LE_SECURE_CONNECTIONS
72c50041a4SMatthias Ringwald 
73c50041a4SMatthias Ringwald #define NVM_NUM_DEVICE_DB_ENTRIES 16
74e514a7f5SMatthias Ringwald 
75e514a7f5SMatthias Ringwald // Mesh Configuration
76e514a7f5SMatthias Ringwald #define ENABLE_MESH
7794dc8eb3SMatthias Ringwald #define ENABLE_MESH_ADV_BEARER
7894dc8eb3SMatthias Ringwald #define ENABLE_MESH_GATT_BEARER
79e514a7f5SMatthias Ringwald #define ENABLE_MESH_PB_ADV
8094dc8eb3SMatthias Ringwald #define ENABLE_MESH_PB_GATT
8194dc8eb3SMatthias Ringwald #define ENABLE_MESH_PROVISIONER
8236327e5aSMilanka Ringwald #define ENABLE_MESH_PROXY_SERVER
8394dc8eb3SMatthias Ringwald 
8436327e5aSMilanka Ringwald #define MAX_NR_MESH_SUBNETS            2
8594dc8eb3SMatthias Ringwald #define MAX_NR_MESH_TRANSPORT_KEYS    16
8694dc8eb3SMatthias Ringwald #define MAX_NR_MESH_VIRTUAL_ADDRESSES 16
8794dc8eb3SMatthias Ringwald 
8894dc8eb3SMatthias Ringwald // allow for one NetKey update
8994dc8eb3SMatthias Ringwald #define MAX_NR_MESH_NETWORK_KEYS      (MAX_NR_MESH_SUBNETS+1)
90e514a7f5SMatthias Ringwald 
91e514a7f5SMatthias Ringwald #endif
92c50041a4SMatthias Ringwald 
93c50041a4SMatthias Ringwald // BTstack configuration. buffers, sizes, ...
94c50041a4SMatthias Ringwald 
95c50041a4SMatthias Ringwald #ifdef ENABLE_CLASSIC
96c50041a4SMatthias Ringwald 
97c50041a4SMatthias Ringwald // ACL buffer large enough for Ethernet frame in BNEP/PAN
98c50041a4SMatthias Ringwald #define HCI_ACL_PAYLOAD_SIZE (1691 + 4)
99c50041a4SMatthias Ringwald 
100c50041a4SMatthias Ringwald #define HCI_HOST_ACL_PACKET_LEN 1024
101c50041a4SMatthias Ringwald #define HCI_HOST_ACL_PACKET_NUM 20
102c50041a4SMatthias Ringwald #define HCI_HOST_SCO_PACKET_LEN 60
103c50041a4SMatthias Ringwald #define HCI_HOST_SCO_PACKET_NUM 10
104c50041a4SMatthias Ringwald 
105c50041a4SMatthias Ringwald #else
106c50041a4SMatthias Ringwald 
107c50041a4SMatthias Ringwald // ACL buffer large enough to allow for 512 byte Characteristic
108c50041a4SMatthias Ringwald #define HCI_ACL_PAYLOAD_SIZE (512 + 4 + 3)
109c50041a4SMatthias Ringwald 
110c50041a4SMatthias Ringwald #define HCI_HOST_ACL_PACKET_LEN HCI_ACL_PAYLOAD_SIZE
111c50041a4SMatthias Ringwald #define HCI_HOST_ACL_PACKET_NUM 20
112c50041a4SMatthias Ringwald #define HCI_HOST_SCO_PACKET_LEN 0
113c50041a4SMatthias Ringwald #define HCI_HOST_SCO_PACKET_NUM 0
114c50041a4SMatthias Ringwald 
115c50041a4SMatthias Ringwald #endif
116c50041a4SMatthias Ringwald 
117c50041a4SMatthias Ringwald 
118c50041a4SMatthias Ringwald #endif
119