kopia lustrzana https://github.com/espressif/esp-idf
rtc: add rtc related changes from feature/support_7.2.7_soc
rodzic
2aead8ba57
commit
e83d213c56
|
@ -40,7 +40,7 @@ static const char *TAG = "rtc_clk";
|
||||||
#define DELAY_RTC_CLK_SWITCH 5
|
#define DELAY_RTC_CLK_SWITCH 5
|
||||||
|
|
||||||
// Current PLL frequency, in MHZ (320 or 480). Zero if PLL is not enabled.
|
// Current PLL frequency, in MHZ (320 or 480). Zero if PLL is not enabled.
|
||||||
static uint32_t s_cur_pll_freq = RTC_PLL_FREQ_480M;
|
static uint32_t s_cur_pll_freq;
|
||||||
|
|
||||||
static void rtc_clk_cpu_freq_to_8m(void);
|
static void rtc_clk_cpu_freq_to_8m(void);
|
||||||
|
|
||||||
|
@ -306,7 +306,8 @@ void rtc_clk_bbpll_configure(rtc_xtal_freq_t xtal_freq, int pll_freq)
|
||||||
REGI2C_WRITE_MASK(I2C_BBPLL, I2C_BBPLL_OC_DR3, dr3);
|
REGI2C_WRITE_MASK(I2C_BBPLL, I2C_BBPLL_OC_DR3, dr3);
|
||||||
REGI2C_WRITE(I2C_BBPLL, I2C_BBPLL_OC_DCUR, i2c_bbpll_dcur);
|
REGI2C_WRITE(I2C_BBPLL, I2C_BBPLL_OC_DCUR, i2c_bbpll_dcur);
|
||||||
REGI2C_WRITE_MASK(I2C_BBPLL, I2C_BBPLL_OC_VCO_DBIAS, dbias);
|
REGI2C_WRITE_MASK(I2C_BBPLL, I2C_BBPLL_OC_VCO_DBIAS, dbias);
|
||||||
|
REGI2C_WRITE_MASK(I2C_BBPLL, I2C_BBPLL_OC_DHREF_SEL, 2);
|
||||||
|
REGI2C_WRITE_MASK(I2C_BBPLL, I2C_BBPLL_OC_DLREF_SEL, 1);
|
||||||
s_cur_pll_freq = pll_freq;
|
s_cur_pll_freq = pll_freq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include "regi2c_ulp.h"
|
#include "regi2c_ulp.h"
|
||||||
#include "soc_log.h"
|
#include "soc_log.h"
|
||||||
|
|
||||||
#define RTC_CNTL_MEM_FORCE_PU (RTC_CNTL_SLOWMEM_FORCE_PU | RTC_CNTL_FASTMEM_FORCE_PU)
|
|
||||||
#define RTC_CNTL_MEM_FORCE_NOISO (RTC_CNTL_SLOWMEM_FORCE_NOISO | RTC_CNTL_FASTMEM_FORCE_NOISO)
|
#define RTC_CNTL_MEM_FORCE_NOISO (RTC_CNTL_SLOWMEM_FORCE_NOISO | RTC_CNTL_FASTMEM_FORCE_NOISO)
|
||||||
|
|
||||||
static char *TAG = "rtcinit";
|
static char *TAG = "rtcinit";
|
||||||
|
@ -47,15 +46,22 @@ void rtc_init(rtc_config_t cfg)
|
||||||
rtc_init_config_t rtc_init_cfg = RTC_INIT_CONFIG_DEFAULT();
|
rtc_init_config_t rtc_init_cfg = RTC_INIT_CONFIG_DEFAULT();
|
||||||
REG_SET_FIELD(RTC_CNTL_TIMER3_REG, RTC_CNTL_WIFI_POWERUP_TIMER, rtc_init_cfg.wifi_powerup_cycles);
|
REG_SET_FIELD(RTC_CNTL_TIMER3_REG, RTC_CNTL_WIFI_POWERUP_TIMER, rtc_init_cfg.wifi_powerup_cycles);
|
||||||
REG_SET_FIELD(RTC_CNTL_TIMER3_REG, RTC_CNTL_WIFI_WAIT_TIMER, rtc_init_cfg.wifi_wait_cycles);
|
REG_SET_FIELD(RTC_CNTL_TIMER3_REG, RTC_CNTL_WIFI_WAIT_TIMER, rtc_init_cfg.wifi_wait_cycles);
|
||||||
|
// set bt timer
|
||||||
|
REG_SET_FIELD(RTC_CNTL_TIMER3_REG, RTC_CNTL_BT_POWERUP_TIMER, rtc_init_cfg.bt_powerup_cycles);
|
||||||
|
REG_SET_FIELD(RTC_CNTL_TIMER3_REG, RTC_CNTL_BT_WAIT_TIMER, rtc_init_cfg.bt_wait_cycles);
|
||||||
|
|
||||||
|
REG_SET_FIELD(RTC_CNTL_TIMER4_REG, RTC_CNTL_CPU_TOP_POWERUP_TIMER, rtc_init_cfg.cpu_top_powerup_cycles);
|
||||||
|
REG_SET_FIELD(RTC_CNTL_TIMER4_REG, RTC_CNTL_CPU_TOP_WAIT_TIMER, rtc_init_cfg.cpu_top_wait_cycles);
|
||||||
|
|
||||||
// set rtc peri timer
|
// set rtc peri timer
|
||||||
REG_SET_FIELD(RTC_CNTL_TIMER4_REG, RTC_CNTL_POWERUP_TIMER, rtc_init_cfg.rtc_powerup_cycles);
|
REG_SET_FIELD(RTC_CNTL_TIMER4_REG, RTC_CNTL_POWERUP_TIMER, rtc_init_cfg.rtc_powerup_cycles);
|
||||||
REG_SET_FIELD(RTC_CNTL_TIMER4_REG, RTC_CNTL_WAIT_TIMER, rtc_init_cfg.rtc_wait_cycles);
|
REG_SET_FIELD(RTC_CNTL_TIMER4_REG, RTC_CNTL_WAIT_TIMER, rtc_init_cfg.rtc_wait_cycles);
|
||||||
// set digital wrap timer
|
// set digital wrap timer
|
||||||
REG_SET_FIELD(RTC_CNTL_TIMER4_REG, RTC_CNTL_DG_WRAP_POWERUP_TIMER, rtc_init_cfg.dg_wrap_powerup_cycles);
|
REG_SET_FIELD(RTC_CNTL_TIMER4_REG, RTC_CNTL_DG_WRAP_POWERUP_TIMER, rtc_init_cfg.dg_wrap_powerup_cycles);
|
||||||
REG_SET_FIELD(RTC_CNTL_TIMER4_REG, RTC_CNTL_DG_WRAP_WAIT_TIMER, rtc_init_cfg.dg_wrap_wait_cycles);
|
REG_SET_FIELD(RTC_CNTL_TIMER4_REG, RTC_CNTL_DG_WRAP_WAIT_TIMER, rtc_init_cfg.dg_wrap_wait_cycles);
|
||||||
// set rtc memory timer
|
|
||||||
REG_SET_FIELD(RTC_CNTL_TIMER5_REG, RTC_CNTLMEM_POWERUP_TIMER, rtc_init_cfg.rtc_mem_powerup_cycles);
|
REG_SET_FIELD(RTC_CNTL_TIMER6_REG, RTC_CNTL_DG_PERI_POWERUP_TIMER, rtc_init_cfg.dg_peri_powerup_cycles);
|
||||||
REG_SET_FIELD(RTC_CNTL_TIMER5_REG, RTC_CNTLMEM_WAIT_TIMER, rtc_init_cfg.rtc_mem_wait_cycles);
|
REG_SET_FIELD(RTC_CNTL_TIMER6_REG, RTC_CNTL_DG_PERI_WAIT_TIMER, rtc_init_cfg.dg_peri_wait_cycles);
|
||||||
|
|
||||||
/* Reset RTC bias to default value (needed if waking up from deep sleep) */
|
/* Reset RTC bias to default value (needed if waking up from deep sleep) */
|
||||||
REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_EXT_RTC_DREG_SLEEP, RTC_CNTL_DBIAS_1V10);
|
REGI2C_WRITE_MASK(I2C_DIG_REG, I2C_DIG_REG_EXT_RTC_DREG_SLEEP, RTC_CNTL_DBIAS_1V10);
|
||||||
|
@ -64,10 +70,6 @@ void rtc_init(rtc_config_t cfg)
|
||||||
if (cfg.clkctl_init) {
|
if (cfg.clkctl_init) {
|
||||||
//clear CMMU clock force on
|
//clear CMMU clock force on
|
||||||
CLEAR_PERI_REG_MASK(EXTMEM_CACHE_MMU_POWER_CTRL_REG, EXTMEM_CACHE_MMU_MEM_FORCE_ON);
|
CLEAR_PERI_REG_MASK(EXTMEM_CACHE_MMU_POWER_CTRL_REG, EXTMEM_CACHE_MMU_MEM_FORCE_ON);
|
||||||
//clear rom clock force on
|
|
||||||
REG_SET_FIELD(SYSCON_CLKGATE_FORCE_ON_REG, SYSCON_ROM_CLKGATE_FORCE_ON, 0);
|
|
||||||
//clear sram clock force on
|
|
||||||
REG_SET_FIELD(SYSCON_CLKGATE_FORCE_ON_REG, SYSCON_SRAM_CLKGATE_FORCE_ON, 0);
|
|
||||||
//clear tag clock force on
|
//clear tag clock force on
|
||||||
CLEAR_PERI_REG_MASK(EXTMEM_DCACHE_TAG_POWER_CTRL_REG, EXTMEM_DCACHE_TAG_MEM_FORCE_ON);
|
CLEAR_PERI_REG_MASK(EXTMEM_DCACHE_TAG_POWER_CTRL_REG, EXTMEM_DCACHE_TAG_MEM_FORCE_ON);
|
||||||
CLEAR_PERI_REG_MASK(EXTMEM_ICACHE_TAG_POWER_CTRL_REG, EXTMEM_ICACHE_TAG_MEM_FORCE_ON);
|
CLEAR_PERI_REG_MASK(EXTMEM_ICACHE_TAG_POWER_CTRL_REG, EXTMEM_ICACHE_TAG_MEM_FORCE_ON);
|
||||||
|
@ -89,6 +91,9 @@ void rtc_init(rtc_config_t cfg)
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PU);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PU);
|
||||||
SET_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PD);
|
SET_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PD);
|
||||||
|
|
||||||
|
//open sar_i2c protect function to avoid sar_i2c reset when rtc_ldo is low.
|
||||||
|
CLEAR_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_I2C_RESET_POR_FORCE_PD);
|
||||||
|
|
||||||
//cancel bbpll force pu if setting no force power up
|
//cancel bbpll force pu if setting no force power up
|
||||||
if (!cfg.bbpll_fpu) {
|
if (!cfg.bbpll_fpu) {
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_BBPLL_FORCE_PU);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_BBPLL_FORCE_PU);
|
||||||
|
@ -104,9 +109,7 @@ void rtc_init(rtc_config_t cfg)
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_REG, RTC_CNTL_REGULATOR_FORCE_PU);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_REG, RTC_CNTL_REGULATOR_FORCE_PU);
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_REG, RTC_CNTL_DBOOST_FORCE_PU);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_REG, RTC_CNTL_DBOOST_FORCE_PU);
|
||||||
|
|
||||||
//combine two rtc memory options
|
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_SLOWMEM_FORCE_NOISO | RTC_CNTL_FASTMEM_FORCE_NOISO);
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_MEM_FORCE_PU);
|
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_MEM_FORCE_NOISO);
|
|
||||||
|
|
||||||
if (cfg.rtc_dboost_fpd) {
|
if (cfg.rtc_dboost_fpd) {
|
||||||
SET_PERI_REG_MASK(RTC_CNTL_REG, RTC_CNTL_DBOOST_FORCE_PD);
|
SET_PERI_REG_MASK(RTC_CNTL_REG, RTC_CNTL_DBOOST_FORCE_PD);
|
||||||
|
@ -114,11 +117,6 @@ void rtc_init(rtc_config_t cfg)
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_REG, RTC_CNTL_DBOOST_FORCE_PD);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_REG, RTC_CNTL_DBOOST_FORCE_PD);
|
||||||
}
|
}
|
||||||
|
|
||||||
//cancel digital pu force
|
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_MEM_FORCE_PU);
|
|
||||||
|
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_I2C_RESET_POR_FORCE_PD);
|
|
||||||
|
|
||||||
/* If this mask is enabled, all soc memories cannot enter power down mode */
|
/* If this mask is enabled, all soc memories cannot enter power down mode */
|
||||||
/* We should control soc memory power down mode from RTC, so we will not touch this register any more */
|
/* We should control soc memory power down mode from RTC, so we will not touch this register any more */
|
||||||
CLEAR_PERI_REG_MASK(SYSTEM_MEM_PD_MASK_REG, SYSTEM_LSLP_MEM_PD_MASK);
|
CLEAR_PERI_REG_MASK(SYSTEM_MEM_PD_MASK_REG, SYSTEM_LSLP_MEM_PD_MASK);
|
||||||
|
@ -129,12 +127,19 @@ void rtc_init(rtc_config_t cfg)
|
||||||
|
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_DG_WRAP_FORCE_PU);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_DG_WRAP_FORCE_PU);
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PU);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PU);
|
||||||
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_BT_FORCE_PU);
|
||||||
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_CPU_TOP_FORCE_PU);
|
||||||
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_DG_PERI_FORCE_PU);
|
||||||
|
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_DG_WRAP_FORCE_NOISO);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_DG_WRAP_FORCE_NOISO);
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_NOISO);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_NOISO);
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_FORCE_NOISO);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_FORCE_NOISO);
|
||||||
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_BT_FORCE_NOISO);
|
||||||
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_CPU_TOP_FORCE_NOISO);
|
||||||
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_DG_PERI_FORCE_NOISO);
|
||||||
//cancel digital PADS force no iso
|
//cancel digital PADS force no iso
|
||||||
if (cfg.cpu_waiti_clk_gate) {
|
if (cfg.cpu_waiti_clk_gate) {
|
||||||
SET_PERI_REG_MASK(SYSTEM_CPU_PER_CONF_REG, SYSTEM_CPU_WAIT_MODE_FORCE_ON);
|
CLEAR_PERI_REG_MASK(SYSTEM_CPU_PER_CONF_REG, SYSTEM_CPU_WAIT_MODE_FORCE_ON);
|
||||||
} else {
|
} else {
|
||||||
SET_PERI_REG_MASK(SYSTEM_CPU_PER_CONF_REG, SYSTEM_CPU_WAIT_MODE_FORCE_ON);
|
SET_PERI_REG_MASK(SYSTEM_CPU_PER_CONF_REG, SYSTEM_CPU_WAIT_MODE_FORCE_ON);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ void rtc_sleep_pu(rtc_sleep_pu_config_t cfg)
|
||||||
{
|
{
|
||||||
REG_SET_FIELD(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_LSLP_MEM_FORCE_PU, cfg.dig_fpu);
|
REG_SET_FIELD(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_LSLP_MEM_FORCE_PU, cfg.dig_fpu);
|
||||||
REG_SET_FIELD(RTC_CNTL_PWC_REG, RTC_CNTL_FASTMEM_FORCE_LPU, cfg.rtc_fpu);
|
REG_SET_FIELD(RTC_CNTL_PWC_REG, RTC_CNTL_FASTMEM_FORCE_LPU, cfg.rtc_fpu);
|
||||||
REG_SET_FIELD(RTC_CNTL_PWC_REG, RTC_CNTL_SLOWMEM_FORCE_LPU, cfg.rtc_fpu);
|
|
||||||
REG_SET_FIELD(APB_CTRL_FRONT_END_MEM_PD_REG, APB_CTRL_DC_MEM_FORCE_PU, cfg.fe_fpu);
|
REG_SET_FIELD(APB_CTRL_FRONT_END_MEM_PD_REG, APB_CTRL_DC_MEM_FORCE_PU, cfg.fe_fpu);
|
||||||
REG_SET_FIELD(APB_CTRL_FRONT_END_MEM_PD_REG, APB_CTRL_PBUS_MEM_FORCE_PU, cfg.fe_fpu);
|
REG_SET_FIELD(APB_CTRL_FRONT_END_MEM_PD_REG, APB_CTRL_PBUS_MEM_FORCE_PU, cfg.fe_fpu);
|
||||||
REG_SET_FIELD(APB_CTRL_FRONT_END_MEM_PD_REG, APB_CTRL_AGC_MEM_FORCE_PU, cfg.fe_fpu);
|
REG_SET_FIELD(APB_CTRL_FRONT_END_MEM_PD_REG, APB_CTRL_AGC_MEM_FORCE_PU, cfg.fe_fpu);
|
||||||
|
@ -74,22 +73,14 @@ void rtc_sleep_init(rtc_sleep_config_t cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg.rtc_fastmem_pd_en) {
|
if (cfg.rtc_fastmem_pd_en) {
|
||||||
SET_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_FASTMEM_PD_EN);
|
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_FASTMEM_FORCE_PU);
|
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_FASTMEM_FORCE_NOISO);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_FASTMEM_FORCE_NOISO);
|
||||||
} else {
|
} else {
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_FASTMEM_PD_EN);
|
|
||||||
SET_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_FASTMEM_FORCE_PU);
|
|
||||||
SET_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_FASTMEM_FORCE_NOISO);
|
SET_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_FASTMEM_FORCE_NOISO);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg.rtc_slowmem_pd_en) {
|
if (cfg.rtc_slowmem_pd_en) {
|
||||||
SET_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_SLOWMEM_PD_EN);
|
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_SLOWMEM_FORCE_PU);
|
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_SLOWMEM_FORCE_NOISO);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_SLOWMEM_FORCE_NOISO);
|
||||||
} else {
|
} else {
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_SLOWMEM_PD_EN);
|
|
||||||
SET_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_SLOWMEM_FORCE_PU);
|
|
||||||
SET_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_SLOWMEM_FORCE_NOISO);
|
SET_PERI_REG_MASK(RTC_CNTL_PWC_REG, RTC_CNTL_SLOWMEM_FORCE_NOISO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,6 +96,22 @@ void rtc_sleep_init(rtc_sleep_config_t cfg)
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_PD_EN);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_PD_EN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cfg.bt_pd_en) {
|
||||||
|
SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_BT_PD_EN);
|
||||||
|
} else {
|
||||||
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_BT_PD_EN);
|
||||||
|
}
|
||||||
|
if (cfg.cpu_pd_en) {
|
||||||
|
SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_CPU_TOP_PD_EN);
|
||||||
|
} else {
|
||||||
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_CPU_TOP_PD_EN);
|
||||||
|
}
|
||||||
|
if (cfg.dig_peri_pd_en) {
|
||||||
|
SET_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_DG_PERI_PD_EN);
|
||||||
|
} else {
|
||||||
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_DG_PERI_PD_EN);
|
||||||
|
}
|
||||||
|
|
||||||
REG_SET_FIELD(RTC_CNTL_BIAS_CONF_REG, RTC_CNTL_DBG_ATTEN_MONITOR, RTC_CNTL_DBG_ATTEN_MONITOR_DEFAULT);
|
REG_SET_FIELD(RTC_CNTL_BIAS_CONF_REG, RTC_CNTL_DBG_ATTEN_MONITOR, RTC_CNTL_DBG_ATTEN_MONITOR_DEFAULT);
|
||||||
REG_SET_FIELD(RTC_CNTL_BIAS_CONF_REG, RTC_CNTL_BIAS_SLEEP_MONITOR, RTC_CNTL_BIASSLP_MONITOR_DEFAULT);
|
REG_SET_FIELD(RTC_CNTL_BIAS_CONF_REG, RTC_CNTL_BIAS_SLEEP_MONITOR, RTC_CNTL_BIASSLP_MONITOR_DEFAULT);
|
||||||
REG_SET_FIELD(RTC_CNTL_BIAS_CONF_REG, RTC_CNTL_BIAS_SLEEP_DEEP_SLP, RTC_CNTL_BIASSLP_SLEEP_DEFAULT);
|
REG_SET_FIELD(RTC_CNTL_BIAS_CONF_REG, RTC_CNTL_BIAS_SLEEP_DEEP_SLP, RTC_CNTL_BIASSLP_SLEEP_DEFAULT);
|
||||||
|
|
|
@ -249,10 +249,16 @@ typedef struct {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint16_t wifi_powerup_cycles : 7;
|
uint16_t wifi_powerup_cycles : 7;
|
||||||
uint16_t wifi_wait_cycles : 9;
|
uint16_t wifi_wait_cycles : 9;
|
||||||
|
uint16_t bt_powerup_cycles : 7;
|
||||||
|
uint16_t bt_wait_cycles : 9;
|
||||||
uint16_t rtc_powerup_cycles : 7;
|
uint16_t rtc_powerup_cycles : 7;
|
||||||
uint16_t rtc_wait_cycles : 9;
|
uint16_t rtc_wait_cycles : 9;
|
||||||
|
uint16_t cpu_top_powerup_cycles : 7;
|
||||||
|
uint16_t cpu_top_wait_cycles : 9;
|
||||||
uint16_t dg_wrap_powerup_cycles : 7;
|
uint16_t dg_wrap_powerup_cycles : 7;
|
||||||
uint16_t dg_wrap_wait_cycles : 9;
|
uint16_t dg_wrap_wait_cycles : 9;
|
||||||
|
uint16_t dg_peri_powerup_cycles : 7;
|
||||||
|
uint16_t dg_peri_wait_cycles : 9;
|
||||||
uint16_t rtc_mem_powerup_cycles : 7;
|
uint16_t rtc_mem_powerup_cycles : 7;
|
||||||
uint16_t rtc_mem_wait_cycles : 9;
|
uint16_t rtc_mem_wait_cycles : 9;
|
||||||
} rtc_init_config_t;
|
} rtc_init_config_t;
|
||||||
|
@ -633,6 +639,9 @@ typedef struct {
|
||||||
uint32_t rtc_slowmem_pd_en : 1; //!< power down RTC slow memory
|
uint32_t rtc_slowmem_pd_en : 1; //!< power down RTC slow memory
|
||||||
uint32_t rtc_peri_pd_en : 1; //!< power down RTC peripherals
|
uint32_t rtc_peri_pd_en : 1; //!< power down RTC peripherals
|
||||||
uint32_t wifi_pd_en : 1; //!< power down WiFi
|
uint32_t wifi_pd_en : 1; //!< power down WiFi
|
||||||
|
uint32_t bt_pd_en : 1; //!< power down BT
|
||||||
|
uint32_t cpu_pd_en : 1; //!< power down CPU, but not restart when lightsleep.
|
||||||
|
uint32_t dig_peri_pd_en : 1; //!< power down digital peripherals
|
||||||
uint32_t deep_slp : 1; //!< power down digital domain
|
uint32_t deep_slp : 1; //!< power down digital domain
|
||||||
uint32_t wdt_flashboot_mod_en : 1; //!< enable WDT flashboot mode
|
uint32_t wdt_flashboot_mod_en : 1; //!< enable WDT flashboot mode
|
||||||
uint32_t dig_dbias_wak : 5; //!< set bias for digital domain, in active mode
|
uint32_t dig_dbias_wak : 5; //!< set bias for digital domain, in active mode
|
||||||
|
|
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
Ładowanie…
Reference in New Issue