Skip to content

Commit 89e8e90

Browse files
committed
esp32c3: update BLE sources
Apply changes needed after syncing hal to latest. Signed-off-by: Sylvio Alves <[email protected]>
1 parent 0c97d43 commit 89e8e90

File tree

3 files changed

+516
-306
lines changed

3 files changed

+516
-306
lines changed

zephyr/esp32c3/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,18 @@ if(CONFIG_SOC_SERIES_ESP32C3)
399399
../port/phy/phy_stubs.c
400400
)
401401

402+
if (CONFIG_SOC_ESP32C3_REV_1_1)
403+
set(ECO_BT_LD_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.eco7_bt_funcs.ld)
404+
else()
405+
set(ECO_BT_LD_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.eco3_bt_funcs.ld)
406+
endif()
407+
408+
zephyr_link_libraries(
409+
gcc
410+
-T${CMAKE_CURRENT_SOURCE_DIR}/../../components/esp_rom/${CONFIG_SOC_SERIES}/ld/${CONFIG_SOC_SERIES}.rom.bt_funcs.ld
411+
-T${ECO_BT_LD_FILE}
412+
)
413+
402414
zephyr_link_libraries_ifndef(
403415
CONFIG_BUILD_ONLY_NO_BLOBS
404416
## ble

zephyr/esp32c3/include/bt/esp_bt.h

Lines changed: 122 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,32 @@
1717
extern "C" {
1818
#endif
1919

20+
/**
21+
* @brief Internal use only
22+
*
23+
* @note Please do not modify this value
24+
*/
2025
#define ESP_BT_CTRL_CONFIG_MAGIC_VAL 0x5A5AA5A5
21-
#define ESP_BT_CTRL_CONFIG_VERSION 0x02404010
2226

27+
/**
28+
* @brief Internal use only
29+
*
30+
* @note Please do not modify this value
31+
*/
32+
#define ESP_BT_CTRL_CONFIG_VERSION 0x02410230
33+
34+
/**
35+
* @brief Internal use only
36+
*
37+
* @note Please do not modify this value
38+
*/
2339
#define ESP_BT_HCI_TL_MAGIC_VALUE 0xfadebead
40+
41+
/**
42+
* @brief Internal use only
43+
*
44+
* @note Please do not modify this value
45+
*/
2446
#define ESP_BT_HCI_TL_VERSION 0x00010000
2547

2648
#if defined(CONFIG_BT_CTLR_TX_PWR_PLUS_21)
@@ -304,6 +326,14 @@ typedef void (* btdm_vnd_ol_task_func_t)(void *param);
304326
.ble_data_lenth_zero_aux = BT_BLE_ADV_DATA_LENGTH_ZERO_AUX, \
305327
.ble_chan_ass_en = BT_CTRL_CHAN_ASS_EN, \
306328
.ble_ping_en = BT_CTRL_LE_PING_EN, \
329+
.ble_llcp_disc_flag = 0, \
330+
.run_in_flash = 0, \
331+
.dtm_en = 1, \
332+
.enc_en = 1, \
333+
.qa_test = 0, \
334+
.master_en = 0, \
335+
.scan_en = 1, \
336+
.ble_aa_check = 0, \
307337
}
308338

309339
#else
@@ -333,51 +363,100 @@ typedef struct {
333363
* some options or parameters of some functions enabled by config mask.
334364
*/
335365
typedef struct {
336-
/*
337-
* Following parameters can not be configured runtime when call esp_bt_controller_init()
338-
* They will be overwritten by constant values from menuconfig options or from macros.
339-
* So, do not modify the value when esp_bt_controller_init()
340-
*/
341366
uint32_t magic; /*!< Magic number */
342367
uint32_t version; /*!< version number of the defined structure */
343-
/*
344-
* Following parameters can be configured runtime, when call esp_bt_controller_init()
345-
*/
346-
uint16_t controller_task_stack_size; /*!< Bluetooth controller task stack size */
347-
uint8_t controller_task_prio; /*!< Bluetooth controller task priority */
348-
uint8_t controller_task_run_cpu; /*!< CPU num that Bluetooth controller task runs on */
349-
uint8_t bluetooth_mode; /*!< Controller mode: BR/EDR, BLE or Dual Mode */
350-
uint8_t ble_max_act; /*!< BLE maximum number of air activities */
351-
uint8_t sleep_mode; /*!< controller sleep mode */
352-
uint8_t sleep_clock; /*!< controller sleep clock */
353-
uint8_t ble_st_acl_tx_buf_nb; /*!< controller static ACL TX BUFFER number */
354-
uint8_t ble_hw_cca_check; /*!< controller hardware triggered CCA check */
355-
uint16_t ble_adv_dup_filt_max; /*!< maximum number of duplicate scan filter */
356-
bool coex_param_en; /*!< deprecated */
357-
uint8_t ce_len_type; /*!< connection event length computation method */
358-
bool coex_use_hooks; /*!< deprecated */
359-
uint8_t hci_tl_type; /*!< HCI transport layer, UART, VHCI, etc */
360-
esp_bt_hci_tl_t *hci_tl_funcs; /*!< hci transport functions used, must be set when hci_tl_type is UART */
361-
uint8_t txant_dft; /*!< default Tx antenna */
362-
uint8_t rxant_dft; /*!< default Rx antenna */
363-
uint8_t txpwr_dft; /*!< default Tx power */
368+
uint16_t controller_task_stack_size; /*!< Bluetooth Controller task stack size in bytes */
369+
uint8_t controller_task_prio; /*!< Bluetooth Controller task priority */
370+
uint8_t controller_task_run_cpu; /*!< CPU number that Bluetooth Controller task runs on. Configurable in menuconfig.
371+
- 0 - CPU 0 (default)
372+
- 1 - CPU 1 */
373+
uint8_t bluetooth_mode; /*!< BLE mode */
374+
uint8_t ble_max_act; /*!< The maximum number of BLE instance. Configurable in menuconfig.
375+
- Range: 1 - 10
376+
- Default: 6 */
377+
uint8_t sleep_mode; /*!< Modem sleep mode. Configurable in menuconfig.
378+
- 0 - Disable (default)
379+
- 1 - Enable */
380+
uint8_t sleep_clock; /*!< Modem sleep clock source. Configurable in menuconfig. */
381+
uint8_t ble_st_acl_tx_buf_nb; /*!< Static ACL TX buffer numbers. Configurable in menuconfig.
382+
- Range: 0 - 12
383+
- Default: 0 */
384+
uint8_t ble_hw_cca_check; /*!< Deprecated */
385+
uint16_t ble_adv_dup_filt_max; /*!< The maximum number of extended duplicate scan filter. Configurable in menuconfig.
386+
- Range: 1 - 500
387+
- Default: 30 */
388+
bool coex_param_en; /*!< Deprecated */
389+
uint8_t ce_len_type; /*!< Connection event length determination method. Configurable in menuconfig.
390+
- 0 - Original (default)
391+
- 1 - use `CE_LEN` parameter from HCI commands
392+
- 2 - Espressif vendor defined method */
393+
bool coex_use_hooks; /*!< Deprecated */
394+
uint8_t hci_tl_type; /*!< HCI transport layer type. Configurable in menuconfig.
395+
- 0 - URAT
396+
- 1 - Virtual HCI (default) */
397+
esp_bt_hci_tl_t *hci_tl_funcs; /*!< HCI transport functions used. It must be set when `hci_tl_type` is UART. */
398+
uint8_t txant_dft; /*!< Default TX antenna. Configurable in menuconfig.
399+
- 0 - Antenna 0 (default)
400+
- 1 - Antenna 1 */
401+
uint8_t rxant_dft; /*!< Default RX antenna. Configurable in menuconfig.
402+
- 0 - Antenna 0 (default)
403+
- 1 - Antenna 1 */
404+
uint8_t txpwr_dft; /*!< Default TX power. Please refer to `esp_power_level_t` for supported power level. Configurable in menuconfig.
405+
- Default : `ESP_PWR_LVL_P9` +9 dBm. */
364406
uint32_t cfg_mask; /*!< Configuration mask to set specific options */
365-
uint8_t scan_duplicate_mode; /*!< scan duplicate mode */
366-
uint8_t scan_duplicate_type; /*!< scan duplicate type */
367-
uint16_t normal_adv_size; /*!< Normal adv size for scan duplicate */
368-
uint16_t mesh_adv_size; /*!< Mesh adv size for scan duplicate */
369-
uint8_t coex_phy_coded_tx_rx_time_limit; /*!< limit on max tx/rx time in case of connection using CODED-PHY with Wi-Fi coexistence */
370-
uint32_t hw_target_code; /*!< hardware target */
371-
uint8_t slave_ce_len_min; /*!< slave minimum ce length*/
372-
uint8_t hw_recorrect_en; /*!< Hardware re-correction enabled */
373-
uint8_t cca_thresh; /*!< cca threshold*/
374-
uint16_t scan_backoff_upperlimitmax; /*!< scan backoff upperlimitmax value */
375-
uint16_t dup_list_refresh_period; /*!< duplicate scan list refresh time */
376-
bool ble_50_feat_supp; /*!< BLE 5.0 feature support */
377-
uint8_t ble_cca_mode; /*!< BLE CCA mode */
378-
uint8_t ble_data_lenth_zero_aux; /*!< Config ext adv aux option */
379-
uint8_t ble_chan_ass_en; /*!< BLE channel assessment enable */
380-
uint8_t ble_ping_en; /*!< BLE ping procedure enable */
407+
uint8_t scan_duplicate_mode; /*!< Scan duplicate filtering mode. Configurable in menuconfig.
408+
- 0 - Normal scan duplicate filtering mode (default)
409+
- 1 - Special scan duplicate filtering mode for BLE Mesh */
410+
uint8_t scan_duplicate_type; /*!< Scan duplicate filtering type. If `scan_duplicate_mode` is set to 1, this parameter will be ignored. Configurable in menuconfig.
411+
- 0 - Filter scan duplicates by device address only (default)
412+
- 1 - Filter scan duplicates by advertising data only, even if they originate from different devices.
413+
- 2 - Filter scan duplicated by device address and advertising data. */
414+
uint16_t normal_adv_size; /*!< Maximum number of devices in scan duplicate filtering list. Configurable in menuconfig.
415+
- Range: 10 - 1000
416+
- Default: 100 */
417+
uint16_t mesh_adv_size; /*!< Maximum number of Mesh advertising packets in scan duplicate filtering list. Configurable in menuconfig.
418+
- Range: 10 - 1000
419+
- Default: 100 */
420+
uint8_t coex_phy_coded_tx_rx_time_limit; /*!< Enable / disable the maximum TX/RX time limit for Coded-PHY connections in coexistence with Wi-Fi scenarios. Configurable in menuconfig.
421+
- 0 - Disable (default)
422+
- 1 - Enable */
423+
uint32_t hw_target_code; /*!< Hardware target. Internal use only. Please do not modify this value. */
424+
uint8_t slave_ce_len_min; /*!< Slave minimum connection event length: 5 slots. Please do not modify this value. */
425+
uint8_t hw_recorrect_en; /*!< Enable / disable uncoded phy / coded phy hardware re-correction. Configurable in menuconfig. */
426+
uint8_t cca_thresh; /*!< Absolute value of hardware-triggered CCA threshold. The CCA threshold is always negative.
427+
If the channel assessment result exceeds the CCA threshold (e.g. -75 dBm), indicating the channel is busy,
428+
the hardware will not transmit packets on that channel. Configurable in menuconfig.
429+
- Range: 20 dBm - 100 dBm
430+
- Default: 75 dBm */
431+
uint16_t scan_backoff_upperlimitmax; /*!< Enable / disable active scan backoff. Configurable in menuconfig.
432+
- 0 - Disable (default)
433+
- 1 - Enable */
434+
uint16_t dup_list_refresh_period; /*!< Scan duplicate filtering list refresh period in seconds. Configurable in menuconfig
435+
- Range: 0 - 100 seconds
436+
- Default: 0 second */
437+
bool ble_50_feat_supp; /*!< True if BLE 5.0 features are enabled; false otherwise. This option depends on whether the Host enable the 5.0 features. */
438+
uint8_t ble_cca_mode; /*!< BLE CCA mode. Configurable in menuconfig
439+
- 0 - Disable (default)
440+
- 1 - Hardware-triggered CCA
441+
- 2 - Software-based CCA */
442+
uint8_t ble_data_lenth_zero_aux; /*!< Enable / disable auxiliary packets when the extended ADV data length is zero. Configurable in menuconfig.
443+
- 0 - Disable (default)
444+
- 1 - Enable */
445+
uint8_t ble_chan_ass_en; /*!< Enable / disable BLE channel assessment. Configurable in menuconfig.
446+
- 0 - Disable
447+
- 1 - Enable (default) */
448+
uint8_t ble_ping_en; /*!< Enable / disable BLE ping procedure. Configurable in menuconfig.
449+
- 0 - Disable
450+
- 1 - Enable (default) */
451+
uint8_t ble_llcp_disc_flag; /*!< Flag indicating whether the Controller disconnects after Instant Passed (0x28) error occurs. Configurable in menuconfig.
452+
- The Controller does not disconnect after Instant Passed (0x28) by default. */
453+
bool run_in_flash; /*!< True if the Controller code is in flash (flash model); false otherwise (default). Configurable in menuconfig. */
454+
bool dtm_en; /*!< In the flash mode, True if the DTM feature is enabled; false otherwise (default). Configurable in menuconfig. */
455+
bool enc_en; /*!< In the flash mode, True if the encryption feature is enabled (default); false otherwise. Configurable in menuconfig. */
456+
bool qa_test; /*!< In the flash mode, True if the QA test feature is enabled; false otherwise (default). Configurable in menuconfig.*/
457+
bool master_en; /*!< In the flash mode, True if the master feature is enabled (default); false otherwise. Configurable in menuconfig.*/
458+
bool scan_en; /*!< In the flash mode, True if the scan feature is enabled (default); false otherwise. Configurable in menuconfig.*/
459+
bool ble_aa_check; /*!< True if adds a verification step for the Access Address within the CONNECT_IND PDU; false otherwise. Configurable in menuconfig */
381460
} esp_bt_controller_config_t;
382461

383462
/**

0 commit comments

Comments
 (0)