Which Libre Boards support external GPIO interrupt?

I’m interested in using a libre board for some control tasks, I want to install a Quadrature Encoder and have the board run ISR routines on pin change interrupt to track position. On the Raspberry Pi this is fairly straightforward, does anyone know if this is possible on the Libre Boards and which ones would support it? The cheap board on Amazon appears to not support external interrupts.

Not sure what you mean by external interrupts but every board supports hardware based GPIO interrupts. Do you mean userspace access to interrupt assignment like with gpiomon?

Some platforms like the Amlogic one, only supports a single edge but all the other ones support all the normal interrupt variants.

I’m interested in this board: Libre Computer Board AML-S905X-CC (Le Potato)

I’m interested in writing a GPIO interrupt routine which gets triggered when the pin changes or goes high, etc. Based upon another thread it was said that GPIO ISR are disabled on these boards by default and it wasn’t clear if there was a straightforward way to enable them.

I basically want a C function to run when it gets triggered, updates a variable that another thread or process has access to which is running its own loop.

The Amlogic platforms, which Le Potato is part of, are currently limited to 1 edge: eg. you will get an error code from the kernel ABI when you try to set an IRQ that tracks both edges. Our engineering team is developing a workaround for this but it comes with limitations and some potential of missed interrupts. Our other platforms have no problems with any IRQ combination.

1 Like

Thanks, is there an example of using GPIO interrupts that I can reference? Preferably both in C and Python. I’m interested in C for speed.

libgpiod should have examples. You can look at the code for gpiomon, both the C version and the Python version.