📄 lcd15e05.lst
字号:
C51 COMPILER V8.05a LCD15E05 04/11/2008 14:19:23 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE LCD15E05
OBJECT MODULE PLACED IN LCD15E05.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\LCDDriver\LCD15E05.c LARGE BROWSE MDU_F120 DEBUG OBJECTEX
-TEND PRINT(.\LCD15E05.lst) OBJECT(LCD15E05.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 : LCD15E05.C
16 Purpose : Driver for LCDs using a Seiko Epson S1D15E05 controller
17 ----------------------------------------------------------------------
18 Version-Date---Author-Explanation
19 ----------------------------------------------------------------------
20 1.00a 020708 JE a) Changed to work with 2bpp DDP bitmaps
21 1.00 020204 JE a) Hardwareinterface routines renamed:
22 ...DATA -> ...A1, ...CMD -> ...A0
23 0.90.00 011030 JE a) First release
24 ---------------------------LIST OF CONFIG SWITCHES--------------------
25 The following is a list of additional configuration switches for this
26 driver. These switches might not be listed in the manual, because
27 the manual mainly covers the general config switches which are
28 supported by all drivers.
29 ----------------------------------------------------------------------
30 define ----------------------Explanation------------------------------
31 LCD_OPTIMIZE Controls the use of optimized routines.
32 ----------------------------------------------------------------------
33 Known problems or limitations with current version
34 ----------------------------------------------------------------------
35 Driver supports only 2bpp mode
36 ----------------------------------------------------------------------
37 Open issues
38 ----------------------------------------------------------------------
39 1bpp mode
40 ---------------------------END-OF-HEADER------------------------------
41 */
42
43 #include <string.h> /* needed for memset */
44 #include <stddef.h> /* needed for definition of NULL */
45 #include "gui\Core\LCD_Private.h" /* private modul definitions & config */
46 #include "gui\Core\GUI_Private.h"
47 #include "gui\Core\GUIDebug.h"
48 #include "gui\LCDDriver\LCD_0.h" /* Defines for first display */
49
50 #if (LCD_CONTROLLER == 0x15E05) \
51 && (!defined(WIN32) | defined(LCD_SIMCONTROLLER))
/*
*********************************************************
C51 COMPILER V8.05a LCD15E05 04/11/2008 14:19:23 PAGE 2
*
* Defaults for config switches
*
*********************************************************
*/
#ifndef LCD_CACHE
#define LCD_CACHE (1)
#endif
#ifndef LCD_INIT_CONTROLLER
#define LCD_INIT_CONTROLLER()
#endif
/*
*********************************************************
*
* Defines for simulation
*
*********************************************************
*/
#ifdef WIN32
#undef LCD_WRITE_A0
#undef LCD_WRITE_A1
#undef LCD_READ_A0
#undef LCD_READ_A1
void SIM_WriteA1C0(U8 Data);
void SIM_WriteA0C0(U8 cmd);
U8 SIM_ReadA1C0(void);
U8 SIM_ReadA0C0(void);
#define LCD_WRITE_A1(Data) SIM_WriteA1C0(Data)
#define LCD_WRITE_A0(cmd) SIM_WriteA0C0(cmd)
#define LCD_READ_A1() SIM_ReadA1C0()
#define LCD_READ_A0() SIM_ReadA0C0()
#endif
/*
*********************************************************
*
* Remap ...A0, ...A1 -> ...CMD, ...DATA
*
*********************************************************
*/
#define LCD_READCMD0 LCD_READ_A0
#define LCD_READDATA0 LCD_READ_A1
#define LCD_WRITECMD0 LCD_WRITE_A0
#define LCD_WRITEDATA0 LCD_WRITE_A1
/*
*********************************************************
*
* Configuration switch checking
*
*********************************************************
*/
#if (LCD_BITSPERPIXEL > 2)
#error This controller can handle only 1bpp and 2bpp displays
#endif
C51 COMPILER V8.05a LCD15E05 04/11/2008 14:19:23 PAGE 3
/*
*********************************************************
* *
* Macros, standard *
* *
*********************************************************
These macros can be found in any LCD-driver as they serve purposes
that can be found in any class of LCD-driver (Like clipping).
*/
#if (!defined (LCD_LUT_COM) && !defined(LCD_LUT_SEG))
#if (!LCD_MIRROR_X && !LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS(x, y) x, y
#elif (!LCD_MIRROR_X && !LCD_MIRROR_Y && LCD_SWAP_XY)
#define LOG2PHYS(x, y) y, x
#elif (!LCD_MIRROR_X && LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS(x, y) x, LCD_YSIZE - 1 - (y)
#elif (!LCD_MIRROR_X && LCD_MIRROR_Y && LCD_SWAP_XY)
#define LOG2PHYS(x, y) LCD_YSIZE - 1 - (y), x
#elif ( LCD_MIRROR_X && !LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS(x, y) LCD_XSIZE - 1 - (x), y
#elif ( LCD_MIRROR_X && !LCD_MIRROR_Y && LCD_SWAP_XY)
#define LOG2PHYS(x, y) LCD_YSIZE - 1 - (y), x
#elif ( LCD_MIRROR_X && LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS(x, y) LCD_XSIZE - 1 - (x), 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, y) x, LCD__aLine2Com0[y]
#elif (!defined (LCD_LUT_COM) && defined(LCD_LUT_SEG))
#define LOG2PHYS(x, y) LCD__aCol2Seg0[x], y
#elif ( defined (LCD_LUT_COM) && defined(LCD_LUT_SEG))
#define LOG2PHYS(x, y) LCD__aCol2Seg0[x], LCD__aLine2Com0[y]
#endif
#endif
#define BKCOLOR LCD_BKCOLORINDEX
#define COLOR LCD_COLORINDEX
/*
*********************************************************
*
* Static variables for driver
*
*********************************************************
*/
#if LCD_CACHE
#if (LCD_BITSPERPIXEL == 1)
static U8 aVRam[(LCD_YSIZE_PHYS + 7) >> 3][LCD_XSIZE_PHYS];
#elif (LCD_BITSPERPIXEL == 2)
static U8 aVRam[(LCD_YSIZE_PHYS + 3) >> 2][LCD_XSIZE_PHYS];
#endif
#endif
static int Page, Offset;
C51 COMPILER V8.05a LCD15E05 04/11/2008 14:19:23 PAGE 4
/*
*********************************************************
*
* Hardware access macros
*
*********************************************************
*/
#define MAX_PAGE 32
#define MAX_OFFSET 159
#define INCREMENT_CURSOR() \
Offset++; \
if (Offset > MAX_OFFSET) { \
Offset = 0; \
Page ++; \
if (Page > MAX_PAGE) \
Page = 0; \
}
#if LCD_CACHE
#define READ_DATA(Data) \
Data = aVRam[Page][Offset]
#define WRITE_DATA(Data) \
LCD_WRITECMD0(0x1d); \
LCD_WRITEDATA0(Data); \
aVRam[Page][Offset] = Data; \
INCREMENT_CURSOR()
#else
#define READ_DATA(Data) \
LCD_WRITECMD0(0x1c); \
Data = LCD_READDATA0(); \
INCREMENT_CURSOR()
#define WRITE_DATA(Data) \
LCD_WRITECMD0(0x1d); \
LCD_WRITEDATA0(Data); \
INCREMENT_CURSOR()
#endif
#define WRITE_PAGE(NewPage) \
LCD_WRITECMD0(0xb1); \
LCD_WRITEDATA0(NewPage); \
Page = NewPage
#define WRITE_OFFSET(NewOffset) \
LCD_WRITECMD0(0x13); \
LCD_WRITEDATA0(NewOffset); \
Offset = NewOffset
#define SET_PAGE_IF_NEEDED(y) \
if (Page != (y >> 2)) { \
WRITE_PAGE(y >> 2); \
}
#define SET_OFFSET_IF_NEEDED(x) \
if (Offset != x) { \
C51 COMPILER V8.05a LCD15E05 04/11/2008 14:19:23 PAGE 5
WRITE_OFFSET(x); \
}
/*
*********************************************************
*
* Static access routines for pixel access
*
*********************************************************
These routines should be only used by access macros to keep
sure, that logical coordinates are mapped to physical level
*/
/*
*****************************************
*
* SetPixelIndex
*
*****************************************
*/
static void SetPixelIndex(int x, int y, LCD_PIXELINDEX ColorIndex) {
U8 Shift = ((y & 3) << 1);
U8 AndMask = ~(0x03 << Shift);
U8 OrMask = ColorIndex << Shift;
U8 Data;
SET_PAGE_IF_NEEDED(y);
SET_OFFSET_IF_NEEDED(x);
READ_DATA(Data);
Data &= AndMask;
Data |= OrMask;
SET_OFFSET_IF_NEEDED(x);
WRITE_DATA(Data);
}
/*
*****************************************
*
* GetPixelIndex
*
*****************************************
*/
static LCD_PIXELINDEX GetPixelIndex(int x, int y) {
U8 Shift = ((y & 3) << 1);
U8 AndMask = 0x03 << Shift;
U8 Data;
SET_PAGE_IF_NEEDED(y);
SET_OFFSET_IF_NEEDED(x);
READ_DATA(Data);
return (Data & AndMask) >> Shift;
}
/*
*****************************************
*
* XorPixel
*
*****************************************
*/
C51 COMPILER V8.05a LCD15E05 04/11/2008 14:19:23 PAGE 6
static void XorPixel(int x, int y) {
U8 Data = GetPixelIndex(x, y);
Data = LCD_NUM_COLORS - 1 - Data;
SetPixelIndex(x, y, Data);
}
/*
*********************************************************
*
* Access macros for pixel access
*
*********************************************************
*/
#define SETPIXEL(x, y, c) SetPixelIndex(LOG2PHYS(x, y), c)
#define GETPIXEL(x, y) GetPixelIndex(LOG2PHYS(x, y))
#define XORPIXEL(x, y) XorPixel (LOG2PHYS(x, y))
/*
*********************************************************
*
* Static DrawBitLineXBPP functions
*
*********************************************************
*/
/*
*****************************************
*
* Draw Bitmap 1 BPP
* no optimizations
*
*****************************************
*/
static void DrawBitLine1BPP(int x, int y, U8 const*p, int Diff, int xsize, const LCD_PIXELINDEX*pTrans) {
LCD_PIXELINDEX pixels;
LCD_PIXELINDEX Index0 = *(pTrans+0);
LCD_PIXELINDEX Index1 = *(pTrans+1);
/*
// Jump to right entry point
*/
pixels = *p;
switch (GUI_Context.DrawMode & (LCD_DRAWMODE_TRANS|LCD_DRAWMODE_XOR)) {
case 0:
switch (Diff&7) {
case 0:
goto WriteBit0;
case 1:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -