Struct rppal::gpio::Pin [−][src]
pub struct Pin { /* fields omitted */ }Expand description
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
Returns the GPIO pin number.
Pins are addressed by their BCM numbers, rather than their physical location.
Consumes the Pin and returns an InputPin. Sets the 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).
Consumes the Pin and returns an InputPin. Sets the 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).
Consumes the Pin and returns an OutputPin. Sets the mode to Mode::Output
and leaves the logic level unchanged.
Consumes the Pin and returns an OutputPin. Changes the logic level to
Level::Low and then sets the mode to Mode::Output.
Consumes the Pin and returns an OutputPin. Changes the logic level to
Level::High and then sets the mode to Mode::Output.
Trait Implementations
InputPin trait implementation for embedded-hal v1.0.0-alpha.5.
Unproven InputPin trait implementation for embedded-hal v0.2.6.