Chapter 2. API Reference
Table 1 – continued from previous page
GPIO Analog Function RTC GPIO Comment
GPIO41 JTAG
GPIO42 JTAG
GPIO43
GPIO44
GPIO45 Strapping pin
GPIO46 GPI;Strapping pin
Note:
• Strapping pin: GPIO0, GPIO45 and GPIO46 are strapping pins. For more infomation, please refer to ESP32-
S2 datasheet
• SPI0/1: GPIO26-32 are usually used for SPI flash and PSRAM and not recommended for other uses.
• JTAG: GPIO39-42 are usually used for inline debug.
• GPI: GPIO46 is fixed to pull-down and is input only.
There is also separate “RTC GPIO”support, which functions when GPIOs are routed to the “RTC”low-power
and analog subsystem. These pin functions can be used when:
• In deep sleep
• The Ultra Low Power co-processor is running
• Analog functions such as ADC/DAC/etc are in use.
Application Example
GPIO output and input interrupt example: peripherals/gpio/generic_gpio.
API Reference - Normal GPIO
Header File
• components/driver/include/driver/gpio.h
Functions
esp_err_t gpio_config(const gpio_config_t *pGPIOConfig)
GPIO common configuration.
Configure GPIO’s Mode,pull-up,PullDown,IntrType
Return
• ESP_OK success
• ESP_ERR_INVALID_ARG Parameter error
Parameters
• pGPIOConfig: Pointer to GPIO configure struct
esp_err_t gpio_reset_pin(gpio_num_t gpio_num)
Reset an gpio to default state (select gpio function, enable pullup and disable input and output).
Note This function also configures the IOMUX for this pin to the GPIO function, and disconnects any other
peripheral output configured via GPIO Matrix.
Return Always return ESP_OK.
Parameters
• gpio_num: GPIO number.
esp_err_t gpio_set_intr_type(gpio_num_t gpio_num, gpio_int_type_t intr_type)
GPIO set interrupt trigger type.
Return
Espressif Systems 250
Submit Document Feedback
Release v4.4