pub struct EncoderData {
pub encoder_value: i32,
pub encoder_options: u8,
pub channel_a_pin: u8,
pub channel_b_pin: u8,
pub dir_a_key_code: u8,
pub dir_a_key_modifier: u8,
pub dir_b_key_code: u8,
pub dir_b_key_modifier: u8,
}Expand description
Encoder data structure containing all encoder state and configuration
Fields§
§encoder_value: i32Current encoder value (32-bit signed)
encoder_options: u8Encoder configuration options
channel_a_pin: u8Channel A input pin (0-54)
channel_b_pin: u8Channel B input pin (0-54)
dir_a_key_code: u8Direction A key code for keyboard mapping
dir_a_key_modifier: u8Direction A key modifier for keyboard mapping
dir_b_key_code: u8Direction B key code for keyboard mapping
dir_b_key_modifier: u8Direction B key modifier for keyboard mapping
Implementations§
Source§impl EncoderData
impl EncoderData
Sourcepub fn get_options(&self) -> EncoderOptions
pub fn get_options(&self) -> EncoderOptions
Get encoder options as structured data
Sourcepub fn set_options(&mut self, options: EncoderOptions)
pub fn set_options(&mut self, options: EncoderOptions)
Set encoder options from structured data
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if encoder is enabled
Sourcepub fn is_4x_sampling(&self) -> bool
pub fn is_4x_sampling(&self) -> bool
Check if 4x sampling is enabled
Sourcepub fn is_2x_sampling(&self) -> bool
pub fn is_2x_sampling(&self) -> bool
Check if 2x sampling is enabled
Sourcepub fn sampling_mode_str(&self) -> &'static str
pub fn sampling_mode_str(&self) -> &'static str
Get sampling mode as string for debugging
Trait Implementations§
Source§impl Clone for EncoderData
impl Clone for EncoderData
Source§fn clone(&self) -> EncoderData
fn clone(&self) -> EncoderData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncoderData
impl Debug for EncoderData
Source§impl Default for EncoderData
impl Default for EncoderData
Source§impl<'de> Deserialize<'de> for EncoderData
impl<'de> Deserialize<'de> for EncoderData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EncoderData
impl RefUnwindSafe for EncoderData
impl Send for EncoderData
impl Sync for EncoderData
impl Unpin for EncoderData
impl UnwindSafe for EncoderData
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