Merge branch 'feature/c6_ulp_timer' into 'master'

ulp: lp timer support for lp core

Closes IDF-6956, IDF-6830, and IDF-6835

See merge request espressif/esp-idf!23453
This commit is contained in:
Zim Kalinowski
2023-05-10 03:06:35 +08:00
23 changed files with 504 additions and 55 deletions

View File

@@ -859,7 +859,7 @@ esp_err_t esp_light_sleep_start(void)
esp_clk_private_lock();
#if SOC_LP_TIMER_SUPPORTED
s_config.rtc_ticks_at_sleep_start = lp_timer_hal_get_cycle_count(0);
s_config.rtc_ticks_at_sleep_start = lp_timer_hal_get_cycle_count();
#else
s_config.rtc_ticks_at_sleep_start = rtc_time_get();
#endif
@@ -1004,7 +1004,7 @@ esp_err_t esp_light_sleep_start(void)
// System timer has been stopped for the duration of the sleep, correct for that.
#if SOC_LP_TIMER_SUPPORTED
uint64_t rtc_ticks_at_end = lp_timer_hal_get_cycle_count(0);
uint64_t rtc_ticks_at_end = lp_timer_hal_get_cycle_count();
#else
uint64_t rtc_ticks_at_end = rtc_time_get();
#endif
@@ -1589,6 +1589,12 @@ static uint32_t get_power_down_flags(void)
// prevents ULP timer and touch FSMs from working correctly.
s_config.domain[ESP_PD_DOMAIN_RTC_PERIPH].pd_option = ESP_PD_OPTION_OFF;
}
#endif //CONFIG_IDF_TARGET_ESP32
#if SOC_LP_CORE_SUPPORTED
else if (s_config.wakeup_triggers & RTC_LP_CORE_TRIG_EN) {
// Need to keep RTC_PERIPH on to allow lp core to wakeup during sleep (e.g. from lp timer)
s_config.domain[ESP_PD_DOMAIN_RTC_PERIPH].pd_option = ESP_PD_OPTION_ON;
}
#endif //CONFIG_IDF_TARGET_ESP32
}
#endif // SOC_PM_SUPPORT_RTC_PERIPH_PD