Struct rotary_encoder_embedded::RotaryEncoder[][src]

pub struct RotaryEncoder<DT, CLK> { /* fields omitted */ }

Rotary Encoder

Implementations

impl<DT, CLK> RotaryEncoder<DT, CLK> where
    DT: InputPin,
    CLK: InputPin
[src]

pub fn new(pin_dt: DT, pin_clk: CLK) -> Self[src]

Initiates a new Rotary Encoder, taking two InputPins InputPin.

pub fn set_sensitivity(&mut self, sensitivity: Sensitivity)[src]

Set the sensitivity of the rotary encoder

pub fn borrow_pins(&mut self) -> (&mut DT, &mut CLK)[src]

Borrow a mutable reference to the underlying InputPins. This is useful for clearing hardware interrupts.

pub fn release(self) -> (DT, CLK)[src]

Release the underying resources such as the InputPins back to the initiator

pub fn update(&mut self)[src]

Update the state machine of the RotaryEncoder. This should be called ideally from an interrupt vector when either the DT or CLK pins state changes. This function will update the RotaryEncoder’s Direction

pub fn direction(&self) -> Direction[src]

Returns the current Direction of the RotaryEncoder

Auto Trait Implementations

impl<DT, CLK> Send for RotaryEncoder<DT, CLK> where
    CLK: Send,
    DT: Send

impl<DT, CLK> Sync for RotaryEncoder<DT, CLK> where
    CLK: Sync,
    DT: Sync

impl<DT, CLK> Unpin for RotaryEncoder<DT, CLK> where
    CLK: Unpin,
    DT: 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.