Skip to main content

GpioBackend

Trait GpioBackend 

Source
pub trait GpioBackend: Send {
    // Required methods
    fn read(&mut self) -> Result<bool, BackendError>;
    fn write(&mut self, value: bool) -> Result<(), BackendError>;
}
Expand description

Hardware access abstraction for a GPIO pin.

Required Methods§

Source

fn read(&mut self) -> Result<bool, BackendError>

Reads the current voltage level (high = true, low = false).

Source

fn write(&mut self, value: bool) -> Result<(), BackendError>

Sets the output voltage level.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§