/*
*********************************************************************************************************
* uC/GUI
* Universal graphic software for embedded applications
*
* (c) Copyright 2002, Micrium Inc., Weston, FL
* (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
*
* 礐/GUI is protected by international copyright laws. Knowledge of the
* source code may not be used to write a similar product. This file may
* only be used in accordance with a license and should not be redistributed
* in any way. We appreciate your understanding and fairness.
*
----------------------------------------------------------------------
File : LCD13XX.C
Purpose : Driver for LCDs using a single Seiko Epson SED13XX controllers
This version supports a single LCD controller
in (almost) any hardware configuration. The following
derivatives are currently supported:
SED1352
SED1354
SED1356 (With/Without BitBlt engine support)
SED1374
SED1375
SED13806
Other Epson LCD controllers are very similar and could
be covered by this driver as well, but have not been
tested.
----------------------------------------------------------------------
---------------------------LIST OF CONFIG SWITCHES--------------------
The following is a list of additional configuration switches for this
driver. These switches might not be listed in the manual, because
the manual mainly covers the general config switches which are
supported by all drivers.
----------------------------------------------------------------------
define ----------------------Explanation------------------------------
LCD_SWAP_BYTE_ORDER Activate if high low bytes are swapped
Default: 0
LCD_WRITE_MEM32(Off,Data32) This macro accelerates display access
if defined by allowing the CPU to write
32 bits at a time to the controller.
(For 32 bits CPUs only and only if the
BUS interface unit can automatically
convert this to 2 16 bit accesses
LCD_OPTIMIZE Controls the use of optimized routines.
If 1, several (speed) optimizations are used.
Default: ON (1)
LCD_USE_BITBLT This switch controls the use of optimized routines
with SED1356 bitblt engine.
If 1, the optimized routines with bitblt access are used.
The default value depends of LCD_BITSPERPIXEL: (4 ) -> 0, (8,15) -> 1
LCD_ENABLE_REG_ACCESS()
LCD_ENABLE_MEM_ACCESS() In most systems (and with most LCD-controllers)
registers / memory can be accessed at
different addresses. However, in some
systems, it could be necessary to exec
code in order to be able to access the
registers or memory. This code should
then be placed in these macros (rather
than the actual access macros, which
would be slowed down)
LCD_DATAADR define adress if video memory can be treated
like regular memory
(will speed up driver)
----------------------------------------------------------------------
Known problems or limitations with current version
----------------------------------------------------------------------
none
----------------------------------------------------------------------
Open issues
----------------------------------------------------------------------
None
---------------------------END-OF-HEADER------------------------------
*/
#include <stddef.h> /* needed for definition of NULL */
#include "LCD_Private.H" /* private modul definitions & config */
#include "GUI_Private.H"
#include "GUIDebug.h"
#include "LCD_0.h" /* Defines for first display */
// extern U8 LCD_Buffer [LCD_XSIZE*LCD_YSIZE];
extern U8 LCD_Buffer [];
// 对 Video RAM 区的读写操作.
#define LCD_READ_MEM(Off) LCD_Buffer[Off]
#define LCD_WRITE_MEM(Off,data) LCD_Buffer[Off]=data
#define LCD_READ_REG(Off) 0
#define LCD_WRITE_REG(Off,data)
#if (LCD_CONTROLLER/100 == 13) && (LCD_CONTROLLER/10 != 133) \
&& (!defined(WIN32) | defined(LCD_SIMCONTROLLER))
/*
*********************************************************
* *
* Compiler specific settings *
* *
*********************************************************
*/
#ifdef WIN32 /* Avoid warnings in MS-compiler */
#pragma warning(disable : 4244) // warning C4244: '=' : conversion from 'long ' to 'unsigned char ', possible loss of data
#pragma warning(disable : 4761) // warning C4761: integral size mismatch in argument; conversion supplied
#endif
/*
*********************************************************
*
* Controller renumbering
*
*********************************************************
EPSON decided to rename all of their controllers. In order to
be able to work with old and new numbers, we simply map the old ones
to the new ones.
*/
#if LCD_CONTROLLER == 1386
#undef LCD_CONTROLLER
#define LCD_CONTROLLER 13806
#endif
/*
*********************************************************
* *
* Defaults for configuration *
* *
*********************************************************
*/
/* Switch for support of multiple pages.
Only available with certain LCD-controllers */
#ifndef LCD_SUPPORT_PAGING
#define LCD_SUPPORT_PAGING (0)
#endif
#ifndef LCD_SCHEDULE_CNT
#define LCD_SCHEDULE_CNT (0)
#endif
#ifndef LCD_NUM_CONTROLLERS
#define LCD_NUM_CONTROLLERS (1)
#endif
#ifndef LCD_BUSWIDTH
#define LCD_BUSWIDTH (16)
#endif
#ifndef LCD_OPTIMIZE
#define LCD_OPTIMIZE (1)
#endif
#if (LCD_CONTROLLER == 1356) || (LCD_CONTROLLER == 13806)
#ifndef LCD_USE_BITBLT
#if ((LCD_BITSPERPIXEL == 16) || (LCD_BITSPERPIXEL == 8 )) && (LCD_MIRROR_Y == 0) && (LCD_SWAP_XY == 0)
#define LCD_USE_BITBLT (1)
#else
#define LCD_USE_BITBLT (0)
#endif
#else
#if (LCD_MIRROR_Y)
#error BITBLT engine does not support LCD_MIRROR_Y = 1!
#endif
#if (LCD_SWAP_XY)
#error BITBLT engine does not support LCD_SWAP_XY = 1!
#endif
#endif
#else
#define LCD_USE_BITBLT (0)
#endif
#ifndef LCD_ENABLE_REG_ACCESS
#define LCD_ENABLE_REG_ACCESS()
#endif
#ifndef LCD_ENABLE_MEM_ACCESS
#define LCD_ENABLE_MEM_ACCESS()
#endif
#ifndef STATIC
#define STATIC static
#endif
/*
*********************************************************
* *
* Defines for configuration simulation *
* *
*********************************************************
*/
#if defined(WIN32) && !defined(USE_PC_HARDWARE)
void SIM_WriteMem8(unsigned int Off, int Data);
void SIM_WriteReg8(unsigned int Off, int Data);
int SIM_ReadMem8(unsigned int Off);
int SIM_ReadReg8(unsigned int O