[][src]Struct rust_gpiozero::input_devices::InputDevice

pub struct InputDevice { /* fields omitted */ }

Represents a generic GPIO input device.

Methods

impl InputDevice[src]

pub fn new(pin: u8) -> InputDevice[src]

Returns an InputDevice with the pin number given with the pin pulled to low by default is_active property is adjusted accordingly so that True still means active regardless of the :attr:pull_up setting

Arguments

  • pin - The GPIO pin which the device is attached to

pub fn new_with_pullup(pin: u8) -> InputDevice[src]

Returns an InputDevice with the pin number given with the pin pulled high with an internal resistor by default is_active property is adjusted accordingly so that True still means active regardless of the :attr:pull_up setting

Arguments

  • pin - The GPIO pin which the device is attached to

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.

pub fn value(&self) -> bool[src]

Returns True if the device is currently active and False otherwise.

Trait Implementations

impl Debug for InputDevice[src]

Auto Trait Implementations

impl Send for InputDevice

impl Sync for InputDevice

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.