From aaeecdf0e7dfa35b887940742be602f51e63fbe1 Mon Sep 17 00:00:00 2001 From: xiewenxiang Date: Tue, 28 Dec 2021 15:11:54 +0800 Subject: [PATCH] component/bt: Support set HW CCA threshold value --- components/bt/controller/esp32c3/Kconfig.in | 7 +++++++ components/bt/controller/lib_esp32c3_family | 2 +- components/bt/include/esp32c3/include/esp_bt.h | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/components/bt/controller/esp32c3/Kconfig.in b/components/bt/controller/esp32c3/Kconfig.in index c30f80bc45..caa0d65328 100644 --- a/components/bt/controller/esp32c3/Kconfig.in +++ b/components/bt/controller/esp32c3/Kconfig.in @@ -66,6 +66,13 @@ config BT_CTRL_HW_CCA help It enables HW CCA feature in controller +config BT_CTRL_HW_CCA_VAL + int "CCA threshold value" + range 20 60 + default 20 + help + It is the threshold value of HW CCA, if the value is 30, it means CCA threshold is -30 dBm. + config BT_CTRL_HW_CCA_EFF int default 1 if BT_CTRL_HW_CCA diff --git a/components/bt/controller/lib_esp32c3_family b/components/bt/controller/lib_esp32c3_family index 07df01f3bf..a01066d872 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit 07df01f3bfd650a257d5481e6b32f5ce9731735a +Subproject commit a01066d87297c330196162fd84cdb108cfa9f67b diff --git a/components/bt/include/esp32c3/include/esp_bt.h b/components/bt/include/esp32c3/include/esp_bt.h index 45e5c3fa52..7a991d121e 100644 --- a/components/bt/include/esp32c3/include/esp_bt.h +++ b/components/bt/include/esp32c3/include/esp_bt.h @@ -26,7 +26,7 @@ extern "C" { #endif #define ESP_BT_CTRL_CONFIG_MAGIC_VAL 0x5A5AA5A5 -#define ESP_BT_CTRL_CONFIG_VERSION 0x02104270 +#define ESP_BT_CTRL_CONFIG_VERSION 0x02112280 #define ESP_BT_HCI_TL_MAGIC_VALUE 0xfadebead #define ESP_BT_HCI_TL_VERSION 0x00010000 @@ -179,6 +179,7 @@ enum { .hw_target_code = BLE_HW_TARGET_CODE_ESP32C3_CHIP_ECO0, \ .slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \ .hw_recorrect_en = AGC_RECORRECT_EN, \ + .cca_thresh = CONFIG_BT_CTRL_HW_CCA_VAL, \ }; #else @@ -245,6 +246,7 @@ typedef struct { uint32_t hw_target_code; /*!< hardware target */ uint8_t slave_ce_len_min; uint8_t hw_recorrect_en; + uint8_t cca_thresh; /*!< cca threshold*/ } esp_bt_controller_config_t; /**