lvgl / lv_binding_micropython

LVGL binding for MicroPython
MIT License
250 stars 161 forks source link

st7789 and st7735 Support for ili9XXX hybrid driver #198

Closed russhughes closed 2 years ago

russhughes commented 2 years ago

Support ST7789 and ST7735 displays for the ESP32 LVGL MicroPython bindings. It was tested with TTGO T-Display, TTGO TWatch-2020, generic eBay ST7735, m5stack core, and core2 devices. See https://github.com/russhughes/lv_st7789 for lv_examples modified to run with this driver.

amirgon commented 2 years ago

@russhughes I've reviewed your changes and tested with a ili9341 display. Everything looks good! What do you think about my suggestion above? :

Perhaps your "configs" scripts could be used as drivers for specific boards? A user who uses a specific board might appreciate being able to simply import a display driver script instead of configuring all the parameters to match the board.

russhughes commented 2 years ago

I think that would be helpful to people, where should they go?

amirgon commented 2 years ago

I think that would be helpful to people, where should they go?

Maybe we can think of these "config" scripts as "Board Support Modules" - Python modules per board that import and initialize everything related to a board (usually display and input drivers, but could also be other things). We can create a new boards/ directory under lv_binding_micropython root and put them there. Later we could freeze them on lv_micropython for each board (with their related drivers).

One comment though. I'm not sure it's a good idea to initialize the display upon import, like you did in your "config" modules.
It doesn't give the user a chance to configure anything. Sometimes it makes sense to configure the display differently for the same board, for example to control landscape/portrait display or use the async event loop.

amirgon commented 2 years ago

Merged! Thank you for your contribution.

If you decide to contribute the board configuration scripts, feel free to open another PR.