Closed kdschlosser closed 4 months ago
Yes, this library can be used without the GUI parts. What this means is that your UI implementation would have to pass the calibration points to lv_tc_compute_coeff(...)
and then any touch point from the user into lv_tc_transform_point(...)
. The calibration data can be read with the getter function or saved via the callback. This should work independent of lvgl.
However, if I understand correctly, all code referencing lvgl api would need to be removed since lvgl and this library must be compiled separately. Specifically the integration into indev would need to be removed and some types would change.
Closing due to inactivity. Feel free to reopen if your question isn't fully answered.
I am interested in using this library to do the touch calibration for LVGL but there is a kind of a twist.
I am working on a better LVGL binding to MicroPython. One that has a more universal API across the different MCU's that MicroPython is able to run on and supporting a greater range if different LCD and touch panel bus types. The goal is to allow the drivers for the LCD IC's and touch IC's to be written in python and have the underlying bus code written in C. Doing this allows for changing the LCD or touch panel that is connected without needing to compile firmware and writing the new firmware to the MCU. Another benefit from a design like this is rapid development and prototyping. This come from the ability to run MicroPython and LVGL on a desktop PC. With the API being consistent the same Python code that is run on the desktop is able to be transferred to the MCU without having to make any alterations to it.
Where we run into a little bit of a snag is how MicroPython handles compiling C code that is being added. We need to keep the firmware size as small as possible and to do that LVGL gets compiled as it own "module". Other C code doesn't access this module as it has a special interface that is generated at build time to make it accessible from Python code. Including LVGL into a calibration routine in C code would cause the firmware size to increase.
Ideally what I am wanting to do is be able to handle the calibration math in C code and have the GUI portion of the calibration be done in Python code. So my question becomes, can this library be used without the GUI? or is the GUI code intertwined with the calibration math in a manner that would not allow the calibration math to be used separately?
Here is the binding I am working on.
https://github.com/kdschlosser/lvgl_micropython
That binding allows for upgrading the version of LVGL that is used and also MicroPython without needing to make massive changes to the MicroPython build system which is a limitation of the official MicroPython binding. I am hoping that once the binding I am working on is complete that it will be adopted as the official binding... I am hopeful that it will be due to it having better support for LCD's and touch panels and it being consistent to use no matter the MCU that it is being run on.