Skip to content

Design for SPI using DMA with atsamd51 #1973

@sago35

Description

@sago35

I am working on a design for SPI with DMA on atsamd51.

I think we'll always want to use DMA. That is an easier to use API and likely faster overall.
#1176 (comment)

Tx() to always use dma if possible, but at least atsamd51 slows things down in some cases.
If the data is small or the communication speed is slow, using DMA will slow down spi.Tx().

To reduce the slowdown, I am considering implementing the following.
If anyone has any opinions, please let me know.

// The following will be executed with blocking as before
// The internal implementation will be the same as before, without DMA.
spi.Tx(w, r)

// The following will be executed using DMA.
// It will always run asynchronously and can wait for completion by calling spi.
spi.TxDMA(w, r)
spi.Wait()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions