gpio interrupts from user space

Just in case anyone found this useful, I was able to get GPIO interrupts working from user space (no custom driver / kernel module). I based the code on the jetson hacks GPIO tutorial

Although in this tutorial, they use a while loop to continually read from a GPIO pin to determine if the level on it has changed. With my method there is no need to consume a ton of CPU resources to determine if an input gpio has seen a rising or falling edge.

I used snippets from this stack overflow post
https://raspberrypi.stackexchange.com/questions/44416/polling-gpio-pin-from-c-always-getting-immediate-response
TX2_gpio.zip (5.57 KB)

1 Like

Good work, thanks for sharing.