ili9341LPC2138驱动

今日头条

1142人已加入

描述

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 

}

/************************************初始化结束**********************************/


打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
  • 相关推荐

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分