📄 display.lst
字号:
98 1
99 1 }
100 #elif INTERFACE_8BIT
void W_C(uchar command) //Write command to LCM
{
LCM_RS=0;//==>Command
lcm_cs(0);
OUTPORT_L=0;//
LCM_WR=0;
LCM_WR=1;
OUTPORT_L=command;//
LCM_WR=0;
LCM_WR=1;
lcm_cs(1);
// LCM_CS=1;
}
#else
#error DON'T SET INTERFACE
#endif
118 /*----------------------------------------------------------------
119 Write command/data sub program
120 -----------------------------------------------------------------*/
121
122 void CMD(unsigned char a,unsigned int b)
123 {
124 1 W_C(a);
125 1 W_D(b);
126 1 }
127
128 /*----------------------------------------------------------------
129 LCM init sub program
130 -----------------------------------------------------------------*/
131 #if DT1505S
void LCM_init()
{
LCM_RES=0;
delay10ms(10);
LCM_RES=1;
delay10ms(10);
CMD(0x00,0x0000);
CMD(0x00,0x0000);
CMD(0x00,0x0000);
CMD(0x00,0x0000);
CMD(0xB0,0x0001);
CMD(0x00,0x0001);
CMD(0x07,0x0000);
CMD(0x12,0x0000);
CMD(0x70,0x2700);
CMD(0x08,0x0405);
CMD(0x30,0x0000);
CMD(0x31,0x0105);
CMD(0x32,0x0004);
CMD(0x33,0x0006);
CMD(0x34,0x0105);
CMD(0x35,0x0001);
C51 COMPILER V7.01 DISPLAY 11/16/2007 15:52:11 PAGE 7
CMD(0x36,0x0707);
CMD(0x37,0x0704);
CMD(0x38,0x0300);
CMD(0x39,0x0800);
CMD(0x15,0x0001);
CMD(0x10,0x66B0);
delay10ms(10);
CMD(0x11,0x0257);//4230
CMD(0x12,0x0108);
CMD(0x12,0x0118);
CMD(0x13,0xA324);
CMD(0x01,0x0100);
delay10ms(10);
CMD(0x02,0x0700);//4230
CMD(0x03,0x4030);
CMD(0x71,0x0000);
CMD(0x90,0x0108);
CMD(0x91,0x0000);
CMD(0x92,0x0000);
CMD(0x09,0x0000);
CMD(0x80,0x0000);
CMD(0x81,0x0000);
CMD(0x82,0x013F);
CMD(0x83,0x0000);
delay10ms(50);
CMD(0x84,0x0000);
CMD(0x85,0x013F);
CMD(0x50,0x0000);
CMD(0x51,0x00EF);
CMD(0x52,0x0000);
delay10ms(10);
CMD(0x53,0x013F);
CMD(0x10,0x76b0);
// CMD(0x07,0x0001);
// CMD(0x12,0x111a);
// CMD(0x07,0x0233);
}
#elif NT39106
void LCM_init()
{
LCM_RES=0;
delay10ms(10);
LCM_RES=1;
delay10ms(10);
CMD(0x12,0x0009);
CMD(0x13,0x131e);
CMD(0x10,0x0604);
CMD(0x11,0x0004);
CMD(0x10,0x4634);
CMD(0x12,0x0018);
delay10ms(10);
CMD(0x10,0x4030);//4230
C51 COMPILER V7.01 DISPLAY 11/16/2007 15:52:11 PAGE 8
CMD(0x13,0x331e);
CMD(0x02,0x0700);
CMD(0x01,0x011b);
CMD(0x08,0x0202);
CMD(0x03,0x1030);
CMD(0x0b,0x5820);
delay10ms(10);
CMD(0x21,0x0000);
CMD(0x30,0x0303);
CMD(0x31,0x0303);
CMD(0x32,0x0303);
CMD(0x33,0x0303);
CMD(0x34,0x0404);
CMD(0x35,0x0404);
CMD(0x36,0x0404);
CMD(0x37,0x0303);
CMD(0x38,0x0000);
CMD(0x39,0x0000);
CMD(0x40,0x0000);
delay10ms(50);
CMD(0x41,0x0000);
CMD(0x42,0xdb00);
CMD(0x43,0x0000);
CMD(0x44,0xaf00);
CMD(0x45,0xdb00);
delay10ms(10);
CMD(0x07,0x005);
delay10ms(10);
CMD(0x07,0x025);
delay10ms(10);
CMD(0x07,0x27);
delay10ms(1);
CMD(0x07,0x037);
}
#elif ILI9320
void LCM_init()
{
LCM_RES=0;
delay10ms(50);
LCM_RES=1;
delay10ms(50);
//************* Start Initial Sequence **********//
CMD(0x2b, 0x0000);
CMD(0xE5, 0x8000); // Set the Vcore voltage and this setting is must.
CMD(0x00, 0x0001); // Start internal OSC.
CMD(0x01, 0x0100); // set SS and SM bit
CMD(0x02, 0x0700); // set 1 line inversion
CMD(0x03, 0x1030); // set GRAM write direction and BGR=1.
CMD(0x04, 0x0000); // Resize register
CMD(0x08, 0x0202); // set the back porch and front porch
CMD(0x09, 0x0000); // set non-display area refresh cycle ISC[3:0]
CMD(0x0A, 0x0000); // FMARK function
CMD(0x0C, 0x0000); // RGB interface setting
CMD(0x0D, 0x0000); // Frame marker Position
CMD(0x0F, 0x0000); // RGB interface polarity
//*************Power On sequence ****************//
CMD(0x10, 0x0000); // SAP, BT[3:0], AP, DSTB, SLP, STB
C51 COMPILER V7.01 DISPLAY 11/16/2007 15:52:11 PAGE 9
CMD(0x11, 0x0007); // DC1[2:0], DC0[2:0], VC[2:0]
CMD(0x12, 0x0000); // VREG1OUT voltage
CMD(0x13, 0x0000); // VDV[4:0] for VCOM amplitude
delay10ms(10); // Dis-charge capacitor power voltage
CMD(0x10, 0x17B0); // SAP, BT[3:0], AP, DSTB, SLP, STB
CMD(0x11, 0x0007); // R11h=0x0001 at VCI=3.3V DC1[2:0], DC0[2:0], VC[2:0]
delay10ms(10); // Delay 50ms
CMD(0x12, 0x013A); // R11h=0x0138 at VCI=3.3V VREG1OUT voltage
delay10ms(10); // Delay 50ms
CMD(0x13, 0x1A00); // R11h=0x1800 at VCI=3.3V VDV[4:0] for VCOM amplitude
CMD(0x29, 0x000C); // R11h=0x0008 at VCI=3.3V VCM[4:0] for VCOMH
delay10ms(10);
CMD(0x20, 0x0000); // GRAM horizontal Address
CMD(0x21, 0x0000); // GRAM Vertical Address
// ----------- Adjust the Gamma Curve ----------//
CMD(0x30, 0x0000);
CMD(0x31, 0x0505);
CMD(0x32, 0x0004);
CMD(0x35, 0x0006);
CMD(0x36, 0x0707);
CMD(0x37, 0x0105);
CMD(0x38, 0x0002);
CMD(0x39, 0x0707);
CMD(0x3C, 0x0704);
CMD(0x3D, 0x0807);
//------------------ Set GRAM area ---------------//
CMD(0x50, 0x0000); // Horizontal GRAM Start Address
CMD(0x51, 0x00EF); // Horizontal GRAM End Address
CMD(0x52, 0x0000); // Vertical GRAM Start Address
CMD(0x53, 0x013F); // Vertical GRAM Start Address
CMD(0x60, 0x2700); // Gate Scan Line
CMD(0x61, 0x0001); // NDL,VLE, REV
CMD(0x6A, 0x0000); // set scrolling line
//-------------- Partial Display Control ---------//
CMD(0x80, 0x0000);
CMD(0x81, 0x0000);
CMD(0x82, 0x0000);
CMD(0x83, 0x0000);
CMD(0x84, 0x0000);
CMD(0x85, 0x0000);
//-------------- Panel Control -------------------//
CMD(0x90, 0x0010);
CMD(0x92, 0x0000);
CMD(0x93, 0x0003);
CMD(0x95, 0x0110);
CMD(0x97, 0x0000);
CMD(0x98, 0x0000);
CMD(0x07, 0x0173); // 262K color and display ON
}
#elif ILI9320AUO
void LCM_init()
{
// VCI=2.8V
//************* Reset LCD Driver ****************//
LCM_RES=0;
delay10ms(50);
LCM_RES=1;
delay10ms(50);
//************* Start Initial Sequence **********//
CMD(0x00E5, 0x8000); // Set the internal vcore voltage
CMD(0x0000, 0x0001); // Start internal OSC.
C51 COMPILER V7.01 DISPLAY 11/16/2007 15:52:11 PAGE 10
CMD(0x0001, 0x0100); // set SS and SM bit
CMD(0x0002, 0x0700); // set 1 line inversion
CMD(0x0003, 0x1030); // set GRAM write direction and BG
CMD(0x0004, 0x0000); // Resize register
CMD(0x0008, 0x0202); // set the back porch and front porc
CMD(0x0009, 0x0000); // set non-display area refresh cycl
CMD(0x000A, 0x0000); // FMARK function
CMD(0x000C, 0x0000); // RGB interface setting
CMD(0x000D, 0x0000); // Frame marker Position
CMD(0x000F, 0x0000); // RGB interface polarity
//*************Power On sequence ****************//
CMD(0x0010, 0x0000); // SAP, BT[3:0], AP, DSTB, S
CMD(0x0011, 0x0000); // DC1[2:0], DC0[2:0], VC[2:0
CMD(0x0012, 0x0000); // VREG1OUT voltage
CMD(0x0013, 0x0000); // VDV[4:0] for VCOM amplitu
delay10ms(200); // Dis-charge capacitor powe
CMD(0x0010, 0x17B0); // SAP, BT[3:0], AP, DSTB, S
CMD(0x0011, 0x0137); // DC1[2:0], DC0[2:0], VC[2:0
delay10ms(50); // Delay 50ms
CMD(0x0012, 0x0139); // VREG1OUT voltage
delay10ms(50); // Delay 50ms
CMD(0x0013, 0x1d00); // VDV[4:0] for VCOM amplitu
CMD(0x0029, 0x0013); // VCM[4:0] for VCOMH
delay10ms(50);
CMD(0x0020, 0x0000); // GRAM horizontal Address
CMD(0x0021, 0x0000); // GRAM Vertical Address
// ----------- Adjust the Gamma Curve ----------//
CMD(0x0030, 0x0006);
CMD(0x0031, 0x0101);
CMD(0x0032, 0x0003);
CMD(0x0035, 0x0106);
CMD(0x0036, 0x0b02);
CMD(0x0037, 0x0302);
CMD(0x0038, 0x0707);
CMD(0x0039, 0x0007);
CMD(0x003C, 0x0600);
CMD(0x003D, 0x020b);
//------------------ Set GRAM area ---------------//
CMD(0x0050, 0x0000); // Horizontal GRAM Start Address
CMD(0x0051, 0x00EF); // Horizontal GRAM End Address
CMD(0x0052, 0x0000); // Vertical GRAM Start Address
CMD(0x0053, 0x013F); // Vertical GRAM Start Address
CMD(0x0060, 0x2700); // Gate Scan Line
CMD(0x0061, 0x0001); // NDL,VLE, REV
CMD(0x006A, 0x0000); // set scrolling line
//-------------- Partial Display Control ---------//
CMD(0x0080, 0x0000);
CMD(0x0081, 0x0000);
CMD(0x0082, 0x0000);
CMD(0x0083, 0x0000);
CMD(0x0084, 0x0000);
CMD(0x0085, 0x0000);
//-------------- Panel Control -------------------//
CMD(0x0090, 0x0010);
C51 COMPILER V7.01 DISPLAY 11/16/2007 15:52:11 PAGE 11
CMD(0x0092, 0x0000);
CMD(0x0093, 0x0003);
CMD(0x0095, 0x0110);
CMD(0x0097, 0x0000);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -