Struct rppal::gpio::Pin[][src]

pub struct Pin { /* fields omitted */ }

Unconfigured GPIO pin.

Pins are constructed by retrieving them using Gpio::get.

An unconfigured Pin can be used to read the pin's mode and logic level. Converting the Pin to an InputPin, OutputPin or IoPin through the various into_ methods available on Pin configures the appropriate mode, and provides access to additional methods relevant to the selected pin mode.

The unproven embedded-hal digital::InputPin trait implementation for Pin can be enabled by specifying the optional hal-unproven feature in the dependency declaration for the rppal crate.

Implementations

impl Pin[src]

pub fn pin(&self) -> u8[src]

Returns the GPIO pin number.

Pins are addressed by their BCM numbers, rather than their physical location.

pub fn mode(&self) -> Mode[src]

Returns the pin's mode.

pub fn read(&self) -> Level[src]

Reads the pin's logic level.

pub fn into_input(self) -> InputPin[src]

Consumes the Pin, returns an InputPin, sets its mode to Input, and disables the pin's built-in pull-up/pull-down resistors.

pub fn into_input_pulldown(self) -> InputPin[src]

Consumes the Pin, returns an InputPin, sets its mode to Input, and enables the pin's built-in pull-down resistor.

The pull-down resistor is disabled when InputPin goes out of scope if reset_on_drop is set to true (default).

pub fn into_input_pullup(self) -> InputPin[src]

Consumes the Pin, returns an InputPin, sets its mode to Input, and enables the pin's built-in pull-up resistor.

The pull-up resistor is disabled when InputPin goes out of scope if reset_on_drop is set to true (default).

pub fn into_output(self) -> OutputPin[src]

Consumes the Pin, returns an OutputPin and sets its mode to Output.

pub fn into_io(self, mode: Mode) -> IoPin[src]

Consumes the Pin, returns an IoPin and sets its mode to the specified mode.

Trait Implementations

impl Debug for Pin[src]

impl Drop for Pin[src]

impl Eq for Pin[src]

impl InputPin for Pin[src]

type Error = Error

Error type

impl<'a> PartialEq<&'a Pin> for Pin[src]

impl PartialEq<Pin> for Pin[src]

impl<'a> PartialEq<Pin> for &'a Pin[src]

Auto Trait Implementations

impl RefUnwindSafe for Pin[src]

impl Send for Pin[src]

impl Sync for Pin[src]

impl Unpin for Pin[src]

impl UnwindSafe for Pin[src]

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.