lcd12864 LCD12864 驱动 ,采用串行方式( 二 )


草稿
*****************************/
void PutBMP(无符号char *puts)
{
无符号int x = 0;
无符号字符I,j;
SendCMD(0x 34);//8位扩展指令集,即使是36H,也要写两遍。
SendCMD(0x 36);//绘图开启,基本指令集36H无法打开绘图
for(I = 0;i&lt。32;i++//实际值256x32
{
SendCMD(0x 80 | I);//行位置
SendCMD(0x 80);//列位置
for(j = 0;j&lt。32;j++) //256/8=32字节
{//列位置自动增加每一行
send DATa(puts[x]);
x++;
}
}
}
void ClearScreen()
{ uchar i,j,x,y;
LCDInit();
SendCMD(0x3e);// RE=1扩展指令选择G=1开启图形显示
x = 0x80
y = 0x80
for(j = 0;j&lt。64;j++)
{
y = 0x80
SendCMD(x);
SendCMD(y);
for(I = 0;i&lt。32;i++)
{
send DATa(0x 00);
}
x = x+1;
}
}
void Sendint(uint dd)
{
发送数据(dd & gt&gt。8);
send DATa(DD);
}
/*****************************
点x = 0:128;y = 0:64;
*****************************/
void Gra(uchar x,uchar y)
{
uchar xx,YY;
SendCMD(0x 34);
SendCMD(0x 36);
xx = x/16;
YY = 63-y;
if(yy >;= 32){ xx = xx+8;YY-= 32;}
SendCMD(0x 80+YY);
SendCMD(0x 80+xx);
send int(0x 8000 & gt;&gt。(x % 16));
}
uchar代码IBM[]=
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7F,0xFF,0xFF,0x87,0xFF,0xFF,0xF0,0x00,0xFF,0xE0,0x00,0x07,0xFF,0xFE,
0x7F,0xFF,0xFF,0x87,0xFF,0xFF,0xF0,0x00,0xFF,0xE0,0x00,0xF,0xFF,0xFE,
0x7F,0xFF,0xFF,0x87,0xFF,0xFF,0xF8,0x00,0xFF,0xE0,0x00,0xF,0xFF,0xFE,
0x7F,0xFF,0xFF,0x87,0xFF,0xFF,0xFF,0xFC,0x00,0xFF,0xF0,0x00,0x1F,0xFF,0xFE,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7F、0xFF、0xFF、0x87、0xFF、0xFF、0xFF、0xFF、0x00、0xFF、0xF8、0x00、0x3F、0xFF、0xFE、
0x7F,0xFF,0xFF,0x87,0xFF,0xFF,0xFF,0xFF,0x80,0xFF,0xFC,0x00,0x7F,0xFF,0xFE,
0x7F,0xFF,0xFF,0x87,0xFF,0xFF,0xFF,0xFF,0x80,0xFF,0xFC,0x00,0x7F,0xFF,0xFE,
0x7F,0xFF,0xFF,0x87,0xFF,0xFF,0xFF,0xFF,0x80,0xFF,0xFC,0x00,0x7F,0xFF,0xFE,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xFF,0xC0,0x00,0x0F,0xF8,0x00,0xFF,0xC0,0x03,0xFF,0xFE,0x01,0xFF,0xFF,0x00,
0x00,0xFF,0xC0,0x00,0x0F,0xF8,0x00,0xFF,0xC0,0x03,0xFF,0xFF,0x01,0xFF,0xFF,0x00,
0x00,0xFF,0xC0,0x00,0x0F,0xF8,0x00,0xFF,0xC0,0x03,0xFF,0xFF,0x03,0xFF,0xFF,0x00,
0x00,0xFF,0xC0,0x00,0x0F,0xF8,0x00,0xFF,0x80,0x03,0xFF,0xFF,0x83,0xFF,0xFF,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

推荐阅读