How to access the GPIOs?


I want to access the GPIOs on NX module. The GPIOs some are on the 40-pin header, some not. I have several questions:

  1. There is one lib called ‘jetson-gpio’, will it support accessing GPIOs not on the 40-pins header?
  2. What’s the underlying of the lib? SysFs ? Or memdev?


hello diverger,

this python library, jetson-gpio, it only works with DevKits. it may not works if you’re having customize boards.
you may also check Topic 144550 for several ways to access GPIOs. such as, kernel APIs, python scripts, C++ samples.

Hi, Chang

About the GPIO interrupt. How to enable them and which pins support interrupt?


hello diverger,

you should have software configure to setup GPIO as interrupt. please check device sources and searching for interrupts for reference,
furthermore, if you done the pin configuration, let’s take an example to configure gpio353 to enable rising interrupt and check events.
for example,

$ sudo -i
# echo 353 > /sys/class/gpio/export
# echo in > /sys/class/gpio/gpio353/direction
# echo rising > /sys/class/gpio/gpio353/edge
# cat /proc/interrupts | grep gpiolib

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.