//----------------- menu.c 部分函数 --------------
//-----------------------------------------函数--------------------------------------------------
void Display_char(unsigned char,unsigned char ,unsigned char *,unsigned char);
void Display_row(unsigned char,unsigned char ,unsigned char ,unsigned char *,unsigned char);
void Display_window(unsigned char,unsigned char);
//-------------------------------------------------------------------------
//功能: 显示16x16汉字
//参数: begneX : 行地址 beginRow:列地址 n: 汉字数量
// s: 显示内容 标志寄存器: 是否反显
//调用: display_Lf() display_Rf()
//zkq 2007.06.04
//-------------------------------------------------------------------------
void display16x16RL(unsigned char beginX,unsigned char beginRow,unsigned char n,unsigned char *s,unsigned char 标志寄存器)
{
unsigned char i;
if(标志寄存器)
{
LCD_Write_ComR(0xb8|beginX);
LCD_Write_ComR(0x40|0);
for(i=0;i<64;i++)
{
LCD_Write_DatR(0xff);
}
LCD_Write_ComL(0xb8|beginX);
LCD_Write_ComL(0x40|0);
for(i=0;i<64;i++)
{
LCD_Write_DatL(0xff);
}
LCD_Write_ComR(0xb8|beginX + 1);
LCD_Write_ComR(0x40|0);
for(i=0;i<64;i++)
{
LCD_Write_DatR(0xff);
}
LCD_Write_ComL(0xb8|beginX + 1);
LCD_Write_ComL(0x40|0);
for(i=0;i<64;i++)
{
LCD_Write_DatL(0xff);
}
}
for(i=0;i<n;i++)
{
displayrow(i,beginX,beginRow+i,s,标志寄存器);
}
}
//--------------------------------------------------------------------------------------
void Display_window(unsigned char win_num,unsigned char sel_row)
{
unsigned char j,f;
if(Windows[win_num].MAX_ROW_NUM < 4)
f = Windows[win_num].MAX_ROW_NUM - 1;
else f = 3;
if(sel_row<4)
{
for(j=0;j<=f;j++)
{
if(j==sel_row)
display16x16RL(2*j,1,*(Windows[win_num].Row_num + j),*(Windows[win_num].MENU_char + j),1);
else
display16x16RL(2*j,1,*(Windows[win_num].Row_num + j),*(Windows[win_num].MENU_char + j),0);
}
}
else if(sel_row<8)
{
for(j=0;j<=Windows[win_num].MAX_ROW_NUM - 5;j++)
{
if(j==sel_row%4)
display16x16RL(2*j,1,*(Windows[win_num].Row_num + j + 4),*(Windows[win_num].MENU_char + j + 4),1);
else
display16x16RL(2*j,1,*(Windows[win_num].Row_num + j + 4),*(Windows[win_num].MENU_char + j + 4),0);
}
}
}
|