I'm using a C++ library (easyBlack) to handle GPIO through /dev/mem.
As I have seen in the chapter "25.3.3 Interrupt Features" of "AM335x SitaraTM Processors - Technical Reference Manual"
In order to generate an interrupt request to a host processor upon a defined event (level or logic transition) occurring on a GPIO pin, the GPIO configuration registers have to be programmed as follows:
• Interrupts for the GPIO channel must be enabled in the GPIO_IRQSTATUS_SET_0 and/or GPIO_IRQSTATUS_SET_1 registers.
• The expected event(s) on input GPIO to trigger the interrupt request has to be selected in the GPIO_LEVELDETECT0, GPIO_LEVELDETECT1, GPIO_RISINGDETECT, and GPIO_FALLINGDETECT registers.
Until there all right, but all the documentation I can find is based using linux kernel header files ("linux/gpio.h" and "linux/interrupt.h"), and it seems that can not be used for user space programs, only in modules. Or examples that use the kernel drivers and watches a state file in the sysfs to implement the interrupt. That may work, but is slow and need a lot of resources.
Is there any other alternative other than to work with multi-thread to see if changing the values of the desired pins? (How does this other library - github.com/jackmitch/libsoc)
Maybe compile easyBlack as a kernel module?
Thanks!