Trait rust_gpiozero::traits::Device
[−]
[src]
pub trait Device { fn pin(&self) -> Pin; fn value(&self) -> i8; fn close(&self) { ... } fn is_active(&self) -> bool { ... } }
Represents a single device of any type; GPIO-based, SPI-based, I2C-based, etc. It defines the basic services applicable to all devices
Required Methods
fn pin(&self) -> Pin
Get the pin
fn value(&self) -> i8
Returns a value representing the device's state.
Provided Methods
fn close(&self)
Shut down the device and release all associated resources.
fn is_active(&self) -> bool
Returns True
if the device is currently active and False
otherwise.
Implementors
impl Device for GPIODevice
impl Device for OutputDevice
impl Device for InputDevice
impl Device for DigitalInputDevice
impl Device for Button