Skip to content

Teach DMA to transfer n bytes n times#666

Description

@TomSaw

馃敟 Here's the # 666 hell 馃槇 of a feature-request 馃敟

To accelerate the graphic APIs clear(Color color) methods i need the following DMA feature.
See #665

Application 1: clear external CGRAM (Display-RAM) with DMA:

// Desired method with repeat parameter
SpiMaster1_Dma::transfer(const uint8_t *tx, uint8_t *rx, std::size_t length, size_t repeat);

// Example usage sending: 0xAA, 0xBB, 0xAA, 0xBB, 0xAA, 0xBB, 0xAA, 0xBB, 0xAA, 0xBB, ... (128 times)
uint8_t buffer[2] = {0xAA, 0xBB};
SpiMaster1_Dma::transfer(buffer, nullptr, 2, 128);

Application 2: Substitute std::fill(..)

Similar to Application 1 but for internal RAM

Possible Implementation!?

Sending repeated bytes is easy: Just disable the DMAs address-incement for the read. Sending repeated multi-byte sequences is not so easy. I think STMs Circular DMA Mode can be utilized here.

Whats your guess @chris-durand / @mikewolfram / @salkinium ? I've recognized your recent effort with DMA.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions