void LCD_ShowChn(uint8_t x,uint16_t y,uint8_t num)
{
#define MAX_CHAR_hPOSX 224
#define MAX_CHAR_hPOSY 304
uint16_t temp;
uint8_t pos,t;
if(x>MAX_CHAR_hPOSX||y>MAX_CHAR_hPOSY)
return;
LCD_WR_COM_DATA(0x0020,x);//设置X坐标位置
LCD_WR_COM_DATA(0x0021,y);//设置Y坐标位置
LCD_WR_COM_DATA(0x0050, x); // Horizontal GRAM Start Address
LCD_WR_COM_DATA(0x0052, y); // Vertical GRAM Start Address
LCD_WR_COM_DATA(0x0051, x+15); // Horizontal GRAM End Address
LCD_WR_COM_DATA(0x0053, y+15); // Vertical GRAM end Address
LCD_WR_COM(0x0022); //指向RAM寄存器,准备写数据到RAM
for(pos=0;pos<16;pos++)
{
temp = (CodeChn[num][pos*2]<<8) + CodeChn[num][pos*2 +1];
if(temp/16<=9)
LCD_ShowChar(x+pos*24,y,temp/16+48);
else
LCD_ShowChar(x+pos*24,y,temp/16+55);
if(temp%16<=9)
LCD_ShowChar(x+pos*24+6,y,temp%16+48);
else
LCD_ShowChar(x+pos*24+6,y,temp%16+55);
temp = CodeChn[pos*2+1+32*num];
if(temp/16<=9)
LCD_ShowChar(x+pos*24+12,y,temp/16+48);
else
LCD_ShowChar(x+pos*24+12,y,temp/16+55);
if(temp%16<=9)
LCD_ShowChar(x+pos*24+18,y,temp%16+48);
else
LCD_ShowChar(x+pos*24+18,y,temp%16+55);*/
for(t=0;t<16;t++)
{
if(temp&0x8000)
LCD_WR_DATA(POINT_COLOR);
else
LCD_WR_DATA(0xffff);//白色
temp<<=1;
}
}
LCD_WR_COM_DATA(0x0050, 0x0000); // Horizontal GRAM Start Address
LCD_WR_COM_DATA(0x0051, 0x00EF); // Horizontal GRAM End Address
LCD_WR_COM_DATA(0x0052, 0x0000); // Vertical GRAM Start Address
LCD_WR_COM_DATA(0x0053, 0x013F); // Vertical GRAM end Address
} |