Help with EXT driver configuration Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

Help with EXT driver configuration

Post 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!
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Help with EXT driver configuration

Post 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
josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

Re: Help with EXT driver configuration

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Help with EXT driver configuration

Post by Giovanni »

Correct.

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

Giovanni
josesimoes
Posts: 91
Joined: Sat Feb 18, 2017 11:50 am
Has thanked: 43 times
Been thanked: 23 times

Re: Help with EXT driver configuration

Post by josesimoes »

Got it.
Thank you very much! :)
Post Reply