资源简介
USARTHMI——GUI绘图指令.zip
代码片段和文件信息
#include “write.h“
#include “stdarg.h“
#include “stdio.h“
void hmi_cls(unsigned int color)
{
hmiprintf(“cls %d%c%c%c“color0xff0xff0xff);
}
void hmi_pic(unsigned int xunsigned int yunsigned int picid)
{
hmiprintf(“pic %d%d%d%c%c%c“xypicid0xff0xff0xff);
}
void hmi_picq(unsigned int xunsigned int yunsigned int wunsigned int hunsigned int picid)
{
hmiprintf(“picq %d%d%d%d%d%c%c%c“xywhpicid0xff0xff0xff);
}
void hmi_xpic(unsigned int xunsigned int yunsigned int wunsigned int hunsigned int x0unsigned int y0unsigned int picid)
{
hmiprintf(“xpic %d%d%d%d%d%d%d%c%c%c“xywhx0y0picid0xff0xff0xff);
}
void hmi_xstr_number(unsigned int xunsigned int yunsigned int wunsigned int hunsigned int pointcolorunsigned int backcolorlong int number)
{
hmiprintf(“xstr %d%d%d%d0%d%d011%c%d%c%c%c%c“xywhpointcolorbackcolor‘“‘number‘“‘0xff0xff0xff);
}
void hmi_xstr_str(unsigned int xunsigned int yunsigned int wunsigned int hunsigned int pointcolorunsigned int backcolorchar* str)
{
hmiprintf(“xstr %d%d%d%d0%d%d011%c%s%c%c%c%c“xywhpointcolorbackcolor‘“‘str‘“‘0xff0xff0xff);
}
void hmi_fill(unsigned int xunsigned int yunsigned int wunsigned int hunsigned int color)
{
hmiprintf(“fill %d%d%d%d%d%c%c%c“xywhcolor0xff0xff0xff);
}
void him_line(unsigned int xunsigned int yunsigned int x2unsigned int y2unsigned int color)
{
hmiprintf(“line %d%d%d%d%d%c%c%c“xyx2y2color0xff0xff0xff);
}
void him_draw(unsigned int xunsigned int yunsigned int x2unsigned int y2unsigned int color)
{
hmiprintf(“draw %d%d%d%d%d%c%c%c“xyx2y2color0xff0xff0xff);
}
void hmi_cir(unsigned int xunsigned int yunsigned int runsigned int color)
{
hmiprintf(“cir %d%d%d%d%c%c%c“xyrcolor0xff0xff0xff);
}
void hmi_cirs(unsigned int xunsigned int yunsigned int runsigned int color)
{
hmiprintf(“cirs %d%d%d%d%c%c%c“xyrcolor0xff0xff0xff);
}
//UART 发送字符串
void UART_SendString(char *s)
{
while(*s)//检测字符串结束符
{
USART_SendData(USART1*s++);//用stm32时对应使用的串口
while(USART_GetFlagStatus(USART1USART_FLAG_TXE) == RESET);//用stm32时等待发送完成
// WByte(*s++);//用51时
}
}
//PRINTF 输出函数
void hmiprintf(const char *fmt...)
{
va_list ap;
char string[100];
// char xdata string[100];//用51时
va_start(apfmt);
vsprintf(stringfmtap);//此处也可以使用sprintf函数,用法差不多,稍加修改即可,此处略去
UART_SendString(string);
va_end(ap);
}
//用51时的发送函数
//void WByte(unsigned char output)
//{
// ES=0; //用51时关串口中断
// SBUF=output;
// while(TI!=1); //用51时等待发送成功
// TI=0; //用51时清除发送中断标志
// ES=1; //用51时开串口中断
//}
////51单片机IO口模拟串口发送
////************波特率间隔时间计算**************//
////********波特率为9600时,11.0592M晶振********//
////间隔机器周期s=(1000000/9600)/(12/11.0592)=96//
//sbit txd=P1^0;
////********************
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2523 2018-07-18 17:40 write.h
文件 7717 2018-07-18 18:46 write.c
相关资源
- 681xg9.doc
- SST5103_2018.zip
- 四种算法.rar
-
ba
se64.zip - rar(22)
- 建行总行信息技术类09、10、11三年的
- 2018哈工大深圳何震宇算法.pdf
- Unity.zip
- qpsksys.rar
- 微服务springboot.txt
- KESA1.0.rar
-
video-pla
yer.zip - iar破解安装包.rar
- CLEAN算法实现超宽带信道估计代码.r
- win7开机密码忘记如何解决.doc
- nm2mwr.doc
- ESXI6.0.txt
- 火车采集器V9微信公众号文章采集规则
- wechat-api-master.zip
- vs2010-2015语言包.rar
- 蚂蚁1.2.3期.txt
- 代码生成.txt
- Z5-jF-.net财务管理系统完整源码.rar
- 自适应滤波器原理(答案与代码).
- Location_WIFI.rar
- 瑞利衰落信道的仿真.doc
- ds18b20.zip
- myeclipse2015stable3.0破解.rar
- 渗透视频教学网盘地址.rar
- eetop.cn_Crack_Quartus_Prime_Standard_Pro_16.0
评论
共有 条评论