For example, if I want to know whether GPIO0 is an input or an output pin ... is that possible?
Thanks for the response. I looked at GPIO_PIN_CONFIG_GET(x) and it appears to be an expression evaluation. Do you know of any docs on how to use these functions? I have a feeling that the methods I have been using (such as gpio_output_set and gpio_input_get) are high level wrappers and the functions in eagle_soc.h are lower level. If I can learn how these work, I'll write them up for the community.
The "direction" register is at offset 0x0c, given by GPIO_ENABLE_ADDRESS. The value resulting from GPIO_REG_READ(GPIO_ENABLE_ADDRESS) will have 1s in bit positions corresponding to pins that are outputs. This assumes, of course, that the IO MUX is set for the bit to be a GPIO.kolban wrote:[...]is there a way to determine the current input and output direction of a given pin?
Beaverton, OR, USA
Who is online
Users browsing this forum: No registered users and 5 guests
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
We also have a RTOS version and a MESH version too!
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!