Page 1 of 1

Help with EXT driver configuration

Posted: Thu Aug 17, 2017 3:35 pm
by josesimoes
Hi,

I'm trying to use (and understand :) ) how to use the EXT driver and setup the configuration.
I can see a call to the interrupt callback when I use this and hit PA0:

Code: Select all

static EXTConfig extInterruptsConfiguration = {
  {
    {EXT_CH_MODE_BOTH_EDGES | EXT_MODE_GPIOA , extInterruptCallback},
...
  }
};


or this and then I hit PC0:

Code: Select all

static EXTConfig extInterruptsConfiguration = {
  {
    {EXT_CH_MODE_BOTH_EDGES | EXT_MODE_GPIOC , extInterruptCallback},
...
  }
};


but it seems that I can't use this because now it only reacts to PC0:

Code: Select all

static EXTConfig extInterruptsConfiguration = {
  {
    {EXT_CH_MODE_BOTH_EDGES | EXT_MODE_GPIOA | EXT_MODE_GPI0C , extInterruptCallback},
...
  }
};


Could you please help me understand how to properly configure this?

Can't I have channel 0 reacting to all Pn0 pins, channel 3 reacting to all Pn3 pins, etc?

Thanks!

Re: Help with EXT driver configuration

Posted: Thu Aug 17, 2017 3:37 pm
by Giovanni
Hi,

On STM32 you cannot have the same bit used on different ports, you can use bit 0 on GPIOA or GPIOC but not both. See how the EXTI unit is wired in the STM32 Reference Manual.

Giovanni

Re: Help with EXT driver configuration

Posted: Thu Aug 17, 2017 3:43 pm
by josesimoes
I was exactly looking at the ETXI diagram there and was under the impression that ETXI0 could be triggered for all Pn0...
Which is wrong according to you explanation. So ETXI0 can only react to one of the existing Pn0s. Is that it?

Re: Help with EXT driver configuration

Posted: Thu Aug 17, 2017 3:46 pm
by Giovanni
Correct.

Those EXT_MODE_GPIOx constants are not meant to be ORed, it is selector in the PINx mux.

Giovanni

Re: Help with EXT driver configuration

Posted: Thu Aug 17, 2017 3:52 pm
by josesimoes
Got it.
Thank you very much! :)