ILI9806E_BOE_初始化代码

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

void ILI9806E_BOE3.97_Initial_BOE(void)
{
// VCI=2.8V
//************* Reset LCD Driver ****************//
LCD_nRESET = 1;
delayms(1); // Delay 1ms
LCD_nRESET = 0;
delayms(10); // Delay 10ms // This delay time is necessary
LCD_nRESET = 1;
delayms(120); // Delay 120 ms
//************* Start Initial Sequence **********//

//**************************************************************************//
//****************************** Page 1 Command ****************************//
//**************************************************************************//

LCD_ILI9806E_CMD(0xFF);
LCD_ILI9806E_INDEX(FF);
LCD_ILI9806E_INDEX(98);
LCD_ILI9806E_INDEX(06);
LCD_ILI9806E_INDEX(04);
LCD_ILI9806E_INDEX(01); // Change to Page 1

LCD_ILI9806E_CMD(0x08);
LCD_ILI9806E_INDEX(0x10); // output SDA

LCD_ILI9806E_CMD(0x21);
LCD_ILI9806E_INDEX(0x01); // DE = 1 Active

LCD_ILI9806E_CMD(0x30);
LCD_ILI9806E_INDEX(0x02); // 480 X 800

LCD_ILI9806E_CMD(0x31);
LCD_ILI9806E_INDEX(0x02); // 2dot Inversion

LCD_ILI9806E_CMD(0x60);
LCD_ILI9806E_INDEX(0x07); // SDTI

LCD_ILI9806E_CMD(0x61);
LCD_ILI9806E_INDEX(0x06); // CRTI

LCD_ILI9806E_CMD(0x62);
LCD_ILI9806E_INDEX(0x06); // EQTI

LCD_ILI9806E_CMD(0x63);
LCD_ILI9806E_INDEX(0x04); // PCTI

LCD_ILI9806E_CMD(0x40);
LCD_ILI9806E_INDEX(0x15); // BT +2.5/-2.5 pump for DDVDH-L

LCD_ILI9806E_CMD(0x41);
LCD_ILI9806E_INDEX(0x22); // DVDDH DVDDL clamp

LCD_ILI9806E_CMD(0x42);
LCD_ILI9806E_INDEX(0x00); // VGH/VGL 31.37ma 32.7ma 0.03

LCD_ILI9806E_CMD(0x43);
LCD_ILI9806E_INDEX(0x8B); // VGH/VGL 13 -9 5 -3.8 1.6 -1.5 -2.75

LCD_ILI9806E_CMD(0x44);
LCD_ILI9806E_INDEX(0x8C); // VGH/VGL

LCD_ILI9806E_CMD(0x45);
LCD_ILI9806E_INDEX(0x1B); // VGL_REG -10V

LCD_ILI9806E_CMD(0x50);
LCD_ILI9806E_INDEX(0x78); // VGMP

LCD_ILI9806E_CMD(0x51);
LCD_ILI9806E_INDEX(0x78); // VGMN

LCD_ILI9806E_CMD(0x52);
LCD_ILI9806E_INDEX(0x00); //Flicker

LCD_ILI9806E_CMD(0x53);
LCD_ILI9806E_INDEX(0x6F); //Flicker4F

///==============Positive Gamma==============///

LCD_ILI9806E_CMD(0xA0);
LCD_ILI9806E_INDEX(0x00); // Gamma 0 /255

LCD_ILI9806E_CMD(0xA1);
LCD_ILI9806E_INDEX(0x14); // Gamma 4 /251

LCD_ILI9806E_CMD(0xA2);
LCD_ILI9806E_INDEX(0x1A); // Gamma 8 /247

LCD_ILI9806E_CMD(0xA3);
LCD_ILI9806E_INDEX(0x06); // Gamma 16 /239

LCD_ILI9806E_CMD(0xA4);
LCD_ILI9806E_INDEX(0x02); // Gamma 24 /231

LCD_ILI9806E_CMD(0xA5);
LCD_ILI9806E_INDEX(0x04); // Gamma 52 / 203

LCD_ILI9806E_CMD(0xA6);
LCD_ILI9806E_INDEX(0x1C); // Gamma 80 / 175

LCD_ILI9806E_CMD(0xA7);
LCD_ILI9806E_INDEX(0x00); // Gamma 108 /147

LCD_ILI9806E_CMD(0xA8);
LCD_ILI9806E_INDEX(0x19); // Gamma 147 /108

LCD_ILI9806E_CMD(0xA9);
LCD_ILI9806E_INDEX(0x0C); // Gamma 175 / 80

LCD_ILI9806E_CMD(0xAA);
LCD_ILI9806E_INDEX(0x0E); // Gamma 203 / 52

LCD_ILI9806E_CMD(0xAB);
LCD_ILI9806E_INDEX(0x04); // Gamma 231 / 24

LCD_ILI9806E_CMD(0xAC);
LCD_

ILI9806E_INDEX(0x07); // Gamma 239 / 16

LCD_ILI9806E_CMD(0xAD);
LCD_ILI9806E_INDEX(0x1A); // Gamma 247 / 8

LCD_ILI9806E_CMD(0xAE);
LCD_ILI9806E_INDEX(0x02); // Gamma 251 / 4

LCD_ILI9806E_CMD(0xAF);
LCD_ILI9806E_INDEX(0x00); // Gamma 255 / 0

///==============Nagitive Gamma==============///

LCD_ILI9806E_CMD(0xC0);
LCD_ILI9806E_INDEX(0x00); // Gamma 0

LCD_ILI9806E_CMD(0xC1);
LCD_ILI9806E_INDEX(0x01); // Gamma 4

LCD_ILI9806E_CMD(0xC2);
LCD_ILI9806E_INDEX(0x0A); // Gamma 8

LCD_ILI9806E_CMD(0xC3);
LCD_ILI9806E_INDEX(0x10); // Gamma 16

LCD_ILI9806E_CMD(0xC4);
LCD_ILI9806E_INDEX(0x07); // Gamma 24

LCD_ILI9806E_CMD(0xC5);
LCD_ILI9806E_INDEX(0x10); // Gamma 52

LCD_ILI9806E_CMD(0xC6);
LCD_ILI9806E_INDEX(0x01); // Gamma 80

LCD_ILI9806E_CMD(0xC7);
LCD_ILI9806E_INDEX(0x0F); // Gamma 108

LCD_ILI9806E_CMD(0xC8);
LCD_ILI9806E_INDEX(0x06); // Gamma 147

LCD_ILI9806E_CMD(0xC9);
LCD_ILI9806E_INDEX(0x0A); // Gamma 175

LCD_ILI9806E_CMD(0xCA);
LCD_ILI9806E_INDEX(0x12); // Gamma 203

LCD_ILI9806E_CMD(0xCB);
LCD_ILI9806E_INDEX(0x0B); // Gamma 231

LCD_ILI9806E_CMD(0xCC);
LCD_ILI9806E_INDEX(0x14); // Gamma 239

LCD_ILI9806E_CMD(0xCD);
LCD_ILI9806E_INDEX(0x17); // Gamma 247

LCD_ILI9806E_CMD(0xCE);
LCD_ILI9806E_INDEX(0x16); // Gamma 251

LCD_ILI9806E_CMD(0xCF);
LCD_ILI9806E_INDEX(0x00); // Gamma 255

//**************************************************************************//
//****************************** Page 7 Command ****************************//
//**************************************************************************//

LCD_ILI9806E_CMD(0xFF);
LCD_ILI9806E_INDEX(FF);
LCD_ILI9806E_INDEX(98);
LCD_ILI9806E_INDEX(06);
LCD_ILI9806E_INDEX(04);
LCD_ILI9806E_INDEX(07); // Change to Page 7

LCD_ILI9806E_CMD(0x18);
LCD_ILI9806E_INDEX(0x1D);

LCD_ILI9806E_CMD(0x17);
LCD_ILI9806E_INDEX(0x12); // VGL_REG ON

//**************************************************************************//
//****************************** Page 6 Command ****************************//
//**************************************************************************//
LCD_ILI9806E_CMD(0xFF);
LCD_ILI9806E_INDEX(FF);
LCD_ILI9806E_INDEX(98);
LCD_ILI9806E_INDEX(06);
LCD_ILI9806E_INDEX(04);
LCD_ILI9806E_INDEX(06); // Change to Page 6

LCD_ILI9806E_CMD(0x00);
LCD_ILI9806E_INDEX(0x20);

LCD_ILI9806E_CMD(0x01);
LCD_ILI9806E_INDEX(0x05);

LCD_ILI9806E_CMD(0x02);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x03);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x04);
LCD_ILI9806E_INDEX(0x01);

LCD_ILI9806E_CMD(0x05);
LCD_ILI9806E_INDEX(0x01);

LCD_ILI9806E_CMD(0x06);
LCD_ILI9806E_INDEX(0x88);

LCD_ILI9806E_CMD(0x07);
LCD_ILI9806E_INDEX(0x04);

LCD_ILI9806E_CMD(0x08);
LCD_ILI9806E_INDEX(0x01);

LCD_ILI9806E_CMD(0x09);
LCD_ILI9806E_INDEX(0x90);

LCD_ILI9806E_CMD(0x0A);
LCD_ILI9806E_INDEX(0x04);

LCD_ILI9806E_CMD(0x0B);
LCD_ILI9806E_INDEX(0x01)

;

LCD_ILI9806E_CMD(0x0C);
LCD_ILI9806E_INDEX(0x01);

LCD_ILI9806E_CMD(0x0D);
LCD_ILI9806E_INDEX(0x01);

LCD_ILI9806E_CMD(0x0E);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x0F);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x10);
LCD_ILI9806E_INDEX(0x55);

LCD_ILI9806E_CMD(0x11);
LCD_ILI9806E_INDEX(0x50);

LCD_ILI9806E_CMD(0x12);
LCD_ILI9806E_INDEX(0x01);

LCD_ILI9806E_CMD(0x13);
LCD_ILI9806E_INDEX(0x0C);

LCD_ILI9806E_CMD(0x14);
LCD_ILI9806E_INDEX(0x0D);

LCD_ILI9806E_CMD(0x15);
LCD_ILI9806E_INDEX(0x43);

LCD_ILI9806E_CMD(0x16);
LCD_ILI9806E_INDEX(0x0B);

LCD_ILI9806E_CMD(0x17);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x18);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x19);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x1A);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x1B);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x1C);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x1D);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x20);
LCD_ILI9806E_INDEX(0x01);

LCD_ILI9806E_CMD(0x21);
LCD_ILI9806E_INDEX(0x23);

LCD_ILI9806E_CMD(0x22);
LCD_ILI9806E_INDEX(0x45);

LCD_ILI9806E_CMD(0x23);
LCD_ILI9806E_INDEX(0x67);

LCD_ILI9806E_CMD(0x24);
LCD_ILI9806E_INDEX(0x01);

LCD_ILI9806E_CMD(0x25);
LCD_ILI9806E_INDEX(0x23);

LCD_ILI9806E_CMD(0x26);
LCD_ILI9806E_INDEX(0x45);

LCD_ILI9806E_CMD(0x27);
LCD_ILI9806E_INDEX(0x67);

LCD_ILI9806E_CMD(0x30);
LCD_ILI9806E_INDEX(0x02);

LCD_ILI9806E_CMD(0x31);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x32);
LCD_ILI9806E_INDEX(0x11);

LCD_ILI9806E_CMD(0x33);
LCD_ILI9806E_INDEX(0xAA);

LCD_ILI9806E_CMD(0x34);
LCD_ILI9806E_INDEX(0xBB);

LCD_ILI9806E_CMD(0x35);
LCD_ILI9806E_INDEX(0x66);

LCD_ILI9806E_CMD(0x36);
LCD_ILI9806E_INDEX(0x00);

LCD_ILI9806E_CMD(0x37);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x38);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x39);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x3A);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x3B);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x3C);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x3D);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x3E);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x3F);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x40);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x53);
LCD_ILI9806E_INDEX(0x1A); //VGLO refer VGL_REG
/*************************增加*******************************************/
LCD_ILI9806E_CMD(0xFF);
LCD_ILI9806E_INDEX(FF);
LCD_ILI9806E_INDEX(98);
LCD_ILI9806E_INDEX(06);
LCD_ILI9806E_INDEX(04);
LCD_ILI9806E_INDEX(07); // Change to Page 7

LCD_ILI9806E_CMD(0x17);
LCD_ILI9806E_INDEX(0x22);

LCD_ILI9806E_CMD(0x02);
LCD_ILI9806E_INDEX(0x77);

LCD_ILI9806E_CMD(0xE1);
LCD_ILI9806E_INDEX(0x79);

//**************************************************************************//
//****************************** Page 0 Command ****************************//
//*********************

*****************************************************//

LCD_ILI9806E_CMD(0xFF);
LCD_ILI9806E_INDEX(FF);
LCD_ILI9806E_INDEX(98);
LCD_ILI9806E_INDEX(06);
LCD_ILI9806E_INDEX(04);
LCD_ILI9806E_INDEX(00); // Change to Page 0

LCD_ILI9806E_CMD(0x11); // Sleep-Out
Delay_ms(120);
LCD_ILI9806E_CMD(0x29); // Display On

}

相关文档
最新文档