Merge branch 'fix/fix_i2c_modem_clock_ref_count_mismatch_v6.0' into 'release/v6.0'

feat(esp_hw_support): add reference count control & clock enable checking for modem clock devices (v6.0)

See merge request espressif/esp-idf!45533
This commit is contained in:
Jiang Jiang Jian
2026-02-01 11:54:27 +08:00
33 changed files with 1096 additions and 21 deletions
+8
View File
@@ -255,6 +255,14 @@ menu "Hardware Settings"
help
Place analog i2c master control functions (e.g. regi2c_ctrl_read_reg, regi2c_ctrl_write_reg) into IRAM,
so that these functions can be IRAM-safe and able to be called in the other IRAM interrupt context.
config ESP_MODEM_CLOCK_ENABLE_CHECKING
bool "Enable modem clock configuration checking"
depends on SOC_MODEM_CLOCK_SUPPORTED
default n
help
If enabled, this option will perform additional checks on modem clock configuration
to ensure proper operation and detect potential configuration issues.
endmenu
rsource "./etm/Kconfig.etm"
@@ -27,6 +27,7 @@ extern "C" {
// For bootloader, the strategy is to keep the analog i2c master clock always enabled if ANA_I2C_MST_CLK_HAS_ROOT_GATING (in bootloader_hardware_init())
#define ANALOG_CLOCK_ENABLE()
#define ANALOG_CLOCK_DISABLE()
#define ANALOG_CLOCK_IS_ENABLED()
#else // !BOOTLOADER_BUILD
@@ -57,9 +58,11 @@ static inline __attribute__((always_inline)) void ANA_I2C_SRC_CLOCK_ENABLE(bool
ANA_I2C_SRC_CLOCK_ENABLE(false); \
}
#define ANALOG_CLOCK_IS_ENABLED() regi2c_ctrl_ll_master_is_clock_enabled()
#else
#define ANALOG_CLOCK_ENABLE()
#define ANALOG_CLOCK_DISABLE()
#define ANALOG_CLOCK_IS_ENABLED()
#endif
#endif // BOOTLOADER_BUILD
+173 -21
View File
@@ -31,7 +31,9 @@ typedef enum {
MODEM_CLOCK_MODEM_ADC_COMMON_FE,
MODEM_CLOCK_MODEM_PRIVATE_FE,
MODEM_CLOCK_COEXIST,
#if ANA_I2C_MST_CLK_HAS_ROOT_GATING
MODEM_CLOCK_I2C_MASTER,
#endif
#if SOC_PHY_CALIBRATION_CLOCK_IS_INDEPENDENT
MODEM_CLOCK_WIFI_APB,
MODEM_CLOCK_WIFI_BB_44M,
@@ -61,9 +63,13 @@ typedef struct modem_clock_context {
modem_clock_hal_context_t *hal;
portMUX_TYPE lock;
struct {
int16_t refs;
uint16_t reserved; /* reserved for 4 bytes aligned */
int16_t refs; /* Reference count for this device, if with_refcnt is enabled */
uint16_t with_refcnt : 1; /* Enable reference count management (true=use refs, false=ignore refs) */
uint16_t reserved : 15; /* reserved for 15 bits aligned */
void (*configure)(struct modem_clock_context *, bool);
#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING
esp_err_t (*check_enable)(struct modem_clock_context *);
#endif
} dev[MODEM_CLOCK_DEVICE_MAX];
/* the low-power clock source for each module */
modem_clock_lpclk_src_t lpclk_src[PERIPH_MODEM_MODULE_NUM];
@@ -90,6 +96,23 @@ static void IRAM_ATTR modem_clock_wifi_bb_configure(modem_clock_context_t *ctx,
modem_syscon_ll_clk_wifibb_configure(ctx->hal->syscon_dev, enable);
}
}
#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING
static esp_err_t IRAM_ATTR modem_clock_wifi_mac_check_enable(modem_clock_context_t *ctx)
{
bool all_clock_enabled = true;
#if !SOC_PHY_CALIBRATION_CLOCK_IS_INDEPENDENT
all_clock_enabled &= modem_syscon_ll_wifi_apb_clock_is_enabled(ctx->hal->syscon_dev);
#endif
all_clock_enabled &= modem_syscon_ll_wifi_mac_clock_is_enabled(ctx->hal->syscon_dev);
return all_clock_enabled ? ESP_OK : ESP_FAIL;
}
static esp_err_t IRAM_ATTR modem_clock_wifi_bb_check_enable(modem_clock_context_t *ctx)
{
return modem_syscon_ll_wifibb_clock_is_enabled(ctx->hal->syscon_dev) ? ESP_OK : ESP_FAIL;
}
#endif
#endif // SOC_WIFI_SUPPORTED
#if SOC_BT_SUPPORTED
@@ -99,6 +122,17 @@ static void IRAM_ATTR modem_clock_ble_mac_configure(modem_clock_context_t *ctx,
modem_syscon_ll_enable_modem_sec_clock(ctx->hal->syscon_dev, enable);
modem_syscon_ll_enable_ble_timer_clock(ctx->hal->syscon_dev, enable);
}
#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING
static esp_err_t IRAM_ATTR modem_clock_ble_mac_check_enable(modem_clock_context_t *ctx)
{
bool all_clock_enabled = true;
all_clock_enabled &= modem_syscon_ll_bt_mac_clock_is_enabled(ctx->hal->syscon_dev);
all_clock_enabled &= modem_syscon_ll_modem_sec_clock_is_enabled(ctx->hal->syscon_dev);
all_clock_enabled &= modem_syscon_ll_ble_timer_clock_is_enabled(ctx->hal->syscon_dev);
return all_clock_enabled ? ESP_OK : ESP_FAIL;
}
#endif
#endif // SOC_BT_SUPPORTED
#if SOC_PHY_CALIBRATION_CLOCK_IS_INDEPENDENT
@@ -115,6 +149,18 @@ static void IRAM_ATTR modem_clock_wifi_bb_44m_configure(modem_clock_context_t *c
modem_syscon_ll_enable_wifibb_44m_clock(ctx->hal->syscon_dev, enable);
}
}
#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING
static esp_err_t IRAM_ATTR modem_clock_wifi_apb_check_enable(modem_clock_context_t *ctx)
{
return modem_syscon_ll_wifi_apb_clock_is_enabled(ctx->hal->syscon_dev) ? ESP_OK : ESP_FAIL;
}
static esp_err_t IRAM_ATTR modem_clock_wifi_bb_44m_check_enable(modem_clock_context_t *ctx)
{
return modem_syscon_ll_wifibb_44m_clock_is_enabled(ctx->hal->syscon_dev) ? ESP_OK : ESP_FAIL;
}
#endif
#endif
#if SOC_BT_SUPPORTED || SOC_IEEE802154_SUPPORTED
@@ -124,6 +170,15 @@ static void IRAM_ATTR modem_clock_ble_i154_bb_configure(modem_clock_context_t *c
modem_syscon_ll_enable_bt_clock(ctx->hal->syscon_dev, enable);
}
#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING
static esp_err_t IRAM_ATTR modem_clock_ble_i154_bb_check_enable(modem_clock_context_t *ctx)
{
bool all_clock_enabled = true;
all_clock_enabled &= modem_syscon_ll_bt_apb_clock_is_enabled(ctx->hal->syscon_dev);
all_clock_enabled &= modem_syscon_ll_bt_clock_is_enabled(ctx->hal->syscon_dev);
return all_clock_enabled ? ESP_OK : ESP_FAIL;
}
#endif
#endif // SOC_BT_SUPPORTED || SOC_IEEE802154_SUPPORTED
#if SOC_IEEE802154_SUPPORTED
@@ -132,6 +187,16 @@ static void IRAM_ATTR modem_clock_ieee802154_mac_configure(modem_clock_context_t
modem_syscon_ll_enable_ieee802154_apb_clock(ctx->hal->syscon_dev, enable);
modem_syscon_ll_enable_ieee802154_mac_clock(ctx->hal->syscon_dev, enable);
}
#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING
static esp_err_t IRAM_ATTR modem_clock_ieee802154_mac_check_enable(modem_clock_context_t *ctx)
{
bool all_clock_enabled = true;
all_clock_enabled &= modem_syscon_ll_ieee802154_apb_clock_is_enabled(ctx->hal->syscon_dev);
all_clock_enabled &= modem_syscon_ll_ieee802154_mac_clock_is_enabled(ctx->hal->syscon_dev);
return all_clock_enabled ? ESP_OK : ESP_FAIL;
}
#endif
#endif // SOC_IEEE802154_SUPPORTED
static void IRAM_ATTR modem_clock_coex_configure(modem_clock_context_t *ctx, bool enable)
@@ -149,6 +214,7 @@ static void IRAM_ATTR modem_clock_modem_private_fe_configure(modem_clock_context
modem_clock_hal_enable_modem_private_fe_clock(ctx->hal, enable);
}
#if ANA_I2C_MST_CLK_HAS_ROOT_GATING
static void IRAM_ATTR modem_clock_i2c_master_configure(modem_clock_context_t *ctx, bool enable)
{
if (enable) {
@@ -157,6 +223,7 @@ static void IRAM_ATTR modem_clock_i2c_master_configure(modem_clock_context_t *ct
ANALOG_CLOCK_DISABLE();
}
}
#endif
static void IRAM_ATTR modem_clock_etm_configure(modem_clock_context_t *ctx, bool enable)
{
@@ -169,6 +236,43 @@ static void IRAM_ATTR modem_clock_data_dump_configure(modem_clock_context_t *ctx
modem_syscon_ll_enable_data_dump_mux_clock(ctx->hal->syscon_dev, enable);
}
#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING
static esp_err_t IRAM_ATTR modem_clock_coex_check_enable(modem_clock_context_t *ctx)
{
return modem_lpcon_ll_coex_clock_is_enabled(ctx->hal->lpcon_dev) ? ESP_OK : ESP_FAIL;
}
static esp_err_t IRAM_ATTR modem_clock_modem_adc_common_fe_check_enable(modem_clock_context_t *ctx)
{
return modem_clock_hal_modem_common_fe_clock_is_enabled(ctx->hal) ? ESP_OK : ESP_FAIL;
}
static esp_err_t IRAM_ATTR modem_clock_modem_private_fe_check_enable(modem_clock_context_t *ctx)
{
return modem_clock_hal_modem_private_fe_clock_is_enabled(ctx->hal) ? ESP_OK : ESP_FAIL;
}
#if ANA_I2C_MST_CLK_HAS_ROOT_GATING
static esp_err_t IRAM_ATTR modem_clock_i2c_master_check_enable(modem_clock_context_t *ctx)
{
return ANALOG_CLOCK_IS_ENABLED() ? ESP_OK : ESP_FAIL;
}
#endif
static esp_err_t IRAM_ATTR modem_clock_etm_check_enable(modem_clock_context_t *ctx)
{
return modem_syscon_ll_etm_clock_is_enabled(ctx->hal->syscon_dev) ? ESP_OK : ESP_FAIL;
}
static esp_err_t IRAM_ATTR modem_clock_data_dump_check_enable(modem_clock_context_t *ctx)
{
bool all_clock_enabled = true;
all_clock_enabled &= modem_syscon_ll_data_dump_clock_is_enabled(ctx->hal->syscon_dev);
all_clock_enabled &= modem_syscon_ll_data_dump_mux_clock_is_enabled(ctx->hal->syscon_dev);
return all_clock_enabled ? ESP_OK : ESP_FAIL;
}
#endif
modem_clock_context_t * __attribute__((weak)) IRAM_ATTR MODEM_CLOCK_instance(void)
{
/* It should be explicitly defined in the internal RAM */
@@ -176,29 +280,32 @@ modem_clock_context_t * __attribute__((weak)) IRAM_ATTR MODEM_CLOCK_instance(voi
static DRAM_ATTR modem_clock_context_t modem_clock_context = {
.hal = &modem_clock_hal, .lock = portMUX_INITIALIZER_UNLOCKED,
.dev = {
[MODEM_CLOCK_MODEM_ADC_COMMON_FE] = { .refs = 0, .configure = modem_clock_modem_adc_common_fe_configure },
[MODEM_CLOCK_MODEM_PRIVATE_FE] = { .refs = 0, .configure = modem_clock_modem_private_fe_configure },
[MODEM_CLOCK_COEXIST] = { .refs = 0, .configure = modem_clock_coex_configure },
[MODEM_CLOCK_I2C_MASTER] = { .refs = 0, .configure = modem_clock_i2c_master_configure },
[MODEM_CLOCK_MODEM_ADC_COMMON_FE] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_modem_adc_common_fe_configure },
[MODEM_CLOCK_MODEM_PRIVATE_FE] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_modem_private_fe_configure },
[MODEM_CLOCK_COEXIST] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_coex_configure },
#if ANA_I2C_MST_CLK_HAS_ROOT_GATING
// ANALOG_CLOCK_ENABLE/DISABLE has its own ref_cnt management.
[MODEM_CLOCK_I2C_MASTER] = { .refs = 0, .with_refcnt = false, .configure = modem_clock_i2c_master_configure },
#endif
#if SOC_PHY_CALIBRATION_CLOCK_IS_INDEPENDENT
[MODEM_CLOCK_WIFI_APB] = { .refs = 0, .configure = modem_clock_wifi_apb_configure },
[MODEM_CLOCK_WIFI_BB_44M] = { .refs = 0, .configure = modem_clock_wifi_bb_44m_configure },
[MODEM_CLOCK_WIFI_APB] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_wifi_apb_configure },
[MODEM_CLOCK_WIFI_BB_44M] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_wifi_bb_44m_configure },
#endif
#if SOC_WIFI_SUPPORTED
[MODEM_CLOCK_WIFI_MAC] = { .refs = 0, .configure = modem_clock_wifi_mac_configure },
[MODEM_CLOCK_WIFI_BB] = { .refs = 0, .configure = modem_clock_wifi_bb_configure },
[MODEM_CLOCK_WIFI_MAC] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_wifi_mac_configure },
[MODEM_CLOCK_WIFI_BB] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_wifi_bb_configure },
#endif
[MODEM_CLOCK_ETM] = { .refs = 0, .configure = modem_clock_etm_configure },
[MODEM_CLOCK_ETM] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_etm_configure },
#if SOC_BT_SUPPORTED
[MODEM_CLOCK_BLE_MAC] = { .refs = 0, .configure = modem_clock_ble_mac_configure },
[MODEM_CLOCK_BLE_MAC] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_ble_mac_configure },
#endif
#if SOC_IEEE802154_SUPPORTED || SOC_BT_SUPPORTED
[MODEM_CLOCK_BT_I154_COMMON_BB] = { .refs = 0, .configure = modem_clock_ble_i154_bb_configure },
[MODEM_CLOCK_BT_I154_COMMON_BB] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_ble_i154_bb_configure },
#endif
#if SOC_IEEE802154_SUPPORTED
[MODEM_CLOCK_802154_MAC] = { .refs = 0, .configure = modem_clock_ieee802154_mac_configure },
[MODEM_CLOCK_802154_MAC] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_ieee802154_mac_configure },
#endif
[MODEM_CLOCK_DATADUMP] = { .refs = 0, .configure = modem_clock_data_dump_configure }
[MODEM_CLOCK_DATADUMP] = { .refs = 0, .with_refcnt = true, .configure = modem_clock_data_dump_configure }
},
.lpclk_src = { [0 ... PERIPH_MODEM_MODULE_NUM - 1] = MODEM_CLOCK_LPCLK_SRC_INVALID }
#if SOC_WIFI_SUPPORTED
@@ -206,12 +313,40 @@ modem_clock_context_t * __attribute__((weak)) IRAM_ATTR MODEM_CLOCK_instance(voi
.modem_status = MODEM_STATUS_IDLE
#endif
};
if (modem_clock_hal.syscon_dev == NULL || modem_clock_hal.lpcon_dev == NULL) {
modem_clock_hal.syscon_dev = &MODEM_SYSCON;
modem_clock_hal.lpcon_dev = &MODEM_LPCON;
#if SOC_CLOCK_TREE_MANAGEMENT_SUPPORTED
ESP_ERROR_CHECK(esp_clk_tree_enable_src(SOC_MOD_CLK_MODEM_APB, true));
#endif
#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING
modem_clock_context.dev[MODEM_CLOCK_MODEM_ADC_COMMON_FE].check_enable = modem_clock_modem_adc_common_fe_check_enable;
modem_clock_context.dev[MODEM_CLOCK_MODEM_PRIVATE_FE].check_enable = modem_clock_modem_private_fe_check_enable;
modem_clock_context.dev[MODEM_CLOCK_COEXIST].check_enable = modem_clock_coex_check_enable;
#if ANA_I2C_MST_CLK_HAS_ROOT_GATING
modem_clock_context.dev[MODEM_CLOCK_I2C_MASTER].check_enable = modem_clock_i2c_master_check_enable;
#endif
#if SOC_PHY_CALIBRATION_CLOCK_IS_INDEPENDENT
modem_clock_context.dev[MODEM_CLOCK_WIFI_APB].check_enable = modem_clock_wifi_apb_check_enable;
modem_clock_context.dev[MODEM_CLOCK_WIFI_BB_44M].check_enable = modem_clock_wifi_bb_44m_check_enable;
#endif
#if SOC_WIFI_SUPPORTED
modem_clock_context.dev[MODEM_CLOCK_WIFI_MAC].check_enable = modem_clock_wifi_mac_check_enable;
modem_clock_context.dev[MODEM_CLOCK_WIFI_BB].check_enable = modem_clock_wifi_bb_check_enable;
#endif
modem_clock_context.dev[MODEM_CLOCK_ETM].check_enable = modem_clock_etm_check_enable;
#if SOC_BT_SUPPORTED
modem_clock_context.dev[MODEM_CLOCK_BLE_MAC].check_enable = modem_clock_ble_mac_check_enable;
#endif
#if SOC_IEEE802154_SUPPORTED || SOC_BT_SUPPORTED
modem_clock_context.dev[MODEM_CLOCK_BT_I154_COMMON_BB].check_enable = modem_clock_ble_i154_bb_check_enable;
#endif
#if SOC_IEEE802154_SUPPORTED
modem_clock_context.dev[MODEM_CLOCK_802154_MAC].check_enable = modem_clock_ieee802154_mac_check_enable;
#endif
modem_clock_context.dev[MODEM_CLOCK_DATADUMP].check_enable = modem_clock_data_dump_check_enable;
#endif // CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING
}
return &modem_clock_context;
}
@@ -252,11 +387,19 @@ esp_err_t modem_clock_domain_clk_gate_disable(modem_clock_domain_t domain, pmu_h
static void IRAM_ATTR modem_clock_device_enable(modem_clock_context_t *ctx, uint32_t dev_map)
{
int16_t refs = 0;
esp_os_enter_critical_safe(&ctx->lock);
for (int i = 0; dev_map; dev_map >>= 1, i++) {
if (dev_map & BIT(0)) {
ctx->dev[i].refs++;
(*ctx->dev[i].configure)(ctx, true);
refs = ctx->dev[i].with_refcnt ? ctx->dev[i].refs++ : refs;
if (refs == 0 || !ctx->dev[i].with_refcnt) {
(*ctx->dev[i].configure)(ctx, true);
}
#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING
if (ctx->dev[i].check_enable) {
ESP_ERROR_CHECK((*ctx->dev[i].check_enable)(ctx));
}
#endif
}
}
esp_os_exit_critical_safe(&ctx->lock);
@@ -268,14 +411,16 @@ static void IRAM_ATTR modem_clock_device_disable(modem_clock_context_t *ctx, uin
esp_os_enter_critical_safe(&ctx->lock);
for (int i = 0; dev_map; dev_map >>= 1, i++) {
if (dev_map & BIT(0)) {
refs = --ctx->dev[i].refs;
if (refs == 0) {
refs = ctx->dev[i].with_refcnt ? --ctx->dev[i].refs : refs;
if (refs == 0 || !ctx->dev[i].with_refcnt) {
(*ctx->dev[i].configure)(ctx, false);
}
if (ctx->dev[i].with_refcnt) {
assert(refs >= 0);
}
}
}
esp_os_exit_critical_safe(&ctx->lock);
assert(refs >= 0);
}
void IRAM_ATTR modem_clock_module_mac_reset(shared_periph_module_t module)
@@ -316,8 +461,12 @@ void IRAM_ATTR modem_clock_module_mac_reset(shared_periph_module_t module)
#define BLE_CLOCK_DEPS (BIT(MODEM_CLOCK_BLE_MAC) | BIT(MODEM_CLOCK_BT_I154_COMMON_BB) | BIT(MODEM_CLOCK_ETM) | BIT(MODEM_CLOCK_COEXIST))
#define IEEE802154_CLOCK_DEPS (BIT(MODEM_CLOCK_802154_MAC) | BIT(MODEM_CLOCK_BT_I154_COMMON_BB) | BIT(MODEM_CLOCK_ETM) | BIT(MODEM_CLOCK_COEXIST))
#define COEXIST_CLOCK_DEPS (BIT(MODEM_CLOCK_COEXIST))
#define PHY_CLOCK_DEPS (BIT(MODEM_CLOCK_I2C_MASTER) | BIT(MODEM_CLOCK_MODEM_ADC_COMMON_FE) | BIT(MODEM_CLOCK_MODEM_PRIVATE_FE))
#if ANA_I2C_MST_CLK_HAS_ROOT_GATING
#define I2C_ANA_MST_CLOCK_DEPS (BIT(MODEM_CLOCK_I2C_MASTER))
#else
#define I2C_ANA_MST_CLOCK_DEPS (0)
#endif
#define PHY_CLOCK_DEPS (I2C_ANA_MST_CLOCK_DEPS | BIT(MODEM_CLOCK_MODEM_ADC_COMMON_FE) | BIT(MODEM_CLOCK_MODEM_PRIVATE_FE))
#define MODEM_ETM_CLOCK_DEPS (BIT(MODEM_CLOCK_ETM))
#define MODEM_ADC_COMMON_FE_CLOCK_DEPS (BIT(MODEM_CLOCK_MODEM_ADC_COMMON_FE))
#if SOC_PHY_CALIBRATION_CLOCK_IS_INDEPENDENT
@@ -394,6 +543,9 @@ static IRAM_ATTR void modem_clock_module_icg_map_init_all(void)
for (int domain = 0; domain < MODEM_CLOCK_DOMAIN_MAX; domain++) {
uint32_t code = modem_clock_hal_get_clock_domain_icg_bitmap(MODEM_CLOCK_instance()->hal, domain);
modem_clock_hal_set_clock_domain_icg_bitmap(MODEM_CLOCK_instance()->hal, domain, initial_gating_mode[domain] | code);
#if CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING
assert((modem_clock_hal_get_clock_domain_icg_bitmap(MODEM_CLOCK_instance()->hal, domain) & code) == code);
#endif
}
esp_os_exit_critical_safe(&MODEM_CLOCK_instance()->lock);
}
@@ -25,6 +25,12 @@ static inline void modem_lpcon_ll_enable_test_clk(modem_lpcon_dev_t *hw, bool en
hw->test_conf.clk_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_test_clk_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->test_conf.clk_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_ble_rtc_timer_slow_osc(modem_lpcon_dev_t *hw, bool en)
{
@@ -163,6 +169,12 @@ static inline void modem_lpcon_ll_enable_coex_clock(modem_lpcon_dev_t *hw, bool
hw->clk_conf.clk_coex_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_coex_clock_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->clk_conf.clk_coex_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_ble_rtc_timer_clock(modem_lpcon_dev_t *hw, bool en)
{
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include "soc/soc.h"
#include "soc/soc_caps.h"
#include "hal/assert.h"
#include "modem/modem_syscon_struct.h"
#include "hal/modem_clock_types.h"
@@ -25,12 +26,24 @@ static inline void modem_syscon_ll_enable_test_clk(modem_syscon_dev_t *hw, bool
hw->test_conf.clk_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_test_clk_is_enabled(modem_syscon_dev_t *hw)
{
return hw->test_conf.clk_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_pwdet_sar_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.pwdet_sar_clock_ena = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_pwdet_sar_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.pwdet_sar_clock_ena;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_set_pwdet_clk_div_num(modem_syscon_dev_t *hw, uint32_t div)
{
@@ -61,24 +74,48 @@ static inline void modem_syscon_ll_enable_data_dump_mux_clock(modem_syscon_dev_t
hw->clk_conf.clk_data_dump_mux = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_mux_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_data_dump_mux;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_etm_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_etm_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_etm_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zb_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zb_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_mac_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zbmac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zbmac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -89,18 +126,40 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw
hw->clk_conf.clk_modem_sec_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_modem_sec_en &&
hw->clk_conf.clk_modem_sec_ecb_en &&
hw->clk_conf.clk_modem_sec_ccm_en &&
hw->clk_conf.clk_modem_sec_bah_en &&
hw->clk_conf.clk_modem_sec_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ble_timer_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_ble_timer_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ble_timer_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_ble_timer_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_data_dump_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_data_dump_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_data_dump_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_force_clock(modem_syscon_dev_t *hw)
{
@@ -352,6 +411,17 @@ static inline void modem_syscon_ll_clk_wifibb_configure(modem_syscon_dev_t *hw,
#endif
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifibb_clock_is_enabled(modem_syscon_dev_t *hw)
{
// Check if any of the wifibb clocks are enabled
#if SOC_PHY_CALIBRATION_CLOCK_IS_INDEPENDENT
return (hw->clk_conf1.val & 0x1fb) == 0x1fb;
#else
return (hw->clk_conf1.val & 0x1ff) == 0x1ff;
#endif
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_wifibb_22m_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -370,6 +440,12 @@ static inline void modem_syscon_ll_enable_wifibb_44m_clock(modem_syscon_dev_t *h
hw->clk_conf1.clk_wifibb_44m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifibb_44m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_wifibb_44m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_wifibb_80m_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -419,12 +495,24 @@ static inline void modem_syscon_ll_enable_wifi_mac_clock(modem_syscon_dev_t *hw,
hw->clk_conf1.clk_wifimac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifi_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_wifimac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_wifi_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_wifi_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifi_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_wifi_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_20m_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -443,18 +531,36 @@ static inline void modem_syscon_ll_enable_fe_80m_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_fe_80m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_80m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_80m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_160m_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_160m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_160m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_160m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_apb_en;
}
// The modem_syscon of esp32c5 adds the enablement of the adc clock on the analog front end compared to esp32h2 and esp32c6.
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_adc_clock(modem_syscon_dev_t *hw, bool en)
@@ -462,6 +568,12 @@ static inline void modem_syscon_ll_enable_fe_adc_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_fe_adc_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_adc_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_adc_en;
}
// The modem_syscon of esp32c5 adds the enablement of the dac clock on the analog front end compared to esp32h2 and esp32c6.
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_dac_clock(modem_syscon_dev_t *hw, bool en)
@@ -469,6 +581,12 @@ static inline void modem_syscon_ll_enable_fe_dac_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_fe_dac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_dac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_dac_en;
}
// The modem_syscon of esp32c5 adds the enablement of the analog power detect clock on the analog front end compared to esp32h2 and esp32c6.
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_pwdet_clock(modem_syscon_dev_t *hw, bool en)
@@ -476,24 +594,48 @@ static inline void modem_syscon_ll_enable_fe_pwdet_clock(modem_syscon_dev_t *hw,
hw->clk_conf1.clk_fe_pwdet_adc_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_pwdet_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_pwdet_adc_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_bt_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_bt_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_mac_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_btmac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_btmac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_btbb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_btbb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_480m_clock(modem_syscon_dev_t *hw, bool en)
{
+14
View File
@@ -103,6 +103,12 @@ void IRAM_ATTR modem_clock_hal_enable_modem_common_fe_clock(modem_clock_hal_cont
}
}
bool IRAM_ATTR modem_clock_hal_modem_common_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_syscon_ll_fe_apb_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_80m_clock_is_enabled(hal->syscon_dev);
}
void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_context_t *hal, bool enable)
{
if (enable) {
@@ -113,6 +119,14 @@ void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_con
}
}
bool IRAM_ATTR modem_clock_hal_modem_private_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_syscon_ll_fe_160m_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_dac_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_pwdet_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_adc_clock_is_enabled(hal->syscon_dev);
}
void modem_clock_hal_set_ble_rtc_timer_divisor_value(modem_clock_hal_context_t *hal, uint32_t divider)
{
modem_lpcon_ll_set_ble_rtc_timer_divisor_value(hal->lpcon_dev, divider);
@@ -145,18 +145,36 @@ static inline void modem_lpcon_ll_enable_wifipwr_clock(modem_lpcon_dev_t *hw, bo
hw->clk_conf.clk_wifipwr_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_wifipwr_clock_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->clk_conf.clk_wifipwr_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_coex_clock(modem_lpcon_dev_t *hw, bool en)
{
hw->clk_conf.clk_coex_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_coex_clock_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->clk_conf.clk_coex_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_ble_rtc_timer_clock(modem_lpcon_dev_t *hw, bool en)
{
hw->clk_conf.clk_lp_timer_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_ble_rtc_timer_clock_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->clk_conf.clk_lp_timer_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_wifipwr_force_clock(modem_lpcon_dev_t *hw, bool en)
{
@@ -31,24 +31,48 @@ static inline void modem_syscon_ll_enable_data_dump_mux_clock(modem_syscon_dev_t
hw->clk_conf.clk_data_dump_mux = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_mux_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_data_dump_mux;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_etm_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_etm_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_etm_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zb_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zb_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_mac_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zb_mac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zb_mac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -59,18 +83,40 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw
hw->clk_conf.clk_modem_sec_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_modem_sec_en &&
hw->clk_conf.clk_modem_sec_ecb_en &&
hw->clk_conf.clk_modem_sec_ccm_en &&
hw->clk_conf.clk_modem_sec_bah_en &&
hw->clk_conf.clk_modem_sec_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ble_timer_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_ble_timer_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ble_timer_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_ble_timer_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_data_dump_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_data_dump_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_data_dump_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_force_clock(modem_syscon_dev_t *hw)
{
@@ -310,6 +356,13 @@ static inline void modem_syscon_ll_clk_wifibb_configure(modem_syscon_dev_t *hw,
modem_syscon_ll_clk_conf1_configure(hw, en, 0x1ff);
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifibb_clock_is_enabled(modem_syscon_dev_t *hw)
{
// Check if any of the wifibb clocks are enabled
return (hw->clk_conf1.val & 0x1ff) == 0x1ff;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_wifibb_22m_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -328,6 +381,12 @@ static inline void modem_syscon_ll_enable_wifibb_44m_clock(modem_syscon_dev_t *h
hw->clk_conf1.clk_wifibb_44m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifibb_44m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_wifibb_44m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_wifibb_80m_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -376,12 +435,24 @@ static inline void modem_syscon_ll_enable_wifi_mac_clock(modem_syscon_dev_t *hw,
hw->clk_conf1.clk_wifimac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifi_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_wifimac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_wifi_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_wifi_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifi_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_wifi_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_20m_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -400,41 +471,83 @@ static inline void modem_syscon_ll_enable_fe_80m_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_fe_80m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_80m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_80m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_160m_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_160m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_160m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_160m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_cal_160m_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_cal_160m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_cal_160m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_cal_160m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_bt_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_bt_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_mac_clock(modem_syscon_dev_t *hw, bool en)
{
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return true;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_bt_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_bt_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_480m_clock(modem_syscon_dev_t *hw, bool en)
{
+12
View File
@@ -103,6 +103,12 @@ void IRAM_ATTR modem_clock_hal_enable_modem_common_fe_clock(modem_clock_hal_cont
}
}
bool IRAM_ATTR modem_clock_hal_modem_common_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_syscon_ll_fe_apb_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_80m_clock_is_enabled(hal->syscon_dev);
}
void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_context_t *hal, bool enable)
{
if (enable) {
@@ -111,6 +117,12 @@ void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_con
}
}
bool IRAM_ATTR modem_clock_hal_modem_private_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_syscon_ll_fe_cal_160m_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_160m_clock_is_enabled(hal->syscon_dev);
}
void modem_clock_hal_set_ble_rtc_timer_divisor_value(modem_clock_hal_context_t *hal, uint32_t divider)
{
modem_lpcon_ll_set_ble_rtc_timer_divisor_value(hal->lpcon_dev, divider);
@@ -25,6 +25,12 @@ static inline void modem_lpcon_ll_enable_test_clk(modem_lpcon_dev_t *hw, bool en
hw->test_conf.clk_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_test_clk_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->test_conf.clk_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_ble_rtc_timer_slow_osc(modem_lpcon_dev_t *hw, bool en)
{
@@ -163,6 +169,12 @@ static inline void modem_lpcon_ll_enable_coex_clock(modem_lpcon_dev_t *hw, bool
hw->clk_conf.clk_coex_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_coex_clock_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->clk_conf.clk_coex_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_ble_rtc_timer_clock(modem_lpcon_dev_t *hw, bool en)
{
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include "soc/soc.h"
#include "soc/soc_caps.h"
#include "hal/assert.h"
#include "modem/modem_syscon_struct.h"
#include "hal/modem_clock_types.h"
@@ -25,12 +26,24 @@ static inline void modem_syscon_ll_enable_test_clk(modem_syscon_dev_t *hw, bool
hw->test_conf.clk_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_test_clk_is_enabled(modem_syscon_dev_t *hw)
{
return hw->test_conf.clk_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_pwdet_sar_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.pwdet_sar_clock_ena = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_pwdet_sar_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.pwdet_sar_clock_ena;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_set_pwdet_clk_div_num(modem_syscon_dev_t *hw, uint32_t div)
{
@@ -61,24 +74,48 @@ static inline void modem_syscon_ll_enable_data_dump_mux_clock(modem_syscon_dev_t
hw->clk_conf.clk_data_dump_mux = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_mux_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_data_dump_mux;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_etm_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_etm_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_etm_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zb_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zb_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_mac_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zbmac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zbmac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -89,18 +126,40 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw
hw->clk_conf.clk_modem_sec_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_modem_sec_en &&
hw->clk_conf.clk_modem_sec_ecb_en &&
hw->clk_conf.clk_modem_sec_ccm_en &&
hw->clk_conf.clk_modem_sec_bah_en &&
hw->clk_conf.clk_modem_sec_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ble_timer_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_ble_timer_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ble_timer_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_ble_timer_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_data_dump_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_data_dump_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_data_dump_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_force_clock(modem_syscon_dev_t *hw)
{
@@ -352,6 +411,16 @@ static inline void modem_syscon_ll_clk_wifibb_configure(modem_syscon_dev_t *hw,
#endif
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifibb_clock_is_enabled(modem_syscon_dev_t *hw)
{
#if SOC_PHY_CALIBRATION_CLOCK_IS_INDEPENDENT
return (hw->clk_conf1.val & 0x1fb) == 0x1fb;
#else
return (hw->clk_conf1.val & 0x1ff) == 0x1ff;
#endif
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_wifibb_22m_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -370,6 +439,12 @@ static inline void modem_syscon_ll_enable_wifibb_44m_clock(modem_syscon_dev_t *h
hw->clk_conf1.clk_wifibb_44m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifibb_44m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_wifibb_44m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_wifibb_80m_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -419,12 +494,24 @@ static inline void modem_syscon_ll_enable_wifi_mac_clock(modem_syscon_dev_t *hw,
hw->clk_conf1.clk_wifimac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifi_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_wifimac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_wifi_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_wifi_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_wifi_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_wifi_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_20m_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -443,18 +530,36 @@ static inline void modem_syscon_ll_enable_fe_80m_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_fe_80m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_80m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_80m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_160m_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_160m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_160m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_160m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_apb_en;
}
// The modem_syscon of esp32c5 adds the enablement of the adc clock on the analog front end compared to esp32h2 and esp32c6.
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_adc_clock(modem_syscon_dev_t *hw, bool en)
@@ -462,6 +567,12 @@ static inline void modem_syscon_ll_enable_fe_adc_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_fe_adc_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_adc_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_adc_en;
}
// The modem_syscon of esp32c5 adds the enablement of the dac clock on the analog front end compared to esp32h2 and esp32c6.
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_dac_clock(modem_syscon_dev_t *hw, bool en)
@@ -469,6 +580,12 @@ static inline void modem_syscon_ll_enable_fe_dac_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_fe_dac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_dac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_dac_en;
}
// The modem_syscon of esp32c5 adds the enablement of the analog power detect clock on the analog front end compared to esp32h2 and esp32c6.
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_pwdet_clock(modem_syscon_dev_t *hw, bool en)
@@ -476,24 +593,48 @@ static inline void modem_syscon_ll_enable_fe_pwdet_clock(modem_syscon_dev_t *hw,
hw->clk_conf1.clk_fe_pwdet_adc_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_pwdet_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_pwdet_adc_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_bt_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_bt_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_mac_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_btmac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_btmac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_btbb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_btbb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_480m_clock(modem_syscon_dev_t *hw, bool en)
{
+14
View File
@@ -103,6 +103,12 @@ void IRAM_ATTR modem_clock_hal_enable_modem_common_fe_clock(modem_clock_hal_cont
}
}
bool IRAM_ATTR modem_clock_hal_modem_common_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_syscon_ll_fe_apb_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_80m_clock_is_enabled(hal->syscon_dev);
}
void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_context_t *hal, bool enable)
{
if (enable) {
@@ -113,6 +119,14 @@ void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_con
}
}
bool IRAM_ATTR modem_clock_hal_modem_private_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_syscon_ll_fe_160m_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_adc_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_dac_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_pwdet_clock_is_enabled(hal->syscon_dev);
}
void modem_clock_hal_set_ble_rtc_timer_divisor_value(modem_clock_hal_context_t *hal, uint32_t divider)
{
modem_lpcon_ll_set_ble_rtc_timer_divisor_value(hal->lpcon_dev, divider);
@@ -25,6 +25,12 @@ static inline void modem_lpcon_ll_enable_test_clk(modem_lpcon_dev_t *hw, bool en
hw->test_conf.clk_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_test_clk_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->test_conf.clk_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_coex_lpclk_slow_osc(modem_lpcon_dev_t *hw, bool en)
{
@@ -67,12 +73,24 @@ static inline void modem_lpcon_ll_enable_coex_clock(modem_lpcon_dev_t *hw, bool
hw->clk_conf.clk_coex_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_coex_clock_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->clk_conf.clk_coex_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_fe_mem_clock(modem_lpcon_dev_t *hw, bool en)
{
hw->clk_conf.clk_fe_mem_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_fe_mem_clock_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->clk_conf.clk_fe_mem_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_coex_force_clock(modem_lpcon_dev_t *hw, bool en)
{
@@ -25,6 +25,12 @@ static inline void modem_syscon_ll_enable_test_clk(modem_syscon_dev_t *hw, bool
hw->test_conf.clk_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_test_clk_is_enabled(modem_syscon_dev_t *hw)
{
return hw->test_conf.clk_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_data_dump_mux_clock(modem_syscon_dev_t *hw, bool en)
@@ -32,24 +38,48 @@ static inline void modem_syscon_ll_enable_data_dump_mux_clock(modem_syscon_dev_t
// ESP32H2 Not Support
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_mux_clock_is_enabled(modem_syscon_dev_t *hw)
{
return true;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_etm_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_etm_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_etm_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zb_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zb_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_mac_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zb_mac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zb_mac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -60,6 +90,16 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw
hw->clk_conf.clk_modem_sec_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_modem_sec_en &&
hw->clk_conf.clk_modem_sec_ecb_en &&
hw->clk_conf.clk_modem_sec_ccm_en &&
hw->clk_conf.clk_modem_sec_bah_en &&
hw->clk_conf.clk_modem_sec_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ble_timer_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -67,12 +107,25 @@ static inline void modem_syscon_ll_enable_ble_timer_clock(modem_syscon_dev_t *hw
hw->clk_conf.clk_ble_timer_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ble_timer_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_ble_timer_apb_en &&
hw->clk_conf.clk_ble_timer_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_data_dump_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_data_dump_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_data_dump_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_force_clock(modem_syscon_dev_t *hw)
{
@@ -209,12 +262,23 @@ static inline void modem_syscon_ll_enable_fe_16m_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_fe_16m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_16m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_16m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_32m_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_32m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_32m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_32m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_sdm_clock(modem_syscon_dev_t *hw, bool en)
@@ -222,27 +286,58 @@ static inline void modem_syscon_ll_enable_fe_sdm_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_fe_sdm_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_sdm_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_sdm_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_adc_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_adc_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_adc_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_adc_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_bt_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_bt_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_mac_clock(modem_syscon_dev_t *hw, bool en)
{
// ESP32H2 Not Support
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return true;
}
__attribute__((always_inline))
@@ -251,6 +346,12 @@ static inline void modem_syscon_ll_enable_bt_clock(modem_syscon_dev_t *hw, bool
hw->clk_conf1.clk_bt_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_bt_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_force_clock(modem_syscon_dev_t *hw, bool en)
{
+14
View File
@@ -19,6 +19,12 @@ void IRAM_ATTR modem_clock_hal_enable_modem_common_fe_clock(modem_clock_hal_cont
modem_syscon_ll_enable_fe_32m_clock(hal->syscon_dev, enable);
}
bool IRAM_ATTR modem_clock_hal_modem_common_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_syscon_ll_fe_apb_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_32m_clock_is_enabled(hal->syscon_dev);
}
void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_context_t *hal, bool enable)
{
modem_lpcon_ll_enable_fe_mem_clock(hal->lpcon_dev, enable);
@@ -27,6 +33,14 @@ void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_con
modem_syscon_ll_enable_fe_16m_clock(hal->syscon_dev, enable);
}
bool IRAM_ATTR modem_clock_hal_modem_private_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_lpcon_ll_fe_mem_clock_is_enabled(hal->lpcon_dev) &&
modem_syscon_ll_fe_sdm_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_adc_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_16m_clock_is_enabled(hal->syscon_dev);
}
void modem_clock_hal_set_ble_rtc_timer_divisor_value(modem_clock_hal_context_t *hal, uint32_t divider)
{
lp_clkrst_ll_set_ble_rtc_timer_divisor_value(&LP_CLKRST, divider);
@@ -25,6 +25,12 @@ static inline void modem_lpcon_ll_enable_test_clk(modem_lpcon_dev_t *hw, bool en
hw->test_conf.clk_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_test_clk_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->test_conf.clk_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_coex_lpclk_slow_osc(modem_lpcon_dev_t *hw, bool en)
{
@@ -67,12 +73,24 @@ static inline void modem_lpcon_ll_enable_coex_clock(modem_lpcon_dev_t *hw, bool
hw->clk_conf.clk_coex_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_coex_clock_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->clk_conf.clk_coex_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_fe_mem_clock(modem_lpcon_dev_t *hw, bool en)
{
hw->clk_conf.clk_fe_mem_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_fe_mem_clock_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->clk_conf.clk_fe_mem_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_coex_force_clock(modem_lpcon_dev_t *hw, bool en)
{
@@ -25,6 +25,12 @@ static inline void modem_syscon_ll_enable_test_clk(modem_syscon_dev_t *hw, bool
hw->test_conf.clk_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_test_clk_is_enabled(modem_syscon_dev_t *hw)
{
return hw->test_conf.clk_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_data_dump_mux_clock(modem_syscon_dev_t *hw, bool en)
@@ -32,24 +38,49 @@ static inline void modem_syscon_ll_enable_data_dump_mux_clock(modem_syscon_dev_t
// ESP32-H21 Not Support
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_mux_clock_is_enabled(modem_syscon_dev_t *hw)
{
// ESP32-H21 Not Support
return true;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_etm_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_etm_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_etm_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zb_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zb_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_mac_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zb_mac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zb_mac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -60,6 +91,16 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw
hw->clk_conf.clk_modem_sec_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_modem_sec_en &&
hw->clk_conf.clk_modem_sec_ecb_en &&
hw->clk_conf.clk_modem_sec_ccm_en &&
hw->clk_conf.clk_modem_sec_bah_en &&
hw->clk_conf.clk_modem_sec_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ble_timer_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -67,12 +108,25 @@ static inline void modem_syscon_ll_enable_ble_timer_clock(modem_syscon_dev_t *hw
hw->clk_conf.clk_ble_timer_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ble_timer_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_ble_timer_apb_en &&
hw->clk_conf.clk_ble_timer_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_data_dump_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_data_dump_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_data_dump_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_force_clock(modem_syscon_dev_t *hw)
{
@@ -210,18 +264,35 @@ static inline void modem_syscon_ll_enable_fe_txlogain_clock(modem_syscon_dev_t *
hw->clk_conf1.clk_fe_txlogain_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_txlogain_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_txlogain_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_16m_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_16m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_16m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_16m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_32m_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_32m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_32m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_32m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_sdm_clock(modem_syscon_dev_t *hw, bool en)
@@ -229,35 +300,71 @@ static inline void modem_syscon_ll_enable_fe_sdm_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_fe_sdm_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_sdm_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_sdm_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_adc_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_adc_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_adc_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_adc_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_bt_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_bt_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_mac_clock(modem_syscon_dev_t *hw, bool en)
{
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return true;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_bt_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_bt_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_force_clock(modem_syscon_dev_t *hw, bool en)
{
+15
View File
@@ -19,6 +19,12 @@ void IRAM_ATTR modem_clock_hal_enable_modem_common_fe_clock(modem_clock_hal_cont
modem_syscon_ll_enable_fe_32m_clock(hal->syscon_dev, enable);
}
bool IRAM_ATTR modem_clock_hal_modem_common_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_syscon_ll_fe_apb_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_32m_clock_is_enabled(hal->syscon_dev);
}
void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_context_t *hal, bool enable)
{
modem_lpcon_ll_enable_fe_mem_clock(hal->lpcon_dev, enable);
@@ -28,6 +34,15 @@ void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_con
modem_syscon_ll_enable_fe_16m_clock(hal->syscon_dev, enable);
}
bool IRAM_ATTR modem_clock_hal_modem_private_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_lpcon_ll_fe_mem_clock_is_enabled(hal->lpcon_dev) &&
modem_syscon_ll_fe_sdm_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_adc_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_txlogain_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_16m_clock_is_enabled(hal->syscon_dev);
}
void modem_clock_hal_set_ble_rtc_timer_divisor_value(modem_clock_hal_context_t *hal, uint32_t divider)
{
lp_clkrst_ll_set_ble_rtc_timer_divisor_value(&LP_CLKRST, divider);
@@ -25,6 +25,12 @@ static inline void modem_lpcon_ll_enable_test_clk(modem_lpcon_dev_t *hw, bool en
hw->test_conf.clk_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_test_clk_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->test_conf.clk_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_coex_lpclk_slow_osc(modem_lpcon_dev_t *hw, bool en)
{
@@ -67,11 +73,23 @@ static inline void modem_lpcon_ll_enable_coex_clock(modem_lpcon_dev_t *hw, bool
hw->clk_conf.clk_coex_en = en;
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_coex_clock_is_enabled(modem_lpcon_dev_t *hw)
{
return hw->clk_conf.clk_coex_en;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_fe_mem_clock(modem_lpcon_dev_t *hw, bool en)
{
}
__attribute__((always_inline))
static inline bool modem_lpcon_ll_fe_mem_clock_is_enabled(modem_lpcon_dev_t *hw)
{
return true;
}
__attribute__((always_inline))
static inline void modem_lpcon_ll_enable_coex_force_clock(modem_lpcon_dev_t *hw, bool en)
{
@@ -25,12 +25,24 @@ static inline void modem_syscon_ll_enable_test_clk(modem_syscon_dev_t *hw, bool
hw->test_conf.clk_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_test_clk_is_enabled(modem_syscon_dev_t *hw)
{
return hw->test_conf.clk_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_pwdet_sar_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.pwdet_sar_clock_ena = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_pwdet_sar_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.pwdet_sar_clock_ena;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_set_pwdet_clk_div_num(modem_syscon_dev_t *hw, uint32_t div)
{
@@ -61,24 +73,48 @@ static inline void modem_syscon_ll_enable_data_dump_mux_clock(modem_syscon_dev_t
hw->clk_conf.clk_data_dump_mux = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_mux_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_data_dump_mux;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_etm_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_etm_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_etm_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zb_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zb_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ieee802154_mac_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_zbmac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ieee802154_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_zbmac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -89,18 +125,40 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw
hw->clk_conf.clk_modem_sec_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_modem_sec_en &&
hw->clk_conf.clk_modem_sec_ecb_en &&
hw->clk_conf.clk_modem_sec_ccm_en &&
hw->clk_conf.clk_modem_sec_bah_en &&
hw->clk_conf.clk_modem_sec_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_ble_timer_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_ble_timer_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_ble_timer_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_ble_timer_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_data_dump_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf.clk_data_dump_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_data_dump_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf.clk_data_dump_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_etm_force_clock(modem_syscon_dev_t *hw)
{
@@ -310,18 +368,36 @@ static inline void modem_syscon_ll_enable_fe_txlogain_clock(modem_syscon_dev_t *
hw->clk_conf1.clk_fe_txlogain_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_txlogain_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_txlogain_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_16m_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_16m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_16m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_16m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_32m_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_32m_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_32m_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_32m_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_sdm_clock(modem_syscon_dev_t *hw, bool en)
@@ -329,24 +405,48 @@ static inline void modem_syscon_ll_enable_fe_sdm_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_fe_sdm_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_sdm_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_sdm_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_adc_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_adc_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_adc_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_adc_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_fe_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_fe_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_fe_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_fe_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_apb_clock(modem_syscon_dev_t *hw, bool en)
{
hw->clk_conf1.clk_bt_apb_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_apb_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_bt_apb_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_bb_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -359,6 +459,12 @@ static inline void modem_syscon_ll_enable_bt_mac_clock(modem_syscon_dev_t *hw, b
hw->clk_conf1.clk_btmac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_mac_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_btmac_en;
}
__attribute__((always_inline))
static inline void modem_syscon_ll_enable_bt_clock(modem_syscon_dev_t *hw, bool en)
{
@@ -367,6 +473,14 @@ static inline void modem_syscon_ll_enable_bt_clock(modem_syscon_dev_t *hw, bool
hw->clk_conf1.clk_btmac_en = en;
}
__attribute__((always_inline))
static inline bool modem_syscon_ll_bt_clock_is_enabled(modem_syscon_dev_t *hw)
{
return hw->clk_conf1.clk_bt_apb_en &&
hw->clk_conf1.clk_btbb_en &&
hw->clk_conf1.clk_btmac_en;
}
__attribute__((always_inline))
static inline uint32_t modem_syscon_ll_get_date(modem_syscon_dev_t *hw)
{
+14
View File
@@ -95,6 +95,12 @@ void IRAM_ATTR modem_clock_hal_enable_modem_common_fe_clock(modem_clock_hal_cont
modem_syscon_ll_enable_fe_32m_clock(hal->syscon_dev, enable);
}
bool IRAM_ATTR modem_clock_hal_modem_common_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_syscon_ll_fe_apb_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_32m_clock_is_enabled(hal->syscon_dev);
}
void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_context_t *hal, bool enable)
{
modem_lpcon_ll_enable_fe_mem_clock(hal->lpcon_dev, enable);
@@ -103,6 +109,14 @@ void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_con
modem_syscon_ll_enable_fe_16m_clock(hal->syscon_dev, enable);
}
bool IRAM_ATTR modem_clock_hal_modem_private_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
{
return modem_lpcon_ll_fe_mem_clock_is_enabled(hal->lpcon_dev) &&
modem_syscon_ll_fe_sdm_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_adc_clock_is_enabled(hal->syscon_dev) &&
modem_syscon_ll_fe_16m_clock_is_enabled(hal->syscon_dev);
}
void modem_clock_hal_set_ble_rtc_timer_divisor_value(modem_clock_hal_context_t *hal, uint32_t divider)
{
lp_clkrst_ll_set_ble_rtc_timer_divisor_value(&LP_CLKRST, divider);
@@ -30,7 +30,9 @@ uint32_t modem_clock_hal_get_clock_domain_icg_bitmap(modem_clock_hal_context_t *
#endif
void modem_clock_hal_enable_modem_common_fe_clock(modem_clock_hal_context_t *hal, bool enable);
bool modem_clock_hal_modem_common_fe_clock_is_enabled(modem_clock_hal_context_t *hal);
void modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_context_t *hal, bool enable);
bool modem_clock_hal_modem_private_fe_clock_is_enabled(modem_clock_hal_context_t *hal);
#if SOC_BT_SUPPORTED
void modem_clock_hal_set_ble_rtc_timer_divisor_value(modem_clock_hal_context_t *hal, uint32_t divider);
@@ -12,6 +12,8 @@ CONFIG_PM_DFS_INIT_AUTO=y
CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
# end of Power Management
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
#
# Sleep Config
#
@@ -13,6 +13,7 @@ CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
# end of Power Management
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
#
# Sleep Config
@@ -13,6 +13,7 @@ CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
# end of Power Management
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
#
# Sleep Config
@@ -13,6 +13,7 @@ CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
# end of Power Management
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
#
# Sleep Config
@@ -14,6 +14,7 @@ CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y
# end of Power Management
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
#
# Sleep Config
@@ -14,6 +14,7 @@ CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y
# end of Power Management
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
#
# Sleep Config
@@ -14,6 +14,7 @@ CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y
# end of Power Management
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
#
# Sleep Config
@@ -13,6 +13,8 @@ CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y
# end of Power Management
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
#
# Sleep Config
#
@@ -52,6 +52,7 @@ CONFIG_IEEE802154_SLEEP_ENABLE=y
# Use 1000Hz freertos tick to lower sleep time threshold
CONFIG_FREERTOS_HZ=1000
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
# end of light sleep
#
@@ -25,5 +25,6 @@ CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=10
CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y
CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y
CONFIG_ESP_PHY_MAC_BB_PD=y
#CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP=y
@@ -1,3 +1,4 @@
CONFIG_EXAMPLE_GET_AP_INFO_FROM_STDIN=y
CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y
CONFIG_ESP_PHY_MAC_BB_PD=y
CONFIG_ESP_MODEM_CLOCK_ENABLE_CHECKING=y