pub struct TimerCounter<TC> { /* private fields */ }
Expand description
A generic hardware timer counter.
The counters are exposed in 16-bit mode only.
The hardware allows configuring the 8-bit mode
and pairing up some instances to run in 32-bit
mode, but that functionality is not currently
exposed by this hal implementation.
TimerCounter implements both the Periodic
and
the CountDown
embedded_hal timer traits.
Before a hardware timer can be used, it must first
have a clock configured.
Implementations§
Source§impl<T> TimerCounter<T>where
T: AsyncCount16,
impl<T> TimerCounter<T>where
T: AsyncCount16,
Sourcepub fn into_future<I>(self, _irq: I) -> TimerFuture<T>
pub fn into_future<I>(self, _irq: I) -> TimerFuture<T>
Transform a TimerCounter
into an TimerFuture
Source§impl TimerCounter<Tc3>
impl TimerCounter<Tc3>
Sourcepub fn tc3_(clock: &Tcc2Tc3Clock, tc: Tc3, pm: &mut Pm) -> Self
pub fn tc3_(clock: &Tcc2Tc3Clock, tc: Tc3, pm: &mut Pm) -> Self
Configure this timer counter instance.
The clock is obtained from the GenericClockController
instance
and its frequency impacts the resolution and maximum range of
the timeout values that can be passed to the start
method.
Note that some hardware timer instances share the same clock
generator instance and thus will be clocked at the same rate.
Source§impl TimerCounter<Tc4>
impl TimerCounter<Tc4>
Sourcepub fn tc4_(clock: &Tc4Tc5Clock, tc: Tc4, pm: &mut Pm) -> Self
pub fn tc4_(clock: &Tc4Tc5Clock, tc: Tc4, pm: &mut Pm) -> Self
Configure this timer counter instance.
The clock is obtained from the GenericClockController
instance
and its frequency impacts the resolution and maximum range of
the timeout values that can be passed to the start
method.
Note that some hardware timer instances share the same clock
generator instance and thus will be clocked at the same rate.
Source§impl TimerCounter<Tc5>
impl TimerCounter<Tc5>
Sourcepub fn tc5_(clock: &Tc4Tc5Clock, tc: Tc5, pm: &mut Pm) -> Self
pub fn tc5_(clock: &Tc4Tc5Clock, tc: Tc5, pm: &mut Pm) -> Self
Configure this timer counter instance.
The clock is obtained from the GenericClockController
instance
and its frequency impacts the resolution and maximum range of
the timeout values that can be passed to the start
method.
Note that some hardware timer instances share the same clock
generator instance and thus will be clocked at the same rate.
Trait Implementations§
Source§impl<TC> InterruptDrivenTimer for TimerCounter<TC>where
TC: Count16,
impl<TC> InterruptDrivenTimer for TimerCounter<TC>where
TC: Count16,
Source§fn enable_interrupt(&mut self)
fn enable_interrupt(&mut self)
Enable the interrupt generation for this hardware timer. This method only sets the clock configuration to trigger the interrupt; it does not configure the interrupt controller or define an interrupt handler.
Source§fn disable_interrupt(&mut self)
fn disable_interrupt(&mut self)
Disables interrupt generation for this hardware timer. This method only sets the clock configuration to prevent triggering the interrupt; it does not configure the interrupt controller.