📄 lcdmem.lst
字号:
C51 COMPILER V8.05a LCDMEM 04/11/2008 14:19:25 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE LCDMEM
OBJECT MODULE PLACED IN LCDMem.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\LCDDriver\LCDMem.c LARGE BROWSE MDU_F120 DEBUG OBJECTEXTE
-ND PRINT(.\LCDMem.lst) OBJECT(LCDMem.obj)
line level source
1 /*
2 *********************************************************************************************************
3 * uC/GUI
4 * Universal graphic software for embedded applications
5 *
6 * (c) Copyright 2002, Micrium Inc., Weston, FL
7 * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
8 *
9 * 礐/GUI is protected by international copyright laws. Knowledge of the
10 * source code may not be used to write a similar product. This file may
11 * only be used in accordance with a license and should not be redistributed
12 * in any way. We appreciate your understanding and fairness.
13 *
14 ----------------------------------------------------------------------
15 File : LCDMem.C
16 Purpose : Driver for LCDs using internal memory
17 ----------------------------------------------------------------------
18 Version-Date---Author-Explanation
19 ----------------------------------------------------------------------
20 2.00a 010926 JE a) Reworked to work with LCD_MIRROR_...
21 and LCD_SWAP_XY
22 2.00 010402 RS a) LCD_GetDevCaps removed from driver
23 (now LCD.c)
24 1.00.04 990930 RS Prototyp changed for LCD_Init()
25 1.00.03 990927 RS Config defaults added
26 1.00.02 990925 RS Bugfix for transparent 4 color bitmaps
27 1.00.01 990920 RS Bugfix for DrawHline
28 1.00 990823 RS Xor accelerated.
29 0.00 990118 RS First release.
30 ----------------------------------------------------------------------
31 Known problems or limitations with current version
32 ----------------------------------------------------------------------
33 None.
34 ---------------------------END-OF-HEADER------------------------------
35 */
36
37 #include <string.h> /* for memset */
38 #include <stddef.h> /* needed for definition of NULL */
39 #include "gui\Core\LCD_Private.h" /* private modul definitions & config */
40 #include "gui\Core\GUI_Private.h"
41 #include "gui\Core\GUIDebug.h"
42 #include "gui\LCDDriver\LCD_0.h" /* Defines for first display */
43
44 #if ((LCD_CONTROLLER == 0) && ((LCD_FIXEDPALETTE==2) | (LCD_FIXEDPALETTE==1)) ) \
45 && (!defined(WIN32) | defined(LCD_SIMCONTROLLER))
46
47
48 #define LCD_BYTESPERLINE (((LCD_VXSIZE_PHYS)+7)/8)
49
50 #ifndef LCD_VRAMTYPE
51 #define LCD_VRAMTYPE
52 #endif
53
54 #ifdef WIN32
C51 COMPILER V8.05a LCDMEM 04/11/2008 14:19:25 PAGE 2
#undef LCD_VRAMTYPE
#define LCD_VRAMTYPE
#endif
58
59 LCD_VRAMTYPE U8 LCD_VRam[LCD_BITSPERPIXEL][LCD_VYSIZE_PHYS * LCD_BYTESPERLINE];
60
61
62
63 /*
64 ********************************************************************
65 * *
66 * Defaults for configuration *
67 * *
68 ********************************************************************
69
70 Please be aware that not all configuration errors can be captured !
71
72 */
73 #ifndef LCD_NUM_EMPTY_LINES
74 #define LCD_NUM_EMPTY_LINES 0
75 #endif
76 #ifndef LCD_REVERSEMODE_SUPPORT
77 #define LCD_REVERSEMODE_SUPPORT (1)
78 #endif
79 #ifndef LCD_VERIFY
80 #define LCD_VERIFY (0)
81 #endif
82
83 #ifndef LCD_REVERSEMODE_SUPPORT
#define LCD_REVERSEMODE_SUPPORT (0)
#endif
86
87 #ifndef LCD_SUPPORT_VERIFY
88 #define LCD_SUPPORT_VERIFY (0)
89 #endif
90
91 /* If disabled, selected drawmode is ignored.
92 ==> XOR, REVERSE drawing not supported */
93 #ifndef LCD_SUPPORT_DRAWMODE
94 #define LCD_SUPPORT_DRAWMODE (1)
95 #endif
96
97 /* Switch support for the LCD_On, LCD_Off functions of the driver */
98 #ifndef LCD_SUPPORT_ONOFF
99 #define LCD_SUPPORT_ONOFF (1)
100 #endif
101
102 /* Switch for support of multiple pages.
103 Only available with certain LCD-controllers */
104 #ifndef LCD_SUPPORT_PAGING
105 #define LCD_SUPPORT_PAGING (0)
106 #endif
107
108 /* Switch for support of run-time inversion of display. */
109 #ifndef LCD_SUPPORT_REVERSEMODE
110 #define LCD_SUPPORT_REVERSEMODE (0)
111 #endif
112
113 /* Switch support for the LCD_SetOrg function of the driver */
114 #ifndef LCD_SUPPORT_SETORG
115 #define LCD_SUPPORT_SETORG (1)
116 #endif
C51 COMPILER V8.05a LCDMEM 04/11/2008 14:19:25 PAGE 3
117
118 #ifndef LCD_SUPPORT_PALETTE
119 #define LCD_SUPPORT_PALETTE (1)
120 #endif
121
122 #ifndef LCD_SCHEDULE_CNT
123 #define LCD_SCHEDULE_CNT (0)
124 #endif
125
126
127 /*
128 ********************************************************************
129 * *
130 * SCHEDULING *
131 * *
132 ********************************************************************
133 */
134
135
136 #if (LCD_SCHEDULE_CNT !=0)
static int ScheduleCntRem=LCD_SCHEDULE_CNT;
#define CHECK_SCHEDULE(PixelCnt) \
if ((ScheduleCntRem-=(PixelCnt)) <=0) { \
ScheduleCntRem=LCD_SCHEDULE_CNT; \
LCD_SCHEDULE(); \
}
#else
144 #define CHECK_SCHEDULE(PixelCnt)
145 #endif
146
147
148 /*
149 ********************************************************************
150 * *
151 * Support for Segment/COMLUTs *
152 * *
153 ********************************************************************
154 */
155
156 /* For compatibility with older configs, define defaults */
157 #ifndef LCD_SUPPORT_COMTRANS
158 #define LCD_SUPPORT_COMTRANS 0
159 #endif
160 #ifndef LCD_SUPPORT_SEGTRANS
161 #define LCD_SUPPORT_SEGTRANS 0
162 #endif
163
164 #if LCD_SUPPORT_COMTRANS
extern U8 LCD__aLine2Com0[LCD_LASTCOM0-LCD_FIRSTCOM0+1];
#endif
167
168 #if LCD_SUPPORT_SEGTRANS
extern U8 LCD__aRow2Seg0[LCD_LASTSEG0-LCD_FIRSTSEG0+1];
#endif
171
172
173 /*
174 ********************************************************************
175 * *
176 * Macro calculations *
177 * *
178 ********************************************************************
C51 COMPILER V8.05a LCDMEM 04/11/2008 14:19:25 PAGE 4
179 */
180
181 /* Define number of used coms/segments per controller */
182 #define LCD_NUM_SEGS0 (LCD_LASTSEG0-LCD_FIRSTSEG0+1)
183 #define LCD_NUM_COMS0 (LCD_LASTCOM0-LCD_FIRSTCOM0+1)
184 /* Define total number of used coms/segments */
185 #define LCD_NUM_SEGS LCD_NUM_SEGS0
186 #define LCD_NUM_COMS LCD_NUM_COMS0
187
188 #define LCD_MEMSIZE LCD_VXSIZE_PHYS*(LCD_VYSIZE_PHYS+LCD_NUM_EMPTY_LINES)
189
190 /*
191 ********************************************************************
192 * *
193 * Configuration switch checking *
194 * *
195 ********************************************************************
196
197 Please be aware that not all configuration errors can be captured !
198
199 */
200
201 #if (LCD_BITSPERPIXEL != 2) & (LCD_BITSPERPIXEL != 1)
#error this value for LCD_BITSPERPIXEL not yet supported
#endif
204
205 /* Check if number of segments / coms equals resolution */
206 /*
207 #if (LCD_NUM_SEGS < LCD_XSIZE_PHYS)
208 #error Please check segment setup of controller 0 and X/YSIZE !!!
209 #endif
210 #if (LCD_NUM_COMS < LCD_YSIZE_PHYS)
211 #error Please check com setup of controller 0 and X/YSIZE !!!
212 #endif
213 */
214
215 /*
216 ********************************************************************
217 * *
218 * EXPORTs for ISR *
219 * *
220 ********************************************************************
221 */
222 #ifndef LCD_TIMERINIT1
223 #define LCD_TIMERINIT1 1599
224 #endif
225 #ifndef LCD_TIMERINIT0
226 #define LCD_TIMERINIT0 1065
227 #endif
228
229 U16 LCD__BitsPerPixel = LCD_BITSPERPIXEL;
230
231 LCD_VRAMTYPE U8 LCD_VRAMTYPE* LCD__apVRam[LCD_BITSPERPIXEL];
232
233 LCD_VRAMTYPE U16 LCD__aTimerReload[LCD_BITSPERPIXEL] = {
234 LCD_TIMERINIT0
235 #if LCD_BITSPERPIXEL > 1
,LCD_TIMERINIT1
#endif
238 };
239
240 /*
C51 COMPILER V8.05a LCDMEM 04/11/2008 14:19:25 PAGE 5
241 ********************************************************************
242 * *
243 * Standard variables for driver *
244 * *
245 ********************************************************************
246 */
247
248 #define PIXELCOLOR U8
249
250 #define BKCOLOR LCD_BKCOLORINDEX
251 #define COLOR LCD_COLORINDEX
252
253
254 /*
255 ********************************************************************
256 *
257 * ID translation table
258 *
259 ********************************************************************
260
261 This table contains 0, 1, 2, ... and serves as translation table for DDBs
262
263 */
264
265 #define INTS(Base) Base+0,Base+1,Base+2,Base+3,Base+4,Base+5, \
266 Base+6,Base+7,Base+8,Base+9,Base+10,Base+11, \
267 Base+12,Base+13,Base+14,Base+15
268
269 static const LCD_PIXELINDEX aID[] = {
270 INTS(0),
271 #if LCD_MAX_LOG_COLORS > 0x10
272 INTS(0x10),
273 #endif
274 #if LCD_MAX_LOG_COLORS > 0x20
275 INTS(0x20),
276 INTS(0x30),
277 #endif
278 };
279
280 /*
281 *********************************************************
282 * *
283 * Macros for internal use *
284 * *
285 *********************************************************
286 */
287
288
289 #if (LCD_SUPPORT_COMTRANS)
#if (LCD_MIRROR_Y)
#error LCD_MIRROR_Y not supported with COMTrans !
#endif
#if (LCD_MIRROR_X)
#error LCD_MIRROR_X not supported with COMTrans !
#endif
#endif
297
298 #if (!LCD_SUPPORT_COMTRANS && !LCD_SUPPORT_SEGTRANS)
299 #if (!LCD_MIRROR_X && !LCD_MIRROR_Y && !LCD_SWAP_XY)
300 #define SETPIXEL(x, y, c) SETPIXELPHYS((x), (y), (c))
301 #define SETPIXELFAST(x, y, c) SETPIXELPHYS((x), (y), (c))
302 #define GETPIXEL(x, y) _GetPixel ((x), (y))
C51 COMPILER V8.05a LCDMEM 04/11/2008 14:19:25 PAGE 6
303 #define XORPIXEL(x, y) XorPixel ((x), (y))
304 #elif (!LCD_MIRROR_X && !LCD_MIRROR_Y && LCD_SWAP_XY)
#define SETPIXEL(x, y, c) SETPIXELPHYS((y), (x), (c))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -