//VCI=IOVCC=3.3V void Init_LCD(void) { LCD_nRST = 1; delayms(50); LCD_nRST = 0; delayms(50); LCD_nRST = 1; delayms(120); //------end Reset Sequence-----// LCD_CtrlWrite(0xFE); LCD_CtrlWrite(0xEF); LCD_CtrlWrite(0x80); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x81); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x82); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x83); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x84); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x85); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x86); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x87); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x88); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x89); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x8A); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x8B); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x8C); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x8D); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x8E); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x8F); LCD_DataWrite(0xFF); LCD_CtrlWrite(0x3A); LCD_DataWrite(0x05); LCD_CtrlWrite(0xEC); LCD_DataWrite(0x01); LCD_CtrlWrite(0x74); LCD_DataWrite(0x02); LCD_DataWrite(0x0E); LCD_DataWrite(0x00); LCD_DataWrite(0x00); LCD_DataWrite(0x00); LCD_DataWrite(0x00); LCD_DataWrite(0x00); LCD_CtrlWrite(0x98); LCD_DataWrite(0x3E); LCD_CtrlWrite(0x99); LCD_DataWrite(0x3E); LCD_CtrlWrite(0xB5); LCD_DataWrite(0x0D); LCD_DataWrite(0x0D); LCD_CtrlWrite(0x60); LCD_DataWrite(0x38); LCD_DataWrite(0x0F); LCD_DataWrite(0x79); LCD_DataWrite(0x67); LCD_CtrlWrite(0x61); LCD_DataWrite(0x38); LCD_DataWrite(0x11); LCD_DataWrite(0x79); LCD_DataWrite(0x67); LCD_CtrlWrite(0x64); LCD_DataWrite(0x38); LCD_DataWrite(0x17); LCD_DataWrite(0x71); LCD_DataWrite(0x5F); LCD_DataWrite(0x79); LCD_DataWrite(0x67); LCD_CtrlWrite(0x65); LCD_DataWrite(0x38); LCD_DataWrite(0x13); LCD_DataWrite(0x71); LCD_DataWrite(0x5B); LCD_DataWrite(0x79); LCD_DataWrite(0x67); LCD_CtrlWrite(0x6A); LCD_DataWrite(0x00); LCD_DataWrite(0x00); LCD_CtrlWrite(0x6C); LCD_DataWrite(0x22); LCD_DataWrite(0x02); LCD_DataWrite(0x22); LCD_DataWrite(0x02); LCD_DataWrite(0x22); LCD_DataWrite(0x22); LCD_DataWrite(0x50); LCD_CtrlWrite(0x6E); LCD_DataWrite(0x03); LCD_DataWrite(0x03); LCD_DataWrite(0x01); LCD_DataWrite(0x01); LCD_DataWrite(0x00); LCD_DataWrite(0x00); LCD_DataWrite(0x0f); LCD_DataWrite(0x0f); LCD_DataWrite(0x0d); LCD_DataWrite(0x0d); LCD_DataWrite(0x0b); LCD_DataWrite(0x0b); LCD_DataWrite(0x09); LCD_DataWrite(0x09); LCD_DataWrite(0x00); LCD_DataWrite(0x00); LCD_DataWrite(0x00); LCD_DataWrite(0x00); LCD_DataWrite(0x0a);// LCD_DataWrite(0x0a);// LCD_DataWrite(0x0c); LCD_DataWrite(0x0c); LCD_DataWrite(0x0e); LCD_DataWrite(0x0e); LCD_DataWrite(0x10); LCD_DataWrite(0x10); LCD_DataWrite(0x00); LCD_DataWrite(0x00); LCD_DataWrite(0x02); LCD_DataWrite(0x02); LCD_DataWrite(0x04); LCD_DataWrite(0x04); LCD_CtrlWrite(0xbf); LCD_DataWrite(0x01); LCD_CtrlWrite(0xF9); LCD_DataWrite(0x40); LCD_CtrlWrite(0x9b); LCD_DataWrite(0x3b); LCD_CtrlWrite(0x93); LCD_DataWrite(0x33); LCD_DataWrite(0x7f); LCD_DataWrite(0x00); LCD_CtrlWrite(0x7E); LCD_DataWrite(0x30); LCD_CtrlWrite(0x70); LCD_DataWrite(0x0d); LCD_DataWrite(0x02); LCD_DataWrite(0x08); LCD_DataWrite(0x0d); LCD_DataWrite(0x02); LCD_DataWrite(0x08); LCD_CtrlWrite(0x71); LCD_DataWrite(0x0d); LCD_DataWrite(0x02); LCD_DataWrite(0x08); LCD_CtrlWrite(0x91); LCD_DataWrite(0x0E); LCD_DataWrite(0x09); LCD_CtrlWrite(0xc3); LCD_DataWrite(0x18); LCD_CtrlWrite(0xc4); LCD_DataWrite(0x18); LCD_CtrlWrite(0xc9); LCD_DataWrite(0x3c); LCD_CtrlWrite(0xf0); LCD_DataWrite(0x13); LCD_DataWrite(0x15); LCD_DataWrite(0x04); LCD_DataWrite(0x05); LCD_DataWrite(0x01); LCD_DataWrite(0x38); LCD_CtrlWrite(0xf2); LCD_DataWrite(0x13); LCD_DataWrite(0x15); LCD_DataWrite(0x04); LCD_DataWrite(0x05); LCD_DataWrite(0x01); LCD_DataWrite(0x34); LCD_CtrlWrite(0xf1); LCD_DataWrite(0x4b); LCD_DataWrite(0xb8); LCD_DataWrite(0x7b); LCD_DataWrite(0x34); LCD_DataWrite(0x35); LCD_DataWrite(0xef); LCD_CtrlWrite(0xf3); LCD_DataWrite(0x47); LCD_DataWrite(0xb4); LCD_DataWrite(0x72); LCD_DataWrite(0x34); LCD_DataWrite(0x35); LCD_DataWrite(0xda); LCD_CtrlWrite(0x36); LCD_DataWrite(0x00); LCD_CtrlWrite(0x11); DelayMs(200); LCD_CtrlWrite(0x29); LCD_CtrlWrite(0x2C); } void Lcd_enter_sleep(void) { LCD_CtrlWrite(0x28); DelayMs(120); LCD_CtrlWrite(0x10); DelayMs(50); } void Lcd_exit_sleep(void) { LCD_CtrlWrite(0x11); DelayMs(120) ; LCD_CtrlWrite(0x29); }