Tag Archives: ESP8266 BITS

ESP12 and More Pins

ESP-12I’m just about to have a go at one of the larger boards – the ESP12 (or 201)…   so can someone save me (and others) re-inventing the wheel.

Here’s what I do to initialise an ESP-01 port bit GPIO0 as an output.

Firstly the setup..

// For GPIO2 just change the 0 to 2 - there is one init line.
#define LED_GPIO 0
#define LED_GPIO_MUX PERIPHS_IO_MUX_GPIO0_U
#define LED_GPIO_FUNC FUNC_GPIO0

then initialisation

PIN_FUNC_SELECT(LED_GPIO_MUX, LED_GPIO_FUNC);

 

and here it is set to 1.

GPIO_OUTPUT_SET(LED_GPIO, OUT_ON);

 

As you can see, I’ve already figured out how to do the same with GPIO2 (though I’ve not used GPIO2 as an output yet)

So – what other pins can we use in exactly the same way and are the numbers as you would expect or different?? This general principle also seems to work for GPO4 and 5 but not for the higher numbers.

Facebooktwittergoogle_pluspinterestlinkedin