lvgl / lv_binding_micropython

LVGL binding for MicroPython
MIT License
237 stars 156 forks source link

ESP32/CYD: Add support for XPT2046 access via SoftSpi and user supplied orientation tables for ILI9XXX classes #340

Open Angus71 opened 1 month ago

Angus71 commented 1 month ago

As I own a set of these cheap 2432S028 boards (CYD - Cheap Yellow Display) I wanted to use this project to create a UI for these kind of boards, but the used XPT2046 is not connected to any of the hardware SPI interfaces and needs to be used with a SoftSPI.

While implementing the required changes, I tried to keep the existing API as stable as possible. So the usage of a hardware vs. a software SPI based XPT2046 should be seamless

from xpt2046 import xpt2046_softspi as xpt2046

To support an easier integration of user supplied orientation_tables in ILI9XXX based classes I extended the API to enable the user to provide an own orientation_table and thus still reuse the already defined rotation constants. The API, when the user provided a positive rotation value is still active.

Changes

Possible optimizations