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(
self,
channel: impl SpiSlaveDmaChannel<'d, AnySpi<'d>>,
) -> SpiDma<'d, Blocking>
pub fn with_dma( self, channel: impl SpiSlaveDmaChannel<'d, AnySpi<'d>>, ) -> SpiDma<'d, Blocking>
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 Instance + 'd, mode: Mode) -> Spi<'d, Blocking>
pub fn new(spi: impl Instance + 'd, mode: Mode) -> Spi<'d, Blocking>
Creates a new SPI instance in 8-bit data-frame 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 PeripheralInput<'d>) -> Self
pub fn with_sck(self, sclk: impl PeripheralInput<'d>) -> Self
Assigns 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 PeripheralInput<'d>) -> Self
pub fn with_mosi(self, mosi: impl PeripheralInput<'d>) -> Self
Assigns 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 PeripheralOutput<'d>) -> Self
pub fn with_miso(self, miso: impl PeripheralOutput<'d>) -> Self
Assigns 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 PeripheralInput<'d>) -> Self
pub fn with_cs(self, cs: impl PeripheralInput<'d>) -> Self
Assigns 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.