HMI – Display Abstraction Layer

I am working on “alDisplay” that is my embedded abstraction class to LCD/TFT diplays. This is quite a challenging task because I will have to deal with how specialized and proprietary these displays are and on top of that performance. The drawing above illustrate four layers – in my case actual hardware (orange) and three classes – I use alSPI, ST7735S and alDisplay. The user code will only see alDisplay and a very normalized interface, so if I swap display hardware that will be invisible to my code.

alDisplay will typically have functions like clear screen, println etc.

ST7735S will have a normalized interface for the alDisplay class and a specialized, proprietary interface for SPI.

alSPI have a normalized SPI interface.

This will bloat a bit, but as I will be using various displays it is a must.

Performance is a bitch as it might force me to use proprietary operations all the way from alDisplay with “#ifdef” code, but usually performance on a display is achieved through some memory moves that I hope to make common.

As for the reason I started this ? Available drivers will force my code to handle display differences, but more important I tested a display and a driver that don’t work. I might have a broken display, but decided that this layer have to done if I want to avoid spending endless time on different displays. I am also a bit fuzzed by depanding simple, straight forward, easy to read code!

Leave a Reply