pub trait Pins {
// Required methods
fn setup(&mut self, pin: Pin, mode: PinMode) -> Result<()>;
fn clear(&mut self, pin: Pin) -> Result<()>;
fn clear_all(&mut self) -> Result<()>;
fn read(&mut self, pin: Pin) -> Result<bool>;
fn write(&mut self, pin: Pin, v: bool) -> Result<()>;
}
Expand description
Generic abstraction over a GPIO chip to back all EndBASIC commands.
Required Methods§
Sourcefn setup(&mut self, pin: Pin, mode: PinMode) -> Result<()>
fn setup(&mut self, pin: Pin, mode: PinMode) -> Result<()>
Configures the pin
as either input or output (per mode
).
This lazily initialies the GPIO chip as well on the first pin setup.
It is OK to set up a pin multiple times without calling clear()
in-between.