Expand description
Provides the core functionality of the Input Capture mode.
The main way to enable the Input Capture mode is by calling
Timer::new(dp.TIM5, &clocks).capture_hz(24.MHz());
In the capture_hz
method, the desired timer counter frequency is specified.
For high accuracy, it is recommended to use 32-bit timers (TIM2, TIM5) and to select the highest possible frequency, ideally the maximum frequency equal to the timer’s clock frequency.
This returns a CaptureHzManager
and a tuple of all CaptureChannel
s supported by the timer. Additionally, the CaptureExt
trait is implemented for pac::TIMx
to simplify the creation of a new structure.
let (cc_manager, (cc_ch1, cc_ch2, ...)) = dp.TIM5.capture_hz(24.MHz(), &clocks);
To enable a CaptureChannel
, you need to pass one or more valid pins supported by the channel using the with
method.
CaptureHzManager
also provides additional methods for managing the Input Capture mode, such as set_prescaler
and set_filter
.