Expand description
§Serial Peripheral Interface - Master Mode
§Overview
In this mode, the SPI acts as master and initiates the SPI transactions.
§Configuration
The peripheral can be used in full-duplex and half-duplex mode and can leverage DMA for data transfers. It can also be used in blocking or async.
§Exclusive access to the SPI bus
If all you want to do is to communicate to a single device, and you initiate transactions yourself, there are a number of ways to achieve this:
- Use the SpiBustrait and its associated functions to initiate transactions with simultaneous reads and writes, or
- Use the ExclusiveDevicestruct fromembedded-hal-busorSpiDevicefromembassy-embedded-hal.
§Shared SPI access
If you have multiple devices on the same SPI bus that each have their own CS
line (and optionally, configuration), you may want to have a look at the
implementations provided by embedded-hal-bus and
embassy-embedded-hal.
§Usage
The module implements several third-party traits from embedded-hal@1.x.x
and embassy-embedded-hal.
Structs§
- AnySpi
- Any SPI peripheral.
- Config
- SPI peripheral configuration
- Spi
- SPI peripheral driver
- SpiDmaunstable
- Stability
- SpiDmaBus unstable
- Stability
- SpiDmaTransfer unstable
- Stability
Enums§
- Addressunstable
- SPI address, ranging from 1 to 32 bits, paired with a data mode.
- ClockSource unstable
- SPI clock source.
- Commandunstable
- SPI commands, each consisting of a 16-bit command value and a data mode.
- ConfigError 
- Configuration errors.
- DataMode unstable
- SPI data mode
- SpiInterruptunstable
- Enumeration of possible SPI interrupt events.
Traits§
- Instance
- SPI peripheral instance.