主程序中使用这个语句显示汉字:
LcdDisp(160,20,data);
字库:
Uint16 data0[]={ // 我
0x0640,0x3850,0x0848,0x0848,
0x0840,0xFFFE,0x0840,0x0848,
0x0E28,0x3830,0xC820,0x0850,
0x0992,0x080A,0x2806,0x1002,
};
Uint16 data1[]={ // 要
0x0000,0xFFFE,0x0440,0x3FF8,
0x2448,0x2448,0x3FF8,0x2408,
0x0400,0xFFFE,0x0810,0x0E20,
0x01C0,0x0630,0x180C,0x6008,
};
Uint16 data2[]={ // 玩
0x0000,0xF9F8,0x2000,0x2000,
0x2000,0x23FE,0xF890,0x2090,
0x2090,0x2090,0x3910,0xC110,
0x0212,0x0412,0x080E,0x1000,
};
Uint16 data3[]={ // 转
0x1020,0x1020,0x2020,0xFEFC,
0x2040,0x5040,0x91FE,0xFE40,
0x1080,0x11FC,0x3C08,0xD088,
0x1050,0x1020,0x1010,0x1010,
};
Uint16 data4[]={ // C
0x0000,0x0FE0,0x1010,0x2008,
0x2000,0x2000,0x2000,0x2000,
0x2000,0x2008,0x1010,0x0FE0,
0x0000,0x0000,0x0000,0x0000,
};
Uint16 data5[]={ // 2
0x0000,0x07C0,0x0820,0x1010,
0x1010,0x0010,0x0010,0x00E0,
0x0300,0x0400,0x0800,0x1000,
0x1010,0x1010,0x1FF0,0x0000,
};
Uint16 data6[]={ // 0
0x0000,0x07C0,0x0820,0x1010,
0x1010,0x1010,0x1010,0x1010,
0x1010,0x1010,0x1010,0x1010,
0x1010,0x0820,0x07C0,0x0000,
};
汉字显示:
void LcdDisp(Uint16 x, Uint16 y, Uint16 *ch)
{
Uint16 i,j,k;
for (i=0; i<16;i++)
{
LcdCoordinate(x,y+i);
for (j=0;j<16;j++)
{
if (ch& (0x8000>>j))
k=0xff;
else
k = 0;
LcdWrite(k,k,1);
}
}
}
清屏:
void LcdClrear(void)
{
for (lcdtemp=0; lcdtemp<38400; lcdtemp++)
{
LcdWrite(0,0,1);
}
for (lcdtemp=0; lcdtemp<38400; lcdtemp++)
{
LcdWrite(0,0,1);
}
}
显示RGB条:
void LcdDispRGB(Uint16 x, Uint16 y)
{
LcdCoordinate(x,y);
for (lcdtemp=0; lcdtemp<25600; lcdtemp++)
{
LcdWrite(0xf8,0,1); // red
}
for (lcdtemp=0; lcdtemp<25600; lcdtemp++)
{
LcdWrite(7,0xe0,1); // green
}
for (lcdtemp=0; lcdtemp<5600; lcdtemp++)
{
LcdWrite(0,0x1f,1); // blue
}
for (lcdtemp=0; lcdtemp<10000; lcdtemp++)
{
LcdWrite(0,0,1); // black
}
for (lcdtemp=0; lcdtemp<10000; lcdtemp++)
{
LcdWrite(0xff,0xff,1); // white
}
} |