Hi,
Check this out: GitHub - valentis/jetson-nano-gpio-example: C code example for using the GPIO Pins of NVIDIA Jetson Nano by memory mapping.
You can add your gpio here: jetson-nano-gpio-example/gpionano.h at master · valentis/jetson-nano-gpio-example · GitHub
and take reference of this file to develop your usecase: jetson-nano-gpio-example/switch.cpp at master · valentis/jetson-nano-gpio-example · GitHub
Here, you directly read/write through /dev/mem which is faster.
Thanks,
Shubhi