how to find corresponding GPIO PIN triggered in GPIO4_Combined_16_31_IRQHandler

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to find corresponding GPIO PIN triggered in GPIO4_Combined_16_31_IRQHandler

769 Views
jinu_mohan
Contributor I

Hi,

we are working on IMXRT1060 EVK in that we need to configure multiple interrupt in same port.

we are using GPIO PORT4 and GPIO_EMC_23,GPIO_EMC_24,GPIO_EMC_25,GPIO_EMC_26 

we are using this interrupt handler GPIO4_Combined_16_31_IRQHandler for execution..The exection of interrupt is running but we need to find which pin is triggering to generate interupt as we configured all for GPIO as interrupt pin in pinmuxing .

@Kerrie

0 Kudos
2 Replies

743 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @jinu_mohan ,

  Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.

  About the GPIO4_Combined_16_31_IRQHandler, it combines the GPIO4, pin16 to 31 as the same IRQ:

kerryzhou_0-1646018455465.png

So, when one of pin GPIO4 pin4-16 interrupt flag is set, it will trigger your GPIO4_Combined_16_31_IRQHandler.

And you want in this GPIO4_Combined_16_31_IRQHandler find which one is trigger this interrupt.

You can in the GPIO4_Combined_16_31_IRQHandler, check the GPIO_ISR, 

kerryzhou_1-1646018556208.png

Then you can determine which detail pin interrupt is triggered.

static inline uint32_t GPIO_PortGetInterruptFlags(GPIO_Type *base)
{
return base->ISR;
}

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

 

 

0 Kudos

760 Views
nickwallis
Senior Contributor I

Checking for a bit set in the ISR register will tell you which GPIO triggered the interrupt.

e.g.

if( (GPIO4->ISR & (1UL << 13)) )
{
.....
}
0 Kudos