Page 1 of 1

Low Memory Backbuffer for SPI Screens

Posted: Sun Jun 07, 2020 7:08 pm
by jeanlemotan
Initially I posted this in the Arduino forum and forgot about it, but I just saw a post in another topic and didn't want to reply there off-topic so I'll paste it here instead:
PeterR wrote:
Fri May 01, 2020 9:41 pm
BTW: My vote is more DMA RAM, enougth to run dual buffered resonable display (320x240, 8 bit colour) with Wifi n BTE. 74*2K is 'not possible' on ESP32 (k, cannot prove a negative).

I wrote a small library for this exact thing: https://github.com/jeanlemotan/jlm-back-buffer
It gives you a backbuffer with very fast SPI updates and a few extras: antialiasing and alpha blending.
The good thing is that you get to control how much memory it uses - from around 3K to 150K (it's 16bit color depth), depending on how much of the screen you update per frame. Half the screen needs half the memory, same for 1/4 and so on.

It's way way faster than other methods - like update/erase/update, etc. Also - no flicker.

Re: Low Memory Backbuffer for SPI Screens

Posted: Tue Jun 09, 2020 11:03 am
by PeterR
Great stuff! I will have to get my rectangles dirty some time soon!