void lcd_int()
{
REST = 1;
Delay(1);
REST = 0;
Delay(10);
REST = 1;
Delay(10);
LCD_RegisterIndex(0x11);
Delay(120);
LCD_RegisterIndex(0xEF);
LCD_RegisterValue(0x03);
LCD_RegisterValue(0x80);
LCD_RegisterValue(0x02);
LCD_RegisterIndex(0xCF);
LCD_RegisterValue(0x00);
LCD_RegisterValue(0xAA);
LCD_RegisterValue(0XB0);
LCD_RegisterIndex(0xED);
LCD_RegisterValue(0x64);
LCD_RegisterValue(0x03);
LCD_RegisterValue(0X12);
LCD_RegisterValue(0X81);
LCD_RegisterIndex(0xE8);
LCD_RegisterValue(0x85);
LCD_RegisterValue(0x00);
LCD_RegisterValue(0x78);
LCD_RegisterIndex(0xCB);
LCD_RegisterValue(0x39);
LCD_RegisterValue(0x2C);
LCD_RegisterValue(0x00);
LCD_RegisterValue(0x34);
LCD_RegisterValue(0x02);
LCD_RegisterIndex(0xF7);
LCD_RegisterValue(0x20);
LCD_RegisterIndex(0xEA);
LCD_RegisterValue(0x00);
LCD_RegisterValue(0x00);
//LCD_RegisterIndex(0xb6);
//LCD_RegisterValue(0x0a);
//LCD_RegisterValue(0xa2);
LCD_RegisterIndex(0xC0); //Power control
LCD_RegisterValue(0x26); //VRH[5:0]
LCD_RegisterIndex(0xC1); //Power control
LCD_RegisterValue(0x11); //SAP[2:0];BT[3:0]
LCD_RegisterIndex(0xC5); //VCM control
LCD_RegisterValue(0x31);
LCD_RegisterValue(0x3C);
LCD_RegisterIndex(0xC7); //VCM control2
LCD_RegisterValue(0xd3);
LCD_RegisterIndex(0x36); // Memory Access Control
LCD_RegisterValue(0x08);
LCD_RegisterIndex(0x3A);
LCD_RegisterValue(0x55);
LCD_RegisterIndex(0xB1); //VCM control
LCD_RegisterValue(0x00);
LCD_RegisterValue(0x14);
LCD_RegisterIndex(0xf6);
LCD_RegisterValue(0x01);
LCD_RegisterValue(0x00);
LCD_RegisterValue(0x06);
LCD_RegisterIndex(0xB0);
LCD_RegisterValue(0xe0); ///Add20110430
LCD_RegisterIndex(0xF2); // 3Gamma Function Disable
LCD_RegisterValue(0x00);
LCD_RegisterIndex(0x26); //Gamma curve selected
LCD_RegisterValue(0x01);
LCD_RegisterIndex(0xE0); //Set Gamma
LCD_RegisterValue(0x0F);
LCD_RegisterValue(0x1d);
LCD_RegisterValue(0x1a);
LCD_RegisterValue(0x09);
LCD_RegisterValue(0x0f);
LCD_RegisterValue(0x09);
LCD_RegisterValue(0x46);
LCD_RegisterValue(0x88);
LCD_RegisterValue(0x39);
LCD_RegisterValue(0x05);
LCD_RegisterValue(0x0f);
LCD_RegisterValue(0x03);
LCD_RegisterValue(0x07);
LCD_RegisterValue(0x05);
LCD_RegisterValue(0x00);
LCD_RegisterIndex(0XE1); //Set Gamma
LCD_RegisterValue(0x00);
LCD_RegisterValue(0x22);
LCD_RegisterValue(0x25);
LCD_RegisterValue(0x06);
LCD_RegisterValue(0x10);
LCD_RegisterValue(0x06);
LCD_RegisterValue(0x39);
LCD_RegisterValue(0x22);
LCD_RegisterValue(0x4a);
LCD_RegisterValue(0x0a);
LCD_RegisterValue(0x10);
LCD_RegisterValue(0x0C);
LCD_RegisterValue(0x38);
LCD_RegisterValue(0x3a);
LCD_RegisterValue(0x0F);
Delay(50);
LCD_RegisterIndex(0x11); //Exit Sleep
Delay(120);
LCD_RegisterIndex(0x29); //Displa
// Write the display data into GRAM here
LCD_RegisterIndex(0x2A);
LCD_RegisterValue(0x00);
LCD_RegisterValue(0x00);
LCD_RegisterValue(0x00);
LCD_RegisterValue(0xEF);
LCD_RegisterIndex(0x2B);
LCD_RegisterValue(0x00);
LCD_RegisterValue(0x00);
LCD_RegisterValue(0x01);
LCD_RegisterValue(0x3F);
LCD_RegisterIndex(0x2C); //GRAM start writing
}
|