LCD12864 cubie驱动显示

操作系统: 使用的是官方网站上的ubuntu sd card 1.1

1. 安装python的库和cubie的gpio库

  1. sudo apt-get install python-dev

  2. wget http://dl.linux-sunxi.org/users/tom/pySUNXI-0.1.12.tar.gz

  3. tar zxf pySUNXI-0.1.12.tar.gz

  4. sudo python setup.py install

复制代码

2. 用Python GPIO里面的GPIO C库文件直接编写 C应用程序 

在/home/cubie/pySUNXI-0.1.12/source目录下编写:
pyinclude.c文件(见附件)
pyinclude.h文件(见附件) 
LCD12864Serial.c文件(见附件) 
LCD12864Serial.h文件 (见附件) 
test12864.c文件如下:

  1. #include "pyinclude.h"

  2. #include "LCD12864Serial.h"


  3. int main(void)

  4. {

  5.     if(SETUP_OK!=sunxi_gpio_init())

  6.         {

  7.         printf("Failed to initialize GPIO\n");

  8.         return -1;

  9.     }

  10.         LCD12864Init();

  11.         while(1)

  12.         {

  13.                 Test12864();

  14.         }

  15.     sunxi_gpio_cleanup();

  16.         return 0;


  17. }

复制代码

3.硬件连接:
cubie       LCD12864
PD6          CS    (RS)
PD7          SID   (RW)
PD8          SCLK   (EN)
PD9          RST
   
4. 编译运行:

  1. gcc LCD12864Serial.c -c

  2. gcc gpio_lib.c -c

  3. gcc pyinclude.c -c

  4. gcc test12864.c -c

  5. gcc test12864.o gpio_lib.o pyinclude.o LCD12864Serial.o -o test12864

  6. ./test12864

复制代码

5.有图有真相:
IMG_20130809_102854.jpgIMG_20130809_102902.jpgIMG_20130809_102912.jpgIMG_20130809_102848.jpg 


附上代码:  串行12864-1-1.zip (1.61 KB, 下载次数: 17)  串行12864-1-0.zip (1.08 KB, 下载次数: 16) Makefile.zip (297 Bytes, 下载次数: 13) 


原文作者:SUNROC1

原文链接:http://forum.cubietech.com/forum.php?mod=viewthread&tid=918

转载于:https://my.oschina.net/u/1982421/blog/301605

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值