I want to write a program to read a status of a GPIO pin (whether it is high or not) specifically using c++. I know that I have to export it by writing a value in sys/class/gpio and then set its direction as "in". Now I am confused on how to access the interrupt generated on a GPIO pin and do some action in my code with respect to that input.. I dont want to use any custom made library functions. Thank you.
Asked
Active
Viewed 887 times
0
-
Please refer the links http://www.linux.com/learn/tutorials/765810-beaglebone-black-how-to-get-interrupts-through-linux-gpio and https://www.kernel.org/doc/Documentation/gpio/sysfs.txt If you plan to get access to ISR or go further lower level you will have to do the same using a kernel module. – Prajosh Premdas Feb 24 '15 at 15:47
-
possible duplicate of [Notify gpio interrupt to user space from a kernel module](http://stackoverflow.com/questions/19820177/notify-gpio-interrupt-to-user-space-from-a-kernel-module) – Prajosh Premdas Feb 24 '15 at 15:56
-
Yes, indeed it is a duplicate. That target question shouldn't be closed - there are multiple options, but it has not degenerated into an opinionated debate. – Chris Stratton Feb 24 '15 at 16:28