12864绘图功能有些不懂,求指教
时间:10-02
整理:3721RD
点击:
void LCD12864_set_tu(uchar X,uchar Y,uchar *tu,uchar wide,uchar high)
{ //Y确定开始行,X确定列(0-7),tu是点阵字模数据
uint hang,lie;
write_12864cmd(extra_cmd);//打开扩展指令集
write_12864cmd(tu_off);//绘图显示关
if(wide%8==0) wide=wide/8;
else wide=wide/8+1;
for(hang=0;hang<high;hang++)
{
if(Y+hang>31) //上下屏地址转换
{
write_12864cmd(0x80+Y+hang-32);//先写Y轴坐标
write_12864cmd(0x88+X);//再写X轴坐标 ,(0x88-0x8f)
} //这里X只需写(0-7)
else
{
write_12864cmd(0x80+Y+hang);//先写Y轴坐标
write_12864cmd(0x80+X);//再写X轴坐标 ,(0x80-0x87)
}
for(lie=0;lie<wide;lie++) //根据列宽逐行写入数据
{ //宽占几字节,就写几字节
write_12864dat(tu[hang*wide+lie]);//每行写入wide个字节数据
}
}
if(wide%8==0) wide=wide/8;
else wide=wide/8+1;这句话什么意思?
求指教
{ //Y确定开始行,X确定列(0-7),tu是点阵字模数据
uint hang,lie;
write_12864cmd(extra_cmd);//打开扩展指令集
write_12864cmd(tu_off);//绘图显示关
if(wide%8==0) wide=wide/8;
else wide=wide/8+1;
for(hang=0;hang<high;hang++)
{
if(Y+hang>31) //上下屏地址转换
{
write_12864cmd(0x80+Y+hang-32);//先写Y轴坐标
write_12864cmd(0x88+X);//再写X轴坐标 ,(0x88-0x8f)
} //这里X只需写(0-7)
else
{
write_12864cmd(0x80+Y+hang);//先写Y轴坐标
write_12864cmd(0x80+X);//再写X轴坐标 ,(0x80-0x87)
}
for(lie=0;lie<wide;lie++) //根据列宽逐行写入数据
{ //宽占几字节,就写几字节
write_12864dat(tu[hang*wide+lie]);//每行写入wide个字节数据
}
}
if(wide%8==0) wide=wide/8;
else wide=wide/8+1;这句话什么意思?
求指教