Close

Framebuffer

A project log for Hardware 2FA TOTP authenticator

Small USB 2FA authenticator for up to 32 profiles

itzandroidtabitzandroidtab 02/18/2024 at 15:180 Comments

The 135x240 ST7789 display requires (135x240x2) 64800 bytes for a full framebuffer. The LPC1756 does not have that much contiguous memory. (2x 16Kb) To work around this issue I could do three things:

* Directly writing pixel for pixel to the screen

* Smaller framebuffers for the items that change

* Divide the screen in sections and update the screen that way

I passed on the first option as that was pretty slow, I passed on the second option as it would make it more difficult to create screens other than the main screen. (It would need a fallback to be able to write pixels outside the predetermined regions.) This made me chose the last option. 

This last option works by splitting the screen in multiple sections and updating a framebuffer while sending a framebuffer to the display. The size of the sections I chose was 15 pixels in height. This option also needs DMA, this makes it that it can send the data to the display without any action of the CPU.

Discussions