The ESP32 chip features 40 physical GPIO pads. Some GPIO pads cannot be used or do not have the corresponding pin on the chip package(refer to technical reference manual ). Each pad can be used as a general purpose I/O or can be connected to an internal peripheral signal.
- Note that GPIO6-11 are usually used for SPI flash.
- GPIO34-39 can only be set as input mode and do not have software pullup or pulldown functions.
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, when the Ultra Low Power co-processor </ulp>
is running, or when analog functions such as ADC/DAC/etc are in use.
GPIO output and input interrupt example: peripherals/gpio
.
- :component_file:`driver/include/driver/gpio.h`
- :component_file:`driver/include/driver/rtc_io.h`
GPIO_SEL_0
GPIO_SEL_1
GPIO_SEL_2
GPIO_SEL_3
GPIO_SEL_4
GPIO_SEL_5
GPIO_SEL_6
GPIO_SEL_7
GPIO_SEL_8
GPIO_SEL_9
GPIO_SEL_10
GPIO_SEL_11
GPIO_SEL_12
GPIO_SEL_13
GPIO_SEL_14
GPIO_SEL_15
GPIO_SEL_16
GPIO_SEL_17
GPIO_SEL_18
GPIO_SEL_19
GPIO_SEL_21
GPIO_SEL_22
GPIO_SEL_23
GPIO_SEL_25
GPIO_SEL_26
GPIO_SEL_27
GPIO_SEL_32
GPIO_SEL_33
GPIO_SEL_34
GPIO_SEL_35
GPIO_SEL_36
GPIO_SEL_37
GPIO_SEL_38
GPIO_SEL_39
GPIO_PIN_REG_0
GPIO_PIN_REG_1
GPIO_PIN_REG_2
GPIO_PIN_REG_3
GPIO_PIN_REG_4
GPIO_PIN_REG_5
GPIO_PIN_REG_6
GPIO_PIN_REG_7
GPIO_PIN_REG_8
GPIO_PIN_REG_9
GPIO_PIN_REG_10
GPIO_PIN_REG_11
GPIO_PIN_REG_12
GPIO_PIN_REG_13
GPIO_PIN_REG_14
GPIO_PIN_REG_15
GPIO_PIN_REG_16
GPIO_PIN_REG_17
GPIO_PIN_REG_18
GPIO_PIN_REG_19
GPIO_PIN_REG_20
GPIO_PIN_REG_21
GPIO_PIN_REG_22
GPIO_PIN_REG_23
GPIO_PIN_REG_25
GPIO_PIN_REG_26
GPIO_PIN_REG_27
GPIO_PIN_REG_32
GPIO_PIN_REG_33
GPIO_PIN_REG_34
GPIO_PIN_REG_35
GPIO_PIN_REG_36
GPIO_PIN_REG_37
GPIO_PIN_REG_38
GPIO_PIN_REG_39
GPIO_APP_CPU_INTR_ENA
GPIO_APP_CPU_NMI_INTR_ENA
GPIO_PRO_CPU_INTR_ENA
GPIO_PRO_CPU_NMI_INTR_ENA
GPIO_SDIO_EXT_INTR_ENA
GPIO_MODE_DEF_INPUT
GPIO_MODE_DEF_OUTPUT
GPIO_MODE_DEF_OD
GPIO_PIN_COUNT
GPIO_IS_VALID_GPIO
GPIO_IS_VALID_OUTPUT_GPIO
gpio_isr_t
gpio_isr_handle_t
gpio_num_t
gpio_int_type_t
gpio_mode_t
gpio_pullup_t
gpio_pulldown_t
gpio_pull_mode_t
rtc_gpio_mode_t
gpio_config_t
gpio_config
gpio_set_intr_type
gpio_intr_enable
gpio_intr_disable
gpio_set_level
gpio_get_level
gpio_set_direction
gpio_set_pull_mode
gpio_wakeup_enable
gpio_wakeup_disable
gpio_isr_register
gpio_pullup_en
gpio_pullup_dis
gpio_pulldown_en
gpio_pulldown_dis
gpio_install_isr_service
gpio_uninstall_isr_service
gpio_isr_handler_add
gpio_isr_handler_remove
rtc_gpio_is_valid_gpio
rtc_gpio_init
rtc_gpio_deinit
rtc_gpio_get_level
rtc_gpio_set_level
rtc_gpio_set_direction
rtc_gpio_pullup_en
rtc_gpio_pulldown_en
rtc_gpio_pullup_dis
rtc_gpio_pulldown_dis
rtc_gpio_unhold_all