mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
Merge branch 'rebase/add_ble_version_support_for_c6_eco1' into 'release/v5.1'
ble:add version num support for esp32c6 chip v5.1 See merge request espressif/esp-idf!23610
This commit is contained in:
@ -50,6 +50,8 @@
|
|||||||
#include "esp_private/periph_ctrl.h"
|
#include "esp_private/periph_ctrl.h"
|
||||||
#include "esp_sleep.h"
|
#include "esp_sleep.h"
|
||||||
|
|
||||||
|
#include "hal/efuse_hal.h"
|
||||||
|
|
||||||
/* Macro definition
|
/* Macro definition
|
||||||
************************************************************************
|
************************************************************************
|
||||||
*/
|
*/
|
||||||
@ -586,6 +588,7 @@ void controller_sleep_deinit(void)
|
|||||||
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||||
{
|
{
|
||||||
uint8_t mac[6];
|
uint8_t mac[6];
|
||||||
|
uint32_t chip_version;
|
||||||
esp_err_t ret = ESP_OK;
|
esp_err_t ret = ESP_OK;
|
||||||
ble_npl_count_info_t npl_info;
|
ble_npl_count_info_t npl_info;
|
||||||
|
|
||||||
@ -647,7 +650,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
|||||||
|
|
||||||
/* Enable BT-related clocks */
|
/* Enable BT-related clocks */
|
||||||
modem_clock_module_enable(PERIPH_BT_MODULE);
|
modem_clock_module_enable(PERIPH_BT_MODULE);
|
||||||
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL, 249);
|
chip_version = efuse_hal_chip_revision();
|
||||||
|
if (chip_version == 0) {
|
||||||
|
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL, (160 - 1));
|
||||||
|
} else{
|
||||||
|
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL, (2 - 1));
|
||||||
|
}
|
||||||
esp_phy_modem_init();
|
esp_phy_modem_init();
|
||||||
esp_phy_enable();
|
esp_phy_enable();
|
||||||
esp_btbb_enable();
|
esp_btbb_enable();
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "nimble/nimble_npl.h"
|
#include "nimble/nimble_npl.h"
|
||||||
#include "esp_bt_cfg.h"
|
#include "esp_bt_cfg.h"
|
||||||
|
#include "hal/efuse_hal.h"
|
||||||
|
|
||||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||||
#include "driver/uart.h"
|
#include "driver/uart.h"
|
||||||
@ -23,7 +24,6 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Bluetooth mode for controller enable/disable
|
* @brief Bluetooth mode for controller enable/disable
|
||||||
*/
|
*/
|
||||||
@ -258,7 +258,7 @@ typedef struct {
|
|||||||
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
|
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
|
||||||
.ble_scan_classify_filter_enable = 0, \
|
.ble_scan_classify_filter_enable = 0, \
|
||||||
.main_xtal_freq = CONFIG_XTAL_FREQ, \
|
.main_xtal_freq = CONFIG_XTAL_FREQ, \
|
||||||
.version_num = 0, \
|
.version_num = efuse_hal_chip_revision(), \
|
||||||
.cpu_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, \
|
.cpu_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, \
|
||||||
.ignore_wl_for_direct_adv = 0, \
|
.ignore_wl_for_direct_adv = 0, \
|
||||||
.enable_pcl = DEFAULT_BT_LE_POWER_CONTROL_ENABLED, \
|
.enable_pcl = DEFAULT_BT_LE_POWER_CONTROL_ENABLED, \
|
||||||
|
@ -196,7 +196,7 @@ extern "C" {
|
|||||||
|
|
||||||
#define BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N (3000)
|
#define BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N (3000)
|
||||||
|
|
||||||
#define RTC_FREQ_N (160000) /* in Hz */
|
#define RTC_FREQ_N (250000) /* in Hz */
|
||||||
|
|
||||||
#define BLE_LL_TX_PWR_DBM_N (9)
|
#define BLE_LL_TX_PWR_DBM_N (9)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user