Trait serpente::sercom::v2::spi::CharSize

source ·
pub trait CharSize: Sealed {
    type Word: 'static;

    const BITS: u8;
}
Expand description

Type-level enum representing the SPI character size

This trait acts as both a type-level enum, forming a type class for character sizes, as well as a type-level function mapping the corresponding word size.

The SPI character size affects the word size for the embedded HAL traits. Eight-bit transactions use a u8 word, while nine-bit transactions use a u16 word.

Required Associated Types§

source

type Word: 'static

Word size for the character size

Required Associated Constants§

source

const BITS: u8

Register bit pattern for the corresponding CharSize

Implementors§

source§

impl CharSize for EightBit

§

type Word = u8

source§

const BITS: u8 = 0u8

source§

impl CharSize for NineBit

§

type Word = u16

source§

const BITS: u8 = 1u8