📄 lcd444.lst
字号:
C51 COMPILER V8.05a LCD444 04/11/2008 14:19:24 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE LCD444
OBJECT MODULE PLACED IN LCD444.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\LCDDriver\LCD444.c LARGE BROWSE MDU_F120 DEBUG OBJECTEXTE
-ND PRINT(.\LCD444.lst) OBJECT(LCD444.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 : LCDDummy.C
16 Purpose : Empty driver for emWin GSC
17 This driver does no perform any function, but it can be
18 used for 2 purposes:
19 a) Satisfy all externals so an application can be
20 compiled and linked in target hardware even if the
21 driver is not already available
22 b) Template for a starting point for a new driver.
23 ----------------------------------------------------------------------
24 Adapting to a new system (creating a new driver):
25 In this case, the first step is to fill the routines
26 LCD_L0_GetPixelIndex, LCD_L0_SetPixelIndex and LCD_L0_Init with
27 functionality, which is sufficient to make the hardware work.
28 A second (optional) step would be to optimize higher level routines.
29 ----------------------------------------------------------------------
30 Version-Date---Author-Explanation
31 ----------------------------------------------------------------------
32 1.00.00 020417 JE a) Changed to have only to adapt _GetPixelIndex
33 and _SetPixelIndex
34 0.90.00 020214 JE a) First release
35 ---------------------------END-OF-HEADER------------------------------
36 */
37
38 #include "gui\Core\LCD_Private.h" /* private modul definitions & config */
39 #include "gui\Core\GUI_Private.h"
40 #include "gui\Core\GUIDebug.h"
41 #include "gui\LCDDriver\LCD_0.h" /* Defines for first display */
42
43 #if (LCD_CONTROLLER == 444) \
44 && (!defined(WIN32) | defined(LCD_SIMCONTROLLER))
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#ifndef LCD_INIT_CONTROLLER
#define LCD_INIT_CONTROLLER()
C51 COMPILER V8.05a LCD444 04/11/2008 14:19:24 PAGE 2
#endif
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef unsigned int tOff;
/*********************************************************************
*
* Macros
*
**********************************************************************
*/
#define WORDS_PER_LINE (LCD_VXSIZE * 3 /4)
#define Y2OFF(y) (WORDS_PER_LINE * y)
/*********************************************
*
* Macros for MIRROR_, SWAP_ and LUT_
*
**********************************************
*/
#if (!defined (LCD_LUT_COM) && !defined(LCD_LUT_SEG))
#if (!LCD_MIRROR_X && !LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) x
#define LOG2PHYS_Y(x, y) y
#elif (!LCD_MIRROR_X && !LCD_MIRROR_Y && LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) y
#define LOG2PHYS_Y(x, y) x
#elif (!LCD_MIRROR_X && LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) x
#define LOG2PHYS_Y(x, y) LCD_YSIZE - 1 - (y)
#elif (!LCD_MIRROR_X && LCD_MIRROR_Y && LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) LCD_YSIZE - 1 - (y)
#define LOG2PHYS_Y(x, y) x
#elif ( LCD_MIRROR_X && !LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) LCD_XSIZE - 1 - (x)
#define LOG2PHYS_Y(x, y) y
#elif ( LCD_MIRROR_X && !LCD_MIRROR_Y && LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) LCD_YSIZE - 1 - (y)
#define LOG2PHYS_Y(x, y) x
#elif ( LCD_MIRROR_X && LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) LCD_XSIZE - 1 - (x)
#define LOG2PHYS_Y(x, y) LCD_YSIZE - 1 - (y)
#elif ( LCD_MIRROR_X && LCD_MIRROR_Y && LCD_SWAP_XY)
#error This combination of mirroring/swapping not yet supported
#endif
#else
#if ( defined (LCD_LUT_COM) && !defined(LCD_LUT_SEG))
#define LOG2PHYS_X(x, y) x
#define LOG2PHYS_Y(x, y) LCD__aLine2Com0[y]
#elif (!defined (LCD_LUT_COM) && defined(LCD_LUT_SEG))
#define LOG2PHYS_X(x, y) LCD__aCol2Seg0[x]
#define LOG2PHYS_Y(x, y) y
#elif ( defined (LCD_LUT_COM) && defined(LCD_LUT_SEG))
#define LOG2PHYS_X(x, y) LCD__aCol2Seg0[x]
C51 COMPILER V8.05a LCD444 04/11/2008 14:19:24 PAGE 3
#define LOG2PHYS_Y(x, y) LCD__aLine2Com0[y]
#endif
#endif
/*********************************************
*
* Macros for simulation
*
**********************************************
*/
/*********************************************************************
*
* Static functions
*
**********************************************************************
*/
#if defined(WIN32)
void SIM_WriteMem16(unsigned int Off, int Data);
int SIM_ReadMem16(unsigned int Off);
#undef LCD_READ_MEM16
#undef LCD_WRITE_MEM16
#define LCD_READ_MEM16(Off) SIM_ReadMem16(Off)
#define LCD_WRITE_MEM16(Off, Data) SIM_WriteMem16(Off, Data)
#endif
/*********************************************
*
* Draw Bitmap 1 BPP
*
**********************************************
*/
static void _DrawBitLine1BPP(int x, int y, U8 const*p, int Diff, int xsize, const LCD_PIXELINDEX*pTrans)
-{
LCD_PIXELINDEX Index0 = *(pTrans+0);
LCD_PIXELINDEX Index1 = *(pTrans+1);
x += Diff;
switch (GUI_Context.DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
case 0:
do {
LCD_L0_SetPixelIndex(x++, y, (*p & (0x80 >> Diff)) ? Index1 : Index0);
if (++Diff == 8) {
Diff = 0;
p++;
}
} while (--xsize);
break;
case LCD_DRAWMODE_TRANS:
do {
if (*p & (0x80 >> Diff))
LCD_L0_SetPixelIndex(x, y, Index1);
x++;
if (++Diff == 8) {
Diff = 0;
p++;
}
} while (--xsize);
break;
case LCD_DRAWMODE_XOR:;
C51 COMPILER V8.05a LCD444 04/11/2008 14:19:24 PAGE 4
do {
if (*p & (0x80 >> Diff)) {
int Pixel = LCD_L0_GetPixelIndex(x, y);
LCD_L0_SetPixelIndex(x, y, LCD_NUM_COLORS - 1 - Pixel);
}
x++;
if (++Diff == 8) {
Diff = 0;
p++;
}
} while (--xsize);
break;
}
}
/*********************************************
*
* Draw Bitmap 2 BPP
*
**********************************************
*/
#if (LCD_MAX_LOG_COLORS > 2)
static void _DrawBitLine2BPP(int x, int y, U8 const * p, int Diff, int xsize, const LCD_PIXELINDEX * pTra
-ns) {
LCD_PIXELINDEX Pixels = *p;
int CurrentPixel = Diff;
x += Diff;
switch (GUI_Context.DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
case 0:
do {
int Shift = (3 - CurrentPixel) << 1;
int Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
LCD_PIXELINDEX PixelIndex = *(pTrans + Index);
LCD_L0_SetPixelIndex(x++, y, PixelIndex);
if (++CurrentPixel == 4) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
break;
case LCD_DRAWMODE_TRANS:
do {
int Shift = (3 - CurrentPixel) << 1;
int Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
if (Index) {
LCD_PIXELINDEX PixelIndex = *(pTrans + Index);
LCD_L0_SetPixelIndex(x, y, PixelIndex);
}
x++;
if (++CurrentPixel == 4) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
break;
}
}
#endif
/*********************************************
*
C51 COMPILER V8.05a LCD444 04/11/2008 14:19:24 PAGE 5
* Draw Bitmap 4 BPP
*
**********************************************
*/
#if (LCD_MAX_LOG_COLORS > 4)
static void _DrawBitLine4BPP(int x, int y, U8 const * p, int Diff, int xsize, const LCD_PIXELINDEX * pTra
-ns) {
LCD_PIXELINDEX Pixels = *p;
int CurrentPixel = Diff;
switch (GUI_Context.DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
case 0:
do {
int Shift = (1 - CurrentPixel) << 2;
int Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
LCD_PIXELINDEX PixelIndex = *(pTrans + Index);
LCD_L0_SetPixelIndex(x++, y, PixelIndex);
if (++CurrentPixel == 2) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
break;
case LCD_DRAWMODE_TRANS:
do {
int Shift = (1 - CurrentPixel) << 2;
int Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
if (Index) {
LCD_PIXELINDEX PixelIndex = *(pTrans + Index);
LCD_L0_SetPixelIndex(x, y, PixelIndex);
}
x++;
if (++CurrentPixel == 2) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
break;
}
}
#endif
/*********************************************
*
* Draw Bitmap 8 BPP
*
**********************************************
*/
#if (LCD_MAX_LOG_COLORS > 16)
static void _DrawBitLine8BPP(int x, int y, U8 const * p, int xsize, const LCD_PIXELINDEX * pTrans) {
LCD_PIXELINDEX Pixel;
switch (GUI_Context.DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
case 0:
if (pTrans) {
for (; xsize > 0; xsize--, x++, p++) {
Pixel = *p;
LCD_L0_SetPixelIndex(x, y, *(pTrans + Pixel));
}
} else {
for (; xsize > 0; xsize--, x++, p++) {
LCD_L0_SetPixelIndex(x, y, *p);
C51 COMPILER V8.05a LCD444 04/11/2008 14:19:24 PAGE 6
}
}
break;
case LCD_DRAWMODE_TRANS:
if (pTrans) {
for (; xsize > 0; xsize--, x++, p++) {
Pixel = *p;
if (Pixel) {
LCD_L0_SetPixelIndex(x, y, *(pTrans + Pixel));
}
}
} else {
for (; xsize > 0; xsize--, x++, p++) {
Pixel = *p;
if (Pixel) {
LCD_L0_SetPixelIndex(x, y, Pixel);
}
}
}
break;
}
}
#endif
/*********************************************
*
* Draw Bitmap 16 BPP
*
**********************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -