adc: improve power logic

This commit is contained in:
Armando
2023-01-09 17:10:04 +08:00
parent f9da48d94f
commit 5be3c21cfc
28 changed files with 480 additions and 249 deletions

View File

@@ -48,10 +48,13 @@ typedef enum {
static inline void sar_ctrl_ll_set_power_mode(sar_ctrl_ll_power_t mode)
{
if (mode == SAR_CTRL_LL_POWER_FSM) {
SENS.sar_peri_clk_gate_conf.saradc_clk_en = 1;
SENS.sar_power_xpd_sar.force_xpd_sar = 0x0;
} else if (mode == SAR_CTRL_LL_POWER_ON) {
SENS.sar_peri_clk_gate_conf.saradc_clk_en = 1;
SENS.sar_power_xpd_sar.force_xpd_sar = 0x3;
} else {
SENS.sar_peri_clk_gate_conf.saradc_clk_en = 0;
SENS.sar_power_xpd_sar.force_xpd_sar = 0x2;
}
}