pub trait CheckBufLen: AnySpi {
    const LEN: usize = size_of::<Self::Word>();
    const STEP: usize = ;

    // Provided methods
    fn len(&self) -> usize { ... }
    fn step(&self) -> usize { ... }
    fn check_buf_len(&self, buf: &impl AsRef<[u8]>) { ... }
}
Expand description

Trait used to verify the SpiFuture buffer length

Provided Associated Constants§

source

const LEN: usize = size_of::<Self::Word>()

Spi transaction length

source

const STEP: usize =

Step size through the SpiFuture buffer

This is equal to the number of bytes sent in each write to the SPI DATA register. It is zero for an Spi with [DynLength].

Provided Methods§

source

fn len(&self) -> usize

Return the Spi transaction length

In most cases, this returns the corresponding constant. For SAMx5x chips with [DynLength], this returns the result of [Spi::get_dyn_length].

source

fn step(&self) -> usize

Return the step size through the SpiFuture buffer

In most cases, this returns the corresponding constant. For SAMx5x chips with [DynLength], this returns a result calculated from Self::len.

source

fn check_buf_len(&self, buf: &impl AsRef<[u8]>)

Check that the buffer has a valid length

If the transaction length is greater than four, then the size of the buffer must equal the transaction length. If the transaction length is less than or equal to four, then the size of the buffer must be an integer multiple of the transaction length.

Both of these statements apply regardless of whether the Spi has a [DynLength].

Implementors§

source§

impl<S> CheckBufLen for Swhere S: AnySpi,