Skip to main content
john doe
Senior III
June 10, 2017
Question

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

  • June 10, 2017
  • 4 replies
  • 659 views
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.

    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    June 10, 2017
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    john doe
    john doeAuthor
    Senior III
    June 11, 2017
    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

    Tesla DeLorean
    Guru
    June 11, 2017
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Zt Liu
    Senior III
    June 11, 2017
    Posted on June 11, 2017 at 16:11

    Check this post

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