mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 12:53:29 +00:00
esp_hw_support: add modem module mac reset api
This commit is contained in:
@@ -18,7 +18,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
static inline uint32_t periph_ll_get_clk_en_mask(periph_module_t periph)
|
||||
{ // TODO: IDF-5713
|
||||
{
|
||||
switch (periph) {
|
||||
case PERIPH_SARADC_MODULE:
|
||||
return PCR_SARADC_CLK_EN;
|
||||
@@ -78,25 +78,13 @@ static inline uint32_t periph_ll_get_clk_en_mask(periph_module_t periph)
|
||||
return PCR_SDIO_SLAVE_CLK_EN;
|
||||
case PERIPH_REGDMA_MODULE:
|
||||
return PCR_REGDMA_CLK_EN;
|
||||
// case PERIPH_RNG_MODULE:
|
||||
// return PCR_WIFI_CLK_RNG_EN;
|
||||
// case PERIPH_WIFI_MODULE:
|
||||
// return PCR_WIFI_CLK_WIFI_EN_M;
|
||||
// case PERIPH_BT_MODULE:
|
||||
// return PCR_WIFI_CLK_BT_EN_M;
|
||||
// case PERIPH_WIFI_BT_COMMON_MODULE:
|
||||
// return PCR_WIFI_CLK_WIFI_BT_COMMON_M;
|
||||
// case PERIPH_BT_BASEBAND_MODULE:
|
||||
// return PCR_BT_BASEBAND_EN;
|
||||
// case PERIPH_BT_LC_MODULE:
|
||||
// return PCR_BT_LC_EN;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static inline uint32_t periph_ll_get_rst_en_mask(periph_module_t periph, bool enable)
|
||||
{ // TODO: IDF-5713
|
||||
{
|
||||
(void)enable; // unused
|
||||
|
||||
switch (periph) {
|
||||
@@ -171,34 +159,14 @@ static inline uint32_t periph_ll_get_rst_en_mask(periph_module_t periph, bool en
|
||||
return PCR_SDIO_SLAVE_RST_EN;
|
||||
case PERIPH_REGDMA_MODULE:
|
||||
return PCR_REGDMA_RST_EN;
|
||||
// case PERIPH_RNG_MODULE:
|
||||
// return PCR_WIFI_CLK_RNG_EN;
|
||||
// case PERIPH_WIFI_MODULE:
|
||||
// return PCR_WIFI_CLK_WIFI_EN_M;
|
||||
// case PERIPH_BT_MODULE:
|
||||
// return PCR_WIFI_CLK_BT_EN_M;
|
||||
// case PERIPH_WIFI_BT_COMMON_MODULE:
|
||||
// return PCR_WIFI_CLK_WIFI_BT_COMMON_M;
|
||||
// case PERIPH_BT_BASEBAND_MODULE:
|
||||
// return PCR_BT_BASEBAND_EN;
|
||||
// case PERIPH_BT_LC_MODULE:
|
||||
// return PCR_BT_LC_EN;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t periph_ll_get_clk_en_reg(periph_module_t periph)
|
||||
{ // TODO: IDF-5713
|
||||
{
|
||||
switch (periph) {
|
||||
// case PERIPH_RNG_MODULE:
|
||||
// case PERIPH_WIFI_MODULE:
|
||||
// case PERIPH_BT_MODULE:
|
||||
// case PERIPH_WIFI_BT_COMMON_MODULE:
|
||||
// case PERIPH_BT_BASEBAND_MODULE:
|
||||
// case PERIPH_BT_LC_MODULE:
|
||||
// return SYSTEM_WIFI_CLK_EN_REG;
|
||||
|
||||
case PERIPH_SARADC_MODULE:
|
||||
return PCR_SARADC_CONF_REG;
|
||||
case PERIPH_RMT_MODULE:
|
||||
@@ -263,7 +231,7 @@ static uint32_t periph_ll_get_clk_en_reg(periph_module_t periph)
|
||||
}
|
||||
|
||||
static uint32_t periph_ll_get_rst_en_reg(periph_module_t periph)
|
||||
{ // TODO: IDF-5713
|
||||
{
|
||||
switch (periph) {
|
||||
case PERIPH_SARADC_MODULE:
|
||||
return PCR_SARADC_CONF_REG;
|
||||
|
@@ -216,6 +216,34 @@ static inline void modem_lpcon_ll_set_lp_apb_icg_bitmap(modem_lpcon_dev_t *hw, u
|
||||
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)
|
||||
{
|
||||
|
@@ -204,31 +204,16 @@ static inline void modem_syscon_ll_reset_zbmac(modem_syscon_dev_t *hw)
|
||||
hw->modem_rst_conf.rst_zbmac = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_modem_ecb(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_modem_ecb = 1;
|
||||
hw->modem_rst_conf.rst_modem_ecb = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_modem_ccm(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_modem_ccm = 1;
|
||||
hw->modem_rst_conf.rst_modem_ccm = 0;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_reset_modem_bah(modem_syscon_dev_t *hw)
|
||||
{
|
||||
hw->modem_rst_conf.rst_modem_bah = 1;
|
||||
hw->modem_rst_conf.rst_modem_bah = 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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user