Hi Diego,
You can receive as many interrupts as pins you have available, the thing is that the handler will be the same.
What you have to do is call the function int32_t GPIO_GetPinsInterruptFlags(GPIO_Type *base) inside the IRQHandler.
This function will give you the current GPIO port interrupt status flag, for example, 0x00010001 means pin 0 and 17 have the interrupt.
Then, depending on the value PORTx_ISFR you can set flags according to your needs.
Please take the following IRQHandler as an example:
void BOARD_SW_IRQ_HANDLER(void)
{
interruptflag = GPIO_GetPinsInterruptFlags(BOARD_SW_GPIO);
if(0x10 == interruptflag)
g_ButtonSW3Press = true;
if(0x20 == interruptflag)
g_ButtonSW4Press = true;
GPIO_ClearPinsInterruptFlags(BOARD_SW_GPIO, 1U << BOARD_SW3_GPIO_PIN);
GPIO_ClearPinsInterruptFlags(BOARD_SW_GPIO, 1U << BOARD_SW4_GPIO_PIN);
}
I hope it helps.
Best regards,
Felipe
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------