📄 lcd15xx.lst
字号:
C51 COMPILER V8.05a LCD15XX 04/11/2008 14:19:23 PAGE 13
#define LCD_SEGOFF3 (LCD_SEGS_MAX-LCD_LASTSEG3-1)
#endif
#else
#define LCD_SEGOFF0 0
#define LCD_SEGOFF1 0
#define LCD_SEGOFF2 0
#define LCD_SEGOFF3 0
#endif
#if !LCD_REVERSE
#define LCD_CMDNORMAL 0xa6
#define LCD_CMDREVERSE 0xa7
#else
#define LCD_CMDNORMAL 0xa7
#define LCD_CMDREVERSE 0xa6
#endif
/*
********************************************************************
* *
* Configuration switch checking *
* *
********************************************************************
Please be aware that not all configuration errors can be captured !
*/
#if (LCD_SUPPORT_REFRESH && !LCD_CACHE)
#error Cache has to be enabled in order to support refresh !
#endif
#if (LCD_BITSPERPIXEL != 1)
#error This controller can handle only b/w displays
#endif
/* Check number of controllers */
#if ((LCD_NUM_CONTROLLERS >4) || (LCD_NUM_CONTROLLERS <0))
#error "More than 4 controllers not supported !"
#endif
/* Check if number of segments / coms equals resolution */
#if (LCD_NUM_SEGS < LCD_XSIZE_P)
#error Please check segment setup of controller 0 and X/YSIZE !!!
#endif
#if (LCD_NUM_COMS < LCD_YSIZE_P)
#error Please check com setup of controller 0 and X/YSIZE !!!
#endif
/*
********************************************************************
* *
* Standard variables for driver *
* *
********************************************************************
*/
#define BKCOLOR LCD_BKCOLORINDEX
#define COLOR LCD_COLORINDEX
C51 COMPILER V8.05a LCD15XX 04/11/2008 14:19:23 PAGE 14
static LCD_RECT ClipRect;
#if LCD_SUPPORT_VERIFY
static int ErrCnt;
static int ErrStat;
#endif
/*
*****************************************
* *
* Memory areas for caching (optional) *
* *
*****************************************
The cache stores only the bytes actually used in every controller.
This is also the reason why different arrays are used for every
controller.
*/
#if LCD_CACHE
/* Handle controller #0 */
#define NUM_COMS0 (LCD_LASTCOM0-LCD_FIRSTCOM0+1)
#define NUM_PAGES0 ((NUM_COMS0+7)/8)
#define NUM_COLS0 (LCD_LASTSEG0-LCD_FIRSTSEG0+1)
static U8 Cache0[NUM_PAGES0][NUM_COLS0];
/* Check configuration a bit to capture the worst mistakes ... */
#if (NUM_COLS0<LCD_NUM_SEGS0)
#error Configuration error ! Please check LCD_LASTSEG0, LCD_FIRSTSEG0
#endif
#if (NUM_COMS0<LCD_NUM_COMS0)
#error Configuration error ! Please check LCD_LASTCOM0, LCD_FIRSTCOM0
#endif
/* Handle controller #1 */
#if (LCD_NUM_CONTROLLERS >1)
#define NUM_COMS1 (LCD_LASTCOM1-LCD_FIRSTCOM1+1)
#define NUM_PAGES1 ((NUM_COMS1+7)/8)
#define NUM_COLS1 (LCD_LASTSEG1-LCD_FIRSTSEG1+1)
static U8 Cache1[NUM_PAGES1][NUM_COLS1];
/* Check configuration a bit to capture the worst mistakes ... */
#if (NUM_COLS1<LCD_NUM_SEGS1)
#error Configuration error ! Please check LCD_LASTSEG1, LCD_FIRSTSEG1
#endif
#if (NUM_COMS1<LCD_NUM_COMS1)
#error Configuration error ! Please check LCD_LASTCOM1, LCD_FIRSTCOM1
#endif
#endif
/* Handle controller #2 */
#if (LCD_NUM_CONTROLLERS >2)
#define NUM_PAGES2 ((LCD_LASTCOM2-LCD_FIRSTCOM2+1+7)/8)
#define NUM_COLS2 (LCD_LASTSEG2-LCD_FIRSTSEG2+1)
static U8 Cache2[NUM_PAGES2][NUM_COLS2];
#endif
/* Handle controller #3 */
#if (LCD_NUM_CONTROLLERS >3)
#define NUM_PAGES3 ((LCD_LASTCOM3-LCD_FIRSTCOM3+1+7)/8)
#define NUM_COLS3 (LCD_LASTSEG3-LCD_FIRSTSEG3+1)
static U8 Cache3[NUM_PAGES3][NUM_COLS3];
#endif
#endif
/*
********************************************************************
* *
C51 COMPILER V8.05a LCD15XX 04/11/2008 14:19:23 PAGE 15
* Write Cache variables *
* *
********************************************************************
*/
#if LCD_SUPPORT_CACHECONTROL
static char CacheStat =0; /* 0: No changes */
static char CacheLocked =0; /* 0: Not locked */
static U8 aaCacheDirtyTag0[NUM_PAGES0][(NUM_COLS0+7)/8];
#if (LCD_NUM_CONTROLLERS >1)
static U8 aaCacheDirtyTag1[NUM_PAGES1][(NUM_COLS1+7)/8];
#endif
#if (LCD_NUM_CONTROLLERS >2)
static U8 aaCacheDirtyTag2[NUM_PAGES2][(NUM_COLS2+7)/8];
#endif
#if (LCD_NUM_CONTROLLERS >3)
static U8 aaCacheDirtyTag3[NUM_PAGES3][(NUM_COLS3+7)/8];
#endif
#endif
/*
********************************************************************
* *
* Hardware access, low level *
* *
* Write Command/Data, Reset *
* Read Command/data if possible (LCD readable) *
* *
********************************************************************
The following routines are used for all access to the
LCD-controller(s).
*/
/* This macro can be used to check how much time is used up
for management and how much for hardware access */
#ifdef LCD_TESTSPEED
#undef WRITE_DATA0
#undef WRITE_CMD0
#undef WRITE_DATA1
#undef WRITE_CMD1
#define WRITE_DATA0(p0)
#define WRITE_CMD0(p0)
#define WRITE_DATA1(p0)
#define WRITE_CMD1(p0)
#endif
/****************************************
* *
* Write Data *
* *
****************************************/
static void LCD_WriteData0(char Data) {
LCD_LOCK();
WRITE_DATA0(Data);
LCD_UNLOCK();
}
#if (LCD_NUM_CONTROLLERS >1)
static void LCD_WriteData1(char Data) {
C51 COMPILER V8.05a LCD15XX 04/11/2008 14:19:23 PAGE 16
LCD_LOCK();
WRITE_DATA1(Data);
LCD_UNLOCK();
}
#endif
#if (LCD_NUM_CONTROLLERS >2)
static void LCD_WriteData2(char Data) {
LCD_LOCK();
LCD_WRITEDATA2(Data);
LCD_UNLOCK();
}
#endif
#if (LCD_NUM_CONTROLLERS >3)
static void LCD_WriteData3(char Data) {
LCD_LOCK();
LCD_WRITEDATA3(Data);
LCD_UNLOCK();
}
#endif
/****************************************
* *
* Write single command *
* *
****************************************/
static void LCD_WriteSingleCommand0(char cmd) {
LCD_LOCK();
WRITE_CMD0(cmd);
LCD_UNLOCK();
}
#if (LCD_NUM_CONTROLLERS >1)
static void LCD_WriteSingleCommand1(char cmd) {
LCD_LOCK();
WRITE_CMD1(cmd);
LCD_UNLOCK();
}
#endif
#if (LCD_NUM_CONTROLLERS >2)
static void LCD_WriteSingleCommand2(char cmd) {
LCD_LOCK();
LCD_WRITECMD2(cmd);
LCD_UNLOCK();
}
#endif
#if (LCD_NUM_CONTROLLERS >3)
static void LCD_WriteSingleCommand3(char cmd) {
LCD_LOCK();
LCD_WRITECMD3(cmd);
LCD_UNLOCK();
}
#endif
/****************************************
* *
* Write double command *
* *
****************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -