[][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 PinMode for alternate peripheral functions

Disabled

Type-level variant of PinMode for disabled modes

DynPin

A value-level pin, parameterized by DynPinId and DynPinMode

DynPinId

Value-level struct representing pin IDs

Input

Type-level variant of PinMode for input modes

Output

Type-level variant of PinMode for output modes

Pin

A type-level GPIO pin, parameterized by PinId and PinMode types

Pins

Collection of all the individual Pins

Enums

A

Type-level variant of AlternateConfig for alternate peripheral function A

B

Type-level variant of AlternateConfig for alternate peripheral function B

C

Type-level variant of AlternateConfig for alternate peripheral function C

D

Type-level variant of AlternateConfig for alternate peripheral function D

DynAlternate

Value-level enum for alternate peripheral function configurations

DynDisabled

Value-level enum for disabled configurations

DynGroup

Value-level enum for pin groups

DynInput

Value-level enum for input configurations

DynOutput

Value-level enum for output configurations

DynPinMode

Value-level enum representing pin modes

E

Type-level variant of AlternateConfig for alternate peripheral function E

Error

GPIO error type

F

Type-level variant of AlternateConfig for alternate peripheral function F

Floating

Type-level variant of both DisabledConfig and InputConfig

G

Type-level variant of AlternateConfig for alternate peripheral function G

GroupA

Type-level variant of Group

GroupB

Type-level variant of Group

H

Type-level variant of AlternateConfig for alternate peripheral function H

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 DisabledConfig and InputConfig

PullUp

Type-level variant of both DisabledConfig and InputConfig

PushPull

Type-level variant of OutputConfig for a push-pull configuration

Readable

Type-level variant of OutputConfig for a readable push-pull configuration

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 enum for alternate peripheral function configurations

AnyPin

Meta-type representing any Pin

DisabledConfig

Type-level enum for disabled configurations

InputConfig

Type-level enum for input configurations

OptionalPin

Meta-type representing an optional Pin.

OutputConfig

Type-level enum for output configurations

PinId

Type-level enum for pin IDs

PinMode

Type-level enum representing pin modes

SomePin

Meta-type representing a valid Pin.

Type Definitions

AlternateA

Type-level variant of PinMode for alternate peripheral function A

AlternateB

Type-level variant of PinMode for alternate peripheral function B

AlternateC

Type-level variant of PinMode for alternate peripheral function C

AlternateD

Type-level variant of PinMode for alternate peripheral function D

AlternateE

Type-level variant of PinMode for alternate peripheral function E

AlternateF

Type-level variant of PinMode for alternate peripheral function F

AlternateG

Type-level variant of PinMode for alternate peripheral function G

AlternateH

Type-level variant of PinMode for alternate peripheral function H

ConcretePin

Type alias to recover the corresponding concrete Pin type from a given implementation of AnyPin

FloatingDisabled

Type-level variant of PinMode for floating disabled mode

FloatingInput

Type-level variant of PinMode for floating input mode

PullDownDisabled

Type-level variant of PinMode for pull-down disabled mode

PullDownInput

Type-level variant of PinMode for pull-down input mode

PullUpDisabled

Type-level variant of PinMode for pull-up disabled mode

PullUpInput

Type-level variant of PinMode for pull-up input mode

PushPullOutput

Type-level variant of PinMode for push-pull output mode

ReadableOutput

Type-level variant of PinMode for readable push-pull output mode

Reset

Type alias for the PinMode at reset