rm-hull / luma.lcd

Python module to drive PCD8544, HT1621, ST7735, ST7567 and UC1701X-based LCDs
https://luma-lcd.readthedocs.io
MIT License
156 stars 56 forks source link

Adds class to back support for ST7789 #92

Closed Gadgetoid closed 4 years ago

Gadgetoid commented 4 years ago

We're working on an ST7789 breakout garden SPI LCD module, so I've had hardware available for testing.

This draft PR replaces #91 and reflects my approach to implementing this LCD so far, but it has a dependency upon numpy that I'm not entirely comfortable with.

The key issue with this LCD is the 18-bit colour data that needs to be sent- requiring the (hopefully elegant) repacking of 24-bit colour into 18-bits. My familliarity (or lack thereof) with Luma fails me here- is there an established pattern for repacking data that could be used instead?

Among other things it also needs:

For my own future reference, this has been tested and works in the rear SPI port of BG SPI using the command-line:

python3 example.py --display st7789 --interface spi --gpio-backlight 18 --backlight-active high --width 160 --height 160 --gpio-data-command 9

I can't seem to get it to work on the other SPI port with CE1/BCM7.

Gadgetoid commented 4 years ago

Actually our display is 240x240 pixels, so that's two resolutions this should support.

thijstriemstra commented 4 years ago

The namespace changes in this PR have been changed and fixed since opening this PR.