发送函数如何 发送汉字为:一
串口发给屏幕的指令实际为AA 11 45 FF FF F8 00 00 C8 00 88 E4 B8 CC 33 C3 3C 。
发送协议如下
void DWINLCD_ShowChar(u8 Mode,u16 Color, u16 Bcolor,u16 Xs, u16 Ys,char*str)
{
DwinSend_Buff_Size=17; //Ö¸áîêy¾Y3¤¶èÎa16£¨Ö¡í·+Ö¸áî+Mode+êy¾Y+Ö¡Î2£©
Data_init(); //ÖØD¸üDÂêy×é
// u16 strlenth=0;
// strlenth=strlen((const char*)str);
DWINSend_Buff[DwinSend_Buff_Size -16]=0x11; //¾ØDÎÇøóòòƶˉÖ¸áî
DWINSend_Buff[DwinSend_Buff_Size -15]=Mode; //¾ØDÎÇøóòòƶˉÄ£ê½Ö¸áî
DWINSend_Buff[DwinSend_Buff_Size -14]=Color>>8; //ìî3äÑÕ髸ß8λ
DWINSend_Buff[DwinSend_Buff_Size -13]=Color&0xFF; //ìî3äÑÕé«μí8λ
DWINSend_Buff[DwinSend_Buff_Size -12]=Bcolor>>8; //ìî3ä×Ö·û±3¾°ÑÕ髸ß8λ
DWINSend_Buff[DwinSend_Buff_Size -11]=Bcolor&0xFF; //ìî3ä×Ö·û±3¾°ÑÕé«μí8λ
DWINSend_Buff[DwinSend_Buff_Size -10]=Xs>>8; //Xs×ø±ê¸ß°Ëλ
DWINSend_Buff[DwinSend_Buff_Size -9]=Xs&0xFF; //Xs×ø±êμí°Ëλ
DWINSend_Buff[DwinSend_Buff_Size -8]=Ys>>8; //Ys×ø±ê¸ß°Ëλ
DWINSend_Buff[DwinSend_Buff_Size -7]=Ys&0xFF; //Ys×ø±êμí°Ëλ
DWINSend_Buff[DwinSend_Buff_Size -6]=*str; //Ys×ø±ê¸ß°Ëλ
DWINSend_Buff[DwinSend_Buff_Size -5]=*(str+1); //Ys×ø±êμí°Ëλ
Send_Data(DWINSend_Buff); //·¢Ëíêy¾Y
}
实际发送内码为:E4B8 理论应为:D2BB
编码设置为ANSI UTF-8 GB2312试过都不行我想问问哪个地方有问题?在线等!!!!!
一周热门 更多>