Struct rotary_encoder_embedded::RotaryEncoder
source · [−]pub struct RotaryEncoder<DT, CLK> { /* private fields */ }
Expand description
Rotary Encoder
Implementations
sourceimpl<DT, CLK> RotaryEncoder<DT, CLK> where
DT: InputPin,
CLK: InputPin,
impl<DT, CLK> RotaryEncoder<DT, CLK> where
DT: InputPin,
CLK: InputPin,
sourcepub fn new(pin_dt: DT, pin_clk: CLK) -> Self
pub fn new(pin_dt: DT, pin_clk: CLK) -> Self
Initiates a new Rotary Encoder, taking two InputPins InputPin
.
sourcepub fn set_sensitivity(&mut self, sensitivity: Sensitivity)
pub fn set_sensitivity(&mut self, sensitivity: Sensitivity)
Set the sensitivity of the rotary encoder
sourcepub fn borrow_pins(&mut self) -> (&mut DT, &mut CLK)
pub fn borrow_pins(&mut self) -> (&mut DT, &mut CLK)
Borrow a mutable reference to the underlying InputPins. This is useful for clearing hardware interrupts.
sourcepub fn release(self) -> (DT, CLK)
pub fn release(self) -> (DT, CLK)
Release the underying resources such as the InputPins back to the initiator
Auto Trait Implementations
impl<DT, CLK> RefUnwindSafe for RotaryEncoder<DT, CLK> where
CLK: RefUnwindSafe,
DT: RefUnwindSafe,
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,
impl<DT, CLK> UnwindSafe for RotaryEncoder<DT, CLK> where
CLK: UnwindSafe,
DT: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more