汉字显示底层驱动函数
void LCD_Draw_Point(u16 x,u16 y,u16 color)
{
u16 temp;
temp=POINT_COLOR;
POINT_COLOR=color;
LCD_DrawPoint(x,y);
POINT_COLOR=temp;
}
void Test_Show_CH_Font16(u16 x,u16 y,u8 index,u16 color)
{
u8 temp,t,t1;
u16 y0=y;
for(t=0;t<32;t++)
{
if(t<16)temp=tfont16[index*2][t];
else temp=tfont16[index*2+1][t-16];
for(t1=0;t1<8;t1++)
{
if(temp&0x80)LCD_Draw_Point(x,y,color);
else LCD_Draw_Point(x,y,BACK_COLOR);
temp<<=1;
y++;
if((y-y0)==16)
{
y=y0;
x++;
break;
}
}
}
}
void Test_Show_CH_Font24(u16 x,u16 y,u8 index,u16 color)
{
u8 temp,t,t1;
u16 y0=y;
for(t=0;t<72;t++)
{
if(t<24)temp=tfont24[index*3][t];
else if(t<48)temp=tfont24[index*3+1][t-24];
else temp=tfont24[index*3+2][t-48];
for(t1=0;t1<8;t1++)
{
if(temp&0x80)LCD_Draw_Point(x,y,color);
else LCD_Draw_Point(x,y,BACK_COLOR);
temp<<=1;
y++;
if((y-y0)==24)
{
y=y0;
x++;
break;
}
}
}
}
void TEST_FONT(void)
{
u8 t;
u8 x,x1;
x=x1=50;
for(t=0;t<7;t++)
{
Test_Show_CH_Font16(x ,50,t,RED);
Test_Show_CH_Font24(x1,70,t,RED);
x+=16;
x1+=24;
}
}