资源描述:
《基于c51的绘图型12864图形库文件》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、基于c51的绘图型12864图形库文件#ifndef__c51_huitu12864_h#define__c51_huitu12864_h/*voidwr_data(uchardat);//写数据voidwr_command(ucharcommand);//写指令voidqingping(ucharcs);//清屏voidwr_onebytel(ucharx,uchary,uchardat);//在第X页Y列写一字节数据voidrd_data(void);//读数据voidrd_onebytel(ucharx,uchary);//在第X页Y列
2、读一字节数据voidpoint(ucharx,uchary,ucharzheng);//在第X行Y列写一个点(zheng=1时表示点亮,0表示熄灭;0<=X<=63,0<=Y<=127)voidmian(ucharx,uchary,ucharxx,ucharyy,ucharzheng);//从坐标(X,Y)到(XX,YY)画一个矩形面zheng=1点亮0熄灭;xx>x,yy>y//voidline(ucharx,uchary,ucharhh,ucharyy,ucharzheng);//从坐标(X,Y)到(XX,YY)画一条线zheng=1点亮
3、0熄灭;voidbiankuang(ucharx,uchary,ucharxx,ucharyy,ucharkuan,ucharzheng);//从坐标(X,Y)到(XX,YY)画一个矩形边框,kuan表示边框宽度;zheng=1点亮0熄灭;xx>x,yy>yvoidyuan(ucharx,uchary,charr,ucharzheng);//以(X,Y)为圆心R为半径画圆面,zheng=1点亮0熄灭voidyuanbiankuang(ucharx,uchary,charr,ucharkuan,ucharzheng);////以(X,Y)为圆心
4、R为半径画圆边框,kuan表示宽度,zheng=1点亮0熄灭voidfanxian(ucharx,uchary,ucharxx,ucharyy);//从坐标(X,Y)到(XX,YY)的矩形区域内数据反显voidpointf(ucharx,uchary);//点(X,Y)反显voidyuanfanxian(ucharx,uchary,charr);//以(X,Y)为圆心R为半径圆形区域内数据反显ucharrd_point(ucharx,uchary);//读(X,Y)点得数据(返回值为uchar型)voidlcd_busy(void);//判忙
5、voidlcd_init(void);//LCD初始化*///《《《《《使用本库必须先调用此函数!》》》》》#include#defineucharunsignedchar#defineuintunsignedint#definelcddataP0//数据口sbitrs=P2^0;//数据指令控制sbitrw=P2^1;//读写控制sbite=P2^2;//使能sbitcs1=P2^3;//片选1sbitcs2=P2^4;//片选2sbitrest=P2^5;//复位voidwr_data(uchardat);voidwr_c
6、ommand(ucharcommand);voidqingping(ucharcs);voidwr_onebytel(ucharx,uchary,uchardat);voidrd_data(void);voidrd_onebytel(ucharx,uchary);voidrd_somebytel(ucharx,uchary,ucharz);voidpoint(ucharx,uchary,ucharzheng);voidmian(ucharx,uchary,ucharxx,ucharyy,ucharzheng);voidline(ucharx,
7、uchary,ucharhh,ucharyy,ucharzheng);voidbiankuang(ucharx,uchary,ucharxx,ucharyy,ucharkuan,ucharzheng);voidyuan(ucharx,uchary,charr,ucharzheng);voidyuanbiankuang(ucharx,uchary,charr,ucharkuan,ucharzheng);voidfanxian(ucharx,uchary,ucharxx,ucharyy);voidpointf(ucharx,uchary);voi
8、dyuanfanxian(ucharx,uchary,charr);ucharrd_point(ucharx,uchary);ucharrd_point(uchar