NuMaker emWin HMI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LCD.h Source File

LCD.h

00001 /*********************************************************************
00002 *                 SEGGER Software GmbH                               *
00003 *        Solutions for real time microcontroller applications        *
00004 **********************************************************************
00005 *                                                                    *
00006 *        (c) 1996 - 2018  SEGGER Microcontroller GmbH                *
00007 *                                                                    *
00008 *        Internet: www.segger.com    Support:  support@segger.com    *
00009 *                                                                    *
00010 **********************************************************************
00011 
00012 ** emWin V5.48 - Graphical user interface for embedded applications **
00013 All  Intellectual Property rights in the Software belongs to  SEGGER.
00014 emWin is protected by  international copyright laws.  Knowledge of the
00015 source code may not be used to write a similar product. This file may
00016 only be used in accordance with the following terms:
00017 
00018 The  software has  been licensed by SEGGER Software GmbH to Nuvoton Technology Corporationat the address: No. 4, Creation Rd. III, Hsinchu Science Park, Taiwan
00019 for the purposes  of  creating  libraries  for its 
00020 Arm Cortex-M and  Arm9 32-bit microcontrollers, commercialized and distributed by Nuvoton Technology Corporation
00021 under  the terms and conditions  of  an  End  User  
00022 License  Agreement  supplied  with  the libraries.
00023 Full source code is available at: www.segger.com
00024 
00025 We appreciate your understanding and fairness.
00026 ----------------------------------------------------------------------
00027 Licensing information
00028 Licensor:                 SEGGER Software GmbH
00029 Licensed to:              Nuvoton Technology Corporation, No. 4, Creation Rd. III, Hsinchu Science Park, 30077 Hsinchu City, Taiwan
00030 Licensed SEGGER software: emWin
00031 License number:           GUI-00735
00032 License model:            emWin License Agreement, signed February 27, 2018
00033 Licensed platform:        Cortex-M and ARM9 32-bit series microcontroller designed and manufactured by or for Nuvoton Technology Corporation
00034 ----------------------------------------------------------------------
00035 Support and Update Agreement (SUA)
00036 SUA period:               2018-03-26 - 2019-03-27
00037 Contact to extend SUA:    sales@segger.com
00038 ----------------------------------------------------------------------
00039 File        : LCD.h
00040 Purpose     : Declares LCD interface functions
00041 ----------------------------------------------------------------------
00042 */
00043 
00044 #ifndef LCD_H
00045 #define LCD_H
00046 
00047 #include "GUI_ConfDefaults.h" /* Used for GUI_CONST_STORAGE */
00048 #include "Global.h"
00049 
00050 #if defined(__cplusplus)
00051 extern "C" {     /* Make sure we have C-declarations in C++ programs */
00052 #endif
00053 
00054 /*********************************************************************
00055 *
00056 *       Basic type defines
00057 *
00058 * The follwing are defines for types used in the LCD-driver and the
00059 * GUI layers on top of that. Since "C" does not provide data types of
00060 * fixed length which are identical on all platforms, this is done here.
00061 * For most 16/32 controllers, the settings will work fine. However, if
00062 * you have similar defines in other sections of your program, you might
00063 * want to change or relocate these defines, e.g. in a TYPE.h file.
00064 */
00065 #define I16P I16              /*   signed 16 bits OR MORE ! */
00066 #define U16P U16              /* unsigned 16 bits OR MORE ! */
00067 
00068 /*********************************************************************
00069 *
00070 *       Settings for windows simulation
00071 *
00072 * Some settings in the configuration may conflict with the values required
00073 * in the Simulation. This is why we ignore the target settings for data
00074 * types and use the correct settings for the simulation.
00075 * (U32 could be defined as long, which would yield a 64 bit type on
00076 * the PC)
00077 */
00078 #ifdef WIN32
00079   #pragma warning( disable : 4244 )  // Disable warning messages in simulation
00080   #pragma warning( disable : 4761 )  // Disable warning "integral size mismatch in argument; conversion supplied"
00081 #endif
00082 
00083 /*********************************************************************
00084 *
00085 *       Constants
00086 */
00087 #define LCD_ERR0 (0x10)
00088 #define LCD_ERR_CONTROLLER_NOT_FOUND (LCD_ERR0+1)
00089 #define LCD_ERR_MEMORY               (LCD_ERR0+2)
00090 
00091 /*********************************************************************
00092 *
00093 *       Drawing modes
00094 */
00095 #define LCD_DRAWMODE_NORMAL (0)
00096 #define LCD_DRAWMODE_XOR    (1<<0)
00097 #define LCD_DRAWMODE_TRANS  (1<<1)
00098 #define LCD_DRAWMODE_REV    (1<<2)
00099 
00100 /*********************************************************************
00101 *
00102 *       Typedefs
00103 */
00104 typedef int LCD_DRAWMODE;
00105 typedef U32 LCD_COLOR;
00106 
00107 /*********************************************************************
00108 *
00109 *       Data structures
00110 */
00111 typedef struct { I16P x,y; } GUI_POINT;
00112 typedef struct { I16 x0,y0,x1,y1; } LCD_RECT;
00113 
00114 typedef struct {
00115   int              NumEntries;
00116   char             HasTrans;
00117   const LCD_COLOR * pPalEntries;
00118 } LCD_LOGPALETTE;
00119 
00120 /* This is used for the simulation only ! */
00121 typedef struct {
00122   int x,y;
00123   unsigned char KeyStat;
00124 } LCD_tMouseState;
00125 
00126 typedef struct {
00127   int               NumEntries;
00128   const LCD_COLOR * pPalEntries;
00129 } LCD_PHYSPALETTE;
00130 
00131 /*********************************************************************
00132 *
00133 *       LCD_L0_... color conversion
00134 */
00135 typedef LCD_COLOR      tLCDDEV_Index2Color  (LCD_PIXELINDEX Index);
00136 typedef LCD_PIXELINDEX tLCDDEV_Color2Index  (LCD_COLOR Color);
00137 typedef LCD_PIXELINDEX tLCDDEV_GetIndexMask (void);
00138 
00139 typedef void tLCDDEV_Index2ColorBulk(void * pIndex, LCD_COLOR * pColor, U32 NumItems, U8 SizeOfIndex);
00140 typedef void tLCDDEV_Color2IndexBulk(LCD_COLOR * pColor, void * pIndex, U32 NumItems, U8 SizeOfIndex);
00141 
00142 /*********************************************************************
00143 *
00144 *       Color conversion API tables
00145 */
00146 typedef struct {
00147   tLCDDEV_Color2Index  * pfColor2Index;
00148   tLCDDEV_Index2Color  * pfIndex2Color;
00149   tLCDDEV_GetIndexMask * pfGetIndexMask;
00150   int NoAlpha;
00151   tLCDDEV_Color2IndexBulk * pfColor2IndexBulk;
00152   tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk;
00153 } LCD_API_COLOR_CONV;
00154 
00155 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_0;
00156 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1;
00157 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_2;
00158 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_4;
00159 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_5;
00160 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_8;
00161 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_16;
00162 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_24;
00163 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_2;
00164 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_4;
00165 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_5;
00166 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_6;
00167 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8;
00168 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_16;
00169 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1616I;
00170 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_111;
00171 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_222;
00172 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_233;
00173 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_323;
00174 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_332;
00175 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_444_12;
00176 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_444_12_1;
00177 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_444_16;
00178 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_555;
00179 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_565;
00180 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_556;
00181 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_655;
00182 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_666;
00183 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_666_9;
00184 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_822216;
00185 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_84444;
00186 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8666;
00187 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8666_1;
00188 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_88666I;
00189 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_888;
00190 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8888;
00191 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M111;
00192 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M1555I;
00193 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M222;
00194 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M233;
00195 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M323;
00196 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M332;
00197 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M4444I;
00198 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M444_12;
00199 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M444_12_1;
00200 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M444_16;
00201 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M555;
00202 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M565;
00203 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M556;
00204 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M655;
00205 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M666;
00206 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M666_9;
00207 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M8565;
00208 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M888;
00209 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M8888;
00210 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M8888I;
00211 
00212 #define GUICC_0         &LCD_API_ColorConv_0
00213 #define GUICC_1         &LCD_API_ColorConv_1
00214 #define GUICC_1_2       &LCD_API_ColorConv_1_2
00215 #define GUICC_1_4       &LCD_API_ColorConv_1_4
00216 #define GUICC_1_5       &LCD_API_ColorConv_1_5
00217 #define GUICC_1_8       &LCD_API_ColorConv_1_8
00218 #define GUICC_1_16      &LCD_API_ColorConv_1_16
00219 #define GUICC_1_24      &LCD_API_ColorConv_1_24
00220 #define GUICC_2         &LCD_API_ColorConv_2
00221 #define GUICC_4         &LCD_API_ColorConv_4
00222 #define GUICC_5         &LCD_API_ColorConv_5
00223 #define GUICC_6         &LCD_API_ColorConv_6
00224 #define GUICC_8         &LCD_API_ColorConv_8
00225 #define GUICC_16        &LCD_API_ColorConv_16
00226 #define GUICC_1616I     &LCD_API_ColorConv_1616I
00227 #define GUICC_111       &LCD_API_ColorConv_111
00228 #define GUICC_222       &LCD_API_ColorConv_222
00229 #define GUICC_233       &LCD_API_ColorConv_233
00230 #define GUICC_323       &LCD_API_ColorConv_323
00231 #define GUICC_332       &LCD_API_ColorConv_332
00232 #define GUICC_M4444I    &LCD_API_ColorConv_M4444I
00233 #define GUICC_444_12    &LCD_API_ColorConv_444_12
00234 #define GUICC_444_12_1  &LCD_API_ColorConv_444_12_1
00235 #define GUICC_444_16    &LCD_API_ColorConv_444_16
00236 #define GUICC_555       &LCD_API_ColorConv_555
00237 #define GUICC_565       &LCD_API_ColorConv_565
00238 #define GUICC_556       &LCD_API_ColorConv_556
00239 #define GUICC_655       &LCD_API_ColorConv_655
00240 #define GUICC_666       &LCD_API_ColorConv_666
00241 #define GUICC_666_9     &LCD_API_ColorConv_666_9
00242 #define GUICC_822216    &LCD_API_ColorConv_822216
00243 #define GUICC_84444     &LCD_API_ColorConv_84444
00244 #define GUICC_8666      &LCD_API_ColorConv_8666
00245 #define GUICC_8666_1    &LCD_API_ColorConv_8666_1
00246 #define GUICC_88666I    &LCD_API_ColorConv_88666I
00247 #define GUICC_888       &LCD_API_ColorConv_888
00248 #define GUICC_8888      &LCD_API_ColorConv_8888
00249 #define GUICC_M111      &LCD_API_ColorConv_M111
00250 #define GUICC_M1555I    &LCD_API_ColorConv_M1555I
00251 #define GUICC_M222      &LCD_API_ColorConv_M222
00252 #define GUICC_M233      &LCD_API_ColorConv_M233
00253 #define GUICC_M323      &LCD_API_ColorConv_M323
00254 #define GUICC_M332      &LCD_API_ColorConv_M332
00255 #define GUICC_M444_12   &LCD_API_ColorConv_M444_12
00256 #define GUICC_M444_12_1 &LCD_API_ColorConv_M444_12_1
00257 #define GUICC_M444_16   &LCD_API_ColorConv_M444_16
00258 #define GUICC_M555      &LCD_API_ColorConv_M555
00259 #define GUICC_M565      &LCD_API_ColorConv_M565
00260 #define GUICC_M556      &LCD_API_ColorConv_M556
00261 #define GUICC_M655      &LCD_API_ColorConv_M655
00262 #define GUICC_M666      &LCD_API_ColorConv_M666
00263 #define GUICC_M666_9    &LCD_API_ColorConv_M666_9
00264 #define GUICC_M8565     &LCD_API_ColorConv_M8565
00265 #define GUICC_M888      &LCD_API_ColorConv_M888
00266 #define GUICC_M8888     &LCD_API_ColorConv_M8888
00267 #define GUICC_M8888I    &LCD_API_ColorConv_M8888I
00268 
00269 void GUICC_M1555I_SetCustColorConv(tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk);
00270 void GUICC_M565_SetCustColorConv  (tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk);
00271 void GUICC_M4444I_SetCustColorConv(tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk);
00272 void GUICC_M888_SetCustColorConv  (tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk);
00273 void GUICC_M8888I_SetCustColorConv(tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk);
00274 
00275 /*********************************************************************
00276 *
00277 *       Compatibility defines for older versions
00278 */
00279 #define GUI_COLOR_CONV_1    GUICC_1
00280 #define GUI_COLOR_CONV_2    GUICC_2
00281 #define GUI_COLOR_CONV_4    GUICC_4
00282 #define GUI_COLOR_CONV_8666 GUICC_8666
00283 #define GUI_COLOR_CONV_888  GUICC_888
00284 #define GUI_COLOR_CONV_8888 GUICC_8888
00285 #define GUI_COLOR_CONV_565  GUICC_565
00286 #define GUI_COLOR_CONV_M565 GUICC_M565
00287 
00288 /*********************************************************************
00289 *
00290 *       LCDDEV function table
00291 *
00292 *  Below the routines which need to in an LCDDEV routine table are
00293 *  defined. All of these routines have to be in the low-level driver
00294 *  (LCD_L0) or in the memory device which can be used to replace the
00295 *  driver.
00296 *  The one exception to this is the SetClipRect routine, which would
00297 *  be identical for all drivers and is therefor contained in the
00298 *  level above (LCD).
00299 */
00300 typedef void         tLCDDEV_DrawPixel    (int x, int y);
00301 typedef void         tLCDDEV_DrawHLine    (int x0, int y0,  int x1);
00302 typedef void         tLCDDEV_DrawVLine    (int x , int y0,  int y1);
00303 typedef void         tLCDDEV_FillRect     (int x0, int y0, int x1, int y1);
00304 typedef unsigned int tLCDDEV_GetPixelIndex(int x, int y);
00305 typedef void         tLCDDEV_SetPixelIndex(int x, int y, int ColorIndex);
00306 typedef void         tLCDDEV_XorPixel     (int x, int y);
00307 typedef void         tLCDDEV_FillPolygon  (const GUI_POINT * pPoints, int NumPoints, int x0, int y0);
00308 typedef void         tLCDDEV_FillPolygonAA(const GUI_POINT * pPoints, int NumPoints, int x0, int y0);
00309 typedef void         tLCDDEV_GetRect      (LCD_RECT * pRect);
00310 typedef int          tLCDDEV_Init         (void);
00311 typedef void         tLCDDEV_On           (void);
00312 typedef void         tLCDDEV_Off          (void);
00313 typedef void         tLCDDEV_SetLUTEntry  (U8 Pos, LCD_COLOR color);
00314 typedef void *       tLCDDEV_GetDevFunc   (int Index);
00315 typedef I32          tLCDDEV_GetDevProp   (int Index);
00316 typedef void         tLCDDEV_SetOrg       (int x, int y);
00317 
00318 /*********************************************************************
00319 *
00320 *       Memory device API tables
00321 */
00322 typedef struct GUI_DEVICE     GUI_DEVICE;
00323 typedef struct GUI_DEVICE_API GUI_DEVICE_API;
00324 
00325 typedef void tLCDDEV_DrawBitmap   (int x0, int y0, int xsize, int ysize,
00326                        int BitsPerPixel, int BytesPerLine,
00327                        const U8 * pData, int Diff,
00328                        const void * pTrans);   /* Really LCD_PIXELINDEX, but is void to avoid compiler warnings */
00329 #define GUI_MEMDEV_APILIST_1  &GUI_MEMDEV_DEVICE_1
00330 #define GUI_MEMDEV_APILIST_8  &GUI_MEMDEV_DEVICE_8
00331 #define GUI_MEMDEV_APILIST_16 &GUI_MEMDEV_DEVICE_16
00332 #define GUI_MEMDEV_APILIST_32 &GUI_MEMDEV_DEVICE_32
00333 
00334 /*********************************************************************
00335 *
00336 *       Defines for device capabilities
00337 *
00338 * The following is the list of device capabilities which can, but do
00339 * not have to be implemented in the driver. This way the driver can be
00340 * enhanced in the future without affecting the driver interface,
00341 * keeping older drivers compatible.
00342 * More DevCaps can always be added in the future, as older drivers
00343 * are guaranteed to return 0 for all unimplemented features or queries.
00344 *
00345 * The values below define the legal parameters to the LCD_GetDeviceCaps
00346 * and the LCD_GetpCapFunc routines.
00347 */
00348 
00349 #define LCD_DEVCAP_XSIZE             0x01    /* Quest horiz. res. of display */
00350 #define LCD_DEVCAP_YSIZE             0x02    /* Quest vert. res. of display */
00351 #define LCD_DEVCAP_VXSIZE            0x03    /* Quest vert. res. of virtual disp.*/
00352 #define LCD_DEVCAP_VYSIZE            0x04    /* Quest vert. res. of virtual disp.*/
00353 #define LCD_DEVCAP_XORG              0x05    /* X-origin ... usually 0 */
00354 #define LCD_DEVCAP_YORG              0x06    /* Y-origin ... usually 0 */
00355 #define LCD_DEVCAP_CONTROLLER        0x07    /* LCD Controller (Numerical) */
00356 #define LCD_DEVCAP_BITSPERPIXEL      0x08    /* Bits per pixel ... 1/2/4/8 */
00357 #define LCD_DEVCAP_NUMCOLORS         0x09    /* Quest number of colors */
00358 #define LCD_DEVCAP_XMAG              0x0A
00359 #define LCD_DEVCAP_YMAG              0x0B
00360 #define LCD_DEVCAP_MIRROR_X          0x0C
00361 #define LCD_DEVCAP_MIRROR_Y          0x0D
00362 #define LCD_DEVCAP_SWAP_XY           0x0E
00363 #define LCD_DEVCAP_SWAP_RB           0x0F
00364 
00365 int LCD_GetXSizeMax(void);
00366 int LCD_GetYSizeMax(void);
00367 int LCD_GetVXSizeMax(void);
00368 int LCD_GetVYSizeMax(void);
00369 int LCD_GetBitsPerPixelMax(void);
00370 void LCD_SetDisplaySize(int xSizeDisplay, int ySizeDisplay);
00371 int LCD_GetXSizeDisplay(void);
00372 int LCD_GetYSizeDisplay(void);
00373 
00374 int LCD_GetXSizeEx          (int LayerIndex);
00375 int LCD_GetYSizeEx          (int LayerIndex);
00376 int LCD_GetVXSizeEx         (int LayerIndex);
00377 int LCD_GetVYSizeEx         (int LayerIndex);
00378 int LCD_GetBitsPerPixelEx   (int LayerIndex);
00379 U32 LCD_GetNumColorsEx      (int LayerIndex);
00380 int LCD_GetXMagEx           (int LayerIndex);
00381 int LCD_GetYMagEx           (int LayerIndex);
00382 int LCD_GetMirrorXEx        (int LayerIndex);
00383 int LCD_GetMirrorYEx        (int LayerIndex);
00384 int LCD_GetSwapXYEx         (int LayerIndex);
00385 int LCD_GetReversLUTEx      (int LayerIndex);
00386 int LCD_GetPhysColorsInRAMEx(int LayerIndex);
00387 
00388 int LCD_GetXSize            (void);
00389 int LCD_GetYSize            (void);
00390 int LCD_GetVXSize           (void);
00391 int LCD_GetVYSize           (void);
00392 int LCD_GetBitsPerPixel     (void);
00393 U32 LCD_GetNumColors        (void);
00394 int LCD_GetXMag             (void);
00395 int LCD_GetYMag             (void);
00396 int LCD_GetMirrorX          (void);
00397 int LCD_GetMirrorY          (void);
00398 int LCD_GetSwapXY           (void);
00399 int LCD_GetReversLUT        (void);
00400 int LCD_GetPhysColorsInRAM  (void);
00401 
00402 I32 LCD__GetBPP      (U32 IndexMask);
00403 I32 LCD__GetBPPDevice(U32 IndexMask);
00404 
00405 tLCDDEV_Index2Color * LCD_GetpfIndex2ColorEx(int LayerIndex);
00406 tLCDDEV_Color2Index * LCD_GetpfColor2IndexEx(int LayerIndex);
00407 
00408 tLCDDEV_Color2Index * LCD_GetpfColor2Index(void);
00409 
00410 int LCD_GetNumLayers(void);
00411 
00412 LCD_COLOR * LCD_GetPalette   (void);
00413 LCD_COLOR * LCD_GetPaletteEx (int LayerIndex);
00414 void      * LCD_GetVRAMAddr  (void);
00415 void      * LCD_GetVRAMAddrEx(int LayerIndex);
00416 
00417 void (* LCD_GetDevFunc(int LayerIndex, int Item))(void);
00418 
00419 /*********************************************************************
00420 *
00421 *       Runtime rotation of drivers
00422 */
00423 int LCD_ROTATE_AddDriver  (const GUI_DEVICE_API * pDriver);
00424 int LCD_ROTATE_AddDriverEx(const GUI_DEVICE_API * pDeviceAPI, int LayerIndex);
00425 int LCD_ROTATE_DecSel     (void);
00426 int LCD_ROTATE_DecSelEx   (int LayerIndex);
00427 int LCD_ROTATE_IncSel     (void);
00428 int LCD_ROTATE_IncSelEx   (int LayerIndex);
00429 int LCD_ROTATE_SetCallback(void (* pCbOnConfig)(GUI_DEVICE *, int, int), int LayerIndex);
00430 int LCD_ROTATE_SetSel     (int Index);
00431 int LCD_ROTATE_SetSelEx   (int Index, int LayerIndex);
00432 
00433 /*********************************************************************
00434 *
00435 *       Values for requesting and setting function pointers (display driver)
00436 */
00437                                        /* Request of a function pointer for... */
00438 #define LCD_DEVFUNC_READRECT      0x01 /* ...reading a rectangular display area */
00439 #define LCD_DEVFUNC_SETALPHA      0x02 /* ...setting the alpha blending factor */
00440 #define LCD_DEVFUNC_SETPOS        0x03 /* ...setting the layer position */
00441 #define LCD_DEVFUNC_GETPOS        0x04 /* ...getting the layer position */
00442 #define LCD_DEVFUNC_SETSIZE       0x05 /* ...setting the layer size */
00443 #define LCD_DEVFUNC_SETVIS        0x06 /* ...setting the visibility of a layer */
00444 #define LCD_DEVFUNC_24BPP         0x07 /* ...drawing 24bpp bitmaps */
00445 #define LCD_DEVFUNC_NEXT_PIXEL    0x08 /* ...drawing a bitmap pixel by pixel */
00446 #define LCD_DEVFUNC_SET_VRAM_ADDR 0x09 /* ...setting the VRAM address */
00447 #define LCD_DEVFUNC_SET_VSIZE     0x0A /* ...setting the VRAM size */
00448 #define LCD_DEVFUNC_SET_SIZE      0x0B /* ...setting the display size */
00449 #define LCD_DEVFUNC_INIT          0x0C /* ...initializing the display controller */
00450 #define LCD_DEVFUNC_CONTROLCACHE  0x0D /* ...controlling the cache */
00451 #define LCD_DEVFUNC_ON            0x0E /* ...switching the display on */
00452 #define LCD_DEVFUNC_OFF           0x0F /* ...switching the display off */
00453 #define LCD_DEVFUNC_SETLUTENTRY   0x10 /* ...setting a LUT entry */
00454 #define LCD_DEVFUNC_FILLPOLY      0x11 /* ...filling a polygon */
00455 #define LCD_DEVFUNC_FILLPOLYAA    0x12 /* ...filling an antialiased polygon */
00456 #define LCD_DEVFUNC_ALPHAMODE     0x13 /* ...setting the alpha blending mode */
00457 #define LCD_DEVFUNC_CHROMAMODE    0x14 /* ...setting the chroma blending mode */
00458 #define LCD_DEVFUNC_CHROMA        0x15 /* ...setting the chroma values */
00459 #define LCD_DEVFUNC_SETFUNC       0x16 /* ...setting a function pointer */
00460 #define LCD_DEVFUNC_REFRESH       0x17 /* ...refreshing the display */
00461 #define LCD_DEVFUNC_SETRECT       0x18 /* ...setting the drawing rectangle */
00462                                        /* Setting a function pointer for... */
00463 #define LCD_DEVFUNC_FILLRECT      0x19 /* ...filling a rectangular area */
00464 #define LCD_DEVFUNC_DRAWBMP_1BPP  0x20 /* ...drawing a 1bpp bitmap */
00465 #define LCD_DEVFUNC_COPYBUFFER    0x21 /* ...copying complete frame buffers */
00466 #define LCD_DEVFUNC_SHOWBUFFER    0x22 /* ...shows the given buffer */
00467 #define LCD_DEVFUNC_COPYRECT      0x23 /* ...filling a rectangular area */
00468 #define LCD_DEVFUNC_DRAWBMP_16BPP 0x24 /* ...drawing a 16bpp bitmap */
00469 #define LCD_DEVFUNC_DRAWBMP_8BPP  0x25 /* ...drawing a 8bpp bitmap */
00470 #define LCD_DEVFUNC_READPIXEL     0x26 /* ...reading a pixel index */
00471 #define LCD_DEVFUNC_READMPIXELS   0x27 /* ...reading multiple pixel indices */
00472 #define LCD_DEVFUNC_DRAWBMP_32BPP 0x28 /* ...drawing a 32bpp bitmap */
00473 #define LCD_DEVFUNC_SET_BUFFERPTR 0x29 /* ...setting an array of buffer pointers */
00474 #define LCD_DEVFUNC_EXIT          0x30 /* ...free memory and shut down controller */
00475 
00476 /*********************************************************************
00477 *
00478 *       Values for requesting function pointers (memory devices)
00479 */
00480                                           /* Request of a function pointer for... */
00481 #define MEMDEV_DEVFUNC_WRITETOACTIVE 0x16 /* ...writing the memory device */
00482 
00483 /*********************************************************************
00484 *
00485 *       Values for requesting data
00486 */
00487                                        /* Request pointer to... */
00488 #define LCD_DEVDATA_MEMDEV        0x01 /* ...default memory device API */
00489 #define LCD_DEVDATA_PHYSPAL       0x02 /* ...physical palette */
00490 #define LCD_DEVDATA_VRAMADDR      0x03 /* ...VRAM address */
00491 
00492 /*********************************************************************
00493 *
00494 *       Structures for passing data to LCD_X_DisplayDriver()
00495 */
00496 typedef struct {
00497   void * pVRAM;
00498 } LCD_X_SETVRAMADDR_INFO;
00499 
00500 typedef struct {
00501   int xPos, yPos;
00502 } LCD_X_SETORG_INFO;
00503 
00504 typedef struct {
00505   LCD_COLOR Color;
00506   U8 Pos;
00507 } LCD_X_SETLUTENTRY_INFO;
00508 
00509 typedef struct {
00510   int xSize, ySize;
00511 } LCD_X_SETSIZE_INFO;
00512 
00513 typedef struct {
00514   int xPos, yPos;
00515   int xLen, yLen;
00516   int BytesPerPixel;
00517   U32 Off;
00518 } LCD_X_SETPOS_INFO;
00519 
00520 typedef struct {
00521   int Alpha;
00522 } LCD_X_SETALPHA_INFO;
00523 
00524 typedef struct {
00525   int OnOff;
00526 } LCD_X_SETVIS_INFO;
00527 
00528 typedef struct {
00529   int AlphaMode;
00530 } LCD_X_SETALPHAMODE_INFO;
00531 
00532 typedef struct {
00533   int ChromaMode;
00534 } LCD_X_SETCHROMAMODE_INFO;
00535 
00536 typedef struct {
00537   LCD_COLOR ChromaMin;
00538   LCD_COLOR ChromaMax;
00539 } LCD_X_SETCHROMA_INFO;
00540 
00541 typedef struct {
00542   int Index;
00543 } LCD_X_SHOWBUFFER_INFO;
00544 
00545 /*********************************************************************
00546 *
00547 *       Commands for LCD_X_DisplayDriver()
00548 */
00549 #define LCD_X_INITCONTROLLER 0x01 /* Initializing the display controller */
00550 #define LCD_X_SETVRAMADDR    0x02 /* Setting the video RAM address */
00551 #define LCD_X_SETORG         0x03 /* Setting the origin within a layer */
00552 #define LCD_X_SETLUTENTRY    0x04 /* Setting an entry of the LUT */
00553 #define LCD_X_ON             0x05 /* Switching the display on */
00554 #define LCD_X_OFF            0x06 /* Switching the display off */
00555 #define LCD_X_SETSIZE        0x07 /* Setting the layer size */
00556 #define LCD_X_SETPOS         0x08 /* Setting the layer position */
00557 #define LCD_X_SETVIS         0x09 /* Setting the visibility of a layer */
00558 #define LCD_X_SETALPHA       0x0A /* Setting the alpha value of the layer */
00559 #define LCD_X_SETALPHAMODE   0x0B /* Setting the alpha blending mode */
00560 #define LCD_X_SETCHROMAMODE  0x0C /* Setting the chroma blending mode */
00561 #define LCD_X_SETCHROMA      0x0D /* Setting the chroma values */
00562 #define LCD_X_SHOWBUFFER     0x0E /* Switching to the given buffer */
00563 
00564 int  LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData);
00565 void LCD_X_Config(void);
00566 
00567 /*********************************************************************
00568 *
00569 *       Get/Set layer properties
00570 */
00571 int  LCD_GetPosEx       (int LayerIndex, int * pxPos, int * pyPos);
00572 int  LCD_OffEx          (int LayerIndex);
00573 int  LCD_OnEx           (int LayerIndex);
00574 int  LCD_RefreshEx      (int LayerIndex);
00575 int  LCD_SetAlphaEx     (int LayerIndex, int Alpha);
00576 int  LCD_SetAlphaModeEx (int LayerIndex, int AlphaMode);
00577 int  LCD_SetBufferPtrEx (int LayerIndex, void ** pBufferPTR);
00578 int  LCD_SetChromaEx    (int LayerIndex, LCD_COLOR ChromaMin, LCD_COLOR ChromaMax);
00579 int  LCD_SetChromaModeEx(int LayerIndex, int ChromaMode);
00580 int  LCD_SetDevFunc     (int LayerIndex, int IdFunc, void (* pDriverFunc)(void));
00581 int  LCD_SetLUTEntryEx  (int LayerIndex, U8 Pos, LCD_COLOR Color);
00582 int  LCD_SetPosEx       (int LayerIndex, int xPos, int yPos);
00583 int  LCD_SetSizeEx      (int LayerIndex, int xSize, int ySize);
00584 int  LCD_SetVisEx       (int LayerIndex, int OnOff);
00585 int  LCD_SetVRAMAddrEx  (int LayerIndex, void * pVRAM);
00586 int  LCD_SetVSizeEx     (int LayerIndex, int xSize, int ySize);
00587 
00588 int  LCD_GetPos         (int * pxPos, int * pyPos);
00589 int  LCD_Off            (void);
00590 int  LCD_On             (void);
00591 int  LCD_Refresh        (void);
00592 int  LCD_SetAlpha       (int Alpha);
00593 int  LCD_SetAlphaMode   (int AlphaMode);
00594 int  LCD_SetBufferPtr   (void ** pBufferPTR);
00595 int  LCD_SetChroma      (LCD_COLOR ChromaMin, LCD_COLOR ChromaMax);
00596 int  LCD_SetChromaMode  (int ChromaMode);
00597 int  LCD_SetLUTEntry    (U8 Pos, LCD_COLOR Color);
00598 void LCD_SetOrg         (int xOrg, int yOrg);
00599 int  LCD_SetPos         (int xPos, int yPos);
00600 int  LCD_SetSize        (int xSize, int ySize);
00601 int  LCD_SetVis         (int OnOff);
00602 int  LCD_SetVRAMAddr    (void * pVRAM);
00603 int  LCD_SetVSize       (int xSize, int ySize);
00604 
00605 /*********************************************************************
00606 *
00607 *       NEXT_PIXEL API support
00608 */
00609 typedef struct {
00610   int  (* pfStart)   (int x0, int y0, int x1, int y1);
00611   void (* pfSetPixel)(LCD_PIXELINDEX PixelIndex);
00612   void (* pfNextLine)(void);
00613   void (* pfEnd)     (void);
00614 } LCD_API_NEXT_PIXEL;
00615 
00616 LCD_API_NEXT_PIXEL * LCD_GetNextPixelAPI(void);
00617 
00618 /*********************************************************************
00619 *
00620 *      LCD_CLIP function table
00621 */
00622 typedef void tLCD_HL_DrawHLine    (int x0, int y0,  int x1);
00623 typedef void tLCD_HL_DrawPixel    (int x0, int y0);
00624 
00625 typedef struct {
00626   tLCD_HL_DrawHLine * pfDrawHLine;
00627   tLCD_HL_DrawPixel * pfDrawPixel;
00628 } tLCD_HL_APIList;
00629 
00630 void LCD_DrawHLine(int x0, int y0,  int x1);
00631 void LCD_DrawPixel(int x0, int y0);
00632 void LCD_DrawVLine(int x,  int y0,  int y1);
00633 
00634 
00635 /*********************************************************************
00636 *
00637 *       Declarations for LCD_
00638 */
00639 void LCD_SetClipRectEx(const LCD_RECT * pRect);
00640 void LCD_SetClipRectMax(void);
00641 
00642 /* Get device capabilities (0 if not supported) */
00643 I32  LCD_GetDevCap  (int Index);
00644 I32  LCD_GetDevCapEx(int LayerIndex, int Index);
00645 
00646 /* Initialize LCD using config-parameters */
00647 int LCD_Init(void);
00648 int LCD_InitColors(void);
00649 int LCD_InitEx(GUI_DEVICE * pDevice, int ClearScreen);
00650 int LCD_ExitEx(int LayerIndex);
00651 
00652 void LCD_SetBkColor   (LCD_COLOR Color); /* Set background color */
00653 void LCD_SetColor     (LCD_COLOR Color); /* Set foreground color */
00654 void LCD_SetPixelIndex(int x, int y, int ColorIndex);
00655 
00656 /* Palette routines (Not available on all drivers) */
00657 void LCD_InitLUT(void);
00658 void LCD_SetLUTEx(int LayerIndex, const LCD_PHYSPALETTE * pPalette);
00659 void LCD_SetLUT  (const LCD_PHYSPALETTE * pPalette);
00660 
00661 LCD_DRAWMODE LCD_SetDrawMode  (LCD_DRAWMODE dm);
00662 void LCD_SetColorIndex(unsigned PixelIndex);
00663 void LCD_SetBkColorIndex(unsigned PixelIndex);
00664 void LCD_FillRect(int x0, int y0, int x1, int y1);
00665 typedef void tLCD_SetPixelAA(int x, int y, U8 Intens);
00666 
00667 void LCD_SetPixelAA4_Trans  (int x, int y, U8 Intens);
00668 void LCD_SetPixelAA4_NoTrans(int x, int y, U8 Intens);
00669 
00670 void LCD_SetPixelAA8_Trans  (int x, int y, U8 Intens);
00671 void LCD_SetPixelAA8_NoTrans(int x, int y, U8 Intens);
00672 
00673 void LCD_AA_EnableGamma(int OnOff);
00674 void LCD_AA_SetGamma   (U8 * pGamma);
00675 void LCD_AA_GetGamma   (U8 * pGamma);
00676 
00677 LCD_COLOR    LCD_AA_MixColors16 (LCD_COLOR Color, LCD_COLOR BkColor, U8 Intens);
00678 LCD_COLOR    LCD_AA_MixColors256(LCD_COLOR Color, LCD_COLOR BkColor, U8 Intens);
00679 LCD_COLOR    LCD_MixColors256   (LCD_COLOR Color, LCD_COLOR BkColor, unsigned Intens);
00680 LCD_COLOR    LCD_GetPixelColor(int x, int y);     /* Get RGB color of pixel */
00681 unsigned int LCD_GetPixelIndex(int x, int y);
00682 int          LCD_GetBkColorIndex (void);
00683 int          LCD_GetColorIndex (void);
00684 #if (GUI_USE_ARGB)
00685 U32          LCD_AA_SetOrMask(U32 OrMask);
00686 #else
00687 U32          LCD_AA_SetAndMask(U32 AndMask);
00688 #endif
00689 
00690 /* Configuration */
00691 int  LCD_SetMaxNumColors(unsigned MaxNumColors);
00692 int  LCD_GetMaxNumColors(void);
00693 void LCD__SetPaletteConversionHook(void (* pfPaletteConversionHook)(const LCD_LOGPALETTE * pLogPal));
00694 
00695 /*********************************************************************
00696 *
00697 *       Optional support for rotation
00698 */
00699 #if GUI_SUPPORT_ROTATION
00700 
00701 typedef void tLCD_DrawBitmap(int x0, int y0, int xsize, int ysize,
00702                              int xMul, int yMul, int BitsPerPixel, int BytesPerLine,
00703                              const U8 * pPixel, const void * pTrans);
00704 typedef void tRect2TextRect (LCD_RECT * pRect);
00705 
00706 struct tLCD_APIList_struct {
00707   tLCD_DrawBitmap   * pfDrawBitmap;
00708   tRect2TextRect    * pfRect2TextRect;
00709   tRect2TextRect    * pfTransformRect;
00710 };
00711 
00712 typedef struct tLCD_APIList_struct tLCD_APIList;
00713 
00714 extern tLCD_APIList LCD_APIListCCW;
00715 extern tLCD_APIList LCD_APIListCW;
00716 extern tLCD_APIList LCD_APIList180;
00717 
00718 #define GUI_ROTATION   tLCD_APIList
00719 #define GUI_ROTATE_CCW &LCD_APIListCCW
00720 #define GUI_ROTATE_CW  &LCD_APIListCW
00721 #define GUI_ROTATE_180 &LCD_APIList180
00722 #define GUI_ROTATE_0   0
00723 
00724 tLCD_SetPixelAA * LCD__GetPfSetPixel(int BitsPerPixel);
00725 
00726 #endif
00727 
00728 /*********************************************************************
00729 *
00730 *       Physical color access, internally used only
00731 */
00732 void LCD__SetPhysColor(U8 Pos, LCD_COLOR Color);
00733 
00734 /*********************************************************************
00735 *
00736 *       Cache control
00737 */
00738 #define LCD_CC_UNLOCK (0)    /* Default mode: Cache is transparent */
00739 #define LCD_CC_LOCK   (1)    /* Cache is locked, no write operations */
00740 #define LCD_CC_FLUSH  (2)    /* Flush cache, do not change mode */
00741 
00742 int LCD_ControlCache  (int Cmd);
00743 int LCD_ControlCacheEx(int LayerIndex, int Cmd);
00744 
00745 /*********************************************************************
00746 *
00747 *       Color conversion
00748 */
00749 LCD_PIXELINDEX   LCD_Color2Index     (LCD_COLOR Color);
00750 LCD_COLOR        LCD_Index2Color     (int Index);
00751 LCD_COLOR        LCD_Index2ColorEx   (int i, unsigned LayerIndex);
00752 
00753 /*********************************************************************
00754 *
00755 *       LCD_X_...
00756 */
00757 unsigned char LCD_X_Read00(void);
00758 unsigned char LCD_X_Read01(void);
00759 void LCD_X_Write00 (unsigned char c);
00760 void LCD_X_Write01 (unsigned char c);
00761 void LCD_X_WriteM01(unsigned char * pData, int NumBytes);
00762 
00763 #if defined(__cplusplus)
00764   }
00765 #endif
00766 
00767 #endif /* LCD_H */
00768 
00769 /*************************** End of file ****************************/