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§
- SPI peripheral configuration
- SPI peripheral driver
- SpiDma
unstableStability - SpiDma
Bus unstableStability - SpiDma
Transfer unstableStability
Enums§
- Address
unstableSPI address, ranging from 1 to 32 bits, paired with a data mode. - Clock
Source unstableSPI clock source. - Command
unstableSPI commands, each consisting of a 16-bit command value and a data mode. - Configuration errors.
- SpiInterrupt
unstableEnumeration of possible SPI interrupt events.