[][src]Struct qei::QeiManager

pub struct QeiManager<T> { /* fields omitted */ }

Extend a Qei peripherals by tracking overflows and underflows.

Methods

impl<T, K> QeiManager<T> where
    T: Qei<Count = K>,
    K: Into<u16>, 
[src]

pub fn new(qei: T) -> QeiManager<T>[src]

Create a new Qei from an existing one. The implemntation assume that the counter can't change for more than (2^16-1)/2, because otherwise we can't detect overflows/underflows

pub fn sample(&mut self) -> Result<(), SamplingError>[src]

Take a new sample from the Qei and update the internal counter.

pub fn sample_unwrap(&mut self)[src]

Take a new sample from the Qei and update the internal counter, unwrapping all errors.

pub fn count(&self) -> i64[src]

Returns the internal counter value

pub fn reset(&mut self)[src]

Resets the internal counter

Trait Implementations

impl<T: Debug> Debug for QeiManager<T>[src]

Auto Trait Implementations

impl<T> Send for QeiManager<T> where
    T: Send

impl<T> Sync for QeiManager<T> where
    T: Sync

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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.

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

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

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