#[non_exhaustive]pub struct Config { /* private fields */ }Expand description
SPI peripheral configuration
Implementations§
Source§impl Config
impl Config
Sourcepub fn clock_source(&self) -> ClockSource
Available on crate feature unstable only.
pub fn clock_source(&self) -> ClockSource
unstable only.The clock source.
Sourcepub fn with_read_bit_order(self, read_bit_order: BitOrder) -> Self
pub fn with_read_bit_order(self, read_bit_order: BitOrder) -> Self
Assign the given value to the read_bit_order field.
Sourcepub fn read_bit_order(&self) -> BitOrder
pub fn read_bit_order(&self) -> BitOrder
Bit order of the read data.
Sourcepub fn with_write_bit_order(self, write_bit_order: BitOrder) -> Self
pub fn with_write_bit_order(self, write_bit_order: BitOrder) -> Self
Assign the given value to the write_bit_order field.
Sourcepub fn write_bit_order(&self) -> BitOrder
pub fn write_bit_order(&self) -> BitOrder
Bit order of the written data.
Sourcepub fn with_min_async_transfer_size(
self,
min_async_transfer_size: usize,
) -> Self
Available on crate feature unstable only.
pub fn with_min_async_transfer_size( self, min_async_transfer_size: usize, ) -> Self
unstable only.Assign the given value to the min_async_transfer_size field.
Sourcepub fn min_async_transfer_size(&self) -> usize
Available on crate feature unstable only.
pub fn min_async_transfer_size(&self) -> usize
unstable only.Minimum transfer size in bytes below which CPU-driven (blocking) I/O is used instead of async or DMA transfers.
This can reduce overhead for small transfers where DMA setup or
async context-switch cost exceeds the benefit. For
SpiDma, the threshold applies in
both blocking and async DMA modes: when met, DMA is disabled and the
transfer is performed by the CPU. This applies to both full-duplex and
half-duplex transfers.
A value of 0 (the default) disables the threshold — all transfers use
the driver’s default method.
Source§impl Config
impl Config
Sourcepub fn with_frequency(self, frequency: Rate) -> Self
pub fn with_frequency(self, frequency: Rate) -> Self
Sets the frequency of the SPI bus clock.
The closest available frequency that does not exceed frequency is used,
so the bus never runs faster than requested.
Sourcepub fn with_clock_source(self, clock_source: ClockSource) -> Self
Available on crate feature unstable only.
pub fn with_clock_source(self, clock_source: ClockSource) -> Self
unstable only.Sets the clock source of the SPI bus.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.