LilyGo T-Display-S3-Pro #674
Robotopera
started this conversation in
Device Configurations
Replies: 1 comment
-
#define LGFX_USE_V1
#include <LovyanGFX.hpp>
// #include "util/main.h" // for Debug
#ifndef BOARDS_T_DISPLAY_S3_Pro_H
#define BOARDS_T_DISPLAY_S3_Pro_H
#define BRIGHTNESS_MAX_LEVEL 255
// ST7796
#define LCD_WIDTH 222
#define LCD_HEIGHT 480
#define LCD_BL 48
#define LCD_MOSI 17
#define LCD_MISO 8
#define LCD_SCLK 18
#define LCD_CS 39
#define LCD_DC 9
#define LCD_RST 47
// SY6970
#define SY6970_SDA 5
#define SY6970_SCL 6
#define SY6970_Address 0x6A
#define SY6970_INT 21
// IIC
#define IIC_SDA 5
#define IIC_SCL 6
// SD
#define SD_CS 14
#define SD_MISO 8
#define SD_MOSI 17
#define SD_SCLK 18
// T-Display-S3-Pro-MVSRBoard
// RT9080
#define RT9080_EN 42
// AW8624
#define AW8624_TRIG_INT 40
#define AW8624_SDA 5
#define AW8624_SCL 6
// Vibration Motor
#define VIBRATINO_MOTOR_PWM 45
// MAX98357A
#define MAX98357A_BCLK 4
#define MAX98357A_LRCLK 15
#define MAX98357A_DIN 11
#define MAX98357A_SD_MODE 41
// MAX98357A
#define MSM261_WS 10
#define MSM261_BCLK 1
#define MSM261_DOUT 2
#define MSM261_EN 3
// CST226SE
#define TOUCH_RST 13
#define TOUCH_INT 21
// PCF85063
#define PCF85063_INT 7
class LGFX : public lgfx::LGFX_Device {
public:
lgfx::Bus_SPI _bus_instance;
lgfx::Panel_ST7796 _panel_instance;
lgfx::Light_PWM _light_instance;
// lgfx::Touch_ (no compatible driver) _touch_instance;
LGFX(void) {
{
auto cfg = _bus_instance.config();
cfg.spi_host = SPI2_HOST;
cfg.spi_mode = 0;
cfg.freq_write = 40000000;
cfg.freq_read = 16000000;
cfg.spi_3wire = true;
cfg.use_lock = true;
cfg.dma_channel = SPI_DMA_CH_AUTO;
cfg.pin_sclk = LCD_SCLK;
cfg.pin_mosi = LCD_MOSI;
cfg.pin_miso = LCD_MISO;
cfg.pin_dc = LCD_DC;
_bus_instance.config(cfg);
_panel_instance.setBus(&_bus_instance);
}
{
auto cfg = _panel_instance.config();
cfg.invert = true;
cfg.pin_rst = LCD_RST;
cfg.pin_cs = LCD_CS;
cfg.pin_busy = -1;
cfg.panel_width = LCD_WIDTH;
cfg.panel_height = LCD_HEIGHT;
cfg.memory_width = LCD_WIDTH;
cfg.memory_height = LCD_HEIGHT;
cfg.offset_x = 49;
cfg.offset_y = 0;
cfg.bus_shared = true;
_panel_instance.config(cfg);
}
{
auto cfg = _light_instance.config();
cfg.pin_bl = LCD_BL;
cfg.invert = false;
cfg.freq = 44100;
cfg.pwm_channel = 7;
_light_instance.config(cfg);
_panel_instance.setLight(&_light_instance);
}
{
// touch instance
// no compatible driver
}
setPanel(&_panel_instance);
}
};
#endif // BOARDS_T_DISPLAY_S3_Pro_H |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Working on a setup for this device based on the LGFX_ESP32 sample but any help appreciated.
https://lilygo.cc/products/t-display-s3-pro
Using spi ST7796
Beta Was this translation helpful? Give feedback.
All reactions