cancel
Showing results for 
Search instead for 
Did you mean: 

Port from GPIO_PIN_#, or how to tell pins apart in a callback?

john doe
Lead
Posted on June 10, 2017 at 21:18

Let us say for the purposes of discussion that I have external interrupts on PA08 and PB08. The callback is passed a pin address. How do I tell them apart if they're both the same pin number on different ports? Or does this just not come up and its a bit fumbling amateur question.

4 REPLIES 4
Posted on June 10, 2017 at 21:32

The EXTI implementations I'm aware of permit only one pin 8 (Px8) input at a time

You might be able to create a similar effect with a TIM using input-capture.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 11, 2017 at 00:02

ok, so we'll chalk this one up to an stm32 hardware limitation regarding its nvic and/or timer/counter implementation

Zt Liu
Senior III
Posted on June 11, 2017 at 16:11

Check this post

https://community.st.com/0D50X00009XkXsnSAF

Posted on June 11, 2017 at 16:17

In this case specifically the EXTI and the gating of pin sources.

Like I said External Interrupts, in the classical sense, can also be implemented via TIMx_CHx inputs. The hardware time-stamp allows for a determination of which fired first, and also accurate understanding of placement with indeterminate latency of the interrupt(s).

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..