📄 lcd_3200.lst
字号:
C51 COMPILER V7.06 LCD_3200 10/15/2004 20:55:30 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE LCD_3200
OBJECT MODULE PLACED IN lcd_3200.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE lcd_3200.c LARGE BROWSE DEBUG OBJECTEXTEND
stmt level source
1 /* `=========================================================================`
2
3 ***************************************
4 **** * * ****
5 Title: LCD_3200
6 File name: lcd_3200.c
7 Project name: DK3200 demo
8 *** ****
9 ****************** * ******************
10 **** ****
11 Author: Petr PFEIFER
12 MPG Prague, Czech Republic
13 **** * * ****
14 ***************************************
15
16 $Version: 0.029 Build: 2004-03-22,15:42:47
17
18
19
20
21 Description:
22 ============
23
24 Universal Version
25
26 *** LCD IO with copy buffer ***
27
28 USB/IAP project source file
29
30 Version >= 0.28 reentrant functions added.
31
32
33
34
35 Notes:
36 ======
37 Version 0.020 - Universal structure
38 Version 0.019 - fixed bug in PrinfLC \n part
39
40
41
42
43 ..........................
44 . .
45 . ****************** .
46 . **PPPPPPPPPPPPPPPP .
47 . *PPPP*******PP**** .
48 . **PPP********PP*** .
49 . ***PPP******PP**** .
50 . *****PPP****PP**** .
51 . *****PPP****PP**** .
52 . PPPPPPPP****PP**** (R) .
53 . .
54 ..........................
55
C51 COMPILER V7.06 LCD_3200 10/15/2004 20:55:30 PAGE 2
56
57 =-=-=-=-=-=
58 =-=-=-=-=-=-=-=-=-=-=-=-=
59 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
60
61 Copyright 2004 ST Microelectronics
62
63 This code/file is provided as is and has no warranty,
64 implied or otherwise. You are free to use/modify any of the provided
65 code at your own risk in your applications with the expressed limitation
66 of liability (see below) so long as your product using the code
67 contains at least one uPSD products (device).
68
69 LIMITATION OF LIABILITY:
70 ========================
71 NEITHER STMicroelectronics NOR ITS VENDORS OR AGENTS
72 SHALL BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF USE, LOSS OF DATA,
73 INTERRUPTION OF BUSINESS, NOR FOR INDIRECT, SPECIAL, INCIDENTAL OR
74 CONSEQUENTIAL DAMAGES OF ANY KIND WHETHER UNDER THIS AGREEMENT OR
75 OTHERWISE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
76
77 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
78 =-=-=-=-=-=-=-=-=-=-=-=-=
79 =-=-=-=-=-=
80
81 For current information on uPSD products,
82 please consult our pages on the World Wide Web:
83
84 www.st.com/psm
85
86 - - - - - - - - - - - -
87
88 STMicroelectronics GROUP OF COMPANIES
89 Australia - Brazil - China - Czech Republic - Finland - France - Germany
90 Hong Kong - India - Italy - Japan - Malaysia - Malta - Morocco - Singapore
91 Spain - Sweden - Switzerland - United Kingdom - U.S.A.
92
93 http://www.st.com
94
95
96 `========================================================================` */
97
98 #pragma NOAREGS
99
100 #include "upsd3200.h"
101 #include "lcd_3200.h"
102 #include "app_intr.h"
103
104
105
106 // LCD Display copy buffer
107
108 xdata DISPLAY LCD_reg _at_ LCD_BASE_ADDR; // XDATA address for display
109
110 #ifdef LCD_BCBuffer
111 data char LCD_buffer[LCD_ColNumBuf*LCD_RowNum]; // IAP&D Memory
112 #endif
113
114 data unsigned char LCDDisp_XPos,LCDDisp_YPos;// Actual cursor position
115
116 static data uchar Cursor_LCD;
117
C51 COMPILER V7.06 LCD_3200 10/15/2004 20:55:30 PAGE 3
118 // User design CG data
119 static uchar code cg_data[] =
120 {
121
122 0x1F,
123 0x1F,
124 0x1F,
125 0x1F,
126 0x1F,
127 0x1F,
128 0x1F,
129 0x1F,
130
131 -1 // Terminator, end of data char
132 }
133 ;
134
135
136
137
138
139 void LCD_delay_ms(int cnt)
140 /******************************************************************************
141 Function : void delay_xms()
142 Parameters : (int cnt)
143 Description: Delay
144 ******************************************************************************/
145 {
146 1
147 1 int w;
148 1 while (cnt>0)
149 1 {
150 2 for (w = 0; w<600; w++); // 5T/cycle(.33us) =>1.67
151 2 cnt--;
152 2 }
153 1 }
154
155
156
157
158
159 void BusyCheck(void)
160 /******************************************************************************
161 Function : void BusyCheck()
162 Parameters : (void)
163 Description: Tests LCD Busy flag, waits until BF is cleared
164 ******************************************************************************/
165 {
166 1 while (LCD_reg.LCD_CMD_RD & BF_BIT);
167 1 }
168
169
170
171 void SetUserCG(unsigned char *data_ptr)
172 /******************************************************************************
173 Function : void SetUserCG()
174 Parameters : (unsigned char *data_ptr)
175 Description: Sets user character set / initialize user character pattern
176 ******************************************************************************/
177 {
178 1 BusyCheck(); // Check display ability to comm.
179 1 LCD_reg.LCD_CMD_WR = CG_ADDR; // | (8*0);
C51 COMPILER V7.06 LCD_3200 10/15/2004 20:55:30 PAGE 4
180 1 //start custom char.set from character #0
181 1 while (*data_ptr != -1)
182 1 {
183 2 BusyCheck();
184 2 LCD_reg.LCD_RAM_WR = *data_ptr++;
185 2 }
186 1 }
187
188
189
190
191
192 static char htoa_lo(byte) uchar byte;
193 /******************************************************************************
194 Function : static char htoa_lo()
195 Parameters : (byte)
196 Description: converts low nibble of unsigned byte
197 ******************************************************************************/
198 {
199 1 byte = byte & 0x0F; // keep lower nibble only
200 1 if (byte <= 0x09)
201 1 return(byte + 0x30);
202 1 else
203 1 return (byte + 0x37);
204 1 }
205
206
207 static char htoa_hi(byte) uchar byte;
208 /******************************************************************************
209 Function : static char htoa_hi()
210 Parameters : (byte)
211 Description: converts hi nibble of unsigned byte
212 ******************************************************************************/
213 {
214 1 byte = byte & 0xF0; // keep upper nibble only
215 1 byte = byte >> 4;
216 1 if (byte <= 0x09)
217 1 return(byte + 0x30);
218 1 else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -