[−][src]Struct rppal::gpio::Pin
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.
Methods
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]
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<'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
impl Send for Pin
impl Sync for Pin
impl Unpin for Pin
impl UnwindSafe for Pin
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,