REQ: simple Samplecode to simultanously use multiple GPIO-PINS

sanduhrgucker
Posts: 2
Joined: Sun Mar 11, 2018 10:21 pm

REQ: simple Samplecode to simultanously use multiple GPIO-PINS

Postby sanduhrgucker » Sun Mar 11, 2018 10:30 pm

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'

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

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

Postby kolban » Mon Mar 12, 2018 3:20 am

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

sanduhrgucker
Posts: 2
Joined: Sun Mar 11, 2018 10:21 pm

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

Postby sanduhrgucker » Mon Mar 12, 2018 6:00 pm

Thank you very much, - it works!

Who is online

Users browsing this forum: No registered users and 10 guests