Struct rotary_encoder_embedded::RotaryEncoder [−][src]
Rotary Encoder
Implementations
impl<DT, CLK> RotaryEncoder<DT, CLK> where
DT: InputPin,
CLK: InputPin,
[src]
DT: InputPin,
CLK: InputPin,
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,
CLK: Send,
DT: Send,
impl<DT, CLK> Sync for RotaryEncoder<DT, CLK> where
CLK: Sync,
DT: Sync,
CLK: Sync,
DT: Sync,
impl<DT, CLK> Unpin for RotaryEncoder<DT, CLK> where
CLK: Unpin,
DT: Unpin,
CLK: Unpin,
DT: 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>,