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'
REQ: simple Samplecode to simultanously use multiple GPIO-PINS
-
- Posts: 2
- Joined: Sun Mar 11, 2018 10:21 pm
Re: REQ: simple Samplecode to simultanously use multiple GPIO-PINS
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.
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
-
- Posts: 2
- Joined: Sun Mar 11, 2018 10:21 pm
Re: REQ: simple Samplecode to simultanously use multiple GPIO-PINS
Thank you very much, - it works!
Who is online
Users browsing this forum: No registered users and 50 guests