📄 lcd12864_driver_new.h
字号:
0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20};
uchar code ASC_62[16] = {
/*b CHAR_62 */
0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,
0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00};
uchar code ASC_63[16] = {
/*c CHAR_63 */
0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,
0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00};
uchar code ASC_64[16] = {
/*d CHAR_64 */
0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,
0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20};
uchar code ASC_65[16] = {
/*e CHAR_65 */
0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,
0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00};
uchar code ASC_66[16] = {
/*f CHAR_66 */
0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,
0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00};
uchar code ASC_67[16] = {
/*g CHAR_67 */
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,
0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,};
uchar code ASC_68[16] = {
/*h CHAR_68 */
0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,
0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20};
uchar code ASC_69[16] = {
/*i CHAR_69 */
0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,
0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00};
uchar code ASC_6a[16] = {
/*j CHAR_6A */
0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,
0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00};
uchar code ASC_6b[16] = {
/*k CHAR_6B */
0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,
0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00};
uchar code ASC_6c[16] = {
/*l CHAR_6C */
0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,
0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00};
uchar code ASC_6d[16] = {
/*m CHAR_6D */
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F};
uchar code ASC_6e[16] = {
/*n CHAR_6E */
0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,
0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20};
uchar code ASC_6f[16] = {
/*o CHAR_6F */
0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,
0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00};
uchar code ASC_70[16] = {
/*p CHAR_70 */
0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,
0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00};
uchar code ASC_71[16] = {
/*q CHAR_71 */
0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,
0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80};
uchar code ASC_72[16] = {
/*r CHAR_72 */
0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,
0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00};
uchar code ASC_73[16] = {
/*s CHAR_73 */
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,
0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00};
uchar code ASC_74[16] = {
/*t CHAR_74 */
0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,
0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00};
uchar code ASC_75[16] = {
/*u CHAR_75 */
0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,
0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20};
uchar code ASC_76[16] = {
/*v CHAR_76 */
0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,
0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00};
uchar code ASC_77[16] = {
/*w CHAR_77 */
0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,
0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00};
uchar code ASC_78[16] = {
/*x CHAR_78 */
0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,
0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00};
uchar code ASC_79[16] = {
/*y CHAR_79 */
0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,
0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00};
uchar code ASC_7a[16] = {
/*z CHAR_7A */
0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00};
uchar code ASC_7b[16] = {
/*{ CHAR_7B */
0x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,
0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40};
uchar code ASC_7c[16] = {
/*| CHAR_7C */
0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00};
uchar code ASC_7d[16] = {
/*} CHAR_7D */
0x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,
0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00};
uchar code ASC_7e[16] = {
/*~ CHAR_7E */
0x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
uchar code ASC_7f[16] = {
/*|| CHAR_7F */
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
#pragma REGISTERBANK(0)
//--------------------------------------------------------------------void lcd_c(bit flag,uchar ldata)
{
uchar data i;
di=!flag;
en=0;
rw=0;
dat=ldata;
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
en=1;
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
en=0;
rw=1;
di=1;
for(i=0;i<20;i++);
}
//--------------------------------------------------------------------
void dis_one_zi(uchar x_add,uchar y_add,uchar code *po,bit back_flag,bit char_moudle)
{
uchar i,j,w,pp,m,n,o,p;
if(char_moudle==0)
{m=8;
n=16;
o=8;
p=8;
}
else
{
m=4;
n=32;
o=16;
p=16;
}
j=x_add*2+0xb8;
w=(y_add<m?y_add:y_add-m)*p+0x40;
cs1=(y_add<m);
cs2=!(y_add<m);
lcd_c(1,j);
lcd_c(1,w);
for(i=0;i<n;i++)
{
if(i==o)
{
lcd_c(1,j+1);
lcd_c(1,w);
}
if(back_flag==0)
{
pp=*po++;
pp=pp^0xff;
lcd_c(0,pp);
}
else if( back_flag==1)
{
lcd_c(0,*po++);
}
}
cs1=0;
cs2=0;
}
//--------------------------------------------------------------------
void dis_point(uchar x_add,uchar y_add)
{
uchar j,w;
uchar xx,cc,xxx=0;
xx=x_add/8;
xxx=x_add%8;
switch(xxx)
{
case 0:
cc=1;
break;
case 1:
cc=2;
break;
case 2:
cc=4;
break;
case 3:
cc=8;
break;
case 4:
cc=16;
break;
case 5:
cc=32;
break;
case 6:
cc=64;
break;
case 7:
cc=128;
break;
}
j=xx+0xb8;
w=(y_add<64?y_add:y_add-64)+0x40;
cs1=(y_add<64);
cs2=!cs1;
lcd_c(1,j);
lcd_c(1,w);
lcd_c(0,cc);
cs1=0;
cs2=0;
}
//--------------------------------------------------------------------
void dis_cls(void)
{
uchar data i,j;
cs1=cs2=1;
for(i=0xb8;i<0xc0;i++)
{
lcd_c(1,i);
lcd_c(1,0x40);
for(j=0;j<0x40;j++)
lcd_c(0,0);
}
cs1=cs2=0;
}
//--------------------------------------------------------------------
uchar *get_asc(uchar a)
{
uchar *p;
p=ASC_20+((a-32)*16);
return p;
}
//--------------------------------------------------------------------
void dis_one_char(uchar x,uchar y,uchar asc_num,bit b_flag)
{//显示函数,X为列坐标,Y为行坐标,左上角为(0,0)右下角为(3,15)
//asc_num为待显示字符的ASCII码值,b_falg为背景标志,1为正显,0为反显
uchar *p;
p=get_asc(asc_num);
dis_one_zi(x,y,p,b_flag,0);
}
//--------------------------------------------------------------------
void lcd_init(void)
{
lcd_c(1,0x3e);
lcd_c(1,0xc0);
lcd_c(1,0x3f);
dis_cls();
}
//--------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -