From 4030ea4d1caad6dc7f962cfcebfae31ded71a493 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Thu, 15 Jan 2026 14:53:58 +0800 Subject: [PATCH] feat(esp_hw_support): support esp32p4 ADC_TESEN_MONITOR mode --- components/esp_hw_support/port/esp32p4/pmu_sleep.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/esp_hw_support/port/esp32p4/pmu_sleep.c b/components/esp_hw_support/port/esp32p4/pmu_sleep.c index a0bea8e56b..1d0330180e 100644 --- a/components/esp_hw_support/port/esp32p4/pmu_sleep.c +++ b/components/esp_hw_support/port/esp32p4/pmu_sleep.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -221,11 +221,14 @@ const pmu_sleep_config_t* pmu_sleep_config_default( config->analog = analog_default; } + if ((sleep_flags & RTC_SLEEP_USE_ADC_TESEN_MONITOR) || (sleep_flags & RTC_SLEEP_XTAL_AS_RTC_FAST)) { + config->analog.hp_sys.analog.pd_cur = PMU_PD_CUR_SLEEP_ON; + config->analog.hp_sys.analog.bias_sleep = PMU_BIASSLP_SLEEP_ON; + } + if (sleep_flags & RTC_SLEEP_XTAL_AS_RTC_FAST) { // Keep XTAL on in HP_SLEEP state if it is the clock source of RTC_FAST power_default.hp_sys.xtal.xpd_xtal = 1; - config->analog.hp_sys.analog.pd_cur = PMU_PD_CUR_SLEEP_ON; - config->analog.hp_sys.analog.bias_sleep = PMU_BIASSLP_SLEEP_ON; config->analog.hp_sys.analog.dbg_atten = PMU_DBG_ATTEN_ACTIVE_DEFAULT; config->analog.hp_sys.analog.dbias = HP_CALI_ACTIVE_DBIAS_DEFAULT; }