📄 lcd_drv.lst
字号:
C51 COMPILER V7.50 LCD_DRV 06/03/2006 10:32:52 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE LCD_DRV
OBJECT MODULE PLACED IN lcd_drv.obj
COMPILER INVOKED BY: C:\Program Files\keil\C51\BIN\C51.EXE lib_mcu\lcd\lcd_drv.c LARGE BROWSE DEBUG OBJECTEXTEND PRINT(.
-\lcd_drv.lst) OBJECT(lcd_drv.obj)
line level source
1 /*C**************************************************************************
2 * NAME: lcd_drv.c
3 *----------------------------------------------------------------------------
4 * Copyright (c) 2004 Toplow.
5 *----------------------------------------------------------------------------
6 * RELEASE: snd1c-refd-nf-4_0_3
7 * REVISION: 1.0
8 *----------------------------------------------------------------------------
9 * PURPOSE:
10 * This file contains the LCD driver routines
11 *
12 * NOTES:
13
14 *****************************************************************************/
15
16 /*_____ I N C L U D E S ____________________________________________________*/
17
18 #include "config.h" /* system configuration */
19 #include "lib_mcu\c51_drv.h" /* c51 driver definition */
20 #include "lcd_drv.h" /* usb driver definition */
21 #include "modules\song\song_drv.h"
22 #include "modules\unicode\unicode.h"
23 #include "lib_mcu\serial\serial.h"
24 /*_____ M A C R O S ________________________________________________________*/
25
26 extern char pdata *lfn_name;
27 extern Uint16 song_name[11];
28 extern bit bdata song_name_style;
29 extern Byte song_sound;
30 extern Byte mp3_volume;
31
32 /*_____ D E F I N I T I O N ________________________________________________*/
33
34
35
36 void ReadBusy(void)
37 {uchar busy;
38 1 do{LCDRS = 0;
39 2 LCDRW = 1;
40 2 LCDEN = 1;
41 2 busy = LCDPORT;
42 2 LCDEN= 0;
43 2 } while(busy & 0x80);
44 1 }
45
46 void printch(uchar pos, uchar *ptr)
47 {uchar j;
48 1
49 1 while (*ptr != ' ')
50 1 {ReadBusy();
51 2 putcomm(pos);
52 2 for (j = 0; j < 2; j++)
53 2 {ReadBusy();
54 3 putchar(*ptr++);
C51 COMPILER V7.50 LCD_DRV 06/03/2006 10:32:52 PAGE 2
55 3 }
56 2 pos++;
57 2 }
58 1 }
59
60 void lcdcls (uchar pos)
61 {
62 1 uchar i;
63 1
64 1 for (i = 0; i < 8; i++)
65 1 {
66 2 ReadBusy();
67 2 putcomm(pos + i);
68 2 ReadBusy();
69 2 putchar(' ');
70 2 ReadBusy();
71 2 putchar(' ');
72 2 }
73 1 }
74
75
76
77 void lcd_ini(void)
78 {
79 1 putcomm(0x30);
80 1 putcomm(0x04);
81 1 ReadBusy();
82 1 putcomm(0x0c);
83 1 ReadBusy();
84 1 putcomm(0x01);
85 1 ReadBusy();
86 1 putcomm(0x02);
87 1
88 1 printch(0x80,"硬盘MP3 播放器 ");
89 1 printch(0x90,"设计: 邵春伟 ");
90 1 }
91
92
93
94
95 void print_file_name()
96 {
97 1 uchar n,y,x;
98 1 uchar find_code = 0;
99 1 song_name_style = 0;
100 1
101 1 // printch(0x90,"歌曲 ");
102 1
103 1 for (n = 0; n < 7; n++)
104 1 {
105 2 for (y = 0; y < 72; y++)
106 2 {
107 3 for (x = 0; x < 96; x++)
108 3 {
109 4 if (song_name[n] == Unicode[y][x])
110 4 {
111 5 song_name[n] =(Uint16)((0xb0+y)<<8)+(0xa0+x);
112 5 find_code = 1;
113 5 song_name_style = 1; //1-CHINESE NAME ,0-ENGLISH NAME
114 5 break;
115 5 }
116 4 }
C51 COMPILER V7.50 LCD_DRV 06/03/2006 10:32:52 PAGE 3
117 3 if (find_code)
118 3 {
119 4 find_code = 0;
120 4 break;
121 4 }
122 3 }
123 2 }
124 1
125 1 for (n = 0; n < 7; n++)
126 1 {
127 2 ReadBusy();
128 2 putcomm(0x80+n);
129 2
130 2 if (song_name_style)
131 2 {
132 3 ReadBusy();
133 3 putchar((Byte)(song_name[n]>>8));
134 3 ReadBusy();
135 3 putchar((Byte)(song_name[n]));
136 3 }
137 2
138 2 else
139 2 {
140 3 ReadBusy();
141 3 putchar(*lfn_name++);
142 3 ReadBusy();
143 3 putchar(*lfn_name++);
144 3 }
145 2 }
146 1
147 1 }
148
149
150 void print_sound_level()
151 {
152 1 switch (song_sound)
153 1 {
154 2 case SND_VOLUME:
155 2 {
156 3 printch(0x93,"音量 ");
157 3 ReadBusy();
158 3 putcomm(0x95);
159 3 ReadBusy();
160 3 putchar(0x30+(Byte)(song_get_level()/10));
161 3 ReadBusy();
162 3 putchar(0x30+song_get_level()%10);
163 3 break;
164 3 }
165 2
166 2 case SND_BASS:
167 2 {
168 3 printch(0x93,"低音 ");
169 3 ReadBusy();
170 3 putcomm(0x95);
171 3 ReadBusy();
172 3 putchar(0x30+(Byte)(song_get_level()/10));
173 3 ReadBusy();
174 3 putchar(0x30+song_get_level()%10);
175 3 break;
176 3 }
177 2
178 2 case SND_MEDIUM:
C51 COMPILER V7.50 LCD_DRV 06/03/2006 10:32:52 PAGE 4
179 2 {
180 3 printch(0x93,"中音 ");
181 3 ReadBusy();
182 3 putcomm(0x95);
183 3 ReadBusy();
184 3 putchar(0x30+(Byte)(song_get_level()/10));
185 3 ReadBusy();
186 3 putchar(0x30+song_get_level()%10);
187 3 break;
188 3 }
189 2
190 2 case SND_TREBLE:
191 2 {
192 3 printch(0x93,"高音 ");
193 3 ReadBusy();
194 3 putcomm(0x95);
195 3 ReadBusy();
196 3 putchar(0x30+(Byte)(song_get_level()/10));
197 3 ReadBusy();
198 3 putchar(0x30+song_get_level()%10);
199 3 break;
200 3 }
201 2
202 2 case SND_NONDIS:
203 2 {
204 3 printch(0x93,"标准态 ");
205 3 break;
206 3 }
207 2
208 2 /*case SND_BBOOST:
209 2 {
210 2 if (song_get_level())
211 2 printch(0x96,"BST ");
212 2 else printch(0x96," ");
213 2 break;
214 2 }*/
215 2
216 2 default : break;
217 2 }
218 1 }
219
220
221 void disp_clock_reset()
222 {;}
223
224 void disp_clock_start()
225 {;}
226
227 void print_state_play()
228 {
229 1 printch(0x90,"播放 ");
230 1 }
231
232 void disp_clock_stop()
233 {;}
234
235 void print_state_pause()
236 {
237 1 printch(0x90,"暂停 ");
238 1 }
239
240 void disp_name_stop()
C51 COMPILER V7.50 LCD_DRV 06/03/2006 10:32:52 PAGE 5
241 {;}
242
243 void disp_end_of_play()
244 {;}
245
246 void print_state_error()
247 {
248 1 printch(0x90,"错误 ");
249 1 }
250
251
252 void print_repeat(bit song_repeat)
253 {
254 1 if(song_repeat)
255 1 printch(0x87,"R ");
256 1 else
257 1 printch(0x87," ");
258 1 }
259
260
261
262
263
264
265
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 762 ----
CONSTANT SIZE = 13924 ----
XDATA SIZE = ---- 7
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- 1
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -