pub trait Configure {
// Required methods
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;
// Provided methods
fn is_input(&self) -> bool { ... }
fn is_output(&self) -> bool { ... }
}
Expand description
Control and configure a GPIO pin.
Required Methods§
sourcefn configuration(&self) -> Configuration
fn configuration(&self) -> Configuration
Return the current pin configuration.
sourcefn make_output(&self) -> Configuration
fn make_output(&self) -> Configuration
Make the pin an output, returning the current configuration,
which should be either Configuration::Output
or
Configuration::InputOutput
.
sourcefn disable_output(&self) -> Configuration
fn disable_output(&self) -> Configuration
Disable the pin as an output, returning the current configuration.
sourcefn make_input(&self) -> Configuration
fn make_input(&self) -> Configuration
Make the pin an input, returning the current configuration,
which should be ither Configuration::Input
or
Configuration::InputOutput
.
sourcefn disable_input(&self) -> Configuration
fn disable_input(&self) -> Configuration
Disable the pin as an input, returning the current configuration.
sourcefn deactivate_to_low_power(&self)
fn deactivate_to_low_power(&self)
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).
sourcefn set_floating_state(&self, state: FloatingState)
fn set_floating_state(&self, state: FloatingState)
Set the floating state of the pin.
sourcefn floating_state(&self) -> FloatingState
fn floating_state(&self) -> FloatingState
Return the current floating state of the pin.