Module master

Source
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:

§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
SpiDmaunstable
Stability
SpiDmaBusunstable
Stability
SpiDmaTransferunstable
Stability

Enums§

Addressunstable
SPI address, ranging from 1 to 32 bits, paired with a data mode.
ClockSourceunstable
SPI clock source.
Commandunstable
SPI commands, each consisting of a 16-bit command value and a data mode.
ConfigError
Configuration errors.
SpiInterruptunstable
Enumeration of possible SPI interrupt events.