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.

Returns the pin’s mode.

Reads the pin’s logic level.

Consumes the Pin and returns an InputPin. Sets the mode to Input and disables the pin’s built-in pull-up/pull-down resistors.

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.

Consumes the Pin and returns an IoPin. Sets the mode to the specified mode.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

InputPin trait implementation for embedded-hal v1.0.0-alpha.5.

Error type

Is the input pin high?

Is the input pin low?

Unproven InputPin trait implementation for embedded-hal v0.2.6.

Error type

Is the input pin high?

Is the input pin low?

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.