Expand description
Type-level enum representing the SPI transaction length, in bytes
This trait acts as both a type-level enum, forming a type class for
transaction lengths, as well as a type-level function mapping the Length
to the corresponding Word
size.
The SPI transaction length is represented in the type domain using
Unsigned
types from the typenum
crate. The length can be set
statically, using a length from U1
to U255
, or it can be set
dynamically, using the DynLength
marker type. All valid Length
types
are re-exported in this module.
The SPI transaction length affects the word size for the embedded HAL
traits, as well as other aspects of the SPI API. Transaction lengths of 1-4
only require a single read/write of the DATA
register, so they have an
AtomicSize
behave differently than longer transaction lengths.