Expand description
Version 2 of the GPIO module
The new API provides two different submodules, pin
and dynpin
,
representing two different ways to handle GPIO pins. The default, pin
,
is a type-level API that tracks the state of each pin at compile-time. The
alternative, dynpin
is a type-erased, value-level API that tracks the
state of each pin at run-time.
The type-level API is strongly preferred. By representing the state of each pin within the type system, the compiler can detect logic errors at compile-time. Furthermore, the type-level API has absolutely zero run-time cost.
If needed, dynpin
can be used to erase the type-level differences
between pins. However, by doing so, pins must now be tracked at run-time,
and each pin has a non-zero memory footprint.
Modules
- Type-erased, value-level module for GPIO pins
- Type-level module for GPIO pins
Structs
- Type-level variant of
PinMode
for alternate peripheral functions - Type-level variant of
PinMode
for disabled modes - A value-level pin, parameterized by
DynPinId
andDynPinMode
- Value-level
struct
representing pin IDs - Type-level variant of
PinMode
for input modes - Type-level variant of
PinMode
for Interrupt modes - Type-level variant of
PinMode
for output modes - Collection of all the individual
Pin
s
Enums
- Type-level variant of
AlternateConfig
for alternate peripheral function B - Type-level variant of
AlternateConfig
for alternate peripheral function C - Type-level variant of
AlternateConfig
for alternate peripheral function D - Value-level
enum
for alternate peripheral function configurations - Value-level
enum
for disabled configurations - Value-level
enum
for pin groups - Value-level
enum
for input configurations - Value-level
enum
for interrupt configurations - Value-level
enum
for output configurations - Value-level
enum
representing pin modes - Type-level variant of
AlternateConfig
for alternate peripheral function E - GPIO error type
- Type-level variant of
AlternateConfig
for alternate peripheral function F - Type-level variant of both
DisabledConfig
andInputConfig
- Type-level variant of
AlternateConfig
for alternate peripheral function G - Type-level variant of
AlternateConfig
for alternate peripheral function H - Pin ID representing pin PA00
- Pin ID representing pin PA01
- Pin ID representing pin PA02
- Pin ID representing pin PA03
- Pin ID representing pin PA04
- Pin ID representing pin PA05
- Pin ID representing pin PA06
- Pin ID representing pin PA07
- Pin ID representing pin PA08
- Pin ID representing pin PA09
- Pin ID representing pin PA10
- Pin ID representing pin PA11
- Pin ID representing pin PA14
- Pin ID representing pin PA15
- Pin ID representing pin PA16
- Pin ID representing pin PA17
- Pin ID representing pin PA18
- Pin ID representing pin PA19
- Pin ID representing pin PA22
- Pin ID representing pin PA23
- Pin ID representing pin PA24
- Pin ID representing pin PA25
- Pin ID representing pin PA27
- Pin ID representing pin PA28
- Pin ID representing pin PA30
- Pin ID representing pin PA31
- Type-level variant of both
DisabledConfig
andInputConfig
- Type-level variant of both
DisabledConfig
andInputConfig
- Type-level variant of
OutputConfig
for a push-pull configuration - Type-level variant of
OutputConfig
for a readable push-pull configuration
Constants
- Value-level variant of
DynPinMode
for alternate peripheral function B - Value-level variant of
DynPinMode
for alternate peripheral function C - Value-level variant of
DynPinMode
for alternate peripheral function D - Value-level variant of
DynPinMode
for alternate peripheral function E - Value-level variant of
DynPinMode
for alternate peripheral function F - Value-level variant of
DynPinMode
for alternate peripheral function G - Value-level variant of
DynPinMode
for alternate peripheral function H - Value-level variant of
DynPinMode
for floating disabled mode - Value-level variant of
DynPinMode
for floating input mode - Value-level variant of
DynPinMode
for floating interrupt mode - Value-level variant of
DynPinMode
for pull-down disabled mode - Value-level variant of
DynPinMode
for pull-down input mode - Value-level variant of
DynPinMode
for pull-down interrupt mode - Value-level variant of
DynPinMode
for pull-up disabled mode - Value-level variant of
DynPinMode
for pull-up input mode - Value-level variant of
DynPinMode
for pull-up interrupt mode - Value-level variant of
DynPinMode
for push-pull output mode - Value-level variant of
DynPinMode
for readable push-pull output mode
Traits
- Type-level enum for alternate peripheral function configurations
- Type class for
Pin
types - Type-level enum for disabled configurations
- Type-level enum for input configurations
- Type-level
enum
for Interrupt configurations - Type-level equivalent of
Option<PinId>
- Type-level equivalent of
Option<PinId>
- Type-level enum for output configurations
- Type-level enum for pin IDs
- Type-level enum representing pin modes
- Type-level equivalent of
Some(PinId)
- Type-level equivalent of
Some(PinId)
Type Definitions
- Type-level variant of
PinMode
for floating disabled mode - Type-level variant of
PinMode
for floating input mode - Type-level variant of
PinMode
for floating Interrupt mode - Type-level variant of
PinMode
for pull-down disabled mode - Type-level variant of
PinMode
for pull-down input mode - Type-level variant of
PinMode
for pull-down Interrupt mode - Type-level variant of
PinMode
for pull-up disabled mode - Type-level variant of
PinMode
for pull-up input mode - Type-level variant of
PinMode
for pull-up Interrupt mode - Type-level variant of
PinMode
for push-pull output mode - Type-level variant of
PinMode
for readable push-pull output mode - Type alias for the
PinMode
at reset