Port manipulation on due board

Hello.

I'm trying to use the functions for port manipulation.

In this forum, I saw interesting informations from MarkT

He said:

PIO_PER - write 1's here to override other peripherals and allow GPIO use for pins
PIO_OER - write 1's here to set pins as OUTPUT
PIO_ODR - write 1's here to set pins as INPUT

  • PIO_SODR - write 1's here to set output pins HIGH
  • PIO_CODR - write 1's here to set output pins LOW
  • PIO_PDSR - read's actual state of the pins on the port.
    PIO_PUDR - write 1's here to switch off internal pull-up for pins
    PIO_PUER - write 1's here to switch on internal pull-up for pins

But Is that possible to read this values? and what is the syntax?
I want to know if a pin is INPUT or OUTPUT, and low or high because my arduino is interfaced
with a home system automation who can change the pins (values and status)

Thanks for your help
Patrick

PS: not easy to find informations on port manipulation on due ...

Hi Patrick,

I found following link which you can refer to check if pin is High / Low.

Not sure about, how to check if pin is input or output. Normally we set pin as input /output and then use it accordingly.

Thanks and Regards,
Abhijit

Look at the source code for digitalRead/Write!! This is open source, you have all the code!