ESPHome  2024.11.0
const_esp32c6.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef USE_ESP32_VARIANT_ESP32C6
4 
5 #include <esp_bt.h>
6 
7 namespace esphome {
8 namespace esp32_ble {
9 
10 static const esp_bt_controller_config_t BT_CONTROLLER_CONFIG = {
11  .config_version = CONFIG_VERSION,
12  .ble_ll_resolv_list_size = CONFIG_BT_LE_LL_RESOLV_LIST_SIZE,
13  .ble_hci_evt_hi_buf_count = DEFAULT_BT_LE_HCI_EVT_HI_BUF_COUNT,
14  .ble_hci_evt_lo_buf_count = DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT,
15  .ble_ll_sync_list_cnt = DEFAULT_BT_LE_MAX_PERIODIC_ADVERTISER_LIST,
16  .ble_ll_sync_cnt = DEFAULT_BT_LE_MAX_PERIODIC_SYNCS,
17  .ble_ll_rsp_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT,
18  .ble_ll_adv_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT,
19  .ble_ll_tx_pwr_dbm = BLE_LL_TX_PWR_DBM_N,
20  .rtc_freq = RTC_FREQ_N,
21  .ble_ll_sca = CONFIG_BT_LE_LL_SCA,
22  .ble_ll_scan_phy_number = BLE_LL_SCAN_PHY_NUMBER_N,
23  .ble_ll_conn_def_auth_pyld_tmo = BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N,
24  .ble_ll_jitter_usecs = BLE_LL_JITTER_USECS_N,
25  .ble_ll_sched_max_adv_pdu_usecs = BLE_LL_SCHED_MAX_ADV_PDU_USECS_N,
26  .ble_ll_sched_direct_adv_max_usecs = BLE_LL_SCHED_DIRECT_ADV_MAX_USECS_N,
27  .ble_ll_sched_adv_max_usecs = BLE_LL_SCHED_ADV_MAX_USECS_N,
28  .ble_scan_rsp_data_max_len = DEFAULT_BT_LE_SCAN_RSP_DATA_MAX_LEN_N,
29  .ble_ll_cfg_num_hci_cmd_pkts = BLE_LL_CFG_NUM_HCI_CMD_PKTS_N,
30  .ble_ll_ctrl_proc_timeout_ms = BLE_LL_CTRL_PROC_TIMEOUT_MS_N,
31  .nimble_max_connections = DEFAULT_BT_LE_MAX_CONNECTIONS,
32  .ble_whitelist_size = DEFAULT_BT_NIMBLE_WHITELIST_SIZE, // NOLINT
33  .ble_acl_buf_size = DEFAULT_BT_LE_ACL_BUF_SIZE,
34  .ble_acl_buf_count = DEFAULT_BT_LE_ACL_BUF_COUNT,
35  .ble_hci_evt_buf_size = DEFAULT_BT_LE_HCI_EVT_BUF_SIZE,
36  .ble_multi_adv_instances = DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES,
37  .ble_ext_adv_max_size = DEFAULT_BT_LE_EXT_ADV_MAX_SIZE,
38  .controller_task_stack_size = NIMBLE_LL_STACK_SIZE,
39  .controller_task_prio = ESP_TASK_BT_CONTROLLER_PRIO,
40  .controller_run_cpu = 0,
41  .enable_qa_test = RUN_QA_TEST,
42  .enable_bqb_test = RUN_BQB_TEST,
43 #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 1)
44  // The following fields have been removed since ESP IDF version 5.3.1, see commit:
45  // https://github.com/espressif/esp-idf/commit/e761c1de8f9c0777829d597b4d5a33bb070a30a8
46  .enable_uart_hci = HCI_UART_EN,
47  .ble_hci_uart_port = DEFAULT_BT_LE_HCI_UART_PORT,
48  .ble_hci_uart_baud = DEFAULT_BT_LE_HCI_UART_BAUD,
49  .ble_hci_uart_data_bits = DEFAULT_BT_LE_HCI_UART_DATA_BITS,
50  .ble_hci_uart_stop_bits = DEFAULT_BT_LE_HCI_UART_STOP_BITS,
51  .ble_hci_uart_flow_ctrl = DEFAULT_BT_LE_HCI_UART_FLOW_CTRL,
52  .ble_hci_uart_uart_parity = DEFAULT_BT_LE_HCI_UART_PARITY,
53 #endif
54  .enable_tx_cca = DEFAULT_BT_LE_TX_CCA_ENABLED,
55  .cca_rssi_thresh = 256 - DEFAULT_BT_LE_CCA_RSSI_THRESH,
56  .sleep_en = NIMBLE_SLEEP_ENABLE,
57  .coex_phy_coded_tx_rx_time_limit = DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF,
58  .dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF,
59  .ble_scan_classify_filter_enable = 1,
60  .main_xtal_freq = CONFIG_XTAL_FREQ,
61  .version_num = (uint8_t) efuse_hal_chip_revision(),
62  .cpu_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ,
63  .ignore_wl_for_direct_adv = 0,
64  .enable_pcl = DEFAULT_BT_LE_POWER_CONTROL_ENABLED,
65 #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 3)
66  .csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT,
67 #endif
68  .config_magic = CONFIG_MAGIC,
69 };
70 
71 } // namespace esp32_ble
72 } // namespace esphome
73 
74 #endif // USE_ESP32_VARIANT_ESP32C6
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7