📄 lcd.lst
字号:
C51 COMPILER V7.06 LCD 12/20/2008 10:18:35 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE LCD
OBJECT MODULE PLACED IN lcd.OBJ
COMPILER INVOKED BY: D:\Program Files\Keil\C51\BIN\C51.EXE lcd.c LARGE BROWSE DEBUG OBJECTEXTEND TABS(2)
stmt level source
1 #include <iom16v.h>
*** WARNING C318 IN LINE 1 OF lcd.c: can't open file 'iom16v.h'
2 #include "lcd.h"
3 #include "delay.h"
*** WARNING C206 IN LINE 29 OF DELAY.H: 'asm': missing function-prototype
*** ERROR C267 IN LINE 29 OF DELAY.H: 'asm': requires ANSI-style prototype
*** ERROR C141 IN LINE 31 OF DELAY.H: syntax error near 'asm'
4 #include "font.h"
5 unsigned char CurOffset,CurRow,CurPage,CurCol;//当前指针位置
6
7 //--------------复位函数---------------------
8 void LCD_reset(void)
9 {
10 1 LCD_RST_DDR |= LCD_RST_BIT;
*** ERROR C202 IN LINE 10 OF LCD.C: 'DDRB': undefined identifier
11 1 CLEAR_LCD_RST;
*** ERROR C202 IN LINE 11 OF LCD.C: 'PORTB': undefined identifier
12 1 delay_nms(10);
13 1 SET_LCD_RST;
*** ERROR C202 IN LINE 13 OF LCD.C: 'PORTB': undefined identifier
14 1 }
15
16 //-------------忙信号检测函数----------------
17 void LCD_BUSY(unsigned char lr) //判断忙标志
18 {
19 1 //unsigned char status;
20 1 asm("cli");
21 1 if(lr==RIGHT)
22 1 {
23 2 CLEAR_LCD_CS2; //cs2=0
*** ERROR C202 IN LINE 23 OF LCD.C: 'PORTB': undefined identifier
24 2 SET_LCD_CS1; //cs1=1
*** ERROR C202 IN LINE 24 OF LCD.C: 'PORTB': undefined identifier
25 2 }
26 1 else
27 1 {
28 2 SET_LCD_CS2; //cs2=1
*** ERROR C202 IN LINE 28 OF LCD.C: 'PORTB': undefined identifier
29 2 CLEAR_LCD_CS1; //cs1=0
*** ERROR C202 IN LINE 29 OF LCD.C: 'PORTB': undefined identifier
30 2 }
31 1 SET_LCD_CMD;
*** ERROR C202 IN LINE 31 OF LCD.C: 'PORTB': undefined identifier
32 1 LCD_DIR_PORT = 0x00;
*** ERROR C202 IN LINE 32 OF LCD.C: 'DDRA': undefined identifier
33 1 LCD_OP_PORT = 0xff;
*** ERROR C202 IN LINE 33 OF LCD.C: 'PORTA': undefined identifier
34 1 SET_LCD_READ;
*** ERROR C202 IN LINE 34 OF LCD.C: 'PORTB': undefined identifier
35 1 SET_LCD_E;
*** ERROR C202 IN LINE 35 OF LCD.C: 'PORTB': undefined identifier
36 1 delay_nus(250);
37 1 delay_nus(250);
38 1 while((LCD_IP_PORT) & LCD_STATUS_BUSY)
*** ERROR C202 IN LINE 38 OF LCD.C: 'PINA': undefined identifier
C51 COMPILER V7.06 LCD 12/20/2008 10:18:35 PAGE 2
39 1 {
40 2 CLEAR_LCD_E;
*** ERROR C202 IN LINE 40 OF LCD.C: 'PORTB': undefined identifier
41 2 delay_nus(250);
42 2 delay_nus(250);
43 2 SET_LCD_E;
*** ERROR C202 IN LINE 43 OF LCD.C: 'PORTB': undefined identifier
44 2 delay_nus(250);
45 2 delay_nus(250);
46 2 }
47 1 CLEAR_LCD_E;
*** ERROR C202 IN LINE 47 OF LCD.C: 'PORTB': undefined identifier
48 1 SET_LCD_WRITE;
*** ERROR C202 IN LINE 48 OF LCD.C: 'PORTB': undefined identifier
49 1 LCD_OP_PORT = 0xff;
*** ERROR C202 IN LINE 49 OF LCD.C: 'PORTA': undefined identifier
50 1 asm("sei");
51 1
52 1 }
53
54 //------------写指令(数据)函数---------------------
55 void write_LCD(unsigned char lr,unsigned char cd,unsigned char data)
*** ERROR C141 IN LINE 55 OF LCD.C: syntax error near ')'
56 {
57 1 asm("cli");
58 1 LCD_BUSY(lr);
59 1 if(cd==CMD)
60 1 SET_LCD_CMD;
*** ERROR C202 IN LINE 60 OF LCD.C: 'PORTB': undefined identifier
61 1 else
62 1 SET_LCD_DATA;
*** ERROR C202 IN LINE 62 OF LCD.C: 'PORTB': undefined identifier
63 1 SET_LCD_WRITE;
*** ERROR C202 IN LINE 63 OF LCD.C: 'PORTB': undefined identifier
64 1 SET_LCD_E;
*** ERROR C202 IN LINE 64 OF LCD.C: 'PORTB': undefined identifier
65 1 LCD_DIR_PORT = 0xff;
*** ERROR C202 IN LINE 65 OF LCD.C: 'DDRA': undefined identifier
66 1 LCD_OP_PORT = data;
*** ERROR C202 IN LINE 66 OF LCD.C: 'PORTA': undefined identifier
*** ERROR C141 IN LINE 66 OF LCD.C: syntax error near 'data'
67 1 delay_nus(250);
68 1 delay_nus(250);
69 1 CLEAR_LCD_E;
*** ERROR C202 IN LINE 69 OF LCD.C: 'PORTB': undefined identifier
70 1 LCD_OP_PORT = 0xff;
*** ERROR C202 IN LINE 70 OF LCD.C: 'PORTA': undefined identifier
71 1 asm("sei");
72 1
73 1 }
74
75 //--------------读数据函数-------------------
76 unsigned char read_LCD(unsigned char lr)
77 {
78 1 unsigned char data;
*** ERROR C141 IN LINE 78 OF LCD.C: syntax error near ';'
79 1
80 1 asm("cli");
81 1 LCD_BUSY(lr);
82 1 SET_LCD_DATA;
*** ERROR C202 IN LINE 82 OF LCD.C: 'PORTB': undefined identifier
83 1 LCD_DIR_PORT = 0x00;
C51 COMPILER V7.06 LCD 12/20/2008 10:18:35 PAGE 3
*** ERROR C202 IN LINE 83 OF LCD.C: 'DDRA': undefined identifier
84 1 LCD_OP_PORT = 0xff;
*** ERROR C202 IN LINE 84 OF LCD.C: 'PORTA': undefined identifier
85 1 SET_LCD_READ;
*** ERROR C202 IN LINE 85 OF LCD.C: 'PORTB': undefined identifier
86 1 SET_LCD_E;
*** ERROR C202 IN LINE 86 OF LCD.C: 'PORTB': undefined identifier
87 1 delay_nms(1);
88 1 data=LCD_IP_PORT;
*** ERROR C141 IN LINE 88 OF LCD.C: syntax error near 'data'
*** ERROR C202 IN LINE 88 OF LCD.C: 'PINA': undefined identifier
89 1 CLEAR_LCD_E;
*** ERROR C202 IN LINE 89 OF LCD.C: 'PORTB': undefined identifier
90 1 SET_LCD_WRITE;
*** ERROR C202 IN LINE 90 OF LCD.C: 'PORTB': undefined identifier
91 1
92 1 LCD_BUSY(lr);
93 1 SET_LCD_DATA;
*** ERROR C202 IN LINE 93 OF LCD.C: 'PORTB': undefined identifier
94 1 LCD_DIR_PORT = 0x00;
*** ERROR C202 IN LINE 94 OF LCD.C: 'DDRA': undefined identifier
95 1 LCD_OP_PORT = 0xff;
*** ERROR C202 IN LINE 95 OF LCD.C: 'PORTA': undefined identifier
96 1 SET_LCD_READ;
*** ERROR C202 IN LINE 96 OF LCD.C: 'PORTB': undefined identifier
97 1 SET_LCD_E;
*** ERROR C202 IN LINE 97 OF LCD.C: 'PORTB': undefined identifier
98 1 delay_nus(250);
99 1 delay_nus(250);
100 1 data=LCD_IP_PORT;
*** ERROR C141 IN LINE 100 OF LCD.C: syntax error near 'data'
*** ERROR C202 IN LINE 100 OF LCD.C: 'PINA': undefined identifier
101 1 CLEAR_LCD_E;
*** ERROR C202 IN LINE 101 OF LCD.C: 'PORTB': undefined identifier
102 1 SET_LCD_WRITE;
*** ERROR C202 IN LINE 102 OF LCD.C: 'PORTB': undefined identifier
103 1 delay_nus(250);
104 1 delay_nus(250);
105 1 asm("sei");
106 1 return data;
*** ERROR C141 IN LINE 106 OF LCD.C: syntax error near 'data', expected ';'
107 1 }
108
109 //-----------------行列页选择函数------------------ CMD 0
110 void set_start_line_L(unsigned char line) /*设置显示起始行*/ //0-63
111 {
112 1 write_LCD(LEFT,CMD,0xc0|line); // LEFT 0
*** ERROR C208 IN LINE 112 OF LCD.C: '_write_LCD': too many actual parameters
113 1 }
114
115 void set_start_line_R(unsigned char line) /*设置显示起始行*/ //0-63
116 {
117 1 write_LCD(RIGHT,CMD,0xc0|line); // RIGHT 1
*** ERROR C208 IN LINE 117 OF LCD.C: '_write_LCD': too many actual parameters
118 1 }
119
120 void set_page_L(unsigned char page) /*设置X地址 设置页*/ //0-7
121 {
122 1 write_LCD(LEFT,CMD,0xb8|page);
*** ERROR C208 IN LINE 122 OF LCD.C: '_write_LCD': too many actual parameters
123 1 }
124 void set_page_R(unsigned char page) /*设置X地址 设置页*/ //0-7
C51 COMPILER V7.06 LCD 12/20/2008 10:18:35 PAGE 4
125 {
126 1 write_LCD(RIGHT,CMD,0xb8|page);
*** ERROR C208 IN LINE 126 OF LCD.C: '_write_LCD': too many actual parameters
127 1 }
128
129 void set_col_addr_L(unsigned char col) /*设置Y地址*/ //0-63
130 {
131 1 write_LCD(LEFT,CMD,0x40|col);
*** ERROR C208 IN LINE 131 OF LCD.C: '_write_LCD': too many actual parameters
132 1 }
133
134 void set_col_addr_R(unsigned char col) /*设置Y地址*/ //0-63
135 {
136 1 write_LCD(RIGHT,CMD,0x40|col);
*** ERROR C208 IN LINE 136 OF LCD.C: '_write_LCD': too many actual parameters
137 1 }
138
139
140 //------------液晶初始化函数-----------------------
141 void LCD_Init(void)
142 {
143 1 LCD_DIR_PORT = 0xff;
*** ERROR C202 IN LINE 143 OF LCD.C: 'DDRA': undefined identifier
144 1 LCD_OP_PORT = 0xff;
*** ERROR C202 IN LINE 144 OF LCD.C: 'PORTA': undefined identifier
145 1 LCD_EN_DDR |= LCD_EN_BIT;
*** ERROR C202 IN LINE 145 OF LCD.C: 'DDRB': undefined identifier
146 1 LCD_DI_DDR |= LCD_DI_BIT;
*** ERROR C202 IN LINE 146 OF LCD.C: 'DDRB': undefined identifier
147 1 LCD_CS1_DDR |= LCD_CS1_BIT;
*** ERROR C202 IN LINE 147 OF LCD.C: 'DDRB': undefined identifier
148 1 LCD_CS2_DDR |= LCD_CS2_BIT;
*** ERROR C202 IN LINE 148 OF LCD.C: 'DDRB': undefined identifier
149 1 LCD_RW_DDR |= LCD_RW_BIT;
*** ERROR C202 IN LINE 149 OF LCD.C: 'DDRB': undefined identifier
150 1 LCD_RW_PORT &= ~LCD_RW_BIT;
*** ERROR C202 IN LINE 150 OF LCD.C: 'PORTB': undefined identifier
151 1 LCD_reset();
152 1 set_start_line_L(0); /*显示起始行为0*/
153 1 set_start_line_R(0); /*显示起始行为0*/
154 1 write_LCD(LEFT,CMD,DISPLAY_ON); /* 开显示 */
*** ERROR C208 IN LINE 154 OF LCD.C: '_write_LCD': too many actual parameters
155 1 write_LCD(RIGHT,CMD,DISPLAY_ON); /* 开显示 */
*** ERROR C208 IN LINE 155 OF LCD.C: '_write_LCD': too many actual parameters
156 1 }
157
158
159 //-----------清屏函数---------------------------
160 void LCD_clr(void)
161 {
162 1 unsigned char pages,i;
163 1 for(pages=0;pages<8;pages++)
164 1 {
165 2 set_page_L(pages); /* X 页地址 */
166 2 set_page_R(pages); /* X 页地址 */
167 2 for(i=0;i<64;i++)
168 2 {
169 3 set_col_addr_L(i);//Y
170 3 set_col_addr_R(i);//Y
171 3 write_LCD(LEFT,DATA,0x0);
*** ERROR C208 IN LINE 171 OF LCD.C: '_write_LCD': too many actual parameters
172 3 write_LCD(RIGHT,DATA,0x0);
C51 COMPILER V7.06 LCD 12/20/2008 10:18:35 PAGE 5
*** ERROR C208 IN LINE 172 OF LCD.C: '_write_LCD': too many actual parameters
173 3 }
174 2 }
175 1 }
176
177
178 //---------当前行列获得函数-----------------------
179 unsigned char GetPage(void) /*得到当前页*/
180 {
181 1 return CurPage;
182 1 }
183
184 unsigned char GetCol(void) /*得到当前列*/
185 {
186 1 return CurCol;
187 1 }
188
189 //-----------------页置函数-----------------
190 void SetPageCol(unsigned char upage, unsigned char ucol)
191 {
192 1 CurPage = upage;
193 1 CurCol = ucol;
194 1 if(ucol<64)
195 1 {
196 2 set_page_L(upage);
197 2 set_col_addr_L(ucol);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -