Tag Archives: ESP8266 GPIO

ESP8266 GPIO

Has anyone had a go at making a set of macros or defines in C to make the programming of the GPIO pins easier?

For people used to:

setMode(1,OUTPUT);

a cold sweat appears when confronted with

PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12);

And if you’re only dealing with GPIO0 and GPIO2 then that’s not too hard, but we have commands to pull up pins, disable pull up, pull down, disable pull down, set as outputs etc…

Personally I’ve no idea which commands can be used on which pins and outside of GPIO0 and 2 I’m not even sure what commands CAN be used on which pins.

Is anyone aware of a simple concise set of documentation with examples for all the pins? Or has anyone done their own thing which would make life easier for others?

The nearest I’ve been able to find is this

http://g-lab.ca/esp8266ex-gpio-application-programming-interface/

and there are also some snippets of useful info here..

http://www.esp8266.com/viewtopic.php?f=13&t=273

However I’m still not clear in my head what can and cannot be done with each pin.

Facebooktwittergoogle_pluspinterestlinkedin