2016-11-13 01:37 AM
I'm using stm32f4discovery to study exti,
I can use exti interrupt mode to get button trigger,but I have no idea what's the event mode,I only know event mode will not triger interrupt,so I do not declare NVIC function and use blow code to get event, but no work,so how can I use exti event mode ?if(EXTI_GetFlagStatus(EXTI_LineX) != RESET){ if(EXTI_GetITStatus(EXTI_LineX) != RESET){ EXTI_ClearFlag(EXTI_Line5); do_something(xxxxxx); }}
#exti-event2016-11-13 05:38 AM
Pretty sure EXTI_GetITStatus(EXTI_LineX) is extraneous.
2016-11-14 01:57 AM
Hi ctc.ctc,
To configure the EXTI on the bottom pin PA0 you should connect it to EXTI Line 0 as the SYSCFG_EXTICR1 register indicate in reference manual .To be eable to receive the interrupt/event on the EXTI0 when pushing the buttom, you should proceed like the following:- Enable clock for both Pin Port (Port A) and SYSCFG peripheral- Configure the pin (PA0) as input- Connect EXTI Line0 to PA0 pin through configuring the indicated SYSCFG register- Configure EXTI Line0 in interrupt mode and rising/ falling or both edge sensitive.- Configure and enable EXTI Line0 , set it to lowest priority through NVIC register.Since you are using Standard library, I recommend that you refer to the example ''EXTI_Example'' in , which shows how to configure external interrupt lines. In this example, 2 EXTI lines (EXTI Line0 and Line15) are configured to generate an interrupt on each rising and falling edge, respectively. Example is at this path:STM32F4xx_DSP_StdPeriph_Lib_V1.7.1\Project\STM32F4xx_StdPeriph_Examples\EXTI\EXTI_ExampleYou can use either the library wich is a HAL library for All STM32 devices.-Hannibal-