pub struct GPIO<State = Enabled> {
pub tokens: Tokens<State>,
/* private fields */
}Expand description
Interface to the GPIO peripheral
Controls the GPIO peripheral. Can be used to enable, disable, or free the
peripheral. For GPIO-functionality directly related to pins, please refer
to GpioPin.
Use Peripherals to gain access to an instance of this struct.
Please refer to the module documentation for more information.
Fields§
§tokens: Tokens<State>Tokens representing all pins
Since the enable and disable methods consume self, they can
only be called, if all tokens are available. This means, any tokens that
have been moved out while the peripheral was enabled, prevent the
peripheral from being disabled (unless those tokens are moved back into
their original place).
As using a pin for GPIO requires such a token, it is impossible to disable the GPIO peripheral while pins are used for GPIO.
Implementations§
Source§impl<State> GPIO<State>
impl<State> GPIO<State>
Sourcepub fn free(self) -> GPIO
pub fn free(self) -> GPIO
Return the raw peripheral
This method serves as an escape hatch from the HAL API. It returns the raw peripheral, allowing you to do whatever you want with it, without limitations imposed by the API.
If you are using this method because a feature you need is missing from the HAL API, please open an issue or, if an issue for your feature request already exists, comment on the existing issue, so we can prioritize it accordingly.