I have LH114T display. It is work fine on TFT_eSPI.
But the image is shifted if i use lvgl.
How to adjust the offsets? just as it is done in the library for Arduino
Do you need to add offsets to the coordinate where lvgl draws the image?
I’ve checked the library (https://github.com/nopnop2002/esp-idf-st7789) and they add the offset (_offsetx and _offsety) when drawing:
void lcdDrawPixel(TFT_t * dev, uint16_t x, uint16_t y, uint16_t color){
if (x >= dev->_width) return;
if (y >= dev->_height) return;
uint16_t _x = x + dev->_offsetx;
uint16_t _y = y + dev->_offsety;
spi_master_write_command(dev, 0x2A); // set column(x) address
spi_master_write_addr(dev, _x, _x);
spi_master_write_command(dev, 0x2B); // set Page(y) address
spi_master_write_addr(dev, _y, _y);
spi_master_write_command(dev, 0x2C); // Memory Write
spi_master_write_data_word(dev, color);
}
I don’t have any display to test it right now but I think you need to edit st7789_flush function (available here: components/lvgl_esp32_drivers/lvgl_tft/st7789.c):
I think we were using 6.1 or something, I’m not sure, I can’t update it to v7 because it’s not released yet, I will try to get it update to the latest v6