I have a Jetson Development tx2 tegra board setup and running.
Using the Jetson Tx2 J21 header pinout document, I am using the pins:
gpio255 - GPIO_GEN3 pin 15,
gpio298 - GPI06 pin 31,
gpio388 - GPIO26 pin 37,
power and gnd
3.3 VDC - pin 1,
GND - pin 39.
I have got the pins functioning using the normal file descriptor approach:
echo 298 > export,
echo out > direction
echo 0 > value
echo 1 > value
The above approach works and it also is usable in c++ using open and write c functions.
I want to use the same pins but access them using memory map, mmap. Is it possible to lookup the memory addresses on the computer that has been allocated for the pin?
What is the sequance needed to:
a) get the moment address for the pin,
b) set the bit in order to make it GPIO rather than SFIO
c) Set the direction
d) set the pin high/low
Any extra helpful info for then using this in a c++ class?
Does it make any difference to the mmap function call if the file descriptors are exported or not?
Hope someone can help this is a brain twister… :)