?? lcd15xx.c
字號:
#endif
********************************************************************
*
* ID translation table
*
********************************************************************
This table contains 0, 1, 2, ... and serves as translation table for DDBs
*/
#define INTS(Base) Base+0,Base+1,Base+2,Base+3,Base+4,Base+5, \
Base+6,Base+7,Base+8,Base+9,Base+10,Base+11, \
Base+12,Base+13,Base+14,Base+15
static const LCD_PIXELINDEX aID[] = {
INTS(0),
#if LCD_MAX_LOG_COLORS > 0x10
INTS(0x10),
#endif
#if LCD_MAX_LOG_COLORS > 0x20
INTS(0x20),
INTS(0x30),
#endif
#if LCD_MAX_LOG_COLORS > 0x40
INTS(0x40),
INTS(0x50),
INTS(0x60),
INTS(0x70),
#endif
#if LCD_MAX_LOG_COLORS > 0x80
INTS(0x80),
INTS(0x90),
INTS(0xa0),
INTS(0xb0),
INTS(0xc0),
INTS(0xd0),
INTS(0xe0),
INTS(0xf0)
#endif
};
/*
********************************************************************
* *
* Defaults for config switches *
* *
********************************************************************
*/
#ifndef LCD_CACHE
#define LCD_CACHE (1)
#endif
#ifndef LCD_SUPPORT_REFRESH
#define LCD_SUPPORT_REFRESH LCD_CACHE
#endif
#ifndef LCD_REVERSEMODE_SUPPORT
#define LCD_REVERSEMODE_SUPPORT (0)
#endif
#ifndef LCD_SUPPORT_VERIFY
#define LCD_SUPPORT_VERIFY (0)
#endif
/* Drivers supports anti-aliasing if active. */
#ifndef LCD_SUPPORT_ANTIALIASING
#define LCD_SUPPORT_ANTIALIASING (0)
#endif
/* Switch for support of cache control (locking) */
#ifndef LCD_SUPPORT_CACHECONTROL
#define LCD_SUPPORT_CACHECONTROL (1)
#endif
/* Switch support for the LCD_CopyRect function of the driver */
#ifndef LCD_SUPPORT_COPYRECT
#define LCD_SUPPORT_COPYRECT (1)
#endif
/* If disabled, selected drawmode is ignored.
==> XOR, REVERSE drawing not supported */
#ifndef LCD_SUPPORT_DRAWMODE
#define LCD_SUPPORT_DRAWMODE (1)
#endif
/* Switch support for the LCD_On, LCD_Off functions of the driver */
#ifndef LCD_SUPPORT_ONOFF
#define LCD_SUPPORT_ONOFF (1)
#endif
/* Switch for support of multiple pages.
Only available with certain LCD-controllers */
#ifndef LCD_SUPPORT_PAGING
#define LCD_SUPPORT_PAGING (0)
#endif
/* Switch for support of run-time inversion of display. */
#ifndef LCD_SUPPORT_REVERSEMODE
#define LCD_SUPPORT_REVERSEMODE (0)
#endif
/* Switch support for the LCD_SetOrg function of the driver */
#ifndef LCD_SUPPORT_SETORG
#define LCD_SUPPORT_SETORG (0)
#endif
/* Switch for support of refreshing video RAM. */
#ifndef LCD_SUPPORT_REFRESH
#define LCD_SUPPORT_REFRESH (0)
#endif
#ifndef LCD_SCHEDULE_CNT
#define LCD_SCHEDULE_CNT 0
#endif
#ifndef LCD_NUM_CONTROLLERS
#define LCD_NUM_CONTROLLERS (1)
#endif
#ifndef LCD_LOCK
#define LCD_LOCK()
#endif
#ifndef LCD_UNLOCK
#define LCD_UNLOCK()
#endif
#ifndef LCD_READABLE
#define LCD_READABLE (0)
#endif
#ifndef LCD_CACHE_WRITETHRU
#define LCD_CACHE_WRITETHRU (0)
#endif
#ifndef LCD_SUPPORT_RT_INVERSION
#define LCD_SUPPORT_RT_INVERSION (0)
#endif
#ifndef LCD_SUPPORT_CHECKINIT
#define LCD_SUPPORT_CHECKINIT (0)
#endif
/*
********************************************************************
* *
* Explicit externals *
* *
********************************************************************
*/
/* For compatibility with older configs, define defaults */
#ifndef LCD_SUPPORT_COMTRANS
#define LCD_SUPPORT_COMTRANS 0
#endif
#ifndef LCD_SUPPORT_SEGTRANS
#define LCD_SUPPORT_SEGTRANS 0
#endif
#if LCD_SUPPORT_COMTRANS
extern U8 LCD__aLine2Com0[LCD_LASTCOM0-LCD_FIRSTCOM0+1];
#if (LCD_NUM_CONTROLLERS >1)
extern U8 LCD__aLine2Com1[LCD_LASTCOM1-LCD_FIRSTCOM1+1];
#endif
#if (LCD_NUM_CONTROLLERS >2)
extern U8 LCD__aLine2Com2[LCD_LASTCOM2-LCD_FIRSTCOM2+1];
#endif
#if (LCD_NUM_CONTROLLERS >3)
extern U8 LCD__aLine2Com3[LCD_LASTCOM3-LCD_FIRSTCOM3+1];
#endif
#endif
#if LCD_SUPPORT_SEGTRANS
extern U8 LCD__aRow2Seg0[LCD_LASTSEG0-LCD_FIRSTSEG0+1];
#if (LCD_NUM_CONTROLLERS >1)
extern U8 LCD__aRow2Seg1[LCD_LASTSEG1-LCD_FIRSTSEG1+1];
#endif
#if (LCD_NUM_CONTROLLERS >2)
extern U8 LCD__aRow2Seg2[LCD_LASTSEG2-LCD_FIRSTSEG2+1];
#endif
#if (LCD_NUM_CONTROLLERS >3)
extern U8 LCD__aRow2Seg3[LCD_LASTSEG3-LCD_FIRSTSEG3+1];
#endif
#endif
/*
********************************************************************
* *
* Internal types *
* *
********************************************************************
*/
/*
********************************************************************
* *
* SCHEDULING *
* *
********************************************************************
*/
#if LCD_SCHEDULE_CNT
static int ScheduleCntRem=LCD_SCHEDULE_CNT;
#define CHECK_SCHEDULE(PixelCnt) \
if ((ScheduleCntRem-=(PixelCnt)) <=0) { \
ScheduleCntRem=LCD_SCHEDULE_CNT; \
LCD_SCHEDULE(); \
}
#define CHECK_SCHEDULE(PixelCnt)
#endif
/*
********************************************************************
* *
* Macro calculations *
* *
********************************************************************
*/
/* To make life easier, assign physical x/y size */
#if !LCD_SWAP_XY
#define LCD_XSIZE_P LCD_XSIZE
#define LCD_YSIZE_P LCD_YSIZE
#else
#define LCD_XSIZE_P LCD_YSIZE
#define LCD_YSIZE_P LCD_XSIZE
#endif
/* Define number of available segments of controller */
#if (LCD_CONTROLLER == 1560)
#define LCD_COMS_MAX 64
#define LCD_SEGS_MAX 102
#elif (LCD_CONTROLLER == 1565)
#define LCD_COMS_MAX 65
#define LCD_SEGS_MAX 132
#elif (LCD_CONTROLLER == 1566)
#define LCD_COMS_MAX 49
#define LCD_SEGS_MAX 132
#elif (LCD_CONTROLLER == 1567)
#define LCD_COMS_MAX 33
#define LCD_SEGS_MAX 132
#elif (LCD_CONTROLLER == 1568)
#define LCD_COMS_MAX 55
#define LCD_SEGS_MAX 132
#elif (LCD_CONTROLLER == 1569)
#define LCD_COMS_MAX 53
#define LCD_SEGS_MAX 132
#elif (LCD_CONTROLLER == 1575)
#define LCD_COMS_MAX 65
#define LCD_SEGS_MAX 200
#elif (LCD_CONTROLLER == 0713)
#define LCD_COMS_MAX 65
#define LCD_SEGS_MAX 132
#elif (LCD_CONTROLLER == 108)
#define LCD_COMS_MAX 64
#define LCD_SEGS_MAX 64
#elif (LCD_CONTROLLER == 61202)
#define LCD_COMS_MAX 64
#define LCD_SEGS_MAX 64
#else
#error Please define a controller to use !
#endif
/* Define number of used coms/segments per controller */
#if !LCD_SUPPORT_SEGTRANS
#define LCD_NUM_SEGS0 (LCD_LASTSEG0-LCD_FIRSTSEG0+1)
#else
#ifndef LCD_NUM_SEGS0
#error Please define LCD_NUM_SEGS0 in your configuratiuon file LCDConf.h
#endif
#endif
#if !LCD_SUPPORT_COMTRANS
#define LCD_NUM_COMS0 (LCD_LASTCOM0-LCD_FIRSTCOM0+1)
#else
#ifndef LCD_NUM_COMS0
#error Please define LCD_NUM_COMS0 in your configuratiuon file LCDConf.h
#endif
#endif
#if (LCD_NUM_CONTROLLERS >1)
#if !LCD_SUPPORT_SEGTRANS
#define LCD_NUM_SEGS1 (LCD_LASTSEG1-LCD_FIRSTSEG1+1)
#else
#ifndef LCD_NUM_SEGS1
#error Please define LCD_NUM_SEGS1 in your configuratiuon file LCDConf.h
#endif
#endif
#if !LCD_SUPPORT_COMTRANS
#define LCD_NUM_COMS1 (LCD_LASTCOM1-LCD_FIRSTCOM1+1)
#else
#ifndef LCD_NUM_COMS1
#error Please define LCD_NUM_COMS1 in your configuratiuon file LCDConf.h
#endif
#endif
#endif
#if (LCD_NUM_CONTROLLERS >2)
#define LCD_NUM_SEGS2 (LCD_LASTSEG2-LCD_FIRSTSEG2+1)
#define LCD_NUM_COMS2 (LCD_LASTCOM2-LCD_FIRSTCOM2+1)
#endif
#if (LCD_NUM_CONTROLLERS >3)
#define LCD_NUM_SEGS3 (LCD_LASTSEG3-LCD_FIRSTSEG3+1)
#define LCD_NUM_COMS3 (LCD_LASTCOM3-LCD_FIRSTCOM3+1)
#endif
/* Define total number of used coms/segments */
#if (LCD_NUM_CONTROLLERS ==1)
#define LCD_NUM_SEGS LCD_NUM_SEGS0
#define LCD_NUM_COMS LCD_NUM_COMS0
#elif (LCD_NUM_CONTROLLERS ==2)
#define LCD_NUM_SEGS (LCD_NUM_SEGS0+LCD_NUM_SEGS1)
#define LCD_NUM_COMS (LCD_NUM_COMS0+LCD_NUM_COMS1)
#elif (LCD_NUM_CONTROLLERS ==3)
#define LCD_NUM_SEGS (LCD_NUM_SEGS0+LCD_NUM_SEGS1+LCD_NUM_SEGS2)
#define LCD_NUM_COMS (LCD_NUM_COMS0+LCD_NUM_COMS1+LCD_NUM_COMS2)
#elif (LCD_NUM_CONTROLLERS ==4)
#define LCD_NUM_SEGS (LCD_NUM_SEGS0+LCD_NUM_SEGS1+LCD_NUM_SEGS2+LCD_NUM_SEGS3)
#define LCD_NUM_COMS (LCD_NUM_COMS0+LCD_NUM_COMS1+LCD_NUM_COMS2+LCD_NUM_COMS3)
#endif
/* Calc. the first column to actually write to. This is not as
easy as it seems, because if we mirror X, the controller
uses different columns in video memory to store the data.
If you use lookup tables for segment lines, the offsets are 0
because the right values are in the table
*/
#if LCD_SUPPORT_SEGTRANS==0
#if !LCD_MIRROR_X
#define LCD_SEGOFF0 LCD_FIRSTSEG0
#define LCD_SEGOFF1 (LCD_XORG1 - LCD_FIRSTSEG1)
#define LCD_SEGOFF2 (LCD_XORG2 - LCD_FIRSTSEG2)
#define LCD_SEGOFF3 (LCD_XORG3 - LCD_FIRSTSEG3)
#else
#define LCD_SEGOFF0 (LCD_SEGS_MAX-LCD_LASTSEG0-1)
#define LCD_SEGOFF1 (LCD_SEGS_MAX-LCD_LASTSEG1-1)
#define LCD_SEGOFF2 (LCD_SEGS_MAX-LCD_LASTSEG2-1)
#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 !!!
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -