Trait atsamd_hal::sercom::spi_future::CheckBufLen
source · [−]pub trait CheckBufLen: AnySpi {
const LEN: usize = _;
const STEP: usize = _;
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
Provided Methods
sourcefn len(&self) -> usize
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
].
sourcefn check_buf_len(&self, buf: &impl AsRef<[u8]>)
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
].