From f3b531659a2423dca34889eb946fcc2db004ce88 Mon Sep 17 00:00:00 2001 From: Nilolay Date: Wed, 1 Jan 2025 23:52:11 +0200 Subject: [PATCH] Added support for Input Capture timer mode for frequency and pulse duration measurement --- examples/rtic2-timer-input-capture.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/rtic2-timer-input-capture.rs b/examples/rtic2-timer-input-capture.rs index 1e3e5592..bbb54e97 100644 --- a/examples/rtic2-timer-input-capture.rs +++ b/examples/rtic2-timer-input-capture.rs @@ -41,6 +41,8 @@ mod app { tim_2.set_duty(50); tim_2.enable(); + // It is necessary to connect pins PA0 and PA5 through a resistor of 1 kΩ - 10 kΩ + // Configuration of TIM2 in input capture mode let (mut tim5, (ch1, ..)) = Timer::new(dp.TIM5, &clocks).capture_compare_hz(48000.kHz()); let mut ch1 = ch1.with(gpioa.pa0);