Macro keypad::keypad_new [−][src]
macro_rules! keypad_new { ( $struct_name:ident { rows: ( $($row_val:expr),* $(,)* ), columns: ( $($col_val:expr),* $(,)* ), }) => { ... }; }
Create an instance of the struct you defined with keypad_struct!()
.
The pins will need to match the types you specified in the keypad_struct!()
macro.
let pins = GPIOA::split(); let keypad = keypad_new!(MyKeypad { rows: ( pins.pa0.into_pull_up_input(), pins.pa1.into_pull_up_input(), ), columns: ( pins.pa2.into_open_drain_output(), pins.pa3.into_open_drain_output(), pins.pa4.into_open_drain_output(), ), });