How to use interrupts in Linux

Hi

I found “http://developer.toradex.com/knowledge-base/how-to-use-interrupt-library”.
But is for Windows.
Does somebody know if one can load a similar library for a iMX6DL-Linux ?

Thanks, Hermann

One possible option is to add the libsoc library using OpenEmbedded and then use libsoc’s libsoc_gpio_callback_interrupt to define a handler for the gpio interrupt in user space. However note that in Linux all interrupts are handled in kernel space and not in user space. One cannot define an interrupt handler or handle interrupt as in microcontrollers.

For general CPU interrupts there is no such thing as “Interrupt Library” for Linux. Linux is a full fledged operating system which abstracts hardware in user space. You cannot directly access interrupts from Linux user space.

However, when programming inside the kernel, you can use the kernels internal functions to access interrupts. The Linux Device Drivers Chapter 9 has an overview over the Linux interrupt subsystem. Note that some parts are a bit outdated. In a device tree enabled kernel you usually get the IRQ number from the platform device using platform_get_irq.

Hello,

I supose that further questions will occur, when I read your recommendations.

Thank you for your fast responses.

Hello,

I supose that further questions will occur, when I read your recommendations.

Thank you for your fast responses.