黄金会员
主题
回帖0
积分6738
阅读权限40
注册时间2012-6-26
最后登录1970-1-1
在线时间 小时
|
void ASIIC(unsigned char x1, unsigned char y1, unsigned char *ASIC,unsigned char type)
{
unsigned char x,uc_CharCode,uc_BitCnt;
//unsigned long j=0;
unsigned char X_Count,Y_Cout;
if(type)
{
X_Count = 8;
Y_Cout = 16;
}
else
{
X_Count = 6;
Y_Cout = 12;
}
LCD_CmdWrite(0x30);
LCD_CmdWrite(0x75);
LCD_DataWrite(x1);
LCD_DataWrite(x1+Y_Cout-1);
LCD_CmdWrite(0x15);
LCD_DataWrite(0X54-(y1+(X_Count-1)/3));
LCD_DataWrite((0X54-y1));
LCD_CmdWrite(0X5C);
for(x=0;x<Y_Cout;x++)
{
uc_CharCode = *ASIC;
ASIC ++;
if(type==0) uc_CharCode = uc_CharCode>>2;
for(uc_BitCnt=0;uc_BitCnt<X_Count;uc_BitCnt++)
{
if((uc_CharCode&0x01) == 0) { LCD_DataWrite(0x00);}
else { LCD_DataWrite(0xFF);}
uc_CharCode =uc_CharCode >>1;
}
if(type) LCD_DataWrite(0x00);
}
}
void HanZi(unsigned char x1, unsigned char y1 ,unsigned char*hanzi,unsigned char type)
{
unsigned int Dat;
unsigned char x,uc_BitCnt;
//unsigned char CoderDat[32];
//unsigned long j=0;
unsigned char X_Count,Y_Cout;
if(type)
{
X_Count = 16;
Y_Cout = 16;
}
else
{
X_Count = 12;
Y_Cout = 12;
}
LCD_CmdWrite(0x30); //EXT=0
LCD_CmdWrite(0x75);
LCD_DataWrite(x1);
LCD_DataWrite((x1+Y_Cout-1));
LCD_CmdWrite(0x15);
LCD_DataWrite(0X54-(y1+(X_Count-1)/3));
LCD_DataWrite((0X54-y1));
LCD_CmdWrite(0X5C);
// j=(((hanzi-0xB0A1)*32)/528 + 4)<<10;
// j = j + (((hanzi-0xB0A1)*32)%528);
// Continuous_Array_Read_3(CoderDat,j,32);
// uc_CharCode = CoderDat[x*2+1];
for(x=0;x<X_Count;x++)
{
Dat = *hanzi;
hanzi++;
Dat = (Dat<<8) + (*hanzi);
hanzi++;
if(type==0) Dat = Dat>>4;
for(uc_BitCnt=0;uc_BitCnt<Y_Cout;uc_BitCnt++)
{
if((Dat&0x0001) == 0) { LCD_DataWrite(0x00);}
else { LCD_DataWrite(0xFF);}
Dat =Dat >>1;
}
if(type)
{
LCD_DataWrite(0x00);
LCD_DataWrite(0x00);
}
}
}
写英文 写汉字函数。。 |
|