!
2.2. Instruction on GPIO Registers
2.2.1. GPIO Function Selection Register
The ESP8266 MTDI is used to demonstrate the GPIO function selection.
Function selection register PERIPHS_IO_MUX_MTDI_U (this register differs for different
GPIOs)
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U,FUNC_GPIO12);
FUNC_GPIO12=3.
Configurations differ for different pins.
During the configuration, refer to ESP8266_Pin_List.xlsx. On the Digital Die Pin List page,
users can see the general GPIO and their multiple functions. On the Reg page, users can
find registers related to GPIO function selection.
On the Digital Die Pin List page, users can find the function configuration in the FUNCTION
column.
⚠ Notice:
If you want to configure it to be FUNCTION X, write X -1 into the bit in the register. For example, if you want
to configure it to be FUNCTION 3, write 2 into the bit in the register.
2.2.2. GPIO Output Registers
Output enable register: GPIO_ENABLE_W1TS
•
bit[15:0] the output enable bit (readable and writable):
If the related bit is set to be 1, the IO output is enabled. Bit[15:0] contains 16 GPIO output
enable bits.
Output disable register: GPIO_ENABLE_W1TC
•
bit[15:0] the output disable bit (readable and writable):
If the related bit is set to be 1, the IO output is disabled. Bit[15:0] contains 16 GPIO output
disable bits.
Output enable status register: GPIO_ENABLE
•
bit[15:0] the output enable status bit (readable and writable):
Value of bit[15:0] of this register shows the related pin output enable status.
By writing data into bit[15:0] of GPIO_ENABLE_W1TS and bit[15:0] of
GPIO_ENABLE_W1TC, users can control bit[15:0] of GPIO_ENABLE. For example, when
bit[0] of GPIO_ENABLE_W1T is set to be 1, then bit[0] of GPIO_ENABLE =1; when bit[1] of
GPIO_ENABLE_W1TC is set to be 1, then bit[1] of GPIO_ENABLE = 0.
Output low level register GPIO_OUT_W1TC
•
bit[15:0] output low level bit (write only register):
Espressif
! /! 7 86
2. GPIO
2016.05
Need help?
Do you have a question about the ESP8266 and is the answer not in the manual?
Questions and answers