mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
feat(esp_hw_support): support modem clock for esp32c5mp
This commit is contained in:
@@ -12,11 +12,311 @@
|
||||
#include <stdbool.h>
|
||||
#include "soc/soc.h"
|
||||
#include "hal/assert.h"
|
||||
#include "modem/modem_lpcon_struct.h"
|
||||
#include "hal/modem_clock_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
__attribute__((always_inline))
|
||||
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 void modem_lpcon_ll_enable_ble_rtc_timer_slow_osc(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->lp_timer_conf.clk_lp_timer_sel_osc_slow = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_ble_rtc_timer_fast_osc(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->lp_timer_conf.clk_lp_timer_sel_osc_fast = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_ble_rtc_timer_main_xtal(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->lp_timer_conf.clk_lp_timer_sel_xtal = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_ble_rtc_timer_32k_xtal(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->lp_timer_conf.clk_lp_timer_sel_xtal32k = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_set_ble_rtc_timer_divisor_value(modem_lpcon_dev_t *hw, uint32_t value)
|
||||
{
|
||||
hw->lp_timer_conf.clk_lp_timer_div_num = value;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_lpcon_ll_get_ble_rtc_timer_divisor_value(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
return hw->lp_timer_conf.clk_lp_timer_div_num;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_coex_lpclk_slow_osc(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->coex_lp_clk_conf.clk_coex_lp_sel_osc_slow = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_coex_lpclk_fast_osc(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->coex_lp_clk_conf.clk_coex_lp_sel_osc_fast = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_coex_lpclk_main_xtal(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->coex_lp_clk_conf.clk_coex_lp_sel_xtal = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_coex_lpclk_32k_xtal(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->coex_lp_clk_conf.clk_coex_lp_sel_xtal32k = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_set_coex_lpclk_divisor_value(modem_lpcon_dev_t *hw, uint32_t value)
|
||||
{
|
||||
hw->coex_lp_clk_conf.clk_coex_lp_div_num = value;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_lpcon_ll_get_coex_lpclk_divisor_value(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
return hw->coex_lp_clk_conf.clk_coex_lp_div_num;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_wifi_lpclk_slow_osc(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->wifi_lp_clk_conf.clk_wifipwr_lp_sel_osc_slow = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_wifi_lpclk_fast_osc(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->wifi_lp_clk_conf.clk_wifipwr_lp_sel_osc_fast = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_wifi_lpclk_main_xtal(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->wifi_lp_clk_conf.clk_wifipwr_lp_sel_xtal = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_wifi_lpclk_32k_xtal(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->wifi_lp_clk_conf.clk_wifipwr_lp_sel_xtal32k = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_set_wifi_lpclk_divisor_value(modem_lpcon_dev_t *hw, uint32_t value)
|
||||
{
|
||||
hw->wifi_lp_clk_conf.clk_wifipwr_lp_div_num = value;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_lpcon_ll_get_wifi_lpclk_divisor_value(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
return hw->wifi_lp_clk_conf.clk_wifipwr_lp_div_num;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_i2c_master_160m_clock(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
// ESP32C5 Not Support
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_set_modem_pwr_clk_src_fo(modem_lpcon_dev_t *hw, bool value)
|
||||
{
|
||||
hw->modem_src_clk_conf.modem_pwr_clk_src_fo = value;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_set_clk_modem_aon_force(modem_lpcon_dev_t *hw, uint32_t value)
|
||||
{
|
||||
hw->modem_src_clk_conf.clk_modem_aon_force = value;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_select_modem_32k_clock_source(modem_lpcon_dev_t *hw, uint32_t src)
|
||||
{
|
||||
hw->modem_32k_clk_conf.clk_modem_32k_sel = src;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_wifipwr_clock(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_wifipwr_en = 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 void modem_lpcon_ll_enable_i2c_master_clock(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_i2c_mst_en = 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 void modem_lpcon_ll_enable_wifipwr_force_clock(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_wifipwr_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_coex_force_clock(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_coex_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_i2c_master_force_clock(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_i2c_mst_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_ble_rtc_timer_force_clock(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_lp_timer_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_lpcon_ll_get_wifipwr_icg_bitmap(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf_power_st.clk_wifipwr_st_map;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_set_wifipwr_icg_bitmap(modem_lpcon_dev_t *hw, uint32_t bitmap)
|
||||
{
|
||||
hw->clk_conf_power_st.clk_wifipwr_st_map = bitmap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_lpcon_ll_get_coex_icg_bitmap(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf_power_st.clk_coex_st_map;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_set_coex_icg_bitmap(modem_lpcon_dev_t *hw, uint32_t bitmap)
|
||||
{
|
||||
hw->clk_conf_power_st.clk_coex_st_map = bitmap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_lpcon_ll_get_i2c_master_icg_bitmap(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf_power_st.clk_i2c_mst_st_map;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_set_i2c_master_icg_bitmap(modem_lpcon_dev_t *hw, uint32_t bitmap)
|
||||
{
|
||||
hw->clk_conf_power_st.clk_i2c_mst_st_map = bitmap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_lpcon_ll_get_lp_apb_icg_bitmap(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf_power_st.clk_lp_apb_st_map;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_set_lp_apb_icg_bitmap(modem_lpcon_dev_t *hw, uint32_t bitmap)
|
||||
{
|
||||
hw->clk_conf_power_st.clk_lp_apb_st_map = bitmap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_reset_wifipwr(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
hw->rst_conf.rst_wifipwr = 1;
|
||||
hw->rst_conf.rst_wifipwr = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_reset_coex(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
hw->rst_conf.rst_coex = 1;
|
||||
hw->rst_conf.rst_coex = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_reset_i2c_master(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
hw->rst_conf.rst_i2c_mst = 1;
|
||||
hw->rst_conf.rst_i2c_mst = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_reset_ble_rtc_timer(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
hw->rst_conf.rst_lp_timer = 1;
|
||||
hw->rst_conf.rst_lp_timer = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_reset_all(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
hw->rst_conf.val = 0xf;
|
||||
hw->rst_conf.val = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_set_pwr_tick_target(modem_lpcon_dev_t *hw, uint32_t val)
|
||||
{
|
||||
hw->tick_conf.modem_pwr_tick_target = val;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_lpcon_ll_get_date(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
return hw->date.val;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_chan_freq_mem(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->apb_mem_sel.chan_freq_mem_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_pbus_mem(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->apb_mem_sel.pbus_mem_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_agc_mem(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->apb_mem_sel.agc_mem_en = en;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -12,11 +12,675 @@
|
||||
#include <stdbool.h>
|
||||
#include "soc/soc.h"
|
||||
#include "hal/assert.h"
|
||||
#include "modem/modem_syscon_struct.h"
|
||||
#include "hal/modem_clock_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_test_clk(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->test_conf.clk_en = 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 void modem_syscon_ll_set_pwdet_clk_div_num(modem_syscon_dev_t *hw, uint32_t div)
|
||||
{
|
||||
hw->clk_conf.pwdet_clk_div_num = div;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_clk_tx_dac_inv(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_tx_dac_inv_ena = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_clk_rx_dac_inv(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_rx_adc_inv_ena = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_clk_pwdet_adc_inv(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_pwdet_adc_inv_ena = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_clk_i2c_mst_sel_160m(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_i2c_mst_sel_160m = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_data_dump_mux_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_data_dump_mux = en;
|
||||
}
|
||||
|
||||
__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 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 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 void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_modem_sec_en = en;
|
||||
hw->clk_conf.clk_modem_sec_ecb_en = en;
|
||||
hw->clk_conf.clk_modem_sec_ccm_en = en;
|
||||
hw->clk_conf.clk_modem_sec_bah_en = en;
|
||||
hw->clk_conf.clk_modem_sec_apb_en = 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 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 void modem_syscon_ll_enable_etm_force_clock(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_etm_fo = 1;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_ieee802154_apb_clock_force(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_zbmac_apb_fo = 1;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_ieee802154_mac_clock_force(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_zbmac_fo = 1;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_modem_sec_force_clock(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_modem_sec_fo = 1;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_ble_timer_force_clock(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_ble_timer_fo = 1;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_data_dump_force_clock(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_data_dump_fo = 1;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_syscon_ll_get_ieee802154_icg_bitmap(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf_power_st.clk_zb_st_map;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_set_ieee802154_icg_bitmap(modem_syscon_dev_t *hw, uint32_t bitmap)
|
||||
{
|
||||
hw->clk_conf_power_st.clk_zb_st_map = bitmap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_syscon_ll_get_fe_icg_bitmap(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf_power_st.clk_fe_st_map;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_set_fe_icg_bitmap(modem_syscon_dev_t *hw, uint32_t bitmap)
|
||||
{
|
||||
hw->clk_conf_power_st.clk_fe_st_map = bitmap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_syscon_ll_get_bt_icg_bitmap(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf_power_st.clk_bt_st_map;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_set_bt_icg_bitmap(modem_syscon_dev_t *hw, uint32_t bitmap)
|
||||
{
|
||||
hw->clk_conf_power_st.clk_bt_st_map = bitmap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_syscon_ll_get_wifi_icg_bitmap(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf_power_st.clk_wifi_st_map;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_set_wifi_icg_bitmap(modem_syscon_dev_t *hw, uint32_t bitmap)
|
||||
{
|
||||
hw->clk_conf_power_st.clk_wifi_st_map = bitmap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_syscon_ll_get_modem_periph_icg_bitmap(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf_power_st.clk_modem_peri_st_map;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_set_modem_periph_icg_bitmap(modem_syscon_dev_t *hw, uint32_t bitmap)
|
||||
{
|
||||
hw->clk_conf_power_st.clk_modem_peri_st_map = bitmap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_syscon_ll_get_modem_apb_icg_bitmap(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf_power_st.clk_modem_apb_st_map;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_set_modem_apb_icg_bitmap(modem_syscon_dev_t *hw, uint32_t bitmap)
|
||||
{
|
||||
hw->clk_conf_power_st.clk_modem_apb_st_map = bitmap;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_wifibb(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_wifibb = 1;
|
||||
hw->modem_rst_conf.rst_wifibb = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_wifimac(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_wifimac = 1;
|
||||
hw->modem_rst_conf.rst_wifimac = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_fe(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_fe = 1;
|
||||
hw->modem_rst_conf.rst_fe = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_btmac_apb(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_btmac_apb = 1;
|
||||
hw->modem_rst_conf.rst_btmac_apb = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_btmac(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_btmac = 1;
|
||||
hw->modem_rst_conf.rst_btmac = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_btbb_apb(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_btbb_apb = 1;
|
||||
hw->modem_rst_conf.rst_btbb_apb = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_btbb(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_btbb = 1;
|
||||
hw->modem_rst_conf.rst_btbb = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_etm(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_etm = 1;
|
||||
hw->modem_rst_conf.rst_etm = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_zbmac_apb(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_zbmac_apb = 1;
|
||||
hw->modem_rst_conf.rst_zbmac_apb = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_zbmac(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_zbmac = 1;
|
||||
hw->modem_rst_conf.rst_zbmac = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_modem_sec(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_modem_ecb = 1;
|
||||
hw->modem_rst_conf.rst_modem_ccm = 1;
|
||||
hw->modem_rst_conf.rst_modem_bah = 1;
|
||||
hw->modem_rst_conf.rst_modem_sec = 1;
|
||||
hw->modem_rst_conf.rst_modem_ecb = 0;
|
||||
hw->modem_rst_conf.rst_modem_ccm = 0;
|
||||
hw->modem_rst_conf.rst_modem_bah = 0;
|
||||
hw->modem_rst_conf.rst_modem_sec = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_ble_timer(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_ble_timer = 1;
|
||||
hw->modem_rst_conf.rst_ble_timer = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_data_dump(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_data_dump = 1;
|
||||
hw->modem_rst_conf.rst_data_dump = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_all(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.val = 0xffffffff;
|
||||
hw->modem_rst_conf.val = 0;
|
||||
}
|
||||
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_clk_conf1_configure(modem_syscon_dev_t *hw, bool en, uint32_t mask)
|
||||
{
|
||||
if(en){
|
||||
hw->clk_conf1.val = hw->clk_conf1.val | mask;
|
||||
} else {
|
||||
hw->clk_conf1.val = hw->clk_conf1.val & ~mask;
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_clk_wifibb_configure(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
/* Configure
|
||||
clk_wifibb_22m / clk_wifibb_40m / clk_wifibb_44m / clk_wifibb_80m
|
||||
clk_wifibb_40x / clk_wifibb_80x / clk_wifibb_40x1 / clk_wifibb_80x1
|
||||
clk_wifibb_160x1
|
||||
*/
|
||||
modem_syscon_ll_clk_conf1_configure(hw, en, 0x1ff);
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_22m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_wifibb_22m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_40m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_wifibb_40m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_44m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_wifibb_44m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_80m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_wifibb_80m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_40x_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_wifibb_40x_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_80x_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_wifibb_80x_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_40x1_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_wifibb_40x1_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_80x1_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_wifibb_80x1_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_160x1_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_wifibb_160x1_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_480m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1.clk_wifibb_480m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifi_mac_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_wifimac_en = 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 void modem_syscon_ll_enable_fe_20m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_fe_20m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_40m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_fe_40m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_80m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_fe_80m_en = 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 void modem_syscon_ll_enable_fe_apb_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_fe_apb_en = 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)
|
||||
{
|
||||
hw->clk_conf1.clk_fe_adc_en = 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)
|
||||
{
|
||||
hw->clk_conf1.clk_fe_dac_en = 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)
|
||||
{
|
||||
hw->clk_conf1.clk_fe_pwdet_adc_en = 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 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 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 void modem_syscon_ll_enable_fe_480m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1.clk_fe_480m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_anamode_40m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1.clk_fe_anamode_40m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_anamode_80m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1.clk_fe_anamode_80m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_anamode_160m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1.clk_fe_anamode_160m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_22m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_wifibb_22m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_40m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_wifibb_40m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_44m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_wifibb_44m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_80m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_wifibb_80m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_40x_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_wifibb_40x_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_80x_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_wifibb_80x_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_40x1_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_wifibb_40x1_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_80x1_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_wifibb_80x1_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_160x1_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_wifibb_160x1_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifibb_480m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifi_mac_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_wifimac_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_wifi_apb_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf_force_on.clk_wifi_apb_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_20m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_fe_20m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_40m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_fe_40m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_80m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_fe_80m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_160m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_fe_160m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_cal_160m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_fe_cal_160m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_apb_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_fe_apb_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_bt_apb_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_bt_apb_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_bt_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_bt_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_480m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_fe_480m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_anamode_40m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_fe_anamode_40m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_anamode_80m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_fe_anamode_80m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_anamode_160m_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
HAL_ASSERT(0 && "not implemented yet");
|
||||
// hw->clk_conf1_force_on.clk_fe_anamode_160m_fo = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline uint32_t modem_syscon_ll_get_date(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->date.val;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user