2015-08-02 02:46 PM
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.
2015-08-02 03:18 PM
EXTI_PinSourceX is an INDEX, you can't OR them together like that. Either do each individually, or iterate in a loop.