Espressif ESP32-S2 Programming Manual page 275

Table of Contents

Advertisement

Chapter 2. API Reference
esp_err_t rtc_gpio_init(gpio_num_t
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
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
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
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
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
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
gpio_num)
gpio_num)
gpio_num)
gpio_num, uint32_t level)
gpio_num,
264
Submit Document Feedback
rtc_gpio_mode_t
mode)
gpio_num,
rtc_gpio_mode_t
mode)
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Table of Contents

Save PDF