2017-02-15 21:59:50 -05:00
GPIO & RTC GPIO
===============
2016-10-25 06:09:05 -04:00
2016-10-26 15:08:36 -04:00
Overview
--------
2019-12-08 22:01:09 -05:00
.. only :: esp32
2022-02-14 22:38:49 -05:00
The {IDF_TARGET_NAME} chip features 35 physical GPIO pads (GPIO0 ~ GPIO23, GPIO25 ~ GPIO27, and GPIO32 ~ GPIO39). Some GPIO pads cannot be used or do not have the corresponding pin on the chip package. For more details, see *{IDF_TARGET_NAME} Technical Reference Manual* > *IO MUX and GPIO Matrix (GPIO, IO_MUX)* [`PDF <{IDF_TARGET_TRM_EN_URL}#iomuxgpio> `__ ].
2021-07-06 05:45:17 -04:00
Each pad can be used as a general purpose I/O or can be connected to an internal peripheral signal. The table below provides more information on pin usage, and please note the comments in the table for GPIOs with restrictions.
2022-02-14 22:38:49 -05:00
.. list-table ::
:header-rows: 1
:widths: 8 12 12 20
2021-07-06 05:45:17 -04:00
* - GPIO
- Analog Function
- RTC GPIO
- Comments
* - GPIO0
- ADC2_CH1
- RTC_GPIO11
2022-02-14 22:38:49 -05:00
- Strapping pin
2021-07-06 05:45:17 -04:00
* - GPIO1
2022-02-14 22:38:49 -05:00
-
-
- TXD
2021-07-06 05:45:17 -04:00
* - GPIO2
- ADC2_CH2
- RTC_GPIO12
2022-02-14 22:38:49 -05:00
- Strapping pin
2021-07-06 05:45:17 -04:00
* - GPIO3
2022-02-14 22:38:49 -05:00
-
-
- RXD
2021-07-06 05:45:17 -04:00
* - GPIO4
- ADC2_CH0
- RTC_GPIO10
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO5
2022-02-14 22:38:49 -05:00
-
-
- Strapping pin
2021-07-06 05:45:17 -04:00
* - GPIO6
2022-02-14 22:38:49 -05:00
-
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO7
2022-02-14 22:38:49 -05:00
-
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO8
2022-02-14 22:38:49 -05:00
-
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO9
2022-02-14 22:38:49 -05:00
-
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO10
2022-02-14 22:38:49 -05:00
-
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO11
2022-02-14 22:38:49 -05:00
-
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO12
- ADC2_CH5
- RTC_GPIO15
2022-02-14 22:38:49 -05:00
- Strapping pin; JTAG
2021-07-06 05:45:17 -04:00
* - GPIO13
- ADC2_CH4
- RTC_GPIO14
- JTAG
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO14
- ADC2_CH6
- RTC_GPIO16
- JTAG
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO15
- ADC2_CH3
- RTC_GPIO13
- Strapping pin; JTAG
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO16
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO17
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO18
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO19
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
-
2021-04-21 17:01:14 -04:00
* - GPIO20
2022-02-14 22:38:49 -05:00
-
2021-04-21 17:01:14 -04:00
-
- This pin is only available on ESP32-PICO-V3 chip package
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO21
-
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
* - GPIO22
-
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
* - GPIO23
-
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
* - GPIO25
- ADC2_CH8
- RTC_GPIO6
-
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO26
- ADC2_CH9
- RTC_GPIO7
-
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO27
- ADC2_CH7
- RTC_GPIO17
-
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO32
- ADC1_CH4
- RTC_GPIO9
-
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO33
- ADC1_CH5
- RTC_GPIO8
-
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO34
- ADC1_CH6
- RTC_GPIO4
- GPI
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO35
- ADC1_CH7
- RTC_GPIO5
- GPI
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO36
- ADC1_CH0
- RTC_GPIO0
- GPI
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO37
- ADC1_CH1
- RTC_GPIO1
- GPI
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO38
- ADC1_CH2
- RTC_GPIO2
- GPI
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO39
- ADC1_CH3
- RTC_GPIO3
- GPI
.. note ::
- Strapping pin: GPIO0, GPIO2, GPIO5, GPIO12 (MTDI), and GPIO15 (MTDO) are strapping pins. For more infomation, please refer to `ESP32 datasheet <https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf> `_ .
2022-02-14 22:38:49 -05:00
- SPI0/1: GPIO6-11 and GPIO16-17 are usually connected to the SPI flash and PSRAM integrated on the module and therefore should not be used for other purposes.
- JTAG: GPIO12-15 are usually used for inline debug.
2021-07-06 05:45:17 -04:00
- GPI: GPIO34-39 can only be set as input mode and do not have software-enabled pullup or pulldown functions.
2022-02-14 22:38:49 -05:00
- TXD & RXD are usually used for flashing and debugging.
2021-07-06 05:45:17 -04:00
- ADC2: ADC2 pins cannot be used when Wi-Fi is used. So, if you’ re using Wi-Fi and you’ re having trouble getting the value from an ADC2 GPIO, you may consider using an ADC1 GPIO instead, that should solve your problem. For more details, please refer to `ADC limitations <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/adc.html#adc-limitations> `_ .
2019-12-08 22:01:09 -05:00
2019-12-12 22:49:10 -05:00
.. only :: esp32s2
2019-12-08 22:01:09 -05:00
2022-02-14 22:38:49 -05:00
The {IDF_TARGET_NAME} chip features 43 physical GPIO pads (GPIO0 ~ GPIO21 and GPIO26 ~ GPIO46). Some GPIO pads cannot be used or do not have the corresponding pin on the chip package. For more details, see *{IDF_TARGET_NAME} Technical Reference Manual* > *IO MUX and GPIO Matrix (GPIO, IO_MUX)* [`PDF <{IDF_TARGET_TRM_EN_URL}#iomuxgpio> `__ ]. Each pad can be used as a general purpose I/O or can be connected to an internal peripheral signal.
2019-12-08 22:01:09 -05:00
2021-07-06 05:45:17 -04:00
The table below provides more information on pin usage, and please note the comments in the table for GPIOs with restrictions.
.. list-table ::
:header-rows: 1
2022-02-14 22:38:49 -05:00
:widths: 8 12 12 20
2021-07-06 05:45:17 -04:00
* - GPIO
- Analog Function
- RTC GPIO
- Comment
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO0
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
- RTC_GPIO0
- Strapping pin
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO1
- ADC1_CH0
- RTC_GPIO1
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO2
- ADC1_CH1
- RTC_GPIO2
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO3
- ADC1_CH2
- RTC_GPIO3
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO4
- ADC1_CH3
- RTC_GPIO4
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO5
- ADC1_CH4
- RTC_GPIO5
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO6
- ADC1_CH5
- RTC_GPIO6
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO7
- ADC1_CH6
- RTC_GPIO7
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO8
- ADC1_CH7
- RTC_GPIO8
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO9
- ADC1_CH8
- RTC_GPIO9
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO10
- ADC1_CH9
- RTC_GPIO10
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO11
- ADC2_CH0
- RTC_GPIO11
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO12
- ADC2_CH1
- RTC_GPIO12
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO13
- ADC2_CH2
- RTC_GPIO13
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO14
- ADC2_CH3
- RTC_GPIO14
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO15
- ADC2_CH4
- RTC_GPIO15
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO16
- ADC2_CH5
- RTC_GPIO16
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO17
- ADC2_CH6
- RTC_GPIO17
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO18
- ADC2_CH7
- RTC_GPIO18
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO19
- ADC2_CH8
- RTC_GPIO19
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO20
- ADC2_CH9
- RTC_GPIO20
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO21
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
- RTC_GPIO21
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO26
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO27
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO28
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO29
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO30
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO31
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO32
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO33
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO34
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO35
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO36
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO37
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO38
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO39
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- JTAG
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO40
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- JTAG
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO41
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- JTAG
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO42
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- JTAG
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO43
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO44
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO45
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- Strapping pin
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO46
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- GPI; Strapping pin
.. note ::
- Strapping pin: GPIO0, GPIO45 and GPIO46 are strapping pins. For more infomation, please refer to `ESP32-S2 datasheet <https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf> `_
- SPI0/1: GPIO26-32 are usually used for SPI flash and PSRAM and not recommended for other uses.
2022-02-14 22:38:49 -05:00
- JTAG: GPIO39-42 are usually used for inline debug.
2021-07-06 05:45:17 -04:00
- GPI: GPIO46 is fixed to pull-down and is input only.
2017-02-15 21:59:50 -05:00
2021-03-23 02:43:09 -04:00
.. only :: esp32c3
2022-02-14 22:38:49 -05:00
The {IDF_TARGET_NAME} chip features 22 physical GPIO pads (GPIO0 ~ GPIO21). Some GPIO pads cannot be used or do not have the corresponding pin on the chip package. For more details, see *{IDF_TARGET_NAME} Technical Reference Manual* > *IO MUX and GPIO Matrix (GPIO, IO_MUX)* [`PDF <{IDF_TARGET_TRM_EN_URL}#iomuxgpio> `__ ]. Each pad can be used as a general purpose I/O or can be connected to an internal peripheral signal.
2021-03-23 02:43:09 -04:00
2021-07-06 05:45:17 -04:00
The table below provides more information on pin usage, and please note the comments in the table for GPIOs with restrictions.
2022-02-14 22:38:49 -05:00
.. list-table ::
:header-rows: 1
:widths: 12 12 22
2021-07-06 05:45:17 -04:00
* - GPIO
- Analog Function
- Comment
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO0
- ADC1_CH0
- RTC
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO1
- ADC1_CH1
- RTC
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO2
- ADC1_CH2
- Strapping pin; RTC
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO3
- ADC1_CH3
- RTC
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO4
- ADC1_CH4
- RTC
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO5
- ADC2_CH0
- RTC
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO6
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
* - GPIO7
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
* - GPIO8
2022-02-14 22:38:49 -05:00
-
- Strapping pin
2021-07-06 05:45:17 -04:00
* - GPIO9
2022-02-14 22:38:49 -05:00
-
- Strapping pin
2021-07-06 05:45:17 -04:00
* - GPIO10
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
* - GPIO11
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
* - GPIO12
2022-02-14 22:38:49 -05:00
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO13
2022-02-14 22:38:49 -05:00
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO14
2022-02-14 22:38:49 -05:00
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO15
2022-02-14 22:38:49 -05:00
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO16
2022-02-14 22:38:49 -05:00
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO17
2022-02-14 22:38:49 -05:00
-
- SPI0/1
2021-07-06 05:45:17 -04:00
* - GPIO18
2022-02-14 22:38:49 -05:00
-
- USB-JTAG
2021-07-06 05:45:17 -04:00
* - GPIO19
2022-02-14 22:38:49 -05:00
-
- USB-JTAG
2021-07-06 05:45:17 -04:00
* - GPIO20
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
* - GPIO21
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
-
.. note ::
- Strapping pin: GPIO2, GPIO8 and GPIO9 are strapping pins. For more infomation, please refer to `ESP32-C3 datasheet <https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf> `_ .
2022-02-14 22:38:49 -05:00
- SPI0/1: GPIO12-17 are usually used for SPI flash and PSRAM and not recommended for other uses.
- USB-JTAG: GPIO 18 and 19 are used by USB-JTAG by default. In order to use them as GPIOs, USB-JTAG will be disabled by the drivers.
2021-07-06 05:45:17 -04:00
- RTC: GPIO0-5 can be used when in deep sleep.
2017-02-15 21:59:50 -05:00
2021-06-09 05:18:39 -04:00
.. only :: esp32s3
2022-02-14 22:38:49 -05:00
The {IDF_TARGET_NAME} chip features 45 physical GPIO pads (GPIO0 ~ GPIO21 and GPIO26 ~ GPIO48). Some GPIO pads cannot be used or do not have the corresponding pin on the chip package. For more details, see *{IDF_TARGET_NAME} Technical Reference Manual* > *IO MUX and GPIO Matrix (GPIO, IO_MUX)* [`PDF <{IDF_TARGET_TRM_EN_URL}#iomuxgpio> `__ ]. Each pad can be used as a general purpose I/O or can be connected to an internal peripheral signal.
2021-06-09 05:18:39 -04:00
2021-07-06 05:45:17 -04:00
The table below provides more information on pin usage, and please note the comments in the table for GPIOs with restrictions.
.. list-table ::
:header-rows: 1
:widths: 8 12 12 20
* - GPIO
- Analog Function
- RTC GPIO
- Comment
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO0
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
- RTC_GPIO0
- Strapping pin
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO1
- ADC1_CH0
- RTC_GPIO1
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO2
- ADC1_CH1
- RTC_GPIO2
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO3
- ADC1_CH2
- RTC_GPIO3
- Strapping pin
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO4
- ADC1_CH3
- RTC_GPIO4
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO5
- ADC1_CH4
- RTC_GPIO5
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO6
- ADC1_CH5
- RTC_GPIO6
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO7
- ADC1_CH6
- RTC_GPIO7
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO8
- ADC1_CH7
- RTC_GPIO8
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO9
- ADC1_CH8
- RTC_GPIO9
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO10
- ADC1_CH9
- RTC_GPIO10
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO11
- ADC2_CH0
- RTC_GPIO11
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO12
- ADC2_CH1
- RTC_GPIO12
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO13
- ADC2_CH2
- RTC_GPIO13
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO14
- ADC2_CH3
- RTC_GPIO14
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO15
- ADC2_CH4
- RTC_GPIO15
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO16
- ADC2_CH5
- RTC_GPIO16
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO17
- ADC2_CH6
- RTC_GPIO17
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO18
- ADC2_CH7
- RTC_GPIO18
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO19
- ADC2_CH8
- RTC_GPIO19
- USB-JTAG
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO20
- ADC2_CH9
- RTC_GPIO20
- USB-JTAG
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO21
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
- RTC_GPIO21
2022-02-14 22:38:49 -05:00
-
2021-07-06 05:45:17 -04:00
* - GPIO26
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO27
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO28
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO29
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO30
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO31
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO32
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO33
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO34
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO35
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO36
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO37
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- SPI0/1
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO38
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO39
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO40
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO41
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO42
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO43
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO44
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO45
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- Strapping pin
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO46
2022-02-14 22:38:49 -05:00
-
-
2021-07-06 05:45:17 -04:00
- Strapping pin
2022-02-14 22:38:49 -05:00
2021-07-06 05:45:17 -04:00
* - GPIO47
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
* - GPIO48
2022-02-14 22:38:49 -05:00
-
-
-
2021-07-06 05:45:17 -04:00
.. Note ::
- Strapping pin: GPIO0, GPIO3, GPIO45 and GPIO46 are strapping pins.
- SPI0/1: GPIO26-32 are usually used for SPI flash and PSRAM and not recommended for other uses. When using Octal Flash or Octal PSRAM or both, GPIO33~37 are connected to SPIIO4 ~ SPIIO7 and SPIDQS. Therefore on ESP32-S3R8 / ESP32-S3R8V board GPIO33~37 are also not recommended for other uses.
- USB-JTAG: GPIO 19 and 20 are used by USB-JTAG by default. In order to use them as GPIOs, USB-JTAG will be disabled by the drivers.
2022-02-14 22:38:49 -05:00
.. only :: esp32c2
The {IDF_TARGET_NAME} chip features 21 physical GPIO pads (GPIO0 ~ GPIO20). For chip variants with an SiP flash built in, GPIO11 ~ GPIO17 are dedicated to connecting the SiP flash; therefore, only 14 GPIO pins are available. For more details, see *{IDF_TARGET_NAME} Technical Reference Manual* > *IO MUX and GPIO Matrix (GPIO, IO_MUX)* [`PDF <{IDF_TARGET_TRM_EN_URL}#iomuxgpio> `__ ]. Each pad can be used as a general purpose I/O or can be connected to an internal peripheral signal.
The table below provides more information on pin usage, and please note the comments in the table for GPIOs with restrictions.
.. list-table ::
:header-rows: 1
:widths: 12 12 22
* - GPIO
- Analog Function
- Comment
* - GPIO0
- ADC1_CH0
- RTC
* - GPIO1
- ADC1_CH1
- RTC
* - GPIO2
- ADC1_CH2
- RTC
* - GPIO3
- ADC1_CH3
- RTC
* - GPIO4
- ADC1_CH4
- RTC
* - GPIO5
-
- RTC
* - GPIO6
-
-
* - GPIO7
-
-
* - GPIO8
-
- Strapping pin
* - GPIO9
-
- Strapping pin
* - GPIO10
-
-
* - GPIO11
-
-
* - GPIO12
-
- SPI0/1
* - GPIO13
-
- SPI0/1
* - GPIO14
-
- SPI0/1
* - GPIO15
-
- SPI0/1
* - GPIO16
-
- SPI0/1
* - GPIO17
-
- SPI0/1
* - GPIO18
-
-
* - GPIO19
-
-
* - GPIO20
-
-
.. note ::
- Strapping pin: GPIO8 and GPIO9 are strapping pins. For more infomation, please refer to `ESP32-C2 datasheet <https://www.espressif.com/sites/default/files/documentation/esp32-c2_datasheet_en.pdf> `_ .
- SPI0/1: GPIO12-17 are usually used for SPI flash and not recommended for other uses.
- RTC: GPIO0-5 can be used when in deep sleep.
2021-06-09 05:18:39 -04:00
2020-10-28 21:57:09 -04:00
.. only :: SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
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:
.. list ::
- In deep sleep
2022-02-21 05:43:02 -05:00
:SOC_ULP_SUPPORTED: - The :doc:`Ultra Low Power co-processor <../../api-reference/system/ulp>` is running
2020-10-28 21:57:09 -04:00
- Analog functions such as ADC/DAC/etc are in use.
2016-10-26 15:08:36 -04:00
Application Example
-------------------
2020-09-29 06:14:17 -04:00
GPIO output and input interrupt example: :example: `peripherals/gpio/generic_gpio` .
2016-11-05 12:18:25 -04:00
2017-05-02 04:36:01 -04:00
API Reference - Normal GPIO
---------------------------
2016-11-05 12:18:25 -04:00
2019-11-12 22:46:16 -05:00
.. include-build-file :: inc/gpio.inc
2020-04-27 22:52:14 -04:00
.. include-build-file :: inc/gpio_types.inc
2016-11-10 16:50:55 -05:00
2020-10-28 21:57:09 -04:00
.. only :: SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
API Reference - RTC GPIO
------------------------
.. include-build-file :: inc/rtc_io.inc
.. include-build-file :: inc/rtc_io_types.inc