component/bt: Support set HW CCA threshold value

This commit is contained in:
xiewenxiang
2021-12-28 15:11:54 +08:00
parent 5fc5016981
commit bf6b3ec0a8
5 changed files with 21 additions and 3 deletions

View File

@@ -66,6 +66,13 @@ config BT_CTRL_HW_CCA
help help
It enables HW CCA feature in controller 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 config BT_CTRL_HW_CCA_EFF
int int
default 1 if BT_CTRL_HW_CCA default 1 if BT_CTRL_HW_CCA

View File

@@ -81,6 +81,13 @@ config BT_CTRL_HW_CCA
help help
It enables HW CCA feature in controller 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 config BT_CTRL_HW_CCA_EFF
int int
default 1 if BT_CTRL_HW_CCA default 1 if BT_CTRL_HW_CCA

View File

@@ -18,7 +18,7 @@ extern "C" {
#endif #endif
#define ESP_BT_CTRL_CONFIG_MAGIC_VAL 0x5A5AA5A5 #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_MAGIC_VALUE 0xfadebead
#define ESP_BT_HCI_TL_VERSION 0x00010000 #define ESP_BT_HCI_TL_VERSION 0x00010000
@@ -178,6 +178,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
.hw_target_code = BLE_HW_TARGET_CODE_ESP32C3_CHIP_ECO0, \ .hw_target_code = BLE_HW_TARGET_CODE_ESP32C3_CHIP_ECO0, \
.slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \ .slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \
.hw_recorrect_en = AGC_RECORRECT_EN, \ .hw_recorrect_en = AGC_RECORRECT_EN, \
.cca_thresh = CONFIG_BT_CTRL_HW_CCA_VAL, \
}; };
#else #else
@@ -244,6 +245,7 @@ typedef struct {
uint32_t hw_target_code; /*!< hardware target */ uint32_t hw_target_code; /*!< hardware target */
uint8_t slave_ce_len_min; uint8_t slave_ce_len_min;
uint8_t hw_recorrect_en; uint8_t hw_recorrect_en;
uint8_t cca_thresh; /*!< cca threshold*/
} esp_bt_controller_config_t; } esp_bt_controller_config_t;
/** /**

View File

@@ -18,7 +18,7 @@ extern "C" {
#endif #endif
#define ESP_BT_CTRL_CONFIG_MAGIC_VAL 0x5A5AA5A5 #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_MAGIC_VALUE 0xfadebead
#define ESP_BT_HCI_TL_VERSION 0x00010000 #define ESP_BT_HCI_TL_VERSION 0x00010000
@@ -177,6 +177,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
.hw_target_code = BLE_HW_TARGET_CODE_ESP32S3_CHIP_ECO0, \ .hw_target_code = BLE_HW_TARGET_CODE_ESP32S3_CHIP_ECO0, \
.slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \ .slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \
.hw_recorrect_en = AGC_RECORRECT_EN, \ .hw_recorrect_en = AGC_RECORRECT_EN, \
.cca_thresh = CONFIG_BT_CTRL_HW_CCA_VAL, \
}; };
#else #else
@@ -243,6 +244,7 @@ typedef struct {
uint32_t hw_target_code; /*!< hardware target */ uint32_t hw_target_code; /*!< hardware target */
uint8_t slave_ce_len_min; /*!< slave minimum ce length*/ uint8_t slave_ce_len_min; /*!< slave minimum ce length*/
uint8_t hw_recorrect_en; uint8_t hw_recorrect_en;
uint8_t cca_thresh; /*!< cca threshold*/
} esp_bt_controller_config_t; } esp_bt_controller_config_t;
/** /**