[−][src]Struct rotary_encoder_hal::Rotary
Holds current/old state and both InputPin
Implementations
impl<A, B> Rotary<A, B> where
A: InputPin,
B: InputPin,
[src]
A: InputPin,
B: InputPin,
pub fn new(pin_a: A, pin_b: B) -> Self
[src]
Accepts two InputPin
s, 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]
pub fn clone(&self) -> Rotary<A, B>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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]
pub fn eq(&self, other: &Rotary<A, B>) -> bool
[src]
pub fn ne(&self, other: &Rotary<A, B>) -> bool
[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,
A: Send,
B: Send,
impl<A, B> Sync for Rotary<A, B> where
A: Sync,
B: Sync,
A: Sync,
B: Sync,
impl<A, B> Unpin for Rotary<A, B> where
A: Unpin,
B: Unpin,
A: Unpin,
B: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,