these are my working settings with LovyanGFX and Arduino_GFX_Library:
###LovyanGFX###
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
#include <lvgl.h>
class LGFX : public lgfx::LGFX_Device{
lgfx::Bus_RGB _bus_instance;
lgfx::Panel_RGB _panel_instance;
lgfx::Light_PWM _light_instance;
lgfx::Touch_XPT2046 _touch_instance;
public:LGFX(void){
auto cfg = _bus_instance.config();
cfg.panel = &_panel_instance;
cfg.pin_d0 = GPIO_NUM_8; // B0
cfg.pin_d1 = GPIO_NUM_3; // B1
cfg.pin_d2 = GPIO_NUM_46; // B2
cfg.pin_d3 = GPIO_NUM_9; // B3
cfg.pin_d4 = GPIO_NUM_1; // B4
cfg.pin_d5 = GPIO_NUM_5; // G0
cfg.pin_d6 = GPIO_NUM_6; // G1
cfg.pin_d7 = GPIO_NUM_7; // G2
cfg.pin_d8 = GPIO_NUM_15; // G3
cfg.pin_d9 = GPIO_NUM_16; // G4
cfg.pin_d10 = GPIO_NUM_4; // G5
cfg.pin_d11 = GPIO_NUM_45; // R0
cfg.pin_d12 = GPIO_NUM_48; // R1
cfg.pin_d13 = GPIO_NUM_47; // R2
cfg.pin_d14 = GPIO_NUM_21; // R3
cfg.pin_d15 = GPIO_NUM_14; // R4
cfg.pin_henable = GPIO_NUM_40;
cfg.pin_vsync = GPIO_NUM_41;
cfg.pin_hsync = GPIO_NUM_39;
cfg.pin_pclk = GPIO_NUM_42;
cfg.freq_write = 12000000; //16000000
cfg.hsync_polarity = 0; //0
cfg.hsync_front_porch = 8; //8
cfg.hsync_pulse_width = 4; //4
cfg.hsync_back_porch = 43; //43
cfg.vsync_polarity = 0; //0
cfg.vsync_front_porch = 8; //8
cfg.vsync_pulse_width = 4; //4
cfg.vsync_back_porch = 12; //12
cfg.pclk_idle_high = 1; //1
_bus_instance.config(cfg);
_panel_instance.setBus(&_bus_instance);
{ auto cfg = _panel_instance.config();
cfg.memory_width = 480;
cfg.memory_height = 272;
cfg.panel_width = 480;
cfg.panel_height = 272;
cfg.offset_x = 0;
cfg.offset_y = 0;
_panel_instance.config(cfg);
}
{ auto cfg = _panel_instance.config_detail();
cfg.use_psram = 1;
_panel_instance.config_detail(cfg);
}
{ auto cfg = _light_instance.config();
cfg.pin_bl = GPIO_NUM_2;
_light_instance.config(cfg);
}
_panel_instance.light(&_light_instance);
{
auto cfg = _touch_instance.config();
cfg.x_min = 100;
cfg.x_max = 4000;
cfg.y_min = 100;
cfg.y_max = 4000;
cfg.pin_int = -1;
cfg.bus_shared = true;
cfg.offset_rotation = 0;// 0-7
cfg.spi_host = 1; //
cfg.freq = 1000000;
cfg.pin_sclk = 12;
cfg.pin_mosi = 11;
cfg.pin_miso = 13;
cfg.pin_cs = 38;
_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance);
}
setPanel(&_panel_instance);
}
};
static LGFX tft;
void setup(){
tft.begin();
tft.setRotation(0);
tft.setBrightness(255);
}
###Arduino_GFX_Library###
#define GFX_BL DF_GFX_BL
#define TFT_BL 2
Arduino_ESP32RGBPanel bus = new Arduino_ESP32RGBPanel(
GFX_NOT_DEFINED / CS /, GFX_NOT_DEFINED / SCK /, GFX_NOT_DEFINED / SDA /,
40 / DE /, 41 / VSYNC /, 39 / HSYNC /, 42 / PCLK /,
45 / R0 /, 48 / R1 /, 47 / R2 /, 21 / R3 /, 14 / R4 /,
5 / G0 /, 6 / G1 /, 7 / G2 /, 15 / G3 /, 16 / G4 /, 4 / G5 /,
8 / B0 /, 3 / B1 /, 46 / B2 /, 9 / B3 /, 1 / B4 */
);
Arduino_RPi_DPI_RGBPanel gfx = new Arduino_RPi_DPI_RGBPanel(
bus,
480 / width /, 0 / hsync_polarity /, 8 / hsync_front_porch /, 4 / hsync_pulse_width /, 42 / 43 hsync_back_porch /,
272 / height /, 0 / vsync_polarity */, 8 /*8 vsync_front_porch /, 4 / vsync_pulse_width /, 12 / 12 vsync_back_porch /,
1 / pclk_active_neg /, 12000000 / prefer_speed /, true / auto_flush */);
void setup(){
gfx->begin();
gfx->fillScreen(BLACK);
pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, HIGH);
}