#include <LovyanGFX.hpp>
class LGFX : public lgfx::LGFX_Device
{
lgfx::Panel_ILI9341 _panel_instance;
lgfx::Bus_SPI _bus_instance;
public:
LGFX(void)
{
{
auto cfg = _bus_instance.config();
cfg.spi_host = SPI3_HOST;
cfg.spi_mode = 0;
cfg.freq_write = 40000000;
cfg.pin_sclk = 47;
cfg.pin_mosi = 48;
cfg.pin_miso = -1;
cfg.pin_dc = 45;
_bus_instance.config(cfg);
_panel_instance.setBus(&_bus_instance);
}
{
auto cfg = _panel_instance.config();
cfg.pin_cs = 38;
cfg.pin_rst = 35;
cfg.pin_busy = -1;
cfg.memory_width = 240;
cfg.memory_height = 320;
cfg.panel_width = 240;
cfg.panel_height = 320;
cfg.offset_x = 0;
cfg.offset_y = 0;
cfg.offset_rotation = 0;
cfg.dummy_read_pixel = 8;
cfg.dummy_read_bits = 1;
cfg.readable = true;
cfg.invert = false;
cfg.rgb_order = false;
cfg.dlen_16bit = false;
cfg.bus_shared = true;
_panel_instance.config(cfg);
}
setPanel(&_panel_instance);
}
};
LGFX tft;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32-S3!");
Serial.print("ESP32 SDK Version: ");
Serial.println(ESP.getSdkVersion());
Serial.print("ESP32 SDK Version: ");
Serial.println(ESP_ARDUINO_VERSION_STR);
tft.init();
tft.fillScreen(TFT_RED);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}
Loading
ili9341-cap-touch
ili9341-cap-touch