pub struct QeiManager<T> { /* private fields */ }
Expand description
Extend a Qei peripherals by tracking overflows and underflows.
Implementations§
Source§impl<T, K> QeiManager<T>
impl<T, K> QeiManager<T>
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.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for QeiManager<T>where
T: Freeze,
impl<T> RefUnwindSafe for QeiManager<T>where
T: RefUnwindSafe,
impl<T> Send for QeiManager<T>where
T: Send,
impl<T> Sync for QeiManager<T>where
T: Sync,
impl<T> Unpin for QeiManager<T>where
T: Unpin,
impl<T> UnwindSafe for QeiManager<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more