Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以配置一个 GPIO 输入,在检测到上升沿或下降沿时设置一个标志而不中断 CPU?然后我可以检查主超级循环中标志的状态吗?CubeMX 中有一个选项可以将 GPIO 模式配置为“具有上升/下降沿触发检测的外部事件模式”,但我不确定如何读取事件标志。这是实现这一目标的正确模式吗?
我不确定事件模式(以前没有使用过),但 External Interrupt Mode with ...只要你没有激活 NVIC 中的 IRQ 处理程序,CPU 就不会被任何引脚更改中断。
External Interrupt Mode with ...
EXTI_PR可以在寄存器中找到是否发生事件/中断的信息。(参见参考手册 12.3.6)
EXTI_PR