cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 configuring exti port interrupt at one function

cnrabdullah
Associate II
Posted on August 02, 2015 at 23:46

I configured `gpio` and `exti` handler configurations for 8 pins `(PD8,PD9...PD15)` each has separate configuration functions and it's working well. Can i do the configurations at just one function? Some lines uses same irq channel, is that a problem? I want to use it like this (syntax is not important i eliminated some columns i used, you can just say its possible)

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 |
GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15); 
GPIO_Init(GPIOD, &GPIO_InitStructure);
SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOD,EXTI_PinSource8 | EXTI_PinSource9| 
EXTI_PinSource10| EXTI_PinSource11| 
EXTI_PinSource12| EXTI_PinSource13| 
EXTI_PinSource14| EXTI_PinSource15);
/* Configure EXTI Line0 */
EXTI_InitStructure.EXTI_Line = EXTI_Line15;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_Init(&EXTI_InitStructure);
Edit: I know and tried this code is not working. But just wanted to tell what i mean, so maybe you suggest me a way.

1 REPLY 1
Posted on August 03, 2015 at 00:18

EXTI_PinSourceX is an INDEX, you can't OR them together like that. Either do each individually, or iterate in a loop.

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