Add support for ESP32-S3-BOX displays (#4942)

The ESP32-S3-BOX display has an ILI9xxx driver
Add the needed configuration so that it works.
This commit is contained in:
guillempages 2023-06-17 10:38:44 +02:00 committed by GitHub
parent ffa669899a
commit 1a7f121ac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 0 deletions

View File

@ -44,6 +44,7 @@ MODELS = {
"ILI9486": ili9XXX_ns.class_("ILI9XXXILI9486", ili9XXXSPI),
"ILI9488": ili9XXX_ns.class_("ILI9XXXILI9488", ili9XXXSPI),
"ST7796": ili9XXX_ns.class_("ILI9XXXST7796", ili9XXXSPI),
"S3BOX": ili9XXX_ns.class_("ILI9XXXS3Box", ili9XXXSPI),
"S3BOX_LITE": ili9XXX_ns.class_("ILI9XXXS3BoxLite", ili9XXXSPI),
}

View File

@ -421,6 +421,17 @@ void ILI9XXXST7796::initialize() {
}
}
// 24_TFT rotated display
void ILI9XXXS3Box::initialize() {
this->init_lcd_(INITCMD_S3BOX);
if (this->width_ == 0) {
this->width_ = 320;
}
if (this->height_ == 0) {
this->height_ = 240;
}
}
// 24_TFT rotated display
void ILI9XXXS3BoxLite::initialize() {
this->init_lcd_(INITCMD_S3BOXLITE);

View File

@ -134,6 +134,11 @@ class ILI9XXXST7796 : public ILI9XXXDisplay {
void initialize() override;
};
class ILI9XXXS3Box : public ILI9XXXDisplay {
protected:
void initialize() override;
};
class ILI9XXXS3BoxLite : public ILI9XXXDisplay {
protected:
void initialize() override;

View File

@ -169,6 +169,36 @@ static const uint8_t PROGMEM INITCMD_ST7796[] = {
0x00 // End of list
};
static const uint8_t PROGMEM INITCMD_S3BOX[] = {
0xEF, 3, 0x03, 0x80, 0x02,
0xCF, 3, 0x00, 0xC1, 0x30,
0xED, 4, 0x64, 0x03, 0x12, 0x81,
0xE8, 3, 0x85, 0x00, 0x78,
0xCB, 5, 0x39, 0x2C, 0x00, 0x34, 0x02,
0xF7, 1, 0x20,
0xEA, 2, 0x00, 0x00,
ILI9XXX_PWCTR1 , 1, 0x23, // Power control VRH[5:0]
ILI9XXX_PWCTR2 , 1, 0x10, // Power control SAP[2:0];BT[3:0]
ILI9XXX_VMCTR1 , 2, 0x3e, 0x28, // VCM control
ILI9XXX_VMCTR2 , 1, 0x86, // VCM control2
ILI9XXX_MADCTL , 1, 0xC8, // Memory Access Control
ILI9XXX_VSCRSADD, 1, 0x00, // Vertical scroll zero
ILI9XXX_PIXFMT , 1, 0x55,
ILI9XXX_FRMCTR1 , 2, 0x00, 0x18,
ILI9XXX_DFUNCTR , 3, 0x08, 0x82, 0x27, // Display Function Control
0xF2, 1, 0x00, // 3Gamma Function Disable
ILI9XXX_GAMMASET , 1, 0x01, // Gamma curve selected
ILI9XXX_GMCTRP1 , 15, 0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, // Set Gamma
0x4E, 0xF1, 0x37, 0x07, 0x10, 0x03,
0x0E, 0x09, 0x00,
ILI9XXX_GMCTRN1 , 15, 0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, // Set Gamma
0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C,
0x31, 0x36, 0x0F,
ILI9XXX_SLPOUT , 0x80, // Exit Sleep
ILI9XXX_DISPON , 0x80, // Display on
0x00 // End of list
};
static const uint8_t PROGMEM INITCMD_S3BOXLITE[] = {
0xEF, 3, 0x03, 0x80, 0x02,
0xCF, 3, 0x00, 0xC1, 0x30,