pub struct MatrixConfig {
pub debounce_ms: Millis,
pub row_active_level: ActiveLevel,
pub column_drive: ColumnDrive,
}Expand description
Matrix timing and electrical configuration.
Fields§
§debounce_ms: MillisTime the raw key state must remain unchanged before it is accepted as the stable debounced state.
row_active_level: ActiveLevelRow input level that means the scanned key is pressed.
column_drive: ColumnDriveColumn output polarity used during scanning.
Implementations§
Source§impl MatrixConfig
impl MatrixConfig
Sourcepub const DEFAULT_DEBOUNCE_MS: Millis = 20
pub const DEFAULT_DEBOUNCE_MS: Millis = 20
Default debounce time.
Sourcepub const fn active_low() -> Self
pub const fn active_low() -> Self
Creates the common pull-up configuration: selected columns are driven low and pressed rows read low.
Sourcepub const fn active_high() -> Self
pub const fn active_high() -> Self
Creates a pull-down style configuration: selected columns are driven high and pressed rows read high.
Sourcepub const fn with_debounce_ms(self, debounce_ms: Millis) -> Self
pub const fn with_debounce_ms(self, debounce_ms: Millis) -> Self
Returns the configuration with a different debounce time.
Sourcepub const fn with_row_active_level(self, row_active_level: ActiveLevel) -> Self
pub const fn with_row_active_level(self, row_active_level: ActiveLevel) -> Self
Returns the configuration with a different row input active level.
Sourcepub const fn with_column_drive(self, column_drive: ColumnDrive) -> Self
pub const fn with_column_drive(self, column_drive: ColumnDrive) -> Self
Returns the configuration with a different column drive polarity.
Trait Implementations§
Source§impl Clone for MatrixConfig
impl Clone for MatrixConfig
impl Copy for MatrixConfig
Source§impl Debug for MatrixConfig
impl Debug for MatrixConfig
Source§impl Default for MatrixConfig
impl Default for MatrixConfig
impl Eq for MatrixConfig
Source§impl PartialEq for MatrixConfig
impl PartialEq for MatrixConfig
impl StructuralPartialEq for MatrixConfig
Auto Trait Implementations§
impl Forget for MatrixConfig
impl Freeze for MatrixConfig
impl Move for MatrixConfig
impl RefUnwindSafe for MatrixConfig
impl Send for MatrixConfig
impl Sync for MatrixConfig
impl Unpin for MatrixConfig
impl UnsafeUnpin for MatrixConfig
impl UnwindSafe for MatrixConfig
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