adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.09k stars 1.21k forks source link

displayio.EPaperDisplay: support fast updates #6872

Open pepijndevos opened 2 years ago

pepijndevos commented 2 years ago

PervasiveDisplay panels support a fast update mode, which requires that the first frame contains the old display data, and the second frame contains the new display data: https://docs.pervasivedisplays.com/epd-usage/epd-driving-sequence/small-epds/fast-update/ssf-upload-image-data/dtm1-and-dtm2-registers

I'm not sure if this is an easy change or a major overhaul. It'd basically require to double-buffer the whole display I think?

If the 128 u32 buffer fitted the entire screen, it'd be as simple as writing the old buffer to the first frame before updating it with the new data, but this seems to be only a partial linebuffer with all the subrectangle stuff going on. So the double-buffering would have to happen somewhere else, and not all circuitpython targets might have the RAM for that I imagine.

So I think it'd be a nontrivial change, but fast updates would allow a lot of applications that are currently out of reach without ditching circuitpython/displayio (PervasiveDisplays provides Arduino code for fast updates on request)

tannewt commented 1 year ago

Does the panel lose the old memory between updates? We could write it after the update with the "new" data so that the next update has a reference.

pepijndevos commented 1 year ago

Every update you need to write both tables with the old and new data as far as I understand.