4.3 Peripheral Output via GPIO Matrix
Notes:
• One input pad can be connected to multiple input_signals.
• The input signal can be inverted with GPIO_FUNCx_IN_INV_SEL.
• It is possible to have a peripheral read a constant low or constant high input value without connecting this
input to a pad. This can be done by selecting a special GPIO_FUNCy_IN_SEL input instead of a GPIO
number:
– When GPIO_FUNCx_IN_SEL is 0x30,
– When GPIO_FUNCx_IN_SEL is 0x38,
4.2.3 Simple GPIO Input
The GPIO_IN_DATA register holds the input values of each GPIO pad.
The input value of any GPIO pin can be read at any time without configuring the GPIO Matrix for a particular
peripheral signal. However, it is necessary to configure the xx_FUN_IE register for pad X, as shown in Section
4.2.2.
4.3 Peripheral Output via GPIO Matrix
4.3.1 Summary
To output a signal from a peripheral via the GPIO Matrix, the GPIO Matrix is configured to route the peripheral
output signal (0-255) to one of the first 34 GPIOs (0-33). (Note that GPIO pads 34-39 cannot be used as
outputs.)
The output signal is routed from the peripheral into the GPIO Matrix. It is then routed into the IO_MUX, which is
configured to set the chosen pad to "GPIO" function. This causes the output GPIO signal to be connected to the
pad.
4.3.2 Functional Description
One of 256 input signals can be selected to go through the GPIO matrix into the IO_MUX and then to a pad.
Figure
8
illustrates the configuration.
To output peripheral signal
1. Configure the GPIO_FUNCx_OUT_SEL_CFG register and GPIO_ENABLE_DATA[x] of GPIO
Matrix:
• Set GPIO_FUNCx_OUT_SEL to the index of desired peripheral output signal Y.
• Set the GPIO_FUNCx_OEN_SEL bits and GPIO_ENABLE_DATA[x] to enable output mode by force,
OR, clear GPIO_FUNCx_OEN_SEL to zero so that the output enable signal will be decided by the
internal logic function.
2. Optionally, to enable open drain mode set the GPIO_PINx_PAD_DRIVER bit in the
3. Configure the I/O mux register for GPIO pad X:
• Set the function field to GPIO.
Espressif Systems
input_signal_x
input_signal_x
Y
to particular GPIO pad X, follow these steps:
is always 0
is always 1.
30
ESP32 Technical Reference Manual V1.0
4 IO_MUX AND GPIO MATRIX
X
in the GPIO
GPIO_PINx
register.
Need help?
Do you have a question about the ESP32 and is the answer not in the manual?
Questions and answers