e310x-hal icon indicating copy to clipboard operation
e310x-hal copied to clipboard

How to assign interrupt handlers to GPIOs

Open romancardenas opened this issue 3 years ago • 0 comments

I've been studying the riscv-rt, e310x and e310x-hal crates for a while, and I'm currently exploring different interruption modes. As far as I know, riscv-rt leaves you the MachineExternal function for dealing with all the machine external interrupts. The e310x crate allows you to define specific interrupt handlers for each interrupt source (e.g., a GPIO) with the interrupt macro. However, I don't see a clear connection between MachineExternal and these functions (I mean, which part of the code does the trick to identify the source and call the proper interrupt handler if exists).

I managed to catch GPIO interruptions by defining a common MachineExternal function and analyzing the interrupt source, but I wonder if it's possible to define custom handlers for a given GPIO using the interrupt macro and forget about the MachineExternal common handler.

romancardenas avatar Nov 18 '22 09:11 romancardenas