📄 lgdp4524-2^2.lst
字号:
C51 COMPILER V7.06 LGDP4524_2_2 02/06/2009 14:31:08 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE LGDP4524_2_2
OBJECT MODULE PLACED IN LGDP4524-2^2.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE LGDP4524-2^2.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1
2 /************************************************
3 LCD: 2.2寸,LG,TFT 176*220 date: 2007.7.23
4
5 IC LGDP4524(R61503U) 8080/16bits
6 VDD 2.8V
7
8
9 ************************************************/
10
11
12
13 #include <reg52.h>
14 #include "LGDP4524-16-V2.h"
*** WARNING C318 IN LINE 14 OF LGDP4524-2^2.c: can't open file 'LGDP4524-16-V2.h'
15 #include "table_V2.h"
*** WARNING C318 IN LINE 15 OF LGDP4524-2^2.c: can't open file 'table_V2.h'
16
17 //#define NBI 0x88 //33B6 用
18 //char contrast=72;
19 char page_no=0;
20
21 void main()
22 {
23 1
24 1 P1=0xf0;
25 1 page(0);
*** WARNING C206 IN LINE 25 OF LGDP4524-2^2.C: 'page': missing function-prototype
*** ERROR C267 IN LINE 25 OF LGDP4524-2^2.C: 'page': requires ANSI-style prototype
26 1 P14=1;
*** ERROR C202 IN LINE 26 OF LGDP4524-2^2.C: 'P14': undefined identifier
27 1 P15=0;
*** ERROR C202 IN LINE 27 OF LGDP4524-2^2.C: 'P15': undefined identifier
28 1 //LED2,LED1,BL_EN,/RES, /CS2,/CS1,/WR,RS
29 1 control_port=0x0F; // /res=0;
*** ERROR C202 IN LINE 29 OF LGDP4524-2^2.C: 'control_port': undefined identifier
30 1 Delayms(50);
31 1 control_port=0x1F; // /res=1;
32 1 Delayms(20);
33 1
34 1 init_LGDP4524();
35 1 set_LGDP4524_add();
36 1
37 1 while(1)
38 1 {
39 2 set_LGDP4524_add();
40 2 frame(220,176);
41 2 key_step();
42 2
43 2 set_LGDP4524_add();
44 2 Write_color_main(0xff,0xff,220,176);
45 2 key_step();
46 2
47 2 set_LGDP4524_add();
48 2 Write_color_main(0x00,0x00,220,176);
C51 COMPILER V7.06 LGDP4524_2_2 02/06/2009 14:31:08 PAGE 2
49 2 key_step();
50 2
51 2
52 2 set_LGDP4524_add();
53 2 Write_color_main(0xf8,0x00,220,176);
54 2 key_step();
55 2
56 2 set_LGDP4524_add();
57 2 Write_color_main(0x07,0xe0,220,176);
58 2 key_step();
59 2
60 2 set_LGDP4524_add();
61 2 Write_color_main(0x00,0x1f,220,176);
62 2 key_step();
63 2
64 2 set_LGDP4524_add();
65 2 Graygray();
66 2 key_step();
67 2
68 2 set_LGDP4524_add();
69 2 Grayred();
70 2 key_step();
71 2
72 2 set_LGDP4524_add();
73 2 Graygreen();
74 2 key_step();
75 2
76 2 set_LGDP4524_add();
77 2 Grayblue();
78 2 key_step();
79 2
80 2 set_LGDP4524_add();
81 2 snow1(220,176);
82 2 key_step();
83 2
84 2 set_LGDP4524_add();
85 2 snow2(220,176);
86 2 key_step();
87 2
88 2 set_LGDP4524_add();
89 2 main_pic(220,176,0xE000,6);
90 2 key_step();
91 2
92 2 set_LGDP4524_add();
93 2 main_pic(220,176,0x8E80,9);
94 2 key_step();
95 2
96 2 set_LGDP4524_add();
97 2 main_pic(220,176,0xBD00,11);
98 2 key_step();
99 2
100 2 /*
101 2 Motor=1;
102 2 Spk=0;
103 2 Rec=0;
104 2 key_step();
105 2
106 2 Motor=0;
107 2 Spk=1;
108 2 Rec=0;
109 2 key_step();
110 2
C51 COMPILER V7.06 LGDP4524_2_2 02/06/2009 14:31:08 PAGE 3
111 2 Motor=0;
112 2 Spk=0;
113 2 Rec=1;
114 2 key_step();
115 2
116 2 Motor=0;
117 2 Spk=0;
118 2 Rec=0;
119 2 */
120 2 }
121 1
122 1 }
123
124
125 void page(char value)
126 {
127 1 ACC=P1;
128 1 P1=(ACC&0xf0)+value;
129 1
130 1 }
131
132 void Delayus(int value)
133 {
134 1 while(value) value--;
135 1 }
136
137 void Delayms(int value)
138 {
139 1 int i,j,k;
140 1 for(i=0;i<value;i++)
141 1 for(j=0;j<5;j++)
142 1 for(k=0;k<131;k++);
143 1 }
144
145 void key_step()
146 {
147 1 Continue=1;
148 1 while(Continue);
149 1 Delayms(80);
150 1 while(!Continue);
151 1 }
152
153
154 void WCom(uchar comh,coml)
155 {
156 1 port_h=comh;
157 1 port_l=coml;
158 1 //LED2,LED1,BL_EN,/RES, /CS2,/CS1,/WR,RS
159 1 control_port=0x1A;
160 1 control_port=0x18;
161 1 control_port=0x1A;
162 1 control_port=0x1E;
163 1
164 1 }
165
166 void WData(uchar dath,datl)
167 {
168 1 port_h=dath;
169 1 port_l=datl;
170 1 //LED2,LED1,BL_EN,/RES, /CS2,/CS1,/WR,RS
171 1 control_port=0x1B;
172 1 control_port=0x19;
C51 COMPILER V7.06 LGDP4524_2_2 02/06/2009 14:31:08 PAGE 4
173 1 control_port=0x1B;
174 1 control_port=0x1F;
175 1
176 1 }
177
178 void Write_color_main(uchar color_h,color_l,int com,seg)
179 { int i,j;
180 1 for(i=0;i<com;i++)
181 1 {for(j=0;j<seg;j++)
182 2 {
183 3 WData(color_h,color_l);
184 3 }
185 2
186 2 }
187 1 }
188
189 void init_LGDP4524()
190 {
191 1 WCom(0x00,0x07);
192 1 WData(0x00,0x00);
193 1 WCom(0x00,0x12);
194 1 WData(0x00,0x00);
195 1 WCom(0x00,0x13);
196 1 WData(0x00,0x00);
197 1 WCom(0x00,0x14);
198 1 WData(0x03,0x31);
199 1 Delayms(20);
200 1 WCom(0x00,0x12);
201 1 WData(0x00,0x09);
202 1 WCom(0x00,0x11);
203 1 WData(0x00,0x00);// WData(0x00,0x00);
204 1 WCom(0x00,0x10);
205 1 WData(0x01,0x04);
206 1 WCom(0x00,0x13);
207 1 WData(0x0C,0x4A);
208 1 WCom(0x00,0x10);
209 1 WData(0x01,0x44);
210 1 WCom(0x00,0x11);
211 1 WData(0x00,0x01);//WData(0x02,0x00);WData(0x00,0x01);
212 1 WCom(0x00,0x12);
213 1 WData(0x00,0x19);
214 1 Delayms(20);
215 1 WCom(0x00,0x13);
216 1 WData(0x2C,0x4A);
217 1 WCom(0x00,0x10);
218 1 WData(0x01,0x40);
219 1 Delayms(20);
220 1 WCom(0x00,0x60);
221 1 WData(0x20,0x00);
222 1 WCom(0x00,0x60);
223 1 WData(0x00,0x00);
224 1 WCom(0x00,0x61);
225 1 WData(0x00,0x02);
226 1
227 1 WCom(0x00,0x01);
228 1 WData(0x01,0x1B);
229 1 Delayms(1);
230 1 WCom(0x00,0x02);
231 1 WData(0x07,0x00);
232 1
233 1 WCom(0x00,0x03);
234 1 WData(0x10,0x30);
C51 COMPILER V7.06 LGDP4524_2_2 02/06/2009 14:31:08 PAGE 5
235 1 WCom(0x00,0x09);
236 1 WData(0x00,0x00);
237 1
238 1 //WCom(0x00,0x0B);
239 1 //WData(0x5D,0x2C);//WData(0x5D,0x2C);
240 1 WCom(0x00,0x21);
241 1 WData(0x00,0x00);
242 1 WCom(0x00,0x30);
243 1 WData(0x01,0x01);
244 1 WCom(0x00,0x31);
245 1 WData(0x06,0x04);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -