Struct imxrt_hal::pit::PIT[][src]

pub struct PIT<Chan> { /* fields omitted */ }

A periodic interrupt timer (PIT)

Implementations

impl<Chan: Channel> PIT<Chan>[src]

pub fn clock_period(&self) -> Duration[src]

Returns the period of the clock ticks. This is the inverse of the clock frequency

pub fn time<F: FnMut() -> R, R>(&mut self, act: F) -> (R, Option<Duration>)[src]

Measure the execution duration of act with this timer. Returns the duration of the action, or None if the timer expired before the action completed.

time will measure the difference of counts in a 32 bit register. The counter changes every clock period. The clock accuracy is based on our ability to round integers. Consider choosing the input clock frequency and prescalars to define a clock that can accurately measure your workloads.

The method will disable any interrupts that this timer has enabled. It will also reset the timer to execute this measurement.

If you need a 64 bit timer, use the chain function to combine timer 0 and timer 1. The two can crate the ‘lifetime’ timer, which is capable of measuring larger intervals.

pub fn set_interrupt_enable(&mut self, interrupt: bool)[src]

Enable the timer to trigger an interrupt when the timer expires

pub fn interrupt_enable(&self) -> bool[src]

Returns true if the timer will trigger an interrupt when it expires.

Trait Implementations

impl<Chan: Channel> CountDown for PIT<Chan>[src]

type Time = Duration

The unit of time used by this timer

impl<Chan: Channel> Periodic for PIT<Chan>[src]

Auto Trait Implementations

impl<Chan> Send for PIT<Chan> where
    Chan: Send

impl<Chan> Sync for PIT<Chan> where
    Chan: Sync

impl<Chan> Unpin for PIT<Chan> where
    Chan: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.