EXT driver - same pins on different GPIO ports

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

Moderator: RoccoMarco

Post Reply
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

EXT driver - same pins on different GPIO ports

Post by DeusExMachina »

I have 2 buttons on GPIO A and C on port 3
And I want to use an IRQ on both of them

Code: Select all

static const EXTConfig extcfg = {
  {
    {EXT_CH_MODE_DISABLED, NULL},   
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_BOTH_EDGES | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOA | EXT_MODE_GPIOC, extcb1},   
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL},
    {EXT_CH_MODE_DISABLED, NULL}
  }
};

How can I distinguish interrupt source (Port A or Port C) in callback function? Can I use 2 callbacks for Port A and PortC (it will be more convinient).
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: EXT driver - same pins on different GPIO ports

Post by Tectu »

The STM32 does not allow to use an external interrupt on the same pin but on different ports. You can only use one interrupt per pin, but not depending on which port.


~ Tectu
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: EXT driver - same pins on different GPIO ports

Post by DeusExMachina »

thank you
Post Reply