CM12864有段程序看不懂,求大神指教
//写 数字字母高12 宽6 xAddr是列地址,yAddr是行地址void PutAscii(BYTE xAddr, BYTE yAddr, BYTE* dat,BYTE Dis_style)
{
unsigned char i,j,x,y;
unsigned char LCD_sel;
for(i = 0;i<2;i++)
{
y = yAddr*2 + i;
for(j = 0;j < 8;j++)
{
x = xAddr * 8 + j;
if(x < 64)
{
LCD_sel = 0;
}
else
{
LCD_sel = 1;
x = x - 64;
}
write_lcd(COMMAND,disp_col + x,LCD_sel); //set X(0~63)
write_lcd(COMMAND,disp_page + y,LCD_sel); //set Y(0~7)
if((j == 0)||(j == 7))
{
if(Dis_style == NORM_DISP)
{
write_lcd(DATA,0,LCD_sel);
}
else
{
if(i == 0)
{
write_lcd(DATA,0xFF,LCD_sel);
}
else
{
// write_lcd(DATA,0x0f,LCD_sel);
write_lcd(DATA,0xff,LCD_sel);
}
}
}
else
{
if(Dis_style == NORM_DISP)
{
//write_oneparameter(*(dat+i-2),0xc4);
write_lcd(DATA,dat[j+i*6-1],LCD_sel);
}
else
{
if(i == 0)
{
write_lcd(DATA,(dat[j+i*6-1]^0xff),LCD_sel);
}
else
{
// write_lcd(DATA,(dat[j+i*6-1]^0x0f),LCD_sel);
write_lcd(DATA,(dat[j+i*6-1]^0xff),LCD_sel);
}
}
}
}
}
}
两层FOR循环什么意思,y = yAddr*2 + i;x = xAddr * 8 + j;什么意思?