[−][src]Struct rust_gpiozero::devices::GpioDevice
Represents a generic GPIO device and provides the services common to all single-pin GPIO devices
Methods
impl GpioDevice
[src]
pub fn new(pin: u8) -> GpioDevice
[src]
Returns a GpioDevice with the pin number given
Arguments
pin
- The GPIO pin which the device is attached to
pub fn value(&self) -> bool
[src]
Returns a value representing the device's state.
pub fn is_active(&self) -> bool
[src]
Returns True
if the device is currently active and False
otherwise.
pub fn close(self)
[src]
Shut down the device and release all associated resources.
pub fn pin(&self) -> u8
[src]
The Pin
that the device is connected to.
Trait Implementations
Auto Trait Implementations
impl Send for GpioDevice
impl Sync for GpioDevice
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,