📄 lcd.c
字号:
u32 uCmdRateVal;
u32 uI80IfConReg, uI80IfConRegVal;
uI80IfConReg = (eLdi == MAIN) ? rI80IFCONB0 : rI80IFCONB1;
uCmdRateVal =
(eCmdRate == DISABLE_AUTO_FRM) ? (0x0<<0) :
(eCmdRate == PER_TWO_FRM) ? (0x1<<0) :
(eCmdRate == PER_FOUR_FRM) ? (0x2<<0) :
(eCmdRate == PER_SIX_FRM) ? (0x3<<0) :
(eCmdRate == PER_EIGHT_FRM) ? (0x4<<0) :
(eCmdRate == PER_TEN_FRM) ? (0x5<<0) :
(eCmdRate == PER_TWELVE_FRM) ? (0x6<<0) :
(eCmdRate == PER_FOURTEEN_FRM) ? (0x7<<0) :
(eCmdRate == PER_SIXTEEN_FRM) ? (0x8<<0) :
(eCmdRate == PER_EIGHTEEN_FRM) ? (0x9<<0) :
(eCmdRate == PER_TWENTY_FRM) ? (0xa<<0) :
(eCmdRate == PER_TWENTY_TWO_FRM) ? (0xb<<0) :
(eCmdRate == PER_TWENTY_FOUR_FRM) ? (0xc<<0) :
(eCmdRate == PER_TWENTY_SIX_FRM) ? (0xd<<0) :
(eCmdRate == PER_TWENTY_EIGHT_FRM) ? (0xe<<0) : (0xf<<0);
uI80IfConRegVal=Inp32(LCD_BASE+uI80IfConReg);
uI80IfConRegVal &= ~(0xf<<0);
uI80IfConRegVal |= uCmdRateVal;
//uI80IfConRegVal |= 0x2<<5;
LcdcOutp32(uI80IfConReg, uI80IfConRegVal);
}
//------------------------------------------------------------
// Function Name : LCD_InitLTS222QV_CPU
//
// Function Desctiption :
//
//
// Input :
//
// Output :
//
// Version :
//------------------------------------------------------------
void LCD_InitLTS222QV_CPU(CPUIF_LDI eLdiMode)
{
u32 uCmd[1];
#if (LCD_MODULE_TYPE != LTS222QV_CPU)
Assert(0);
#endif
oLcdc.m_bIsNormalCall = false;
#if 1
////////// Using Normal Mode //////////
// power funtion 1
uCmd[0] = 0x2201; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1); // 50us, min. value. is 1
uCmd[0] = 0x0301; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(42); // 5ms
//Initial funtion 1
uCmd[0] = 0x00a0; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x0110; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x0200; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x0510; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x0d00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500);
//Initial funtion 2
uCmd[0] = 0x0e00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x0f01; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x1000; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x1100; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x1200; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x1300; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x1400; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x1500; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x1600; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x1700; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x3401; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x3500; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500);
//Initial funtion 3
uCmd[0] = 0x8d01; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x8b28; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4b00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4c00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4d00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4e00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4f00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x5000; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x8600; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x8726; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x8802; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x8905; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x3301; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x3701; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1); // modified by kwan. letter
uCmd[0] = 0x7600; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500);
//Initial funtion 4
uCmd[0] = 0x4200; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4300; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4400; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4500; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x46ef; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4700; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4800; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4901; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4a3f; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x3c00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x3d00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x3e01; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x3f3f; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x4003; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1); // modified by kwan. letter
uCmd[0] = 0x410a; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500);
//Initial funtion 5
uCmd[0] = 0x8f00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x903f; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9133; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9277; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9377; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9417; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9500; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9600; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9733; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9877; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9977; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9a17; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9b00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9c00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x9d80; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500);
uCmd[0] = 0x1d08; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500);
//power funtion 2
uCmd[0] = 0x2300; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(5);
uCmd[0] = 0x2494; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(5);
uCmd[0] = 0x256f; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500); // 40ms
//power funtion 3
uCmd[0] = 0x2810; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1); // modified by kwan. letter
uCmd[0] = 0x1a00; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x2110; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x1825; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500);
uCmd[0] = 0x1994; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1); // modified by kwan. letter
uCmd[0] = 0x18e5; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500); //40ms
uCmd[0] = 0x18f7; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500);
uCmd[0] = 0x1b09; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500); //40ms, modified by kwan. letter
uCmd[0] = 0x1f78; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);// modified by kwan. letter
uCmd[0] = 0x2045; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x1ec1; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500);
uCmd[0] = 0x2100; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(1);
uCmd[0] = 0x3b01; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500); //10ms
uCmd[0] = 0x0020; LCD_PutCmdToLdi_NormalCmd(uCmd, 1, eLdiMode); Delay(500); //40ms
#else
////////// Using Manual Mode //////////
uCmd[0] = 0x2201; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1); // 50us, min. value. is 1
uCmd[0] = 0x0301; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(42); // 5ms
//Initial funtion 1
uCmd[0] = 0x00a0; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x0110; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x0200; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x0510; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x0d00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500); //original: 334
//Initial funtion 2
uCmd[0] = 0x0e00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x0f01; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x1000; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x1100; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x1200; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x1300; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x1400; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x1500; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x1600; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x1700; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x3401; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x3500; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500);
//Initial funtion 3
uCmd[0] = 0x8d01; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x8b28; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4b00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4c00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4d00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4e00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4f00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x5000; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x8600; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x8726; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x8802; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x8905; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x3301; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x3701; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1); // modified by kwan. letter
uCmd[0] = 0x7600; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500);
//Initial funtion 4
uCmd[0] = 0x4200; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4300; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4400; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4500; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x46ef; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4700; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4800; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4901; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4a3f; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x3c00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x3d00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x3e01; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x3f3f; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x4003; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1); // modified by kwan. letter
uCmd[0] = 0x410a; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500);
//Initial funtion 5
uCmd[0] = 0x8f00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x903f; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9133; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9277; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9377; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9417; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9500; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9600; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9733; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9877; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9977; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9a17; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9b00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9c00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x9d80; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500);
uCmd[0] = 0x1d08; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500);
//power funtion 2
uCmd[0] = 0x2300; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(5);
uCmd[0] = 0x2494; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(5);
uCmd[0] = 0x256f; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500); // 40ms
//power funtion 3
uCmd[0] = 0x2810; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1); // modified by kwan. letter
uCmd[0] = 0x1a00; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x2110; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x1825; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500);
uCmd[0] = 0x1994; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1); // modified by kwan. letter
uCmd[0] = 0x18e5; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500); //40ms
uCmd[0] = 0x18f7; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500);
uCmd[0] = 0x1b09; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500); //40ms, modified by kwan. letter
uCmd[0] = 0x1f78; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);// modified by kwan. letter
uCmd[0] = 0x2045; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x1ec1; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500);
uCmd[0] = 0x2100; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(1);
uCmd[0] = 0x3b01; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500); //10ms
uCmd[0] = 0x0020; LCD_PutCmdToLdi_ManualCmd(uCmd, eLdiMode); Delay(500); //40ms
#endif
}
void LCD_InitLTS222QV_SRGB(void)
{
//Select LCD IF Pin Configure
GPIO_SetLCDType(eHOSTIF);
//Set LCD GPIO Port
GPIO_SetFunctionAll(eGPIO_I, 0xaaaaaaaa, 2); //GPI[15..0]-> SYS VD[15..0]
GPIO_SetFunctionAll(eGPIO_J, 0xaaaaaaaa, 2);
//GPJ[1..0]-> SYS VD[17..16], GPJ[11..6]-> SYS_VSYNC, SYS_OEn, SYS_CSn_main, SYS_CSn_sub, SYS_RS, SYS_WEn
/*
GPIO_SetDataEach(eGPIO_N, eGPIO_5 , 1); //GPN[5] -> High
GPIO_SetFunctionEach(eGPIO_N, eGPIO_5, 1); //GPN[5] -> Output
Delay(100);
GPIO_SetDataEach(eGPIO_N, eGPIO_5 , 0); //GPN[5] -> Low
Delay(1000);
GPIO_SetDataEach(eGPIO_N, eGPIO_5 , 1); //GPN[5] -> High
Delay(100); */
///////////////////////////////////////////////////////////////////
// Power Setting Function 1
//////////////////////////////////////////////////////////////////
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x22, 0x01); // PARTIAL 2 DISPLAY AREA RASTER-ROW NUMBER REGISTER 1
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x03, 0x01); // RESET REGISTER
///////////////////////////////////////////////////////////////////
// Initializing Function 1
///////////////////////////////////////////////////////////////////
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x00,0xa0); Delay(1); // CONTROL REGISTER 1, delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x01,0x10); Delay(1); // CONTROL REGISTER 2, delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x02,0x00); Delay(1); // RGB INTERFACE REGISTER
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x05,0x00); Delay(1); // DATA ACCESS CONTROL REGISTER
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x0D,0x00); Delay(400); // delay about 40ms
///////////////////////////////////////////////////////////////////
// Initializing Function 2
///////////////////////////////////////////////////////////////////
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x0E,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x0F,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x10,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x11,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x12,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x13,0x00); Delay(5); // DISPLAY SIZE CONTROL REGISTER
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x14,0x00); Delay(5); // PARTIAL-OFF AREA COLOR REGISTER 1
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x15,0x00); Delay(5); // PARTIAL-OFF AREA COLOR REGISTER 2
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x16,0x00); Delay(5); // PARTIAL 1 DISPLAY AREA STARTING REGISTER 1
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x17,0x00); Delay(5); // PARTIAL 1 DISPLAY AREA STARTING REGISTER 2
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x34,0x01); Delay(5); // POWER SUPPLY SYSTEM CONTROL REGISTER 14
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x35,0x00); Delay(400); // POWER SUPPLY SYSTEM CONTROL REGISTER 7
////////////////////////////////////////////////////////////////////
// Initializing Function 3
////////////////////////////////////////////////////////////////////
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x8D,0x01); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x8B,0x28); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x4B,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x4C,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x4D,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x4E,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x4F,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x50,0x00); Delay(500); // ID CODE REGISTER 2, Check it out, delay about 50 ms
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x86,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x87,0x26); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x88,0x02); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x89,0x05); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x33,0x01); Delay(5); // POWER SUPPLY SYSTEM CONTROL REGISTER 13
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x37,0x06); Delay(500); // POWER SUPPLY SYSTEM CONTROL REGISTER 12, Check it out
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x76,0x00); Delay(400); // SCROLL AREA START REGISTER 2, delay about 30ms
/////////////////////////////////////////////////////////////////////
// Initializing Function 4
/////////////////////////////////////////////////////////////////////
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x42,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x43,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x44,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x45,0x00); Delay(5); // CALIBRATION REGISTER
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x46,0xef); Delay(5);
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x47,0x00); Delay(5);
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x48,0x00); Delay(5);
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x49,0x01); Delay(5); // ID CODE REGISTER 1 check it out
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x4A,0x3f); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x3C,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x3D,0x00); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x3E,0x01); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x3F,0x3f); Delay(5); // delay about 300ns
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x40,0x01); Delay(5); // delay about 300ns, horizontal back porch, 050105 Boaz.Kim
// LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x40,0x02); Delay(5); // horizontal back porch //050105 Boaz.Kim
LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x41,0x0a); Delay(5); // vertical back porch
// LCD_WriteCmd((CPUIF_LDI)LCD_CPUIF_CS, 0x41,0x08); Delay(5); // vertical back porch
#if 0 /// 6.15
LCD_W
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -