ili9xxx: Add support for GC9A01A display (#6351)

* Add support for GCA901A display


---------

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Clyde Stubbs 2024-03-11 18:19:35 +11:00 committed by GitHub
parent dfb14fc6ea
commit 221f04b9a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 71 additions and 0 deletions

View File

@ -51,6 +51,7 @@ ILI9XXXColorMode = ili9xxx_ns.enum("ILI9XXXColorMode")
ColorOrder = display.display_ns.enum("ColorMode")
MODELS = {
"GC9A01A": ili9xxx_ns.class_("ILI9XXXGC9A01A", ILI9XXXDisplay),
"M5STACK": ili9xxx_ns.class_("ILI9XXXM5Stack", ILI9XXXDisplay),
"M5CORE": ili9xxx_ns.class_("ILI9XXXM5CORE", ILI9XXXDisplay),
"TFT_2.4": ili9xxx_ns.class_("ILI9XXXILI9341", ILI9XXXDisplay),

View File

@ -254,5 +254,10 @@ class ILI9XXXS3BoxLite : public ILI9XXXDisplay {
ILI9XXXS3BoxLite() : ILI9XXXDisplay(INITCMD_S3BOXLITE, 320, 240, true) {}
};
class ILI9XXXGC9A01A : public ILI9XXXDisplay {
public:
ILI9XXXGC9A01A() : ILI9XXXDisplay(INITCMD_GC9A01A, 240, 240, true) {}
};
} // namespace ili9xxx
} // namespace esphome

View File

@ -316,6 +316,60 @@ static const uint8_t PROGMEM INITCMD_ST7789V[] = {
0x00 // End of list
};
static const uint8_t PROGMEM INITCMD_GC9A01A[] = {
0xEF, 0,
0xEB, 1, 0x14, // ?
0xFE, 0,
0xEF, 0,
0xEB, 1, 0x14, // ?
0x84, 1, 0x40, // ?
0x85, 1, 0xFF, // ?
0x86, 1, 0xFF, // ?
0x87, 1, 0xFF, // ?
0x88, 1, 0x0A, // ?
0x89, 1, 0x21, // ?
0x8A, 1, 0x00, // ?
0x8B, 1, 0x80, // ?
0x8C, 1, 0x01, // ?
0x8D, 1, 0x01, // ?
0x8E, 1, 0xFF, // ?
0x8F, 1, 0xFF, // ?
0xB6, 2, 0x00, 0x00, // ?
0x90, 4, 0x08, 0x08, 0x08, 0x08, // ?
ILI9XXX_PIXFMT , 1, 0x05,
ILI9XXX_MADCTL , 1, MADCTL_MX| MADCTL_BGR, // Memory Access Control
0xBD, 1, 0x06, // ?
0xBC, 1, 0x00, // ?
0xFF, 3, 0x60, 0x01, 0x04, // ?
0xC3, 1, 0x13,
0xC4, 1, 0x13,
0xF9, 1, 0x22,
0xBE, 1, 0x11, // ?
0xE1, 2, 0x10, 0x0E, // ?
0xDF, 3, 0x21, 0x0c, 0x02, // ?
0xF0, 6, 0x45, 0x09, 0x08, 0x08, 0x26, 0x2A,
0xF1, 6, 0x43, 0x70, 0x72, 0x36, 0x37, 0x6F,
0xF2, 6, 0x45, 0x09, 0x08, 0x08, 0x26, 0x2A,
0xF3, 6, 0x43, 0x70, 0x72, 0x36, 0x37, 0x6F,
0xED, 2, 0x1B, 0x0B, // ?
0xAE, 1, 0x77, // ?
0xCD, 1, 0x63, // ?
0xE8, 1, 0x34,
0x62, 12, 0x18, 0x0D, 0x71, 0xED, 0x70, 0x70, // ?
0x18, 0x0F, 0x71, 0xEF, 0x70, 0x70,
0x63, 12, 0x18, 0x11, 0x71, 0xF1, 0x70, 0x70, // ?
0x18, 0x13, 0x71, 0xF3, 0x70, 0x70,
0x64, 7, 0x28, 0x29, 0xF1, 0x01, 0xF1, 0x00, 0x07, // ?
0x66, 10, 0x3C, 0x00, 0xCD, 0x67, 0x45, 0x45, 0x10, 0x00, 0x00, 0x00, // ?
0x67, 10, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x01, 0x54, 0x10, 0x32, 0x98, // ?
0x74, 7, 0x10, 0x85, 0x80, 0x00, 0x00, 0x4E, 0x00, // ?
0x98, 2, 0x3e, 0x07, // ?
0x35, 0,
ILI9XXX_SLPOUT , 0x80, // Exit Sleep
ILI9XXX_DISPON , 0x80, // Display on
0x00 // End of list
};
// clang-format on
} // namespace ili9xxx
} // namespace esphome

View File

@ -0,0 +1,11 @@
spi:
mosi_pin: GPIO23
clk_pin: GPIO18
display:
- platform: ili9xxx
model: gc9a01a
id: gca901_display
cs_pin: GPIO5
dc_pin: GPIO22
reset_pin: GPIO21