void LCD_Init(void) { //CS0=0; RST=1; Delay(200); RST=0; Delay(800); RST=1; Delay(800); WriteComm(0x11); //Sleep out Delay(120); //Delay 120ms //------------------------------------ST7735S Frame Rate-----------------------------------------// WriteComm(0xB1); WriteData(0x05);//0x05 WriteData(0x3A);//0x3A WriteData(0x3A);//0x3A WriteComm(0xB2); WriteData(0x05); WriteData(0x3A); WriteData(0x3A); WriteComm(0xB3); WriteData(0x05); WriteData(0x3A); WriteData(0x3A); WriteData(0x05); WriteData(0x3A); WriteData(0x3A); //------------------------------------End ST7735S Frame Rate-----------------------------------------// WriteComm(0xB4); //Dot inversion WriteData(0x03); //------------------------------------ST7735S Power Sequence-----------------------------------------// WriteComm(0xC0); WriteData(0x62); WriteData(0x02); WriteData(0x04); WriteComm(0xC1); WriteData(0xC0); WriteComm(0xC2); WriteData(0x0D); WriteData(0x00); WriteComm(0xC3); WriteData(0x8D); WriteData(0x6A); WriteComm(0xC4); WriteData(0x8D); WriteData(0xEE); //---------------------------------End ST7735S Power Sequence-------------------------------------// WriteComm(0xC5); //VCOM WriteData(0x12);//0x12 //------------------------------------ST7735S Gamma Sequence-----------------------------------------// WriteComm(0xE0); WriteData(0x03); WriteData(0x1B); WriteData(0x12); WriteData(0x11); WriteData(0x3F); WriteData(0x3A); WriteData(0x32); WriteData(0x34); WriteData(0x2F); WriteData(0x2B); WriteData(0x30); WriteData(0x3A); WriteData(0x00); WriteData(0x01); WriteData(0x02); WriteData(0x05); WriteComm(0xE1); WriteData(0x03); WriteData(0x1B); WriteData(0x12); WriteData(0x11); WriteData(0x32); WriteData(0x2F); WriteData(0x2A); WriteData(0x2F); WriteData(0x2E); WriteData(0x2C); WriteData(0x35); WriteData(0x3F); WriteData(0x00); WriteData(0x00); WriteData(0x01); WriteData(0x05); //------------------------------------End ST7735S Gamma Sequence-----------------------------------------// //WriteComm(0x21); //WriteComm(0xFC); //Enable Gate power save mode WriteData(0x8C); WriteComm(0x3A); //65k mode WriteData(0x05); WriteComm(0x36); //65k mode WriteData(0x08); WriteComm(0x29); WriteComm(0x2C); //Display on }