kopia lustrzana https://github.com/espressif/esp-idf
ble:add version num support for esp32c6 chip
rodzic
cacb45d450
commit
3d181f5346
|
@ -50,6 +50,8 @@
|
|||
#include "esp_private/periph_ctrl.h"
|
||||
#include "esp_sleep.h"
|
||||
|
||||
#include "hal/efuse_hal.h"
|
||||
|
||||
/* Macro definition
|
||||
************************************************************************
|
||||
*/
|
||||
|
@ -586,6 +588,7 @@ void controller_sleep_deinit(void)
|
|||
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||
{
|
||||
uint8_t mac[6];
|
||||
uint32_t chip_version;
|
||||
esp_err_t ret = ESP_OK;
|
||||
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 */
|
||||
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_enable();
|
||||
esp_btbb_enable();
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "nimble/nimble_npl.h"
|
||||
#include "esp_bt_cfg.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#include "driver/uart.h"
|
||||
|
@ -23,7 +24,6 @@
|
|||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Bluetooth mode for controller enable/disable
|
||||
*/
|
||||
|
@ -258,7 +258,7 @@ typedef struct {
|
|||
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
|
||||
.ble_scan_classify_filter_enable = 0, \
|
||||
.main_xtal_freq = CONFIG_XTAL_FREQ, \
|
||||
.version_num = 0, \
|
||||
.version_num = efuse_hal_chip_revision(), \
|
||||
.cpu_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, \
|
||||
.ignore_wl_for_direct_adv = 0, \
|
||||
.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 RTC_FREQ_N (160000) /* in Hz */
|
||||
#define RTC_FREQ_N (250000) /* in Hz */
|
||||
|
||||
#define BLE_LL_TX_PWR_DBM_N (9)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue