pub trait Configure {
    fn configuration(&self) -> Configuration;
    fn make_output(&self) -> Configuration;
    fn disable_output(&self) -> Configuration;
    fn make_input(&self) -> Configuration;
    fn disable_input(&self) -> Configuration;
    fn deactivate_to_low_power(&self);
    fn set_floating_state(&self, state: FloatingState);
    fn floating_state(&self) -> FloatingState;

    fn is_input(&self) -> bool { ... }
    fn is_output(&self) -> bool { ... }
}
Expand description

Control and configure a GPIO pin.

Required Methods

Return the current pin configuration.

Make the pin an output, returning the current configuration, which should be either Configuration::Output or Configuration::InputOutput.

Disable the pin as an output, returning the current configuration.

Make the pin an input, returning the current configuration, which should be ither Configuration::Input or Configuration::InputOutput.

Disable the pin as an input, returning the current configuration.

Put a pin into its lowest power state, with no guarantees on if it is enabled or not. Implementations are free to use any state (e.g. input, output, disable, etc.) the hardware pin supports to ensure the pin is as low power as possible. Re-enabling the pin requires reconfiguring it (i.e. the state of its enabled configuration is not stored).

Set the floating state of the pin.

Return the current floating state of the pin.

Provided Methods

Return whether the pin is an input (reading from the Input trait will return valid results). Returns true if the pin is in Configuration::Input or Configuration::InputOutput.

Return whether the pin is an output (writing to the Output trait will change the output of the pin). Returns true if the pin is in Configuration::Output or Configuration::InputOutput.

Implementors