pub struct Spi<'d, Dm: DriverMode> { /* private fields */ }
unstable
only.Expand description
SPI peripheral driver.
See the module-level documentation for more details.
§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.
Implementations§
Source§impl<'d> Spi<'d, Blocking>
impl<'d> Spi<'d, Blocking>
Sourcepub fn with_dma<CH>(
self,
channel: impl Peripheral<P = CH> + 'd,
rx_descriptors: &'static mut [DmaDescriptor],
tx_descriptors: &'static mut [DmaDescriptor],
) -> SpiDma<'d, Blocking>where
CH: DmaChannelFor<AnySpi>,
pub fn with_dma<CH>(
self,
channel: impl Peripheral<P = CH> + 'd,
rx_descriptors: &'static mut [DmaDescriptor],
tx_descriptors: &'static mut [DmaDescriptor],
) -> SpiDma<'d, Blocking>where
CH: DmaChannelFor<AnySpi>,
Configures the SPI peripheral with the provided DMA channel and descriptors.
§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.
Source§impl<'d> Spi<'d, Blocking>
impl<'d> Spi<'d, Blocking>
Sourcepub fn new(
spi: impl Peripheral<P = impl Instance> + 'd,
mode: Mode,
) -> Spi<'d, Blocking>
pub fn new( spi: impl Peripheral<P = impl Instance> + 'd, mode: Mode, ) -> Spi<'d, Blocking>
Constructs an SPI instance in 8bit dataframe mode.
§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.
Sourcepub fn with_sck(
self,
sclk: impl Peripheral<P = impl PeripheralInput> + 'd,
) -> Self
pub fn with_sck( self, sclk: impl Peripheral<P = impl PeripheralInput> + 'd, ) -> Self
Assign the SCK (Serial Clock) pin for the SPI instance.
§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.
Sourcepub fn with_mosi(
self,
mosi: impl Peripheral<P = impl PeripheralInput> + 'd,
) -> Self
pub fn with_mosi( self, mosi: impl Peripheral<P = impl PeripheralInput> + 'd, ) -> Self
Assign the MOSI (Master Out Slave In) pin for the SPI instance.
§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.
Sourcepub fn with_miso(
self,
miso: impl Peripheral<P = impl PeripheralOutput> + 'd,
) -> Self
pub fn with_miso( self, miso: impl Peripheral<P = impl PeripheralOutput> + 'd, ) -> Self
Assign the MISO (Master In Slave Out) pin for the SPI instance.
§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.
Sourcepub fn with_cs(self, cs: impl Peripheral<P = impl PeripheralInput> + 'd) -> Self
pub fn with_cs(self, cs: impl Peripheral<P = impl PeripheralInput> + 'd) -> Self
Assign the CS (Chip Select) pin for the SPI instance.
§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.