Struct qei::QeiManager
source · pub struct QeiManager<T> { /* private fields */ }
Expand description
Extend a Qei peripherals by tracking overflows and underflows.
Implementations§
source§impl<T, K> QeiManager<T>where
T: Qei<Count = K>,
K: Into<u16>,
impl<T, K> QeiManager<T>where
T: Qei<Count = K>,
K: Into<u16>,
sourcepub fn new(qei: T) -> QeiManager<T>
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
sourcepub fn sample(&mut self) -> Result<(), SamplingError>
pub fn sample(&mut self) -> Result<(), SamplingError>
Take a new sample from the Qei and update the internal counter.
sourcepub fn sample_unwrap(&mut self)
pub fn sample_unwrap(&mut self)
Take a new sample from the Qei and update the internal counter, unwrapping all errors.