|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2014-8-16 10:57:24
|
显示全部楼层
- void Lcd_Init(void)
- {
- //调用一次这些函数,免得编译的时候提示警告
- LCD_CS =1;
- if(LCD_CS==0)
- {
- LCD_WR_REG_DATA(0,0);
- LCD_ShowString(0,0," ");
- LCD_ShowNum(0,0,0,0);
- LCD_Show2Num(0,0,0,0);
- LCD_DrawPoint_big(0,0);
- LCD_DrawRectangle(0,0,0,0);
- Draw_Circle(0,0,0);
- }
- LCD_RD=1;
- LCD_WR=1;
- LCD_REST=0;
- delayms(20); //此处保证要有5ms以上才能保证复位稳定,推荐20ms
- LCD_REST=1;
- delayms(20); //此处保证要有5ms以上才能保证复位稳定,推荐20ms
- LCD_CS =0; //打开片选使能
- LCD_WR_REG(0x0083);
- LCD_WR_DATA(0x0002); //TESTM=1
-
- LCD_WR_REG(0x0085);
- LCD_WR_DATA(0x0003); //VDC_SEL=011
- LCD_WR_REG(0x008B);
- LCD_WR_DATA(0x0001);
- LCD_WR_REG(0x008C);
- LCD_WR_DATA(0x0093); //STBA[7]=1,STBA[5:4]=01,STBA[1:0]=11
-
- LCD_WR_REG(0x0091);
- LCD_WR_DATA(0x0001); //DCDC_SYNC=1
-
- LCD_WR_REG(0x0083);
- LCD_WR_DATA(0x0000); //TESTM=0
- //Gamma Setting
-
- LCD_WR_REG(0x003E);
- LCD_WR_DATA(0x00B0);
- LCD_WR_REG(0x003F);
- LCD_WR_DATA(0x0003);
- LCD_WR_REG(0x0040);
- LCD_WR_DATA(0x0010);
- LCD_WR_REG(0x0041);
- LCD_WR_DATA(0x0056);
- LCD_WR_REG(0x0042);
- LCD_WR_DATA(0x0013);
- LCD_WR_REG(0x0043);
- LCD_WR_DATA(0x0046);
- LCD_WR_REG(0x0044);
- LCD_WR_DATA(0x0023);
- LCD_WR_REG(0x0045);
- LCD_WR_DATA(0x0076);
- LCD_WR_REG(0x0046);
- LCD_WR_DATA(0x0000);
- LCD_WR_REG(0x0047);
- LCD_WR_DATA(0x005E);
- LCD_WR_REG(0x0048);
- LCD_WR_DATA(0x004F);
- LCD_WR_REG(0x0049);
- LCD_WR_DATA(0x0040);
- //**********Power On sequence************
-
- LCD_WR_REG(0x0017);
- LCD_WR_DATA(0x0091);
-
- LCD_WR_REG(0x002B);
- LCD_WR_DATA(0x00F9);
- delayms(10);
-
- LCD_WR_REG(0x001B);
- LCD_WR_DATA(0x0014);
-
- LCD_WR_REG(0x001A);
- LCD_WR_DATA(0x0011);
-
- LCD_WR_REG(0x001C);
- LCD_WR_DATA(0x0006); //0d
-
- LCD_WR_REG(0x001F);
- LCD_WR_DATA(0x0042);
- delayms(20);
-
- LCD_WR_REG(0x0019);
- LCD_WR_DATA(0x000A);
-
- LCD_WR_REG(0x0019);
- LCD_WR_DATA(0x001A);
- delayms(40);
-
-
- LCD_WR_REG(0x0019);
- LCD_WR_DATA(0x0012);
- delayms(40);
-
- LCD_WR_REG(0x001E);
- LCD_WR_DATA(0x0027);
- delayms(100);
-
-
- //**********DISPLAY ON SETTING***********
-
- LCD_WR_REG(0x0024);
- LCD_WR_DATA(0x0060);
-
- LCD_WR_REG(0x003D);
- LCD_WR_DATA(0x0040);
-
- LCD_WR_REG(0x0034);
- LCD_WR_DATA(0x0038);
-
- LCD_WR_REG(0x0035);
- LCD_WR_DATA(0x0038);
-
- LCD_WR_REG(0x0024);
- LCD_WR_DATA(0x0038);
- delayms(40);
-
- LCD_WR_REG(0x0024);
- LCD_WR_DATA(0x003C);
-
- LCD_WR_REG(0x0016);
- LCD_WR_DATA(0x001C);
-
- LCD_WR_REG(0x0001);
- LCD_WR_DATA(0x0006);
-
- LCD_WR_REG(0x0055);
- LCD_WR_DATA(0x0000);
-
- LCD_WR_REG(0x0002);
- LCD_WR_DATA(0x0000);
- LCD_WR_REG(0x0003);
- LCD_WR_DATA(0x0000);
- LCD_WR_REG(0x0004);
- LCD_WR_DATA(0x0000);
- LCD_WR_REG(0x0005);
- LCD_WR_DATA(0x00ef);
-
- LCD_WR_REG(0x0006);
- LCD_WR_DATA(0x0000);
- LCD_WR_REG(0x0007);
- LCD_WR_DATA(0x0000);
- LCD_WR_REG(0x0008);
- LCD_WR_DATA(0x0001);
- LCD_WR_REG(0x0009);
- LCD_WR_DATA(0x008f);
- LCD_WR_REG(0x0022);
- }
复制代码
TFT液晶初始化程序,怎么在HX8352A上找到相应寄存器? |
|