-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Teach DMA to transfer n bytes n times #666
Comments
I had a quick look into the L4 reference manual. If I interpret the SPI chapter correctly, then it should be possible to write a 16bit value to an 8bit SPI (DMA packing on SPI, pages 1316 and 1318). With pointer incrementing disabled this would allow to set the pixel color for a predefined area. But requires reconfiguration of the DMA channel before sending. The problem with circular mode is the never ending transfer. You'd need to count the loops and disable the transfer when done. If going that path it would be preferable to use a small buffer for the transfer to reduce the overhead of the DMA IRQ handler being called after every byte/word. |
Ah nice! Thanks for the hint mike, I'll gonna try this out. Additional note: |
At least for STM32 DMA you can make it read 16- or 32-bits (but not 24-bits), but only write 8-bits with the DMA buffering the value in between, so this may work even without anything special.
|
Si. Let's keep std::fill, it's fine. The OLEDs actually don't have an internal buffer. If I can't implement a 'clear()' working this way, I need to add a (little) buffer just for clearing the noize on power-up witch is stupid. |
I have expanded this task and added bit-resolution to each |
OMG 🤩 this uint16_t / 16bit Before
After
|
🔥 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.
The text was updated successfully, but these errors were encountered: