From b3eacec4fc600dbb4b674dd13e9941ca53e63c6f Mon Sep 17 00:00:00 2001 From: ainyan03 <205502311+ainyan03@users.noreply.github.com> Date: Thu, 10 Sep 2026 09:31:42 +0000 Subject: [PATCH] Add Panel_GC9B72 (360x360 round SPI TFT) Shares the GC9xxx base with GC9A01; NOP closing is disabled for the same reason as GC9A01. --- src/lgfx/v1/panel/Panel_GC9A01.hpp | 96 ++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/src/lgfx/v1/panel/Panel_GC9A01.hpp b/src/lgfx/v1/panel/Panel_GC9A01.hpp index da662a20..eb8de4f6 100644 --- a/src/lgfx/v1/panel/Panel_GC9A01.hpp +++ b/src/lgfx/v1/panel/Panel_GC9A01.hpp @@ -150,6 +150,102 @@ namespace lgfx } }; +//---------------------------------------------------------------------------- + + struct Panel_GC9B72 : public Panel_GC9xxx + { + Panel_GC9B72(void) + { + _cfg.panel_width = _cfg.memory_width = 360; + _cfg.panel_height = _cfg.memory_height = 360; + + _cfg.dummy_read_pixel = 16; + + // GC9A01 malfunctions when sending NOP. + // Therefore, the function to send a NOP at the end of communication should be disabled. + _nop_closing = false; + } + + protected: + + // Source : https://github.com/xboot/xstar/blob/bd51ce0ce0e6350fdb76ccdaed3627d3b8ad84e8/xstar/driver/framebuffer/fb-gc9b72.c + const uint8_t* getInitCommands(uint8_t listno) const override + { + static constexpr uint8_t list0[] = { + 0xFE, 0, + 0xEF, 0, + 0x80, 1, 0x19, + 0x82, 1, 0x09, + 0x83, 1, 0x03, + 0x88, 1, 0x00, + 0x89, 1, 0x38, + 0x8A, 1, 0x40, + 0x8B, 1, 0x0A, + 0x8C, 1, 0x00, + 0x81, 1, 0xFF, + 0x84, 1, 0xFF, + 0x85, 1, 0xFF, + 0x86, 1, 0xFF, + 0x87, 1, 0xFF, + 0x8E, 1, 0xFF, + 0x8F, 1, 0xFF, + 0x98, 1, 0x3E, + 0x99, 1, 0x3E, + 0x7D, 1, 0x72, + 0x70, 10, 0x02, 0x03, 0x03, 0x06, 0x03, 0x03, 0x09, 0x07, 0x09, 0x03, + 0x90, 4, 0x06, 0x06, 0x01, 0x01, + 0x93, 3, 0x02, 0xFF, 0x00, + 0xCB, 1, 0x02, + 0xFB, 2, 0x00, 0x00, + 0xF6, 1, 0xC0, + 0x6C, 7, 0x00, 0x00, 0x22, 0x00, 0xCC, 0x04, 0x58, + 0xAA, 2, 0x0B, 0x00, + 0xEC, 1, 0x07, + 0xF9, 1, 0x40, + 0xEB, 2, 0x01, 0x67, + 0x74, 6, 0x01, 0x60, 0x00, 0x00, 0x00, 0x00, + 0xB5, 3, 0x14, 0x14, 0x14, + 0x6E, 32, + 0x0B, 0x0B, 0x09, 0x09, 0x13, 0x13, 0x11, 0x11, + 0x16, 0x15, 0x01, 0x04, 0x00, 0x0D, 0x1D, 0x00, + 0x00, 0x1D, 0x0D, 0x00, 0x04, 0x08, 0x15, 0x16, + 0x12, 0x12, 0x14, 0x14, 0x0A, 0x0A, 0x0C, 0x0C, + 0x60, 4, 0x38, 0x1C, 0x13, 0x56, + 0x61, 4, 0xF8, 0x0A, 0x13, 0x56, + 0x62, 4, 0xF8, 0x0B, 0x13, 0x56, + 0x63, 4, 0x38, 0x1C, 0x13, 0x56, + 0x64, 6, 0x38, 0x20, 0x72, 0xF8, 0x13, 0x56, + 0x65, 6, 0x78, 0x1A, 0x70, 0x0B, 0x56, 0x13, + 0x66, 6, 0x38, 0x24, 0x72, 0xFC, 0x13, 0x56, + 0x68, 7, 0xB3, 0x08, 0x0E, 0x08, 0x0E, 0x0A, 0x0A, + 0x69, 7, 0xB3, 0x08, 0x0E, 0x08, 0x0E, 0x0A, 0x0A, + 0x6A, 2, 0x00, 0x00, + 0x3A, 1, 0x05, // COLMOD: 16 bits / pixel (RGB565) + 0x36, 1, 0x00, // MADCTL + 0x7C, 2, 0xB6, 0x29, + 0xAC, 1, 0x40, + 0xC3, 1, 0x1A, + 0xC4, 1, 0x24, + 0xC9, 1, 0x2F, + 0xF0, 6, 0x11, 0x17, 0x08, 0x06, 0x05, 0x38, + 0xF1, 6, 0x4D, 0x72, 0x72, 0x2D, 0x34, 0x8F, + 0xF2, 6, 0x11, 0x17, 0x08, 0x06, 0x05, 0x38, + 0xF3, 6, 0x4D, 0x72, 0x72, 0x2D, 0x34, 0x8F, + 0xB4, 1, 0x0A, + 0x35, 1, 0x00, + 0xFE, 0, + 0xEE, 0, + 0x11, 0+CMD_INIT_DELAY, 120, // sleep out + 0x29, 0, // display on + 0xFF,0xFF, // end + }; + switch (listno) { + case 0: return list0; + default: return nullptr; + } + } + }; + //---------------------------------------------------------------------------- struct Panel_GC9107 : public Panel_GC9xxx