TFT液晶屏C51控制
//------------------ Set GRAM area ---------------//
LCD_Write_REG(0x0050); LCD_Write_DA
LCD_Write_REG(0x0051); LCD_Write_DA
LCD_Write_REG(0x0052); LCD_Write_DA
LCD_Write_REG(0x0053); LCD_Write_DA
//LCD_Write_REG(0x0060); LCD_Write_DA
LCD_Write_REG(0x0060); LCD_Write_DA
LCD_Write_REG(0x0061); LCD_Write_DA
LCD_Write_REG(0x006A); LCD_Write_DA
//-------------- Partial Display Control ---------//
LCD_Write_REG(0x0080); LCD_Write_DA
LCD_Write_REG(0x0081); LCD_Write_DA
LCD_Write_REG(0x0082); LCD_Write_DA
LCD_Write_REG(0x0083); LCD_Write_DA
LCD_Write_REG(0x0084); LCD_Write_DA
LCD_Write_REG(0x0085); LCD_Write_DA
//-------------- Panel Control -------------------//
LCD_Write_REG(0x0090); LCD_Write_DA
LCD_Write_REG(0x0092); LCD_Write_DA
//添加
LCD_Write_REG(0x0093); LCD_Write_DA
LCD_Write_REG(0x0095); LCD_Write_DA
LCD_Write_REG(0x0097); LCD_Write_DA
LCD_Write_REG(0x0098); LCD_Write_DA
//LCD_Write_REG(0x0007); LCD_Write_DA
LCD_Write_REG(0x0007); LCD_Write_DA
LCD_Clear(0);//设置底色为黑
}
/**********************************************
函数名:Lcd全屏擦除函数
功能:将Lcd整屏擦为指定颜色
入口参数:color 指定Lcd全屏颜色 RGB(5-6-5)
返回值:无
***********************************************/
void LCD_Clear(unsigned int Color)
{
unsigned long index = 0;
LCD_Write_REG_DA
LCD_Write_REG_DA
LCD_Write_REG_DA
LCD_Write_REG_DA
LCD_Write_REG_DA
LCD_Write_REG_DA
LCD_Write_REG(0x0022);
LCD_RD=1;
LCD_RS=1;
LCD_CS=0;
for(index = 0; index < 76800; index++)
{
LCD_WR=0;
LCD_DA
LCD_WR=1;
LCD_WR=0;
LCD_DA
LCD_WR=1;
}
LCD_CS=1;
}
////////////////////////////////////////////////////
void LCD_write_english(unsigned char da
{
unsigned char avl,i,n;
LCD_Write_REG(0x0022);
for (i=0;i<16;i++)
{
avl=english[da
for (n=0;n<8;n++)
{
if(avl&0x80) LCD_Write_DA
else LCD_Write_DA
avl<=1;
}
}
}
void LCD_write_english_string(unsigned int x,unsigned int y,unsigned char *s,unsigned int color,unsigned int xcolor)//英文字符串显示
{
unsigned int k=0;
while (*s)
{
Lcd_SetBox(y,x+k,15,8);
LCD_write_english( *s,color,xcolor);
k=k+8;
s++;
}
}
void Lcd_SetBox(unsigned int xStart,unsigned int yStart,unsigned int xLong,unsigned int yLong)
{
LCD_SetCursor(xStart,312-yStart+yLong-1);
LCD_Write_REG_DA
LCD_Write_REG_DA
LCD_Write_REG_DA
LCD_Write_REG_DA
}
/*************************************************
函数名:Lcd光标起点定位函数
功能:指定320240液晶上的一点作为写数据的起始点
入口参数:x 坐标 0~239
y 坐标 0~319
返回值:无
*************************************************/
void LCD_SetCursor(unsigned int Xpos, unsigned int Ypos)
{
// CLR_RS;
LCD_Write_REG_DA
LCD_Write_REG_DA
}
////////////////显示图片///////////////////////////
void LCD_picture_diplay(void)
{
uint i,x1,y1,x2,y2;
uint temp1,temp2,temp;
x1=0;
y1=0;
x2=100;
y2=99;
LCD_Add_Set(x1,y1,x2,y2);
for (i=0;i<20000;i=i+2)
{
temp2=gImage[i];
temp1=gImage[i+1];
temp=(temp1*256)+temp2;
LCD_Write_DA
}
}
////////////////显示彩条///////////////////////////
void LCD_caitiao_diplay(uchar x,uint color)
{
uint i,x1,y1,x2,y2;
x1=x;
y1=0;
x2=x+20;
y2=319;
LCD_Add_Set(x1,y1,x2,y2);
for (i=0;i<320*20;i++)
{
LCD_Write_DA
}
}
TFT液晶屏C51控 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)