Struct qei::QeiManager [−][src]
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]
impl<T, K> QeiManager<T> where
T: Qei<Count = K>,
K: Into<u16>,
pub fn new(qei: T) -> QeiManager<T>
[src]
pub fn new(qei: T) -> QeiManager<T>
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]
pub fn sample(&mut self) -> Result<(), SamplingError>
Take a new sample from the Qei and update the internal counter.
pub fn sample_unwrap(&mut self)
[src]
pub fn sample_unwrap(&mut self)
Take a new sample from the Qei and update the internal counter, unwrapping all errors.
pub fn count(&self) -> i64
[src]
pub fn count(&self) -> i64
Returns the internal counter value
Trait Implementations
impl<T: Debug> Debug for QeiManager<T>
[src]
impl<T: Debug> Debug for QeiManager<T>
Auto Trait Implementations
impl<T> Send for QeiManager<T> where
T: Send,
impl<T> Send for QeiManager<T> where
T: Send,
impl<T> Sync for QeiManager<T> where
T: Sync,
impl<T> Sync for QeiManager<T> where
T: Sync,