Void ST7789Vinitialcode(void) { //-----------------------------------ST7789S reset sequence------------------------------------// LCD_RESET=1); Delay (1); //Delay 1ms LCD_RESET=0); Delay (10); //Delay 10ms LCD_RESET=1); Delayms(120); WriteCom(0x11); Delayms(120); WriteCom(0x36); WriteData(0x00); WriteCom(0x3A); WriteData(0x05); WriteCom(0xB2); WriteData(0x0C); WriteData(0x0C); WriteData(0x00); WriteData(0x33); WriteData(0x33); WriteCom(0xB7); WriteData(0x35); WriteCom(0xBB); //VCOM WriteData(0x16); WriteCom(0xC0); WriteData(0x2C); WriteCom(0xC2); WriteData(0x01); WriteCom(0xC3); //GVDD WriteData(0x03); //3.7V WriteCom(0xC4); WriteData(0x20); WriteCom(0xC6); WriteData(0x0F); WriteCom(0xD0); WriteData(0xA4); WriteData(0xA1); WriteCom(0xE0); WriteData(0xD0); WriteData(0x04); WriteData(0x08); WriteData(0x08); WriteData(0x08); WriteData(0x25); WriteData(0x2A); WriteData(0x43); WriteData(0x42); WriteData(0x2B); WriteData(0x18); WriteData(0x18); WriteData(0x22); WriteData(0x23); WriteCom(0xE1); WriteData(0xD0); WriteData(0x03); WriteData(0x07); WriteData(0x08); WriteData(0x05); WriteData(0x23); WriteData(0x2A); WriteData(0x43); WriteData(0x42); WriteData(0x2B); WriteData(0x1A); WriteData(0x1A); WriteData(0x22); WriteData(0x23); WriteCom(0x29); Delayms(120); //ms WriteCom(0x21);//normal Black //WriteCom(0x20); //normal white WriteCom(0x2A); //Column Address Set WriteData(0x00); WriteData(0x00); //0 WriteData(0x00); WriteData(0xEF); //239 WriteCom(0x2B); //Row Address Set WriteData(0x00); WriteData(0x00); //0 WriteData(0x00); WriteData(0xEF); //239 WriteCom(0x2c); }