[−]Struct trellis_m4::Keypad
NeoTrellis M4 Express 8x4 keypad
Methods
impl Keypad
pub fn decompose<'a>(&'a self) -> [[KeypadInput<'a>; 8]; 4]
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>>>>))
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
.
impl Keypad
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self