- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
基于C8051f410的12864液晶驱动程序(12864 LCD driver based on C8051f410)
基于C8051f410的12864液晶驱动程序(12864 LCD driver based on C8051f410)
#包括 C8051F410。”
#包括信息。”
#定义unsigned char函数
# unsigned int定义单元
函数代码表[ ] = {“2012年01月05日”};
函数代码表[ ] = {“23时59分00秒”};
函数代码表3 [ ] = { 0808 }毕业就發”;
函数代码表[ ] = {“作者:XXX”};
/ ****************************************** CGRAM字库定义*/
无符号字符代码cgram_ziku_i2c [ 32 ] =
{
0x03,0x80,0x00,0x80,0xf8,0x8e,0x23,0x91,0x22,0x21,0x22,0x20,0x23,0xa0,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x21,0x20,0x11,0xf8,0x0e,0x00,0x00,0x00,0x00
};
#定义lcd_data P2 /数据口
普通RS = P1 ^ 3;/ /选择寄存器(并行)0:1:数据寄存器指令寄存器;
公司RW = P1 ^ 4;/ /读写控制脚(并行)0:1:读出写入
公司E = P1 ^ 5;/ /读写数据启始脚(并行)
P1 ^了PSB = 6;//串并方式选择引脚为串行模式,0,1为8 / 4位数据口模式
普通RST = P0 ^ 7;/ /复位引脚
公司L = P0 ^ 0;
虚空DelayMs(unsigned int数)
{
无符号整型;
虽然(计数)
{
我= 2350;
在(i至0)i—;
计数—;
}
}
虚空DelayUs(unsigned int数)/延时1us,24.5mh
{
无符号整型;
虽然(计数)
{
我= 1;
在(i至0)i—;
计数—;
_nop_();
}
}
无效busy()
{
(1)
{
lcd_data = 0xff;
RS=0;
RW = 1;
DelayUs(4);
e=1;
DelayUs(4);
如果((lcd_data 0x80)= = 0)
打破;
e=0;
}
}
无效lcdwcom(unsigned char世界通讯)/写命令函数
{
busy();
RS = 0;//指明操作对象为指令寄存器
RW = 0;//指明为写操作
DelayUs(4);
lcd_data =世界通讯;/ /将命令写入总线
e=1;
DelayUs(4);
e=0;
}
无效lcdwdata(unsigned char数据)/写数据函数
{
busy();
RS=1;
RW = 0;
DelayUs(4);
lcd_data =数据;/ /将数据写入总线
e=1;
DelayUs(4);
e=0;
}
lcd12864_init虚空(void)/显示初始化函数
{
DelayMs(50);//延时45ms
PSB = 1;
RST = 1;该(50);
RST = 0;该(50);
RST = 1;该(50);
lcdwcom(0x30);
DelayUs(8);
lcdwcom(0x0c);
DelayUs(4);
lcdwcom(0x01);
DelayUs(80);
lcdwcom(0x06);
DelayUs(8);
}
无效set_cursor(unsigned char,unsigned char Y)/设置光标函数为行号:X,Y为列号
{
未签名字符;
开关(X)/确定行号
{
例:我= 0x80 0x00;断裂;/ /第一行
例:我= 0x90 0x01;断裂;/ /第二行
例:我= 0x88 0x02;断裂;/ /第三行
例:我0x03 = 0x98;断裂;/ /第四行
默认值:中断;
}
我= y +我;/ /确定列号
lcdwcom(我);/ /写地址
DelayUs(80);
}
无效display_char(unsigned char,unsigned char,unsigned char字母)/显示字符函数
{
set_cursor(x,y);/ /光标地址设定
lcdwdata(字母);/ /写入需要显示字符的显示码
}
/ /指定位置显示字符串函数为行号:X,Y为列号
无效display_string(unsigned char,unsigned char,unsigned char *字母)
{
无符号char i=0;
set_cursor(x,y);/ /设置显示的起始地址
而(字母表i)!=“0”)
{
lcdwdata(字母[我]);//写入需要显示字符的显示码
++;
}
您可能关注的文档
- 古埃及、古希腊及古罗马神话入门简介(A brief introduction to myths of ancient Egypt, ancient Greece and Rome).doc
- 古文-冷泉亭记(The ancient pavilion - Cold Spring).doc
- 古时称谓(Ancient appellation).doc
- 古汉语同义词辨析的途径_以_制_度_为例(_ way of ancient Chinese synonyms in _ system _ _ degree as an example).doc
- 古罗马建筑特色赏析(Appreciation of architectural features in ancient Rome).doc
- 古诗词常用字词、意象(Commonly used words and images in ancient poetry).doc
- 古龙群侠传全攻略(Energy-saving.).doc
- 古风诗词发展的轨迹(The development track of ancient poetry).doc
- 古龙群侠传港服升级表和挂狗秘籍(Energy-saving port service upgrade and hang dog.).doc
- 古诗词满分解密(Full decryption of Ancient Poems).doc
- 基于DB2的数据库应用系统的性能优化(Performance optimization of database application system based on DB2).doc
- 基于HALCON的模板匹配方法总结--蓝云杨的机器视觉之路(A summary of template matching method based on HALCON -- the road of machine vision for blue cloud Yang).doc
- 基于Excel的精细人力资源管理与分析模型 2010-1-14 6-24 11-4(上海(Excel based fine human resource management and analysis model 2010-1-14, 6-24, 11-4 (Shanghai)).doc
- 基于Fisher准则线性分类器设计Matlab实现源代码(Based on the Fisher criterion, linear classifier design, Matlab implementation source code).doc
- 基于IEC61850的数字化变电站远动方案探讨(Discussion on Telecontrol scheme of digital substation based on IEC61850).doc
- 地铁施工工法汇总(Summary of metro construction methods).doc
- 基于MAP算法的图像超分辨率重建(Image super resolution reconstruction based on MAP algorithm).doc
- 基于MOS场效应管5A恒流源设计及实验(Design and experiment of 5A constant current source based on MOS field effect transistor).doc
- 基于MATLABSimulink的光伏电池建模与仿真(Modeling and Simulation of photovoltaic cells based on MATLAB Simulink).doc
- 基于Skyline的吉林市三维数字城市消防系统设计与开发(Design and development of 3D digital city fire fighting system based on Skyline in Jilin).doc
文档评论(0)