- 1、本文档共18页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
arm_st7920驱动程序(Arm_st7920 driver)
arm_st7920驱动程序(Arm_st7920 driver)
# include lpc17xx.h / / lpc1768 st7920 128 * 64 主要性能描述参见 pdfst7920.pdf
# include stdint.h / / 定义uint8 _ t格式变量类型
# define delay _ n 20 / / 命令延时, 太快会导致写操作失败或出错 my: 20
# define delay _ clr 200 / / 清屏函数的延时, 大些, 否则液晶屏开始处有乱码
# define hours 150000 / / 显示延时, 延时函数参量max: uint32 _ t
# define num 7 / / 能够显示的数据的总位数, 不包括符号位
# define lcd _ rs _ 1 lpc _ gpio0 - fiopin | = (1 18) / / 相应位0.18置1, 即置位
# define lcd _ rs _ 0 lpc _ gpio0 - fiopin = ~ (1 18) / / 相应位0.18置0, 即清零
# define lcd _ rw _ 1 lpc _ gpio0 - fiopin | = (1 19)
# define lcd _ rw _ 0 lpc _ gpio0 - fiopin = ~ (1 19)
# define lcd _ e _ 1 lpc _ gpio0 - fiopin | = (1 20)
# define lcd _ e _ 0 lpc _ gpio0 - fiopin = ~ (1 20)
# define lcd _ psb _ 1 lpc _ gpio0 - fiopin | = (1 21)
# define lcd _ psb _ 0 lpc _ gpio0 - fiopin = ~ (1 21)
/ / rs 0.18
/ / rw 0.19
/ / e 0,20
/ / psb 0.21
/ / db0 ~ 7 对应arm的2.0 ~ 2.7
/ / 2.0 ~ 2.7, 以及 0.18 ~ 0.21 端口都设置为输出
/ / 正弦波表, 取点表
int table _ its [46] = {0,4,8,12,16,19,22,25,27,29,30,30,30,29,28,26,24,
21,18,14,10,6,2, - 2, - 6, - 10, 14, 18, 21, 24, 26, 28, 29,
- 30, - 30, - 30, - 29, 27, 25, 22, 19, 16, - 12, - 8, - 4};
uint8 _ t table _ dot [8] = {0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
uint8 _ t table _ dot _ double [8] = {0x80,0xc0,0x60,0x30,0x18,0x0c, 0x06,0x03};
uint8 _ t picture [32 * 32] = {0}; / / 最终要画的图
void delay (uint32 _ t count) / / 延时函数, 与宏定义delay _ n配合使用
{
uint8 _ t j;
while (count - -)
{
for (j = 0, j 0x7f; j + +);
}
}
void lcd _ wcmd (uint8 _ t cmd) / / 写命令
{
delay (delay _ n);
lcd _ rs _ 0;
lcd _ rw _ 0;
lcd _ e _ 0;
lpc _ gpio2 - fiopin0 = cmd; / / 命令写到2.0 ~ 2.7端口
lcd _ e _ 1;
lcd _ e _ 0;
}
void lcd _ wdata (uint8 _ t data) / / 写数据, 时序参考pdf
{
delay (delay _ n);
lcd _ rs _ 1;
lcd _ rw _ 0;
lcd _ e _ 0;
lpc _ gpio2 - fiopin0 = data; / / 数据写到2.0 ~ 2.7端口
lcd _ e _ 1;
lcd _ e _ 0;
}
void lcd _ practice () / / 液晶屏初始化, 包括cpu的相关端口设置
{
lcd _ wcmd (0x30);
The //8 bit MPU interface, the default basic instruction set, see
您可能关注的文档
- 2010年中考地理复习的几个关注(Several concerns of geography review in 2010).doc
- 2010年二级建造师《建筑工程》(In 2010, the two construction division construction works).doc
- 2010年二级建造师考试《建筑工程》真题及答案解析(In 2010 two construction division examination Zhenti and answers the construction analysis).doc
- 2010年仓库管理工作年终总结(Summary of warehouse management work in 2010).doc
- 2010年四川省高考理科一分段表--招生考试信息网(2010 Sichuan science entrance examination section of the entrance examination information network).doc
- 2010年度中国十大管理实践(Ten major management practices of China in 2010).doc
- 2010年普通高等学校招生全国统一考试江苏卷语文(含附加题答案)(In 2010, ordinary colleges and universities enrolled in the national unified examination, Jiangsu language (including additional questions, answers)).doc
- 2010年立体几何复习建议(Review of solid geometry in 2010).doc
- 2010年高考数学知识点复习重点90条(In 2010, the university entrance examination mathematics knowledge spot review key 90).doc
- 2010年计算机ftp索引(Computer FTP Index 2010).doc
- arm开发之一种dwt域基于ifs的数字水印算法(Digital watermarking algorithm based on IFS arm development of DWT Domain).doc
- arm的开发步骤(The development of arm steps).doc
- as常用代码(As common code).doc
- as的基本代码解释(The basic as code explanation).doc
- atc scm20的打摩(ATC scm20 rub).doc
- atx电源结构图(ATX power supply structure).doc
- auto cad 命令大全(Auto CAD命令大全).doc
- autocad 2004命令大全(AutoCAD command Daquan 2004).doc
- auto cad快捷命令表(Auto CAD快捷命令表).doc
- autocad 应用技巧(椭圆)(autocad 应用技巧 (椭圆)).doc
文档评论(0)