[−][src]Module itsybitsy_m0::gpio::v2
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
dynpin | Type-erased, value-level module for GPIO pins |
pin | Type-level module for GPIO pins |
Structs
Alternate | Type-level variant of |
Disabled | Type-level variant of |
DynPin | A value-level pin, parameterized by DynPinId and DynPinMode |
DynPinId | Value-level |
Input | Type-level variant of |
Output | Type-level variant of |
Pin | A type-level GPIO pin, parameterized by |
Pins | Collection of all the individual |
Enums
A | Type-level variant of |
B | Type-level variant of |
C | Type-level variant of |
D | Type-level variant of |
DynAlternate | Value-level |
DynDisabled | Value-level |
DynGroup | Value-level |
DynInput | Value-level |
DynOutput | Value-level |
DynPinMode | Value-level |
E | Type-level variant of |
Error | GPIO error type |
F | Type-level variant of |
Floating | Type-level variant of both |
G | Type-level variant of |
GroupA | Type-level variant of |
GroupB | Type-level variant of |
H | Type-level variant of |
PA00 | Pin ID representing pin PA00 |
PA01 | Pin ID representing pin PA01 |
PA02 | Pin ID representing pin PA02 |
PA03 | Pin ID representing pin PA03 |
PA04 | Pin ID representing pin PA04 |
PA05 | Pin ID representing pin PA05 |
PA06 | Pin ID representing pin PA06 |
PA07 | Pin ID representing pin PA07 |
PA08 | Pin ID representing pin PA08 |
PA09 | Pin ID representing pin PA09 |
PA10 | Pin ID representing pin PA10 |
PA11 | Pin ID representing pin PA11 |
PA12 | Pin ID representing pin PA12 |
PA13 | Pin ID representing pin PA13 |
PA14 | Pin ID representing pin PA14 |
PA15 | Pin ID representing pin PA15 |
PA16 | Pin ID representing pin PA16 |
PA17 | Pin ID representing pin PA17 |
PA18 | Pin ID representing pin PA18 |
PA19 | Pin ID representing pin PA19 |
PA20 | Pin ID representing pin PA20 |
PA21 | Pin ID representing pin PA21 |
PA22 | Pin ID representing pin PA22 |
PA23 | Pin ID representing pin PA23 |
PA24 | Pin ID representing pin PA24 |
PA25 | Pin ID representing pin PA25 |
PA27 | Pin ID representing pin PA27 |
PA28 | Pin ID representing pin PA28 |
PA30 | Pin ID representing pin PA30 |
PA31 | Pin ID representing pin PA31 |
PB02 | Pin ID representing pin PB02 |
PB03 | Pin ID representing pin PB03 |
PB08 | Pin ID representing pin PB08 |
PB09 | Pin ID representing pin PB09 |
PB10 | Pin ID representing pin PB10 |
PB11 | Pin ID representing pin PB11 |
PB22 | Pin ID representing pin PB22 |
PB23 | Pin ID representing pin PB23 |
PullDown | Type-level variant of both |
PullUp | Type-level variant of both |
PushPull | Type-level variant of |
Readable | Type-level variant of |
Constants
DYN_ALTERNATE_A | Value-level variant of DynPinMode for alternate peripheral function A |
DYN_ALTERNATE_B | Value-level variant of DynPinMode for alternate peripheral function B |
DYN_ALTERNATE_C | Value-level variant of DynPinMode for alternate peripheral function C |
DYN_ALTERNATE_D | Value-level variant of DynPinMode for alternate peripheral function D |
DYN_ALTERNATE_E | Value-level variant of DynPinMode for alternate peripheral function E |
DYN_ALTERNATE_F | Value-level variant of DynPinMode for alternate peripheral function F |
DYN_ALTERNATE_G | Value-level variant of DynPinMode for alternate peripheral function G |
DYN_ALTERNATE_H | Value-level variant of DynPinMode for alternate peripheral function H |
DYN_FLOATING_DISABLED | Value-level variant of DynPinMode for floating disabled mode |
DYN_FLOATING_INPUT | Value-level variant of DynPinMode for floating input mode |
DYN_PULL_DOWN_DISABLED | Value-level variant of DynPinMode for pull-down disabled mode |
DYN_PULL_DOWN_INPUT | Value-level variant of DynPinMode for pull-down input mode |
DYN_PULL_UP_DISABLED | Value-level variant of DynPinMode for pull-up disabled mode |
DYN_PULL_UP_INPUT | Value-level variant of DynPinMode for pull-up input mode |
DYN_PUSH_PULL_OUTPUT | Value-level variant of DynPinMode for push-pull output mode |
DYN_READABLE_OUTPUT | Value-level variant of DynPinMode for readable push-pull output mode |
Traits
AlternateConfig | Type-level |
AnyPin | Meta-type representing any |
DisabledConfig | Type-level |
InputConfig | Type-level |
OptionalPin | Meta-type representing an optional |
OutputConfig | Type-level |
PinId | Type-level |
PinMode | Type-level |
SomePin | Meta-type representing a valid |
Type Definitions
AlternateA | Type-level variant of |
AlternateB | Type-level variant of |
AlternateC | Type-level variant of |
AlternateD | Type-level variant of |
AlternateE | Type-level variant of |
AlternateF | Type-level variant of |
AlternateG | Type-level variant of |
AlternateH | Type-level variant of |
ConcretePin | Type alias to recover the corresponding concrete |
FloatingDisabled | Type-level variant of |
FloatingInput | Type-level variant of |
PullDownDisabled | Type-level variant of |
PullDownInput | Type-level variant of |
PullUpDisabled | Type-level variant of |
PullUpInput | Type-level variant of |
PushPullOutput | Type-level variant of |
ReadableOutput | Type-level variant of |
Reset | Type alias for the |