How to read gpio configuration?
Posted: Sat Feb 24, 2018 2:00 pm
I want to my program to read state of gpio pins.
On old Arduino hardware i did things like
How can I get similar informations on an ESP32?
On old Arduino hardware i did things like
Code: Select all
// ATTENTION: example code is for old Arduino boards, *not* ESP
// input or output?
reg = portModeRegister(port);
if (*reg & mask) { // digital OUTPUTS
...
// high or low?
reg = portOutputRegister(port);
if (*reg & mask) { // HIGH
...
} else { // LOW
...
}
} else { // digital INPUTS
...
// pullup, tristate
// similar code ...
}