JNX30D TECHNICAL REFERENCE MANUAL
VERSION: 1.4
Page 22 of 28
FEB 2022
SECTION 10
Appendix B [GPIO]
10.1
GPIO control
This example shows how to set and readout GPIO 414.
For different GPIO numbers replace 414 accordingly.
10.1.1
Export GPIO
nvidia@nvidia-desktop:~$ echo 414 > /sys/class/gpio/export
nvidia@nvidia-desktop:~$
10.1.2
Change direction to in
nvidia@nvidia-desktop:~$ echo in > /sys/class/gpio/gpio414/direction
nvidia@nvidia-desktop:~$
10.1.3
Change direction to out
nvidia@nvidia-desktop:~$ echo out > /sys/class/gpio/gpio414/direction
nvidia@nvidia-desktop:~$
10.1.4
Set GPIO low
nvidia@nvidia-desktop:~$ echo 0 > /sys/class/gpio/gpio414/value
nvidia@nvidia-desktop:~$
10.1.5
Set GPIO high
nvidia@nvidia-desktop:~$ echo 1 > /sys/class/gpio/gpio414/value
nvidia@nvidia-desktop:~$
10.1.6
Readout GPIO value
nvidia@nvidia-desktop:~$ cat /sys/class/gpio/gpio414/value
0
nvidia@nvidia-desktop:~$ cat /sys/class/gpio/gpio414/value
1