LVGL 9 + support for 16-bit SPI displays
Hi,
Thanks for your port, it got me inspired enough to leave the TFT_eSPI library and move to LVGL. Reason I not started out with LVGL from the beginning was that no other library seems to handle ILI9488 displays running in 16-bit SPI configurations.
I forked your repo and got the 16-bit stuff working (just a matter of padding/sending parameters in 16-bit chunks). Unfortunately my linter messed up the formatting so creating a patch wasn't a one-line git thing any more.
Also moved to LVGL 9 and the fact that it uses RGB888 internally means the color_buffer in the driver can be removed (and also the bit stuffing).
Everything is in two branches on my fork, I think one would need everything from both because some 16-bit things ended up in the LVGL 9 branch.
What is needed to get this 100% working is a way to keep track of the display/parameter bit setting within the driver (for the 16-bit padding). Not sure I will find time for that in the near future but with this issue, at least someone looking will find a pointer to a solution.
Fork: https://github.com/phlundblom/esp_lcd_ili9488
Branches: feature/16-bit-support and feature/uprade-to-lvgl-9
I'm surprised that 16-bit wasn't working for you, it was tested previously with no issues reported.
Unfortunately the code reformat will make accepting a patch quite challenging. I was looking through the diffs and it looks like mostly it is adjustments in the writing of color data? I'm also unsure that the removal of color_buffer in 18-bit mode is feasible or not, the buffer needs to be from DMA capable memory in most cases.
For LVGL9, it would be preferred to have it as a dedicated example and not modify the LVGL8 example(s) used today. Also the Kconfig file was recently removed from the LVGL8 example that had it.
I cleaned it up a bit and will keep it on my fork. Free to use, should be possible to create a PR from it now (minus the Kconfig).
New branch is lvgl-9-and-16-bit-spi-support.
16-bit isn't working because the display expects command and parameters to be of the number of configured bits. A 16-bit parameter must be sent as two bytes even though it only contains one byte of data. Something I found out dissecting TFT_eSPI. This is applicable to crappy Raspberry Pi 3.5" displays (crappy because they also doesn't support SPI speeds above ~20MHz). I assume the padding is necessary in a theoretical 32-bit scenario too.
Ideally this juggling could have been done in esp-idf/componets/esp_lcd/spi/esp_lcd_panel_io_spi.c. In that file, the private structs already contains information on cmd/parameter_bits.
Removing the color_buffer is fine because the buffers provided to LVGL are allocated in DMA:able memory.
Did something of the same to add support for lvgl 9, but as a hack job. So it's no improvement on the driver, just adapted to my use. But the info from @phlundblom's is good Edit: the changes are to draw_bitmap and maybe some in the create. Not much changes needed. Also it works on c6, tried two boards. Super mini c6 4mb and a very generic 8mb one. Think I just needed to alter the c3 to c6 for example to work. I might provide patches at some point but I'm really just learning to code c. My implementation: https://github.com/oisteink/zenith/tree/master/zenith_components%2Fesp_lcd_ili9488