3-bit mode added to copied ili9xxx driver for ILI9488 and ILI9488_A #6039
Replies: 4 comments 3 replies
-
Hi @maartenwrs Can you show the YAML code that belongs to this modification? |
Beta Was this translation helpful? Give feedback.
-
I just pushed an update to pack two pixels per byte of buffer space. This enables the ili9xxx 'single-write' mode for 3-bit support and also enables the buffer space to be one quarter that of 16-bit (18-bit) mode. I updated the thread above accordingly. |
Beta Was this translation helpful? Give feedback.
-
Merged PR6034 (draw_pixels_at) commit from esphome dev branch. |
Beta Was this translation helpful? Give feedback.
-
@nielsnl68 I would like to propose defining a COLOR_BITNESS_111 for native 3-bit color mode in esphome and providing an implementation - with a view to subsequently generate a pull request. Would that be something that might have a path forward? |
Beta Was this translation helpful? Give feedback.
-
An ILI9488 TFT display connected to an ESP32 CPU over SPI is driven by esphome's ili9xxx driver using 18-bit mode because the hardware in the driver chip does not support 16-bit mode - even though the manual says it does (hw bug). Although 18-bit mode is slower than 16-bit mode since an extra byte is needed, it generally works quite well.
However, on higher resolution displays such as 480x320 pixels, the CPU spends a lot of time doing pixel processing. It turns out that the ILI9488 also supports a 3-bit mode which packs 2 pixels into a single byte at the expense of only allowing 8 colors. 3-bit mode for 4-wire SPI is described on page 121 in the manual.
To get my board running faster and using less memory for the display buffer, I added some experimental code for ILI9488 3-bit mode to the ili9xxx driver from the esphome dev branch. It is in this repository.
To try it, add this to an esphome config that defines display platform: ili9xxx and model: ILI9488 or model: ILI9488_A:
And in the display: configuration, add this line:
With 3-bit mode, these 8 colors can be declared:
The ili9xxx config dumped to the console on start-up will show that 3-bit mode is enabled. Compared to 18-bit mode (which stores color pixels as RGB 565 in 16-bits), 3-bit mode uses one quarter of the buffer space since it packs two pixels per byte of buffer space.
If you have an ILI9488 TFT and you know how to use the esphome dev branch, please give it a whirl and let me know how things went. Thanks, Maarten
Disclaimer: this is not an official esphome driver feature request, feature or implementation. This is experimental stuff that has little soak time and no code review yet. If you don't use the esphome dev branch, this exercise may not be for you)
Beta Was this translation helpful? Give feedback.
All reactions