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!
已解决! 转到解答。
Hi @Elmi77 ,
Thanks you for your interest in the NXP MIMXRT product, I would like to provide service for you.
Yes, to the RT1010 GPIO1 interrupt, the IRQ is shared:
About how to check which detail pin in the 16 pin when GPIO1 interrupt happens.
You can check this register:
Check the ISR which flag is set, then you will know which detail pin interrupt happens.
Use this code to get the ISR, then check which pin is set in the interrupt handler:
Best Regards,
Kerry
Hi @Elmi77 ,
Thanks you for your interest in the NXP MIMXRT product, I would like to provide service for you.
Yes, to the RT1010 GPIO1 interrupt, the IRQ is shared:
About how to check which detail pin in the 16 pin when GPIO1 interrupt happens.
You can check this register:
Check the ISR which flag is set, then you will know which detail pin interrupt happens.
Use this code to get the ISR, then check which pin is set in the interrupt handler:
Best Regards,
Kerry