今日头条
void initial_ILI9341()
{
// VCI=2.8V
//************* Reset LCD Driver ****************//
RES = 1;
delayms(1); // Delay 1ms
RES = 0;
delayms(10); // Delay 10ms // This delay time is necessary
RES = 1;
delayms(120); // Delay 1200 ms
//************* Start Initial Sequence **********//
WriteCOM(0xCF);
WriteCOM_DATA(0x00);
WriteCOM_DATA(0xC1);
WriteCOM_DATA(0X30);
WriteCOM(0xED);
WriteCOM_DATA(0x64);
WriteCOM_DATA(0x03);
WriteCOM_DATA(0X12);
WriteCOM_DATA(0X81);
WriteCOM(0xE8);
WriteCOM_DATA(0x85);
WriteCOM_DATA(0x00);
WriteCOM_DATA(0x78);
WriteCOM(0xCB);
WriteCOM_DATA(0x39);
WriteCOM_DATA(0x2C);
WriteCOM_DATA(0x00);
WriteCOM_DATA(0x34);
WriteCOM_DATA(0x02);
WriteCOM(0xF7);
WriteCOM_DATA(0x20);
WriteCOM(0xEA);
WriteCOM_DATA(0x00);
WriteCOM_DATA(0x00);
WriteCOM(0xC0); //Power control
WriteCOM_DATA(0x18); //VRH[5:0]
WriteCOM(0xC1); //Power control
WriteCOM_DATA(0x12); //SAP[2:0];BT[3:0]
WriteCOM(0xC5); //VCM control
WriteCOM_DATA(0x31);
WriteCOM_DATA(0x3C);
WriteCOM(0xC7); //VCM control2
WriteCOM_DATA(0X99);
WriteCOM(0x36); // Memory Access Control
WriteCOM_DATA(0x08);
WriteCOM(0x3A);
WriteCOM_DATA(0x55);
WriteCOM(0xB1);
WriteCOM_DATA(0x00);
WriteCOM_DATA(0x16);
WriteCOM(0xB6); // Display Function Control
WriteCOM_DATA(0x0A);
WriteCOM_DATA(0xA2);
WriteCOM(0xF6);
WriteCOM_DATA(0x01);
WriteCOM_DATA(0x30);
WriteCOM(0xF2); // 3Gamma Function Disable
WriteCOM_DATA(0x00);
WriteCOM(0x26); //Gamma curve selected
WriteCOM_DATA(0x02);
WriteCOM(0xE0); //Set Gamma
WriteCOM_DATA(0x0F);
WriteCOM_DATA(0x1D);
WriteCOM_DATA(0x1A);
WriteCOM_DATA(0x0A);
WriteCOM_DATA(0x0D);
WriteCOM_DATA(0x07);
WriteCOM_DATA(0x49);
WriteCOM_DATA(0X66);
WriteCOM_DATA(0x3B);
WriteCOM_DATA(0x07);
WriteCOM_DATA(0x11);
WriteCOM_DATA(0x01);
WriteCOM_DATA(0x09);
WriteCOM_DATA(0x05);
WriteCOM_DATA(0x04);
WriteCOM(0XE1); //Set Gamma
WriteCOM_DATA(0x00);
WriteCOM_DATA(0x18);
WriteCOM_DATA(0x1D);
WriteCOM_DATA(0x02);
WriteCOM_DATA(0x0F);
WriteCOM_DATA(0x04);
WriteCOM_DATA(0x36);
WriteCOM_DATA(0x13);
WriteCOM_DATA(0x4C);
WriteCOM_DATA(0x07);
WriteCOM_DATA(0x13);
WriteCOM_DATA(0x0F);
WriteCOM_DATA(0x2E);
WriteCOM_DATA(0x2F);
WriteCOM_DATA(0x05);
WriteCOM(0x11); //Exit Sleep
delay1(120);
WriteCOM(0x29); //Display on
}
/************************************初始化结束**********************************/
全部0条评论
快来发表一下你的评论吧 !