Reputation: 120
Is it possible to configure a GPIO input that sets a flag when rising or falling edge is detected without interrupting the CPU? I can then check the status of the flag in the main superloop? There is an option in CubeMX to configure the GPIO mode as "External Event Mode with Rising/Falling edge trigger detection" but I'm not sure how to read the event flag. Is this the correct mode to achieve this?
Upvotes: 1
Views: 2640
Reputation: 1102
I'm not sure about the event mode (haven't used them before) but you could also use the
External Interrupt Mode with ...
as long as you don't activated the IRQ Handler in the NVIC the CPU is not interrupted by any pin change.
The information if an event/interrupt has occurred could be found in the EXTI_PR
register.
(See reference manual 12.3.6)
Upvotes: 3