Module capture

Module capture 

Source
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 CaptureChannels 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.

Re-exports§

pub use super::Ch;
pub use super::C1;
pub use super::C2;
pub use super::C3;
pub use super::C4;

Structs§

CaptureChannel
CaptureChannelDisabled
CaptureErasedChannel
CaptureHzManager

Traits§

CaptureExt