mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
component/bt: clean up WIFI_CLK_EN_REG settings for Bluetooth
1. move settings of WIFI_CLK_EN_REG for bluetooth into controller init/deinit APIs 2. modify the bit mask used in phy_rf init/deinit to use WIFI-BT shared bits
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "phy.h"
|
||||
#include "phy_init_data.h"
|
||||
#include "esp_coexist.h"
|
||||
#include "driver/periph_ctrl.h"
|
||||
|
||||
static const char* TAG = "phy_init";
|
||||
|
||||
@@ -51,7 +52,7 @@ esp_err_t esp_phy_rf_init(const esp_phy_init_data_t* init_data,
|
||||
_lock_acquire(&s_phy_rf_init_lock);
|
||||
if (s_phy_rf_init_count == 0) {
|
||||
// Enable WiFi peripheral clock
|
||||
DPORT_SET_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_WIFI_EN | DPORT_WIFI_CLK_RNG_EN);
|
||||
periph_module_enable(PERIPH_WIFI_BT_COMMON_MODULE);
|
||||
ESP_LOGV(TAG, "register_chipv7_phy, init_data=%p, cal_data=%p, mode=%d",
|
||||
init_data, calibration_data, mode);
|
||||
phy_set_wifi_mode_only(0);
|
||||
@@ -76,7 +77,7 @@ esp_err_t esp_phy_rf_deinit(void)
|
||||
// Disable PHY and RF.
|
||||
phy_close_rf();
|
||||
// Disable WiFi peripheral clock. Do not disable clock for hardware RNG
|
||||
DPORT_CLEAR_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_WIFI_EN);
|
||||
periph_module_disable(PERIPH_WIFI_BT_COMMON_MODULE);
|
||||
} else {
|
||||
#if CONFIG_SW_COEXIST_ENABLE
|
||||
coex_deinit();
|
||||
|
Reference in New Issue
Block a user