Struct trellis_m4::Keypad
source ·
[−]pub struct Keypad { /* fields omitted */ }
Expand description
NeoTrellis M4 Express 8x4 keypad
Implementations
Get a 2d array of embedded-hal input pins, each representing one key in the keypad matrix.
pub fn release(
self
) -> ((OldInputPin<Pa18<Input<PullUp>>>, OldInputPin<Pa19<Input<PullUp>>>, OldInputPin<Pb22<Input<PullUp>>>, OldInputPin<Pb23<Input<PullUp>>>), (RefCell<OldOutputPin<Pa14<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa15<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa16<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa17<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa20<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa21<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa22<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa23<Output<OpenDrain>>>>))
pub fn release(
self
) -> ((OldInputPin<Pa18<Input<PullUp>>>, OldInputPin<Pa19<Input<PullUp>>>, OldInputPin<Pb22<Input<PullUp>>>, OldInputPin<Pb23<Input<PullUp>>>), (RefCell<OldOutputPin<Pa14<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa15<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa16<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa17<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa20<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa21<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa22<Output<OpenDrain>>>>, RefCell<OldOutputPin<Pa23<Output<OpenDrain>>>>))
Give back ownership of the row and column pins.
This consumes the keypad struct. All references to its virtual
KeypadInput
pins must have gone out of scope before you try to
call .release()
, or it will fail to compile. Opting in to the
non-lexical lifetimes feature in your project can make that
simpler.
The column pins will be returned inside of RefCell
s (because
macros are hard). You can use .into_inner()
to extract
each column pin from its RefCell
.