[−][src]Struct pygamer::timer::TimerCounter
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
impl TimerCounter<TC2>
[src]
pub fn tc2_(clock: &Tc2Tc3Clock, tc: TC2, mclk: &mut MCLK) -> TimerCounter<TC2>
[src]
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.
impl TimerCounter<TC3>
[src]
pub fn tc3_(clock: &Tc2Tc3Clock, tc: TC3, mclk: &mut MCLK) -> TimerCounter<TC3>
[src]
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.
impl TimerCounter<TC4>
[src]
pub fn tc4_(clock: &Tc4Tc5Clock, tc: TC4, mclk: &mut MCLK) -> TimerCounter<TC4>
[src]
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.
impl TimerCounter<TC5>
[src]
pub fn tc5_(clock: &Tc4Tc5Clock, tc: TC5, mclk: &mut MCLK) -> TimerCounter<TC5>
[src]
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
impl<TC> CountDown for TimerCounter<TC> where
TC: Count16,
[src]
TC: Count16,
type Time = Microseconds
The unit of time used by this timer
fn start<T>(&mut self, timeout: T) where
T: Into<<TimerCounter<TC> as CountDown>::Time>,
[src]
T: Into<<TimerCounter<TC> as CountDown>::Time>,
fn wait(&mut self) -> Result<(), Error<Void>>
[src]
impl<TC> InterruptDrivenTimer for TimerCounter<TC> where
TC: Count16,
[src]
TC: Count16,
fn enable_interrupt(&mut self)
[src]
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.
fn disable_interrupt(&mut self)
[src]
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.
impl<TC> Periodic for TimerCounter<TC>
[src]
Auto Trait Implementations
impl<TC> Send for TimerCounter<TC> where
TC: Send,
TC: Send,
impl<TC> Sync for TimerCounter<TC> where
TC: Sync,
TC: Sync,
impl<TC> Unpin for TimerCounter<TC> where
TC: Unpin,
TC: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,