pub struct RotaryEncoder { /* private fields */ }
Expand description
Encoder struct with internal states.
Implementations§
Source§impl RotaryEncoder
impl RotaryEncoder
Sourcepub fn update<T: Into<bool>>(
&mut self,
input_a: T,
input_b: T,
tick: Option<u64>,
pulse_divider: i32,
) -> Option<RotaryEncoderEvent>
pub fn update<T: Into<bool>>( &mut self, input_a: T, input_b: T, tick: Option<u64>, pulse_divider: i32, ) -> Option<RotaryEncoderEvent>
Updates the processor and returns an event if a movement is detected.
input_a
andinput_b
are the signals of the encoder pins.tick
is a monotonic value from the system clock used for velocity calculation.pulse_divider
determines how many pulses must occur before an event is generated.
Trait Implementations§
Source§impl Debug for RotaryEncoder
impl Debug for RotaryEncoder
Source§impl Default for RotaryEncoder
impl Default for RotaryEncoder
Source§fn default() -> RotaryEncoder
fn default() -> RotaryEncoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RotaryEncoder
impl RefUnwindSafe for RotaryEncoder
impl Send for RotaryEncoder
impl Sync for RotaryEncoder
impl Unpin for RotaryEncoder
impl UnwindSafe for RotaryEncoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more