embassy-stm32

Crates

git

Versions

stm32u5a5qj

Flavors

Skip to main content

Module triggered

Module triggered 

Source
Expand description

SPI frames started by a hardware trigger, received into a ring of blocks.

For devices that signal each sample with a data-ready edge. Each trigger edge (an EXTI event, a timer, …) starts one frame of TSIZE words, with an NSS pulse if the Spi drives NSS (Spi::new_with_nss). A third DMA channel, gated by the trigger, restarts the SPI; the SPI’s own channels fill the ring and send the same frame each time. No CPU time per frame.

With a CRC (Config::crc), failed frames are marked per block (Block::is_valid). This needs InterruptHandler bound to the SPI’s interrupt.

Structs§

Block
One block of frames, borrowed from the ring.
Config
Stream configuration.
Descriptors
DMA descriptors and per-block state. Must outlive the stream, in memory the DMA reaches.
InterruptHandler
SPI interrupt handler for TriggeredFrames: marks CRC failures and counts overruns.
TriggeredFrames
A stream of triggered frames. Dropping it stops the stream and restores the Spi.

Enums§

Error
Stream error.

Constants§

MAX_FRAMES_PER_BLOCK
Maximum frames per block (the bad-frame marks are 64 bits).

Traits§

InterruptInstance
An SPI instance with an interrupt of its own.