Hello,
With LPC54628, looking into GPIO interrupt functionality, found that only way to use GPIO as an interrupt is either GINT or PINT. And, it works only for port 0 and 1. Correct me if I am wrong.
Anyway, as with PINT it is possible only 8 pins to use as pin interrupt at a time, I switched to GINT. I am able to get interrupt with port(port 0 for example), but could not able to get which pin (pin 5 of port 0 for example) of the port generating the interrupt. Checked into documents but could not found any status register to read pin which is interrupted.
Is it possible to get pin number which is being interrupted with GINT.? Or any other method which can be used for GPIO interrupt.?
Thanks.
Dear Rahul,
I will try to answer your questions the best I can.
With LPC54628, looking into GPIO interrupt functionality, found that only way to use GPIO as an interrupt is either GINT or PINT. And, it works only for port 0 and 1. Correct me if I am wrong.
Yes, that's correct.
Is it possible to get pin number which is being interrupted with GINT.? Or any other method which can be used for GPIO interrupt.?
You could check the logic state of the pin to check which one is enabled. For this I will suggest to check the lpcxpresso54628_gpio_led_output from the SDK.
You can donwload the SDK from the following link: Welcome | MCUXpresso SDK Builder
Let me know if this helps you.
Best Regards,
Alexis Andalon
Dear Alexis,
Your suggestion works fine to identify the pin.
Thanks.
Dear Alexis,
Regarding your suggestion, I thought the same but I do have some confusion.
You could check the logic state of the pin to check which one is enabled. For this I will suggest to check the lpcxpresso54628_gpio_led_output from the SDK.
-> Reading pin state on interrupt event in ISR how efficient is it? If Pin state can get changed before we read the state, cannot it be possible?
If I am having used multiple pins configured as an interrupt with different logic level transition (high to low or low to high), would not it will be difficult to identify actual pin by reading their states.
Hope you will understand what I am trying to elaborate.
Thanks,
Rahul Patel.