EXTI_Mode_Event
时间: 2023-08-05 10:04:35 浏览: 88
EXTI_Mode_Event 是一个枚举类型,用于描述外部中断(External Interrupt)的触发模式。它有以下几个取值:
1. EXTI_Mode_Interrupt:中断模式,中断触发时会跳转到中断服务程序。
2. EXTI_Mode_Event:事件模式,中断触发时不会跳转到中断服务程序,只是触发一个事件,在程序中可以通过查询事件状态来判断是否触发了中断。
3. EXTI_Mode_Interrupt_Event:中断/事件模式,即同时支持中断和事件模式,中断触发时会跳转到中断服务程序,事件触发时不会跳转到中断服务程序,只是触发一个事件,在程序中可以通过查询事件状态来判断是否触发了中断。
相关问题
EXTI_Mode_Interrupt 和事件 EXTI_Mode_Event
EXTI_Mode_Interrupt 和事件 EXTI_Mode_Event 是 STM32 的外部中断模式,其中 EXTI_Mode_Interrupt 是中断触发模式,而 EXTI_Mode_Event 是事件触发模式。在 EXTI_Mode_Interrupt 模式下,当外部信号符合中断事件要求时,会触发中断响应函数执行相应操作;而在 EXTI_Mode_Event 模式下,当外部信号符合事件要求时,会触发事件响应函数执行相应操作。
代码什么意思: if(SLEEP == LOW_POWER_MODE) { printf("Enter Sleep mode\r\n"); if(WFI_INT == WAKEUP_MODE) { __WFI(); printf("WFI exti\r\n"); } else { __WFE(); printf("WFE exti\r\n"); } }
这段代码的意思是,如果当前的模式是低功耗模式(LOW_POWER_MODE),则将输出 "Enter Sleep mode",然后检查触发唤醒模式的外部中断(WFI_INT)是否被触发。如果是,则执行等待时钟(Wait for Interrupt)指令 (__WFI()),并输出 "WFI exti";如果不是,则执行等待事件(Wait for Event)指令 (__WFE()),并输出 "WFE exti"。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![apk](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)