EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1051 background imageLoading...
Page #1051 background image
Chapter 2. API Reference
For example, on ESP32-WROOM-32 board, GPIO16 and GPIO17 are linked to VDD_SPI power domain. If
they are configured to remain high during light sleep, the power domain should be configured to remain powered
ON. This can be done with esp_sleep_pd_config():
esp_sleep_pd_config(ESP_PD_DOMAIN_VDDSDIO, ESP_PD_OPTION_ON);
UART wakeup (light sleep only) When ESP32-S2 receives UART input from external devices, it is often required
to wake up the chip when input data is available. UART peripheral contains a feature which allows waking up the
chip from light sleep when a certain number of positive edges on RX pin are seen. This number of positive edges
can be set using uart_set_wakeup_threshold() function. Note that the character which triggers wakeup
(and any characters before it) will not be received by the UART after wakeup. This means that the external device
typically needs to send an extra character to the ESP32-S2 to trigger wakeup, before sending the data.
esp_sleep_enable_uart_wakeup() function can be used to enable this wakeup source.
Power-down of RTC peripherals and memories
By default, esp_deep_sleep_start() and esp_light_sleep_start() functions will power down
all RTC power domains which are not needed by the enabled wakeup sources. To override this behaviour,
esp_sleep_pd_config() function is provided.
If some variables in the program are placed into RTC slow memory (for example, using RTC_DATA_ATTR attribute),
RTC slow memory will be kept powered on by default. This can be overridden using esp_sleep_pd_config()
function, if desired.
Entering light sleep
esp_light_sleep_start() function can be used to enter light sleep once wakeup sources are configured. It
is also possible to go into light sleep with no wakeup sources configured, in this case the chip will be in light sleep
mode indefinitely, until external reset is applied.
Entering deep sleep
esp_deep_sleep_start() function can be used to enter deep sleep once wakeup sources are configured. It
is also possible to go into deep sleep with no wakeup sources configured, in this case the chip will be in deep sleep
mode indefinitely, until external reset is applied.
Configuring IOs
Some ESP32-S2 IOs have internal pullups or pulldowns, which are enabled by default. If an external circuit drives
this pin in deep sleep mode, current consumption may increase due to current flowing through these pullups and
pulldowns.
To isolate a pin, preventing extra current draw, call rtc_gpio_isolate() function.
For example, on ESP32-WROVER module, GPIO12 is pulled up externally. GPIO12 also has an internal pull-
down in the ESP32 chip. This means that in deep sleep, some current will flow through these external and in-
ternal resistors, increasing deep sleep current above the minimal possible value. Add the following code before
esp_deep_sleep_start() to remove this extra current:
rtc_gpio_isolate(GPIO_NUM_12);
Espressif Systems 1040
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish