[][src]Struct rotary_encoder_hal::Rotary

pub struct Rotary<A, B> { /* fields omitted */ }

Holds current/old state and both InputPin

Implementations

impl<A, B> Rotary<A, B> where
    A: InputPin,
    B: InputPin
[src]

pub fn new(pin_a: A, pin_b: B) -> Self[src]

Accepts two InputPins, these will be read on every update()

pub fn update(&mut self) -> Result<Direction, Either<A::Error, B::Error>>[src]

Call update to evaluate the next state of the encoder, propagates errors from InputPin read

pub fn pin_a(&mut self) -> &mut A[src]

Returns a reference to the first pin. Can be used to clear interrupt.

pub fn pin_b(&mut self) -> &mut B[src]

Returns a reference to the second pin. Can be used to clear interrupt.

Trait Implementations

impl<A: Clone, B: Clone> Clone for Rotary<A, B>[src]

impl<A: Debug, B: Debug> Debug for Rotary<A, B>[src]

impl<A: Eq, B: Eq> Eq for Rotary<A, B>[src]

impl<A: PartialEq, B: PartialEq> PartialEq<Rotary<A, B>> for Rotary<A, B>[src]

impl<A, B> StructuralEq for Rotary<A, B>[src]

impl<A, B> StructuralPartialEq for Rotary<A, B>[src]

Auto Trait Implementations

impl<A, B> Send for Rotary<A, B> where
    A: Send,
    B: Send

impl<A, B> Sync for Rotary<A, B> where
    A: Sync,
    B: Sync

impl<A, B> Unpin for Rotary<A, B> where
    A: Unpin,
    B: 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, 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.