mirror of https://github.com/periph/devices
waveshare213v2: Keep display contents in shadow buffer
This is necessary for partial updates of the display--not just incremental updates of the full display, but updating part of the display in general. On the horizontal axis only whole bytes can be written, so updates need to be aligned to 8 pixels. One option would be to require the caller of Dev.Draw to only operate at multiples of 8. Another would be to read back the contents of bytes to be updated partially and combine the data. According to the datasheet the controller supports that (command 0x27). The simplest option, however, is to maintain a shadow buffer in the driver. Updates are applied to the buffer from which only the changed destination rectangle is sent to the display. The permanent cost is a bit more than 4kB of memory for a 122x250 display while saving on memory allocations for a temporary image buffer on updates. Signed-off-by: Michael Hanselmann <public@hansmi.ch>pull/41/head
parent
cbda71a0c8
commit
bb13c4c789
Loading…
Reference in New Issue