|
现在要把K600+的一个C51程序进行移植到T5L_DGUS II 上,是之前其他人写的程序,其中有一个画线的部分,这边有没有什么文档可以说明这些参数是啥意思我好对应去修改。
void DrawLine(uchar num,uint color,uchar thin,uchar lflag,uchar y0,uchar y1)
{
uchar i=0,j=0;
uint x = lflag?X2:X1;
uchar y = 0;
if(y0>7 || y1>7 || num>0x0C){
Send1Data(y0);
Send1Data(y1);
Send1Data(num);
return; //最大只能有8个值,从0开始,依次对应8种线;线序最多只有12根
}
if(color==0xFFFF && thin==1) y = 5;
for(i=0,j=0;i<(thin?3:5);i++,j++){
DBuf[0+i*16] = (uchar)(X0>>8);
DBuf[1+i*16] = (uchar)X0;
DBuf[2+i*16] = (uchar)((Y[y0]+y+j)>>8);
DBuf[3+i*16] = (uchar)(Y[y0]+y+j);
DBuf[4+i*16] = (uchar)(x>>8); //短线的长度为X1 长线的为X2
DBuf[5+i*16] = (uchar)(x);
DBuf[6+i*16] = (uchar)((Y[y1]+y+j)>>8);
DBuf[7+i*16] = (uchar)(Y[y1]+y+j);
j++;
if(thin && i==3) break;
DBuf[8+i*16] = (uchar)(x>>8);
DBuf[9+i*16] = (uchar)(x);
DBuf[10+i*16] = (uchar)((Y[y1]+y+j)>>8);
DBuf[11+i*16] = (uchar)(Y[y1]+y+j);
DBuf[12+i*16] = (uchar)(X0>>8);
DBuf[13+i*16] = (uchar)X0;
DBuf[14+i*16] = (uchar)((Y[y0]+y+j)>>8);
DBuf[15+i*16] = (uchar)(Y[y0]+y+j);
}
Send1Data(0x5A);
Send1Data(0xA5);
Send1Data(thin?0x33:0x5B);
Send1Data(0x82);
Send1Data(num); //序号
Send1Data(0x00);
Send1Data(0x00);
Send1Data(0x02);
Send1Data(0x00);
Send1Data(thin?0x09:0x12);
Send1Data((uchar)(color>>8));
Send1Data((uchar)color);
Send1Datas(DBuf,(thin?40:80));
Send1Data(0xFF);
Send1Data(0x00);
}
//清除画线
void ClearLine(void)
{
uchar i;
xdata uchar buf[]={0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x01,0x00,0x03,0x00,0x01,0x00,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x01,0x00,0x05};
for(i=1;i<0x0D;i++){
Send1Data(0x5A);
Send1Data(0xA5);
Send1Data(0x33);
Send1Data(0x82);
Send1Data(i); //序号
Send1Data(0x00);
Send1Data(0x00);
Send1Data(0x02);
Send1Data(0x00);
Send1Data(0x09);
Send1Data(0xFF);
Send1Data(0xFF);
Send1Datas(buf,sizeof(buf));
Send1Data(0xFF);
Send1Data(0x00);
}
}
|
|