@@ -19,7 +19,7 @@ extern "C" {
1919#endif
2020
2121#define ESP_BT_CTRL_CONFIG_MAGIC_VAL 0x5A5AA5A5
22- #define ESP_BT_CTRL_CONFIG_VERSION 0x02409260
22+ #define ESP_BT_CTRL_CONFIG_VERSION 0x02410230
2323
2424#define ESP_BT_HCI_TL_MAGIC_VALUE 0xfadebead
2525#define ESP_BT_HCI_TL_VERSION 0x00010000
@@ -236,6 +236,60 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
236236#endif
237237
238238#define BT_CTRL_BLE_LLCP_DISC_FLAG (BT_CTRL_BLE_LLCP_CONN_UPDATE | BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE | BT_CTRL_BLE_LLCP_PHY_UPDATE)
239+ #if defined(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY )
240+ #define BT_CTRL_RUN_IN_FLASH_ONLY CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
241+ #else
242+ #define BT_CTRL_RUN_IN_FLASH_ONLY (0)
243+ #endif
244+
245+ #if (BT_CTRL_RUN_IN_FLASH_ONLY == 1 )
246+
247+ #if defined(CONFIG_BT_CTRL_DTM_ENABLE )
248+ #define BT_CTRL_DTM_ENABLE CONFIG_BT_CTRL_DTM_ENABLE
249+ #else
250+ #define BT_CTRL_DTM_ENABLE (0)
251+ #endif
252+
253+ #if defined(CONFIG_BT_CTRL_BLE_MASTER )
254+ #define BT_CTRL_BLE_MASTER CONFIG_BT_CTRL_BLE_MASTER
255+ #else
256+ #define BT_CTRL_BLE_MASTER (0)
257+ #endif
258+
259+ #if defined(CONFIG_BT_CTRL_BLE_TEST )
260+ #define BT_CTRL_BLE_TEST CONFIG_BT_CTRL_BLE_TEST
261+ #else
262+ #define BT_CTRL_BLE_TEST (0)
263+ #endif
264+
265+ #if defined (CONFIG_BT_NIMBLE_SECURITY_ENABLE ) || defined (CONFIG_BT_BLE_SMP_ENABLE )
266+ #ifdef CONFIG_BT_NIMBLE_SECURITY_ENABLE
267+ #define BLE_SECURITY_ENABLE (CONFIG_BT_NIMBLE_SECURITY_ENABLE)
268+ #endif //CONFIG_BT_NIMBLE_SECURITY_ENABLE
269+ #ifdef CONFIG_BT_BLE_SMP_ENABLE
270+ #define BLE_SECURITY_ENABLE (CONFIG_BT_BLE_SMP_ENABLE)
271+ #endif //CONFIG_BT_BLE_SMP_ENABLE
272+ #else
273+ #if defined (CONFIG_BT_CTRL_BLE_SECURITY_ENABLE )
274+ #define BLE_SECURITY_ENABLE (CONFIG_BT_CTRL_BLE_SECURITY_ENABLE)
275+ #else
276+ #define BLE_SECURITY_ENABLE (0)
277+ #endif
278+ #endif // (CONFIG_BT_NIMBLE_SECURITY_ENABLE) || (CONFIG_BT_BLE_SMP_ENABLE)
279+
280+ #if defined (CONFIG_BT_CTRL_BLE_SCAN )
281+ #define BT_CTRL_BLE_SCAN CONFIG_BT_CTRL_BLE_SCAN
282+ #else
283+ #define BT_CTRL_BLE_SCAN (0)
284+ #endif
285+
286+ #else
287+ #define BT_CTRL_BLE_MASTER (1)
288+ #define BT_CTRL_DTM_ENABLE (1)
289+ #define BT_CTRL_BLE_TEST (1)
290+ #define BLE_SECURITY_ENABLE (1)
291+ #define BT_CTRL_BLE_SCAN (1)
292+ #endif // (BT_CTRL_RUN_IN_FLASH_ONLY == 1)
239293
240294#define BT_CONTROLLER_INIT_CONFIG_DEFAULT () { \
241295 .magic = ESP_BT_CTRL_CONFIG_MAGIC_VAL, \
@@ -276,6 +330,12 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
276330 .ble_chan_ass_en = BT_CTRL_CHAN_ASS_EN, \
277331 .ble_ping_en = BT_CTRL_LE_PING_EN, \
278332 .ble_llcp_disc_flag = BT_CTRL_BLE_LLCP_DISC_FLAG, \
333+ .run_in_flash = BT_CTRL_RUN_IN_FLASH_ONLY, \
334+ .dtm_en = BT_CTRL_DTM_ENABLE, \
335+ .enc_en = BLE_SECURITY_ENABLE, \
336+ .qa_test = BT_CTRL_BLE_TEST, \
337+ .master_en = BT_CTRL_BLE_MASTER, \
338+ .scan_en = BT_CTRL_BLE_SCAN, \
279339}
280340
281341#else
@@ -351,6 +411,12 @@ typedef struct {
351411 uint8_t ble_chan_ass_en ; /*!< BLE channel assessment enable */
352412 uint8_t ble_ping_en ; /*!< BLE ping procedure enable */
353413 uint8_t ble_llcp_disc_flag ; /*!< BLE disconnect flag when instant passed */
414+ bool run_in_flash ; /*!< Check if controller code is in flash */
415+ bool dtm_en ; /*!< Controller DTM feature is enabled or not */
416+ bool enc_en ; /*!< Controller encryption feature is enabled or not */
417+ bool qa_test ; /*!< Controller QA test feature is enabled or not */
418+ bool master_en ; /*!< Controller master feature is enabled or not */
419+ bool scan_en ; /*!< Controller scan feature is enabled or not */
354420} esp_bt_controller_config_t ;
355421
356422/**
0 commit comments