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
SpiBus
trait and its associated functions to initiate transactions with simultaneous reads and writes, or - Use the
ExclusiveDevice
struct fromembedded-hal-bus
orSpiDevice
fromembassy-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§
- Config
- SPI peripheral configuration
- Spi
- SPI peripheral driver
- SpiDma
unstable
- Stability
- SpiDma
Bus unstable
- Stability
- SpiDma
Transfer unstable
- Stability
Enums§
- Address
unstable
- SPI address, ranging from 1 to 32 bits, paired with a data mode.
- Clock
Source unstable
- SPI clock source.
- Command
unstable
- SPI commands, each consisting of a 16-bit command value and a data mode.
- Config
Error - Configuration errors.
- SpiInterrupt
unstable
- Enumeration of possible SPI interrupt events.