AnsweredAssumed Answered

Discerning Rising and Falling Trigger Edges in HAL_GPIO_EXTI_Callback()

Question asked by Stephen on May 3, 2016
Latest reply on May 3, 2016 by FTITI.Walid

I have a digital input GPIO line where I need an interrupt whenever its input changes. In STM32CubeMX I set this pin to an EXTI line and set the interrupt to trigger on both rising and falling edges.

When, in response to either a rising or falling edge the function HAL_GPIO_EXTI_Callback() is called, is there a way to know whether it was a rising or falling edge that triggered the interrupt? Or will it be necessary to call HAL_GPIO_ReadPin() to infer this?

The prototype of the callback is:
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin);
What number is the GPIO_Pin parameter set to? Is this the same number I see in STM32CubeMX that follows "GPIO_EXTI" when selecting an alternative function for a pin? If so, since this number seems to be same as a pin number within a pin group, if there needs to be such an interrupt for the same pin number in two different groups, is there a way to know the pin's group's letter that triggered the interrupt?

What is the difference between and External Event and an External Interrupt?