Hi,
I'm developing a bare-metal application on a MIMX1010-EVK board. Now I have implemented a functionality to raise an interrupt whenever a falling or a rising edge occurs on a GPI. This is the ISR generated by MCUXpresso which works properly:
/* GPIO1_Combined_0_15_IRQn interrupt handler */
void GPIO1_GPIO_COMB_0_15_IRQHANDLER(void)
{
uint32_t pins_flags = GPIO_GetPinsInterruptFlags(GPIO1);
/* Place your interrupt code here */
/* Clear ins flags */
GPIO_ClearPinsInterruptFlags(GPIO1, pins_flags);
/* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F
Store immediate overlapping exception return operation might vector to incorrect interrupt. */
#if defined __CORTEX_M && (__CORTEX_M == 4U)
__DSB();
#endif
}
The point is, this ISR is used for all GPIs from 0 to 15. Now when I have more than one GPI bound to this interrupt - how can I find out which one has caused the IRQ?
Reading the current state of an GPI does not help as the interrupt happens on a rising or falling edge but not on an input level 0 or 1.
So how can one find the source GPI of the interrupt?
Thanks!