|
5110的頭文件 編寫 誰能幫我看看 哪里出錯啦 謝謝 里面的 編寫的 頭文件 有問題 找不到問題所在
單片機源程序如下:- #include <REGX51.H>
- #ifndef __5110_H__
- #define __5110_H__
- #include "ziku.c"
- //宏定義
- #define X_Col_Addr 0x80 //定位到第0列指令(列起始地址)(0 - 83)
- #define Y_Page_Addr 0x40 //定位到第0頁指令(頁起始地址)(0 - 5)
- #define LCD_write_cmd(cmd) LCD_write_byte(cmd, 0) //寫入指令
- #define LCD_write_dat(dat) LCD_write_byte(dat, 1) //寫入數據
- sbit LCD_CLK = P0^4; //串行時鐘 //上升沿寫入數據
- sbit LCD_DIN = P0^3; //串行數據輸入 //先高后低
- sbit LCD_DC = P0^2; //數據指令控制端 //高電平數據,低電平指令
- sbit LCD_CS = P0^1; //片選使能 //低電平有效
- sbit LCD_RST = P0^0; //LCD復位端 //低電平復位
- //顯示一個字節(數據或命令)
- void LCD_write_byte(unsigned char wbyte, unsigned char dat_cmd);
- //液晶字節定位(1*1)
- //液晶規劃:
- //x: 0 - 83
- //y: 0 - 5
- void LCD_pos_byte(unsigned char x, unsigned char y);
- //顯示清屏
- void LCD_clr_scr(void);
- //液晶字符輸出(6*8字體)
- //x: 0 - 13
- //y: 0 - 5
- void LCD_printc(unsigned char x, unsigned char y, unsigned char c_dat);
- //液晶字符串輸出(6*8字體)
- //x: 0 - 13
- //y: 0 - 5
- void LCD_prints(unsigned char x, unsigned char y, unsigned char *s_dat);
- //液晶漢字輸出(16*16字體)
- //取碼規則: 低位在前, 列行掃描, 陰碼(1-亮, 0-滅)
- //x: 0 - 4
- //y: 0 - 2
- void LCD_printch(unsigned char x, unsigned char y, unsigned char code *h_dat);
- //液晶漢字輸出(16*16字體)
- //查表顯示輸出
- //取碼規則: 低位在前, 列行掃描, 陰碼(1-亮, 0-滅)
- //x: 0 - 4
- //y: 0 - 2
- void LCD_showch(unsigned char x, unsigned char y, unsigned char code *dat);
- //初始化LCD5510
- void LCD5510_Init(void);
- #endif
復制代碼
|
-
-
5110.zip
2019-6-28 09:32 上傳
點擊文件名下載附件
42.14 KB, 下載次數: 9
|