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 #275 background imageLoading...
Page #275 background image
Chapter 2. API Reference
esp_err_t rtc_gpio_init(gpio_num_t gpio_num)
Init a GPIO as RTC GPIO.
This function must be called when initializing a pad for an analog function.
Return
ESP_OK success
ESP_ERR_INVALID_ARG GPIO is not an RTC IO
Parameters
gpio_num: GPIO number (e.g. GPIO_NUM_12)
esp_err_t rtc_gpio_deinit(gpio_num_t gpio_num)
Init a GPIO as digital GPIO.
Return
ESP_OK success
ESP_ERR_INVALID_ARG GPIO is not an RTC IO
Parameters
gpio_num: GPIO number (e.g. GPIO_NUM_12)
uint32_t rtc_gpio_get_level(gpio_num_t gpio_num)
Get the RTC IO input level.
Return
1 High level
0 Low level
ESP_ERR_INVALID_ARG GPIO is not an RTC IO
Parameters
gpio_num: GPIO number (e.g. GPIO_NUM_12)
esp_err_t rtc_gpio_set_level(gpio_num_t gpio_num, uint32_t level)
Set the RTC IO output level.
Return
ESP_OK Success
ESP_ERR_INVALID_ARG GPIO is not an RTC IO
Parameters
gpio_num: GPIO number (e.g. GPIO_NUM_12)
level: output level
esp_err_t rtc_gpio_set_direction(gpio_num_t gpio_num, rtc_gpio_mode_t mode)
RTC GPIO set direction.
Configure RTC GPIO direction, such as output only, input only, output and input.
Return
ESP_OK Success
ESP_ERR_INVALID_ARG GPIO is not an RTC IO
Parameters
gpio_num: GPIO number (e.g. GPIO_NUM_12)
mode: GPIO direction
esp_err_t rtc_gpio_set_direction_in_sleep(gpio_num_t gpio_num, rtc_gpio_mode_t mode)
RTC GPIO set direction in deep sleep mode or disable sleep status (default). In some application scenarios,
IO needs to have another states during deep sleep.
NOTE: ESP32 support INPUT_ONLY mode. ESP32S2 support INPUT_ONLY, OUTPUT_ONLY, IN-
PUT_OUTPUT mode.
Return
ESP_OK Success
ESP_ERR_INVALID_ARG GPIO is not an RTC IO
Parameters
gpio_num: GPIO number (e.g. GPIO_NUM_12)
mode: GPIO direction
Espressif Systems 264
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