void ILI9341_CTC2.8_Initial(void) { // VCI=2.8V //************* Reset LCD Driver ****************// LCD_nRESET = 1; delayms(1); // Delay 1ms LCD_nRESET = 0; delayms(10); // Delay 10ms, This delay time is necessary LCD_nRESET = 1; delayms(120); // Delay 120 ms WriteCom(0xCF); WriteData(0x00); WriteData(0xc9); //91 c1 c9 3-4 WriteData(0Xe0); //30 e0 WriteCom(0xED); WriteData(0x67); WriteData(0x03); WriteData(0X12); WriteData(0X81); WriteCom(0xE8); WriteData(0x85); WriteData(0x11); WriteData(0x78); WriteCom(0xCB); WriteData(0x39); WriteData(0x2C); WriteData(0x00); WriteData(0x34); WriteData(0x02); WriteCom(0xF7); WriteData(0x20); WriteCom(0xEA); WriteData(0x00); WriteData(0x00); WriteCom(0xC0); //Power control WriteData(0x21); //VRH[5:0] WriteCom(0xC1); //Power control WriteData(0x10); //SAP[2:0];BT[3:0] 11 WriteCom(0xC5); //VCM control WriteData(0x24); //24 WriteData(0x3e); //3c WriteCom(0xC7); //VCM control2 WriteData(0xb7); //c7 WriteCom(0x36); // Memory Access Control WriteData(0x48); WriteCom(0xF2); // 3Gamma Function Disable WriteData(0x00); WriteCom(0x26); //Gamma curve selected WriteData(0x01); WriteCom(0xB1); WriteData(0x10); WriteCom(0x3A); //Gamma curve selected WriteData(0x55); //55 65k;56 262k WriteCom(0xE0); //Set Gamma WriteData(0x0F); WriteData(0x1B); WriteData(0x19); WriteData(0x0C); WriteData(0x0D); WriteData(0x07); WriteData(0x44); WriteData(0xA9); WriteData(0x2F); WriteData(0x08); WriteData(0x0D); WriteData(0x03); WriteData(0x10); WriteData(0x0B); WriteData(0x00); WriteCom(0XE1); //Set Gamma WriteData(0x00); WriteData(0x24); WriteData(0x26); WriteData(0x03); WriteData(0x12); WriteData(0x08); WriteData(0x3C); WriteData(0x56); WriteData(0x50); WriteData(0x07); WriteData(0x12); WriteData(0x0C); WriteData(0x2F); WriteData(0x34); WriteData(0x0F); //Window Setting WriteCom(0x2A); WriteData(0x00); WriteData(0x00); WriteData(0x00); WriteData(0xEf); //// WriteCom(0x2B); WriteData(0x00); WriteData(0x00); WriteData(0x01); WriteData(0x3f); // WriteCom(0x11); //Exit Sleep Delayms(120); WriteCom(0x29); //Display on WriteCom(0x2C); } void LCD_Enter Standby_ILI9341(void) { LCD_CtrlWrite_ILI9341(0x0028); // Display off Delayms(100); LCD_CtrlWrite_ILI9341(0x0010); // Enter Standby mode } void LCD_Exit Standby _ILI9341(void) { LCD_CtrlWrite_ILI9341(0x0011); // Standby out Delayms(100); LCD_CtrlWrite_ILI9341(0x0029); // Display on }