I am not sure what I am doing wrong.
Do you know about any example for 4BPP?
The display works with 4BPP and has 16 shades of gray.
In Lvgl I am using RGB233 and I convert it with set_px_cb.
Could you please take a look at this conversion?
disp_driver.set_px_cb = lv_vdb_wr_bpp4;
...
void lv_vdb_wr_bpp4(lv_disp_drv_t * disp_drv, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa)
{
(void)opa;
(void)disp_drv;
uint8_t brightness_4BPP;
buf += buf_w / 2 * y; //(buf + ((buf_w * y) / 2))
buf += x / 2; //buf + (x / 2)
brightness_4BPP = lv_color_brightness(color) / 17; //[0xFF, 0x0] to [0xF, 0x0]
if (x % 2 == 0)
{
(*buf) = brightness_4BPP << 4;
}
else
{
(*buf) |= brightness_4BPP;
}
}