pub struct ExampleKeypad { /* private fields */ }
Expand description

Example output of keypad_struct!()- for documentation purposes only!

You shouldn’t try to use ExampleKeypad outside of this crate.

This struct is the result of this macro invocation:

use mock_hal::{self, Input, OpenDrain, Output, PullUp};
use core::convert::Infallible;

keypad_struct!{
    pub struct ExampleKeypad <Error = Infallible> {
        rows: (
            mock_hal::gpioa::PA0<Input<PullUp>>,
            mock_hal::gpioa::PA1<Input<PullUp>>,
            mock_hal::gpioa::PA2<Input<PullUp>>,
            mock_hal::gpioa::PA3<Input<PullUp>>,
        ),
        columns: (
            mock_hal::gpioa::PA4<Output<OpenDrain>>,
            mock_hal::gpioa::PA5<Output<OpenDrain>>,
            mock_hal::gpioa::PA6<Output<OpenDrain>>,
            mock_hal::gpioa::PA7<Output<OpenDrain>>,
            mock_hal::gpioa::PA8<Output<OpenDrain>>,
        ),
    }
}

Implementations

Get a 2d array of embedded-hal input pins, each representing one key in the keypad matrix.

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.

The column pins will be returned inside of RefCells (because macros are hard). You can use .into_inner() to extract each column pin from its RefCell.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.