Question about reading state of GPIO output
Posted: Wed Jan 20, 2021 9:47 am
I have some GPIOs I'm using as outputs with code like this:
J2[21].function(PINJ2_21_GPIO);
J2[21] = 1;
I'd like to be able to read the state of these pins, but if I do something like i=J2[21] they change to inputs. I'm using shadow registers to get around this, but I'd like to know if there's an easy way to read the current state of a pin set as an output without switching it to an input?
J2[21].function(PINJ2_21_GPIO);
J2[21] = 1;
I'd like to be able to read the state of these pins, but if I do something like i=J2[21] they change to inputs. I'm using shadow registers to get around this, but I'd like to know if there's an easy way to read the current state of a pin set as an output without switching it to an input?