pub trait Api: Support<usize> + Send {
    // Required methods
    fn configure(gpio: Id<Self>, config: Config) -> Result<(), Error>;
    fn read(gpio: Id<Self>) -> Result<bool, Error>;
    fn write(gpio: Id<Self>, value: bool) -> Result<(), Error>;
    fn last_write(gpio: Id<Self>) -> Result<bool, Error>;
}
Available on crate feature api-gpio only.
Expand description

Low-level GPIO interface.

Required Methods§

source

fn configure(gpio: Id<Self>, config: Config) -> Result<(), Error>

Configures a GPIO.

source

fn read(gpio: Id<Self>) -> Result<bool, Error>

Reads from a GPIO (must be configured as input).

source

fn write(gpio: Id<Self>, value: bool) -> Result<(), Error>

Writes to a GPIO (must be configured as output).

source

fn last_write(gpio: Id<Self>) -> Result<bool, Error>

Returns the last logical value written to a GPIO (must be configured as output).

Object Safety§

This trait is not object safe.

Implementors§