#[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
Set 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.Set 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.
Trait Implementations§
impl Copy for Config
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)