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 DmaChannelFor<AnySpi<'d>>,
) -> SpiDma<'d, Blocking>
pub fn with_dma( self, channel: impl DmaChannelFor<AnySpi<'d>>, ) -> SpiDma<'d, Blocking>
Configures the SPI peripheral with the provided DMA channel and descriptors.
Note: ESP32 only supports Mode 1 and 3.
§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>
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 PeripheralInput<'d>) -> Self
pub fn with_sck(self, sclk: 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 PeripheralInput<'d>) -> Self
pub fn with_mosi(self, mosi: 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 PeripheralOutput<'d>) -> Self
pub fn with_miso(self, miso: 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 PeripheralInput<'d>) -> Self
pub fn with_cs(self, cs: 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.