Chapter 2. API Reference
UART output handling
Before entering sleep mode,
When entering light sleep mode using esp_light_sleep_start(), UART FIFOs will not be flushed. Instead,
UART output will be suspended, and remaining characters in the FIFO will be sent out after wakeup from light sleep.
Checking sleep wakeup cause
esp_sleep_get_wakeup_cause()
from sleep mode.
For
touch
pad,
it
esp_sleep_get_touchpad_wakeup_status()
For
ext1
wakeup
sources,
esp_sleep_get_ext1_wakeup_status()
Disable sleep wakeup source
Previously configured wakeup source can be disabled later using
API. This function deactivates trigger for the given wakeup source. Additionally it can disable all triggers if the
argument is ESP_SLEEP_WAKEUP_ALL.
Application Example
Implementation of basic functionality of deep sleep is shown in
odically waken up to retrieve time from NTP server.
More extensive example in
processor programming.
API Reference
Header File
•
components/esp_hw_support/include/esp_sleep.h
Functions
esp_err_t esp_sleep_disable_wakeup_source(esp_sleep_source_t
Disable wakeup source.
This function is used to deactivate wake up trigger for source defined as parameter of the function.
See docs/sleep-modes.rst for details.
Note This function does not modify wake up configuration in RTC. It will be performed in esp_sleep_start
function.
Return
• ESP_OK on success
• ESP_ERR_INVALID_STATE if trigger was not active
Parameters
• source: - number of source to disable of type esp_sleep_source_t
esp_err_t
esp_sleep_enable_ulp_wakeup(void)
Enable wakeup by ULP coprocessor.
Note In revisions 0 and 1 of the ESP32, ULP wakeup source cannot be used when RTC_PERIPH power
domain is forced to be powered on (ESP_PD_OPTION_ON) or when ext0 wakeup source is used.
Espressif Systems
esp_deep_sleep_start()
function can be used to check which wakeup source has triggered wakeup
is
possible
to
identify
it
is
possible
functions.
system/deep_sleep
illustrates usage of various deep sleep wakeup triggers and ULP co-
Submit Document Feedback
will flush the contents of UART FIFOs.
touch
pad
which
functions.
to
identify
pin
which
esp_sleep_disable_wakeup_source()
protocols/sntp
example, where ESP module is peri-
source)
1041
has
caused
wakeup
has
caused
wakeup
Release v4.4
using
using
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?