How can I disable debugging in SWD and read as PA31 (SWDIO) and PA30 (SWCLK) inputs?
How to read IO using register ?
Hi giorgio,
To check if a given input pin is high:
if (REG_PORT_IN0 & PORT_PA30)
{
// Add your code here...
}
Where the "0" suffix of the REG_PORT_IN0 register denotes port A.
An identical, but alternative syntax is:
if (PORT->Group[PORTA].IN.reg & PORT_PA30)
{
// Add your code here...
}