I would like to use LVGL with a 128x64 monochrome display (1 bit / pixel).
The documentation states that LVGL can be used with such displays, but
I didn’t find any in-tree example code. Via Google I found some existing examples
which set LV_COLOR_DEPTH to 1 for this. But this seems to be unsupported
with current LVGL-9.1.
As I use an embedded Linux system with tons of RAM, it wouldn’t be an issue
requiring more than 1 bit/pixel of RAM for buffers.
What MCU/Processor/Board and compiler are you using?
NXP i.MX6ULL
What LVGL version are you using?
Version 9.1
What do you want to achieve?
Using a monochrome display (ST7539 controller) with LVGL.
What have you tried so far?
Looking for existing projects using LVGL with monochrome displays (only found pre-9.0 stuff)
Setting LV_COLOR_DEPTH to 1 (results in compile errors, LV_COLOR_FORMAT_NATIVE undeclared)
Analyzed the GIT history of lv_conf_template.h (only found out that LV_COLOR_DEPTH 1 has been removed in f753265a799b (“arch(draw): add parallel rendering architecture”)
Analyzed the GIT history of docs/overview/colors.rst (only found out that LV_COLOR_DEPTH 1 has been removed in d5daccdd48f8 (“docs: update API comments”))
If you intend to continue with version 9, perhaps you can change the way the framebuffer is sent to the display and convert the RGB to monochrome before sending it to the hardware.
But version 9 does not yet support the monochrome standard according to the documentation.
Maybe the monochrome mode has been removed by intention? But for a library which states to support monochrome displays, the available examples could definitely be improved.
Have you tried using version 8?
I wasn’t aware of the fact that version 9 is more or less a complete rewrite. As a side effect, there are almost no working graphics drivers available (beside a hand full in the main repository). All drivers which I found in external repos (like lv_drivers or esp32) have been written for some older version (which one?) of LVGL.
I am starting a new development. Would it be future proof to start with an older version?
I already read somewhere that set_px_cb() should now be implemented within flush_cb(). But I am unsure how to convert px_data into monochrome (there used to be a lv_color_to1() method in older versions). The format of px_data seems to depend on the display`s color mode. But who is the stakeholder of this color mode?
The application? → The display driver must be able to convert from any color mode into a supported one.
The display driver (e.g. in lv_xxx_create()) → Usually no conversion is required in flush_cb (only for monochrome).
Another strange thing is, that px_data contains some non-zero data at the beginning of the buffer, although I didn’t create any widgets yet. Even if I create a single widget, only the first bytes of px_data seem to contain non-zero values.
I am also trying to setup LVGL V9.2 with a monochrome display from Newhaven - 128x128 ST7528. As per the documentation, rendering for monochrome displays seems to be supported. I just cannot find proper documentation to implement the flush callback for this display.
Can any one give me a direction here?
Thanks.
By the way I am able to run the simulator with the monochrome setting correctly. So it seems the graphics library is all setup to work with monochrome displays. Just the flush_cb() needs to be implemented for which I need to know what will be the contents of the draw buffer which I can modify and send to the display over SPI.