Page 1 of 1

REQ: simple Samplecode to simultanously use multiple GPIO-PINS

Posted: Sun Mar 11, 2018 10:30 pm
by sanduhrgucker
Hey,

there is not much on the web about using ESP32-gpio changing by bitmasks. On Arduino a normal thing.
Is anybody able to share some examplecode?

F.e. I want to read or write simultanously 8 Bit of Data on 8 wires/pins.

Every Hint is welcome!
Regards
Rene'

Re: REQ: simple Samplecode to simultanously use multiple GPIO-PINS

Posted: Mon Mar 12, 2018 3:20 am
by kolban
Howdy Rene'

In the ESP32 technical reference manual found here:

https://www.espressif.com/sites/default ... ual_en.pdf

In there you will find reference to a couple of of registers:

* GPIO_OUT_W1TS_REG
* GPIO_OUT_W1TC_REG

These two 32bit registers set high/low the corresponding GPIO corresponding to the bit number allowing you to set high/low up to 32 bits in one operation.

The name encoding: W1TS = Write 1 to set and W1TC = Write 1 to clear.

Another register, GPIO_IN_REG can be read. Its value will be the current setting (high/low) of each of the corresponding pins.

The notes I give here are summary only and you should review the appropriate sections of the document in detail for full guidance.

Re: REQ: simple Samplecode to simultanously use multiple GPIO-PINS

Posted: Mon Mar 12, 2018 6:00 pm
by sanduhrgucker
Thank you very much, - it works!