Skip to main content
IJoe.1
Associate II
Sep 4, 2021 3:29 PM UTC
Question

How to know if Input Capture interrupt routine was called due to Falling or Rising edge, when both are enabled.

Good day to everybody,

In certain STM32 MCUs input capture can be defined for both falling and rising edge.

0693W00000DmC0uQAF.pngIn such cases, how to know if the input capture interrupt routine was called due to a falling or a rising edge? Is there a way to know?

This topic has been closed for replies.

1 reply

waclawek.jan
Super User
Sep 4, 2021 3:48 PM UTC

There's no direct way.

But you can simply read the current state of given pin from respective GPIO_IDR, If you know that the input signal won't change too fast.

JW