Skip to main content

MatrixKeyboardConfig

Struct MatrixKeyboardConfig 

Source
pub struct MatrixKeyboardConfig {
    pub enabled: bool,
    pub width: u8,
    pub height: u8,
    pub row_pins: [u8; 16],
    pub column_pins: [u8; 8],
    pub direct_macro_bitmap: [u8; 16],
    pub alternate_function_pin: u8,
    pub scanning_decimation: u8,
}
Expand description

A snapshot of the device-side matrix-keyboard configuration, returned by crate::PoKeysDevice::get_matrix_keyboard_configuration.

Read-only view of what the firmware currently has stored — reflects the result of the most recent successful configuration write or pre-existing state from non-volatile storage. Useful for diff-against-device flows.

Fields§

§enabled: bool

true if the matrix keyboard is currently enabled (bit 0 of the configuration byte at spec byte 9).

§width: u8

Number of columns (1..=8). Decoded from (size_byte >> 4) + 1.

§height: u8

Number of rows (1..=16). Decoded from (size_byte & 0x0F) + 1.

§row_pins: [u8; 16]

1-based pin numbers for rows 0..16. Trailing entries beyond height are 0. Stored 1-based for human readability; the protocol uses 0-based pin codes on the wire.

§column_pins: [u8; 8]

1-based pin numbers for columns 0..8. Trailing entries beyond width are 0.

§direct_macro_bitmap: [u8; 16]

Direct/macro mapping bitmap, 128 bits. Bit k set means key k uses macro mapping; clear means direct key mapping.

§alternate_function_pin: u8

Alternate-function pin (1-based, or 0 if disabled). When set, the state of this digital input pin selects between the primary and alternate keyboard mapping for each key.

§scanning_decimation: u8

Scanning decimation factor (0..=50). Higher values reduce the device-side scan rate.

Implementations§

Source§

impl MatrixKeyboardConfig

Source

pub fn size_byte(&self) -> u8

Wire size byte: (width-1) << 4 | (height-1).

Trait Implementations§

Source§

impl Clone for MatrixKeyboardConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MatrixKeyboardConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MatrixKeyboardConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for MatrixKeyboardConfig

Source§

impl PartialEq for MatrixKeyboardConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for MatrixKeyboardConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MatrixKeyboardConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.