|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2014-9-4 08:42:49
|
显示全部楼层
这是我移植的画点程序 大家帮忙看下怎么回事
void Set_12864_point(u8 x,u8 y)
{
u8 x_byte,x_bit,y_byte,y_bit;
u8 data1,data2;
x&=0x7F;//ÏÞÖÆÔÚÒº¾§ÆÁÄ»µÄ·¶Î§ÄÚ
y&=0x3F;
x_byte=x/16;//Ëã³öÔÚÄǸö×Ö½Ú
x_bit=x&0x0f; //Ëã³öÊÇÄÄһλ
y_byte=y/32;
y_bit=y&0x3f;
Write_12864_Com(extern_commod);
Write_12864_Com(0x80+y_bit);
Write_12864_Com(0x80+x_byte+8*y_byte);
Read_12864_Data();//ÏÈ¿Õ¶ÁÒ»´Î£¿²»ÖªµÀΪʲô
data1=Read_12864_Data();
data2=Read_12864_Data();
// data2=0;
// data1=0;
Write_12864_Com(extern_commod);
Write_12864_Com(0x80+y_bit);
Write_12864_Com(0x80+x_byte+8*y_byte);
if(x_bit<8)
{
Write_12864_Data(data1|(0x01<<(7-x_bit)));
Write_12864_Data(data2);
}
else
{
Write_12864_Data(data1);
Write_12864_Data(data2|(0x01<<(15-x_bit)));
}
Write_12864_Com(draw_on);
Write_12864_Com(basic_commod);
} |
|