⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initial-forcmo-2.0.txt

📁 HX8340BIC+CMO2.0或CMO2.2
💻 TXT
字号:
Initial Code for CMO 2.0” and 2.2” 
 
 
M51_WR_REG(U05_LCD_POWER_ON,    0x0F);  //VCI & IOVCC ON 
DelayX1ms(100); 
//RESET 
M51_WR_REG(U05_LCD_RST,        0x01);  // LCD HW RST Enable 
DelayX1ms(5); 
M51_WR_REG(U05_LCD_RST,        0x00);  // LCD HW RST Disable. 
DelayX1ms(10); 
 
//Driving ability Setting 
Set_LCD_8B_REG(0x60,0x00);  //PTBA[15:8] 
Set_LCD_8B_REG(0x61,0x06);  //PTBA[7:0] 
Set_LCD_8B_REG(0x62,0x00);  //STBA[15:8] 
Set_LCD_8B_REG(0x63,0xD9);  //STBA[7:0] 
Set_LCD_8B_REG(0x73,0x70);  //OPON[7:0],SET OPON=70h, default 38h 
 
//Gamma 2.2 Setting     
Set_LCD_8B_REG(0x40,0x00); 
Set_LCD_8B_REG(0x41,0x40); 
Set_LCD_8B_REG(0x42,0x45); 
Set_LCD_8B_REG(0x43,0x01); 
Set_LCD_8B_REG(0x44,0x60); 
Set_LCD_8B_REG(0x45,0x05); 
Set_LCD_8B_REG(0x46,0x0C); 
Set_LCD_8B_REG(0x47,0xD1); 
Set_LCD_8B_REG(0x48,0x05); 
 
Set_LCD_8B_REG(0x50,0x75); 
Set_LCD_8B_REG(0x51,0x01); 
Set_LCD_8B_REG(0x52,0x67); 
Set_LCD_8B_REG(0x53,0x14); 
Set_LCD_8B_REG(0x54,0xF2); 
Set_LCD_8B_REG(0x55,0x07); 
Set_LCD_8B_REG(0x56,0x03); 
Set_LCD_8B_REG(0x57,0x49); 
 
//Power Voltage Setting 
Set_LCD_8B_REG(0x1F,0x03);  //VRH=4.65V 
Set_LCD_8B_REG(0x20,0x00);  //BT (VGH~15V,VGL~-12V,DDVDH~5V) 
Set_LCD_8B_REG(0x24,0x1C);  //VMH(VCOM High voltage3.2V) 
Set_LCD_8B_REG(0x25,0x34);  //VML(VCOM Low voltage -1.2V) 
//****VCOM offset**/// 
Set_LCD_8B_REG(0x23,0x2F);  //for Flicker adjust //can reload from OTP 
 
//Power on Setting 
Set_LCD_8B_REG(0x18,0x44);  //I/P_RADJ,N/P_RADJ, Normal mode 60Hz 
Set_LCD_8B_REG(0x1B,0x44);  //FS1 Pumping Clock= 2 x line frequency 
Set_LCD_8B_REG(0x21,0x01);  //OSC_EN='1', start Osc 
Set_LCD_8B_REG(0x01,0x00);  //SLP='0', out sleep 
Set_LCD_8B_REG(0x1C,0x03);  //AP=011  
Set_LCD_8B_REG(0x19,0x06);  // VOMG=1,PON=1, DK=0, 
DelayX1ms(5);  
 
 
//262k/65k color selection 
Set_LCD_8B_REG(0x17,0x06);  //default 0x06 262k color // 0x05 65k color 
 
//Display ON Setting 
Set_LCD_8B_REG(0x26,0x84);  //PT=10,GON=0, DTE=0, D=0100 
DelayX1ms(40); 
Set_LCD_8B_REG(0x26,0xB8);  //PT=10,GON=1, DTE=1, D=1000 
DelayX1ms(40); 
Set_LCD_8B_REG(0x26,0xBC);  //PT=10,GON=1, DTE=1, D=1100  
 
//Set GRAM Area 
Set_LCD_8B_REG(0x02,0x00); 
Set_LCD_8B_REG(0x03,0x00);  //Column Start 
Set_LCD_8B_REG(0x04,0x00); 
Set_LCD_8B_REG(0x05,0xAF);  //Column End 
 
Set_LCD_8B_REG(0x06,0x00); 
Set_LCD_8B_REG(0x07,0x00);  //Row Start 
Set_LCD_8B_REG(0x08,0x00); 
Set_LCD_8B_REG(0x09,0xDB);  //Row End 
 
WR_8B_FORMAT(0x22);   //Start GRAM write 
 
//################################################################## 
// Power Off Setting 
Set_LCD_8B_REG(0x26,0xB8);  //GON=’1’ DTE=’1’ D[1:0]=’10’ 
DelayX1ms(40); 
Set_LCD_8B_REG(0x19,0x01);  //VCOMG=’0’, PON=’0’, DK=’1’ 
DelayX1ms(40); 
Set_LCD_8B_REG(0x26,0xA4);  //GON=’1’ DTE=’0’ D[1:0]=’01’ 
DelayX1ms(40); 
Set_LCD_8B_REG(0x26,0x84);  //GON=’0’ DTE=’0’ D[1:0]=’01’ 
DelayX1ms(40);   
Set_LCD_8B_REG(0x1C,0x00);  //AP[2:0]=’000’ 
Set_LCD_8B_REG(0x01,0x02);  //SLP=’1’ 
Set_LCD_8B_REG(0x21,0x00);  //OSC_EN=’0’ 
DelayX1ms(5); 
M51_WR_REG(U05_LCD_POWER_ON,    0x00);  //VCI & IOVCC OFF 
   
 
// ENTER IDLE mode Setting 
Set_LCD_8B_REG(0x18,0x55);  //I/P_RADJ,N/P_RADJ, IDLE mode 50Hz 
Set_LCD_8B_REG(0x2F,0x11);  //IDLE mode line inversion 
Set_LCD_8B_REG(0x01,0x08);  //IDLE='1' , enter IDLE mode 
 
 
// EXIT IDLE mode Setting 
Set_LCD_8B_REG(0x18,0x44);  //I/P_RADJ,N/P_RADJ, Normal mode 60Hz 
Set_LCD_8B_REG(0x2F,0x11);  //Normal mode line inversion 
Set_LCD_8B_REG(0x01,0x00);  //IDLE='0', EXIT IDLE mode 
 

 
// ENTER Partial mode Setting 32line 
Set_LCD_8B_REG(0x18,0x44);  //I/P_RADJ,N/P_RADJ  Partial mode 60Hz 
Set_LCD_8B_REG(0x2F,0x11);  //Partial mode line inversion 
Set_LCD_8B_REG(0x01,0x01);  //PTL='1', Enter Partial mode 
Set_LCD_8B_REG(0x0A,0x00);  //PSL[15:8]=0x00 
Set_LCD_8B_REG(0x0B,0x20);  //PSL[7:0]=0x20 
Set_LCD_8B_REG(0x0C,0x00);  //PEL[15:8]=0x00 
Set_LCD_8B_REG(0x0D,0x47);  //PEL[7:0]=0x47 
Set_LCD_8B_REG(0x27,0xBF);  //refresh cycle=31frame 
 
// EXIT Partial mode Setting 
Set_LCD_8B_REG(0x18,0x44);  //I/P_RADJ,N/P_RADJ, Normal mode 60Hz 
Set_LCD_8B_REG(0x2F,0x11);  //Normal mode, line inversion 
Set_LCD_8B_REG(0x01,0x00);  //PTL='0', EXIT Partial mode 

 
// ENTER Partial + IDLE mode Setting 32line 
Set_LCD_8B_REG(0x18,0x55);  //I/P_RADJ,N/P_RADJ, Partial mode 50Hz 
Set_LCD_8B_REG(0x2F,0x11);  // Partial + IDLE mode line inversion 
Set_LCD_8B_REG(0x01,0x09);  // PTL='1' IDLE=’1’, Enter Partial + IDLE mode 
Set_LCD_8B_REG(0x0A,0x00);  //PSL[15:8]=0x00 
Set_LCD_8B_REG(0x0B,0x20);  //PSL[7:0]=0x20 
Set_LCD_8B_REG(0x0C,0x00);  //PEL[15:8]=0x00 
Set_LCD_8B_REG(0x0D,0x47);  //PEL[7:0]=0x47 
Set_LCD_8B_REG(0x27,0xBF);  //refresh cycle=31frame 
 
// EXIT Partial + IDLE mode Setting 
Set_LCD_8B_REG(0x18,0x44);  //I/P_RADJ,N/P_RADJ ,Normal mode 60Hz 
Set_LCD_8B_REG(0x2F,0x11);  //Normal mode, line inversion 
Set_LCD_8B_REG(0x01,0x00);  // PTL='0' IDLE=’0’, EXIT Partial + IDLE mode  
 

// Enter Sleep mode Setting 
Set_LCD_8B_REG(0x26,0xB8);  //GON=’1’ DTE=’1’ D[1:0]=’10’ 
DelayX1ms(40); 
Set_LCD_8B_REG(0x19,0x01);  //VCOMG=’0’, PON=’0’, DK=’1’ 
DelayX1ms(40); 
Set_LCD_8B_REG(0x26,0xA4);  //GON=’1’ DTE=’0’ D[1:0]=’01’ 
DelayX1ms(40); 
Set_LCD_8B_REG(0x26,0x84);  //GON=’0’ DTE=’0’ D[1:0]=’01’ 
DelayX1ms(40);   
Set_LCD_8B_REG(0x1C,0x00);  //AP[2:0]=’000’ 
Set_LCD_8B_REG(0x01,0x02);  //SLP=’1’ 
Set_LCD_8B_REG(0x21,0x00);  //OSC_EN=’0’ 
 
// Exit Sleep mode Setting 
Set_LCD_8B_REG(0x18,0x44);  //I/P_RADJ,N/P_RADJ, Normal mode 60Hz 
Set_LCD_8B_REG(0x21,0x01);  //OSC_EN='1', start Osc 
Set_LCD_8B_REG(0x01,0x00);  //SLP='0', out sleep 
Set_LCD_8B_REG(0x1C,0x03);  //AP=011 
Set_LCD_8B_REG(0x19,0x06);  // VOMG=1,PON=1, DK=0, 
DelayX1ms(5); 
Set_LCD_8B_REG(0x26,0x84);  //PT=10,GON=0, DTE=0, D=0100 
DelayX1ms(40); 
Set_LCD_8B_REG(0x26,0xB8);  //PT=10,GON=1, DTE=1, D=1000 
DelayX1ms(40); 
Set_LCD_8B_REG(0x26,0xBC);  //PT=10,GON=1, DTE=1, D=1100 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -