8 static const char *
const TAG =
"deep_sleep";
12 esp_sleep_wakeup_cause_t wakeup_cause = esp_sleep_get_wakeup_cause();
13 switch (wakeup_cause) {
14 case ESP_SLEEP_WAKEUP_EXT0:
15 case ESP_SLEEP_WAKEUP_EXT1:
16 case ESP_SLEEP_WAKEUP_GPIO:
18 case ESP_SLEEP_WAKEUP_TOUCHPAD:
31 #if !defined(USE_ESP32_VARIANT_ESP32C3) && !defined(USE_ESP32_VARIANT_ESP32C6) 46 ESP_LOGCONFIG(TAG,
" Default Wakeup Run Duration: %" PRIu32
" ms",
59 ESP_LOGW(TAG,
"Waiting for pin_ to switch state to enter deep sleep...");
68 #if !defined(USE_ESP32_VARIANT_ESP32C3) && !defined(USE_ESP32_VARIANT_ESP32C6) 79 esp_sleep_enable_ext1_wakeup(this->
ext1_wakeup_->mask, this->ext1_wakeup_->wakeup_mode);
83 esp_sleep_enable_touchpad_wakeup();
84 esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
87 #if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32C6) 96 static_cast<esp_deepsleep_gpio_wake_up_mode_t
>(level));
99 esp_deep_sleep_start();
optional< uint32_t > get_run_duration_() const
optional< bool > touch_wakeup_
optional< WakeupCauseToRunDuration > wakeup_cause_to_run_duration_
void status_set_warning(const char *message="unspecified")
WakeupPinMode
The values of this enum define what should be done if deep sleep is set up with a wakeup pin on the E...
void set_ext1_wakeup(Ext1Wakeup ext1_wakeup)
optional< uint64_t > sleep_duration_
void dump_config_platform_()
bool next_enter_deep_sleep_
optional< uint32_t > run_duration_
void set_wakeup_pin_mode(WakeupPinMode wakeup_pin_mode)
optional< Ext1Wakeup > ext1_wakeup_
void set_run_duration(WakeupCauseToRunDuration wakeup_cause_to_run_duration)
void set_touch_wakeup(bool touch_wakeup)
virtual uint8_t get_pin() const =0
InternalGPIOPin * wakeup_pin_
virtual bool digital_read()=0
As long as the wakeup pin is still in the wakeup state, keep awake.
Implementation of SPI Controller mode.
Automatically invert the wakeup level.
WakeupPinMode wakeup_pin_mode_
virtual bool is_inverted() const =0