NuMaker emWin HMI

Committer:
csyang2
Date:
Mon Mar 04 15:47:41 2024 +0800
Revision:
10:c8165817d92a
Parent:
1:c0f972361605
Support NuMaker-IoT-M467

Who changed what in which revision?

UserRevisionLine numberNew contents of line
csyang2 1:c0f972361605 1 /*********************************************************************
csyang2 1:c0f972361605 2 * SEGGER Software GmbH *
csyang2 1:c0f972361605 3 * Solutions for real time microcontroller applications *
csyang2 1:c0f972361605 4 **********************************************************************
csyang2 1:c0f972361605 5 * *
csyang2 1:c0f972361605 6 * (c) 1996 - 2018 SEGGER Microcontroller GmbH *
csyang2 1:c0f972361605 7 * *
csyang2 1:c0f972361605 8 * Internet: www.segger.com Support: support@segger.com *
csyang2 1:c0f972361605 9 * *
csyang2 1:c0f972361605 10 **********************************************************************
csyang2 1:c0f972361605 11
csyang2 1:c0f972361605 12 ** emWin V5.48 - Graphical user interface for embedded applications **
csyang2 1:c0f972361605 13 All Intellectual Property rights in the Software belongs to SEGGER.
csyang2 1:c0f972361605 14 emWin is protected by international copyright laws. Knowledge of the
csyang2 1:c0f972361605 15 source code may not be used to write a similar product. This file may
csyang2 1:c0f972361605 16 only be used in accordance with the following terms:
csyang2 1:c0f972361605 17
csyang2 1:c0f972361605 18 The software has been licensed by SEGGER Software GmbH to Nuvoton Technology Corporationat the address: No. 4, Creation Rd. III, Hsinchu Science Park, Taiwan
csyang2 1:c0f972361605 19 for the purposes of creating libraries for its
csyang2 1:c0f972361605 20 Arm Cortex-M and Arm9 32-bit microcontrollers, commercialized and distributed by Nuvoton Technology Corporation
csyang2 1:c0f972361605 21 under the terms and conditions of an End User
csyang2 1:c0f972361605 22 License Agreement supplied with the libraries.
csyang2 1:c0f972361605 23 Full source code is available at: www.segger.com
csyang2 1:c0f972361605 24
csyang2 1:c0f972361605 25 We appreciate your understanding and fairness.
csyang2 1:c0f972361605 26 ----------------------------------------------------------------------
csyang2 1:c0f972361605 27 Licensing information
csyang2 1:c0f972361605 28 Licensor: SEGGER Software GmbH
csyang2 1:c0f972361605 29 Licensed to: Nuvoton Technology Corporation, No. 4, Creation Rd. III, Hsinchu Science Park, 30077 Hsinchu City, Taiwan
csyang2 1:c0f972361605 30 Licensed SEGGER software: emWin
csyang2 1:c0f972361605 31 License number: GUI-00735
csyang2 1:c0f972361605 32 License model: emWin License Agreement, signed February 27, 2018
csyang2 1:c0f972361605 33 Licensed platform: Cortex-M and ARM9 32-bit series microcontroller designed and manufactured by or for Nuvoton Technology Corporation
csyang2 1:c0f972361605 34 ----------------------------------------------------------------------
csyang2 1:c0f972361605 35 Support and Update Agreement (SUA)
csyang2 1:c0f972361605 36 SUA period: 2018-03-26 - 2019-03-27
csyang2 1:c0f972361605 37 Contact to extend SUA: sales@segger.com
csyang2 1:c0f972361605 38 ----------------------------------------------------------------------
csyang2 1:c0f972361605 39 File : LCD.h
csyang2 1:c0f972361605 40 Purpose : Declares LCD interface functions
csyang2 1:c0f972361605 41 ----------------------------------------------------------------------
csyang2 1:c0f972361605 42 */
csyang2 1:c0f972361605 43
csyang2 1:c0f972361605 44 #ifndef LCD_H
csyang2 1:c0f972361605 45 #define LCD_H
csyang2 1:c0f972361605 46
csyang2 1:c0f972361605 47 #include "GUI_ConfDefaults.h" /* Used for GUI_CONST_STORAGE */
csyang2 1:c0f972361605 48 #include "Global.h"
csyang2 1:c0f972361605 49
csyang2 1:c0f972361605 50 #if defined(__cplusplus)
csyang2 1:c0f972361605 51 extern "C" { /* Make sure we have C-declarations in C++ programs */
csyang2 1:c0f972361605 52 #endif
csyang2 1:c0f972361605 53
csyang2 1:c0f972361605 54 /*********************************************************************
csyang2 1:c0f972361605 55 *
csyang2 1:c0f972361605 56 * Basic type defines
csyang2 1:c0f972361605 57 *
csyang2 1:c0f972361605 58 * The follwing are defines for types used in the LCD-driver and the
csyang2 1:c0f972361605 59 * GUI layers on top of that. Since "C" does not provide data types of
csyang2 1:c0f972361605 60 * fixed length which are identical on all platforms, this is done here.
csyang2 1:c0f972361605 61 * For most 16/32 controllers, the settings will work fine. However, if
csyang2 1:c0f972361605 62 * you have similar defines in other sections of your program, you might
csyang2 1:c0f972361605 63 * want to change or relocate these defines, e.g. in a TYPE.h file.
csyang2 1:c0f972361605 64 */
csyang2 1:c0f972361605 65 #define I16P I16 /* signed 16 bits OR MORE ! */
csyang2 1:c0f972361605 66 #define U16P U16 /* unsigned 16 bits OR MORE ! */
csyang2 1:c0f972361605 67
csyang2 1:c0f972361605 68 /*********************************************************************
csyang2 1:c0f972361605 69 *
csyang2 1:c0f972361605 70 * Settings for windows simulation
csyang2 1:c0f972361605 71 *
csyang2 1:c0f972361605 72 * Some settings in the configuration may conflict with the values required
csyang2 1:c0f972361605 73 * in the Simulation. This is why we ignore the target settings for data
csyang2 1:c0f972361605 74 * types and use the correct settings for the simulation.
csyang2 1:c0f972361605 75 * (U32 could be defined as long, which would yield a 64 bit type on
csyang2 1:c0f972361605 76 * the PC)
csyang2 1:c0f972361605 77 */
csyang2 1:c0f972361605 78 #ifdef WIN32
csyang2 1:c0f972361605 79 #pragma warning( disable : 4244 ) // Disable warning messages in simulation
csyang2 1:c0f972361605 80 #pragma warning( disable : 4761 ) // Disable warning "integral size mismatch in argument; conversion supplied"
csyang2 1:c0f972361605 81 #endif
csyang2 1:c0f972361605 82
csyang2 1:c0f972361605 83 /*********************************************************************
csyang2 1:c0f972361605 84 *
csyang2 1:c0f972361605 85 * Constants
csyang2 1:c0f972361605 86 */
csyang2 1:c0f972361605 87 #define LCD_ERR0 (0x10)
csyang2 1:c0f972361605 88 #define LCD_ERR_CONTROLLER_NOT_FOUND (LCD_ERR0+1)
csyang2 1:c0f972361605 89 #define LCD_ERR_MEMORY (LCD_ERR0+2)
csyang2 1:c0f972361605 90
csyang2 1:c0f972361605 91 /*********************************************************************
csyang2 1:c0f972361605 92 *
csyang2 1:c0f972361605 93 * Drawing modes
csyang2 1:c0f972361605 94 */
csyang2 1:c0f972361605 95 #define LCD_DRAWMODE_NORMAL (0)
csyang2 1:c0f972361605 96 #define LCD_DRAWMODE_XOR (1<<0)
csyang2 1:c0f972361605 97 #define LCD_DRAWMODE_TRANS (1<<1)
csyang2 1:c0f972361605 98 #define LCD_DRAWMODE_REV (1<<2)
csyang2 1:c0f972361605 99
csyang2 1:c0f972361605 100 /*********************************************************************
csyang2 1:c0f972361605 101 *
csyang2 1:c0f972361605 102 * Typedefs
csyang2 1:c0f972361605 103 */
csyang2 1:c0f972361605 104 typedef int LCD_DRAWMODE;
csyang2 1:c0f972361605 105 typedef U32 LCD_COLOR;
csyang2 1:c0f972361605 106
csyang2 1:c0f972361605 107 /*********************************************************************
csyang2 1:c0f972361605 108 *
csyang2 1:c0f972361605 109 * Data structures
csyang2 1:c0f972361605 110 */
csyang2 1:c0f972361605 111 typedef struct { I16P x,y; } GUI_POINT;
csyang2 1:c0f972361605 112 typedef struct { I16 x0,y0,x1,y1; } LCD_RECT;
csyang2 1:c0f972361605 113
csyang2 1:c0f972361605 114 typedef struct {
csyang2 1:c0f972361605 115 int NumEntries;
csyang2 1:c0f972361605 116 char HasTrans;
csyang2 1:c0f972361605 117 const LCD_COLOR * pPalEntries;
csyang2 1:c0f972361605 118 } LCD_LOGPALETTE;
csyang2 1:c0f972361605 119
csyang2 1:c0f972361605 120 /* This is used for the simulation only ! */
csyang2 1:c0f972361605 121 typedef struct {
csyang2 1:c0f972361605 122 int x,y;
csyang2 1:c0f972361605 123 unsigned char KeyStat;
csyang2 1:c0f972361605 124 } LCD_tMouseState;
csyang2 1:c0f972361605 125
csyang2 1:c0f972361605 126 typedef struct {
csyang2 1:c0f972361605 127 int NumEntries;
csyang2 1:c0f972361605 128 const LCD_COLOR * pPalEntries;
csyang2 1:c0f972361605 129 } LCD_PHYSPALETTE;
csyang2 1:c0f972361605 130
csyang2 1:c0f972361605 131 /*********************************************************************
csyang2 1:c0f972361605 132 *
csyang2 1:c0f972361605 133 * LCD_L0_... color conversion
csyang2 1:c0f972361605 134 */
csyang2 1:c0f972361605 135 typedef LCD_COLOR tLCDDEV_Index2Color (LCD_PIXELINDEX Index);
csyang2 1:c0f972361605 136 typedef LCD_PIXELINDEX tLCDDEV_Color2Index (LCD_COLOR Color);
csyang2 1:c0f972361605 137 typedef LCD_PIXELINDEX tLCDDEV_GetIndexMask (void);
csyang2 1:c0f972361605 138
csyang2 1:c0f972361605 139 typedef void tLCDDEV_Index2ColorBulk(void * pIndex, LCD_COLOR * pColor, U32 NumItems, U8 SizeOfIndex);
csyang2 1:c0f972361605 140 typedef void tLCDDEV_Color2IndexBulk(LCD_COLOR * pColor, void * pIndex, U32 NumItems, U8 SizeOfIndex);
csyang2 1:c0f972361605 141
csyang2 1:c0f972361605 142 /*********************************************************************
csyang2 1:c0f972361605 143 *
csyang2 1:c0f972361605 144 * Color conversion API tables
csyang2 1:c0f972361605 145 */
csyang2 1:c0f972361605 146 typedef struct {
csyang2 1:c0f972361605 147 tLCDDEV_Color2Index * pfColor2Index;
csyang2 1:c0f972361605 148 tLCDDEV_Index2Color * pfIndex2Color;
csyang2 1:c0f972361605 149 tLCDDEV_GetIndexMask * pfGetIndexMask;
csyang2 1:c0f972361605 150 int NoAlpha;
csyang2 1:c0f972361605 151 tLCDDEV_Color2IndexBulk * pfColor2IndexBulk;
csyang2 1:c0f972361605 152 tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk;
csyang2 1:c0f972361605 153 } LCD_API_COLOR_CONV;
csyang2 1:c0f972361605 154
csyang2 1:c0f972361605 155 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_0;
csyang2 1:c0f972361605 156 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1;
csyang2 1:c0f972361605 157 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_2;
csyang2 1:c0f972361605 158 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_4;
csyang2 1:c0f972361605 159 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_5;
csyang2 1:c0f972361605 160 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_8;
csyang2 1:c0f972361605 161 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_16;
csyang2 1:c0f972361605 162 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1_24;
csyang2 1:c0f972361605 163 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_2;
csyang2 1:c0f972361605 164 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_4;
csyang2 1:c0f972361605 165 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_5;
csyang2 1:c0f972361605 166 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_6;
csyang2 1:c0f972361605 167 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8;
csyang2 1:c0f972361605 168 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_16;
csyang2 1:c0f972361605 169 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_1616I;
csyang2 1:c0f972361605 170 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_111;
csyang2 1:c0f972361605 171 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_222;
csyang2 1:c0f972361605 172 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_233;
csyang2 1:c0f972361605 173 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_323;
csyang2 1:c0f972361605 174 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_332;
csyang2 1:c0f972361605 175 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_444_12;
csyang2 1:c0f972361605 176 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_444_12_1;
csyang2 1:c0f972361605 177 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_444_16;
csyang2 1:c0f972361605 178 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_555;
csyang2 1:c0f972361605 179 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_565;
csyang2 1:c0f972361605 180 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_556;
csyang2 1:c0f972361605 181 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_655;
csyang2 1:c0f972361605 182 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_666;
csyang2 1:c0f972361605 183 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_666_9;
csyang2 1:c0f972361605 184 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_822216;
csyang2 1:c0f972361605 185 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_84444;
csyang2 1:c0f972361605 186 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8666;
csyang2 1:c0f972361605 187 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8666_1;
csyang2 1:c0f972361605 188 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_88666I;
csyang2 1:c0f972361605 189 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_888;
csyang2 1:c0f972361605 190 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_8888;
csyang2 1:c0f972361605 191 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M111;
csyang2 1:c0f972361605 192 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M1555I;
csyang2 1:c0f972361605 193 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M222;
csyang2 1:c0f972361605 194 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M233;
csyang2 1:c0f972361605 195 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M323;
csyang2 1:c0f972361605 196 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M332;
csyang2 1:c0f972361605 197 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M4444I;
csyang2 1:c0f972361605 198 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M444_12;
csyang2 1:c0f972361605 199 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M444_12_1;
csyang2 1:c0f972361605 200 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M444_16;
csyang2 1:c0f972361605 201 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M555;
csyang2 1:c0f972361605 202 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M565;
csyang2 1:c0f972361605 203 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M556;
csyang2 1:c0f972361605 204 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M655;
csyang2 1:c0f972361605 205 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M666;
csyang2 1:c0f972361605 206 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M666_9;
csyang2 1:c0f972361605 207 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M8565;
csyang2 1:c0f972361605 208 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M888;
csyang2 1:c0f972361605 209 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M8888;
csyang2 1:c0f972361605 210 extern const LCD_API_COLOR_CONV LCD_API_ColorConv_M8888I;
csyang2 1:c0f972361605 211
csyang2 1:c0f972361605 212 #define GUICC_0 &LCD_API_ColorConv_0
csyang2 1:c0f972361605 213 #define GUICC_1 &LCD_API_ColorConv_1
csyang2 1:c0f972361605 214 #define GUICC_1_2 &LCD_API_ColorConv_1_2
csyang2 1:c0f972361605 215 #define GUICC_1_4 &LCD_API_ColorConv_1_4
csyang2 1:c0f972361605 216 #define GUICC_1_5 &LCD_API_ColorConv_1_5
csyang2 1:c0f972361605 217 #define GUICC_1_8 &LCD_API_ColorConv_1_8
csyang2 1:c0f972361605 218 #define GUICC_1_16 &LCD_API_ColorConv_1_16
csyang2 1:c0f972361605 219 #define GUICC_1_24 &LCD_API_ColorConv_1_24
csyang2 1:c0f972361605 220 #define GUICC_2 &LCD_API_ColorConv_2
csyang2 1:c0f972361605 221 #define GUICC_4 &LCD_API_ColorConv_4
csyang2 1:c0f972361605 222 #define GUICC_5 &LCD_API_ColorConv_5
csyang2 1:c0f972361605 223 #define GUICC_6 &LCD_API_ColorConv_6
csyang2 1:c0f972361605 224 #define GUICC_8 &LCD_API_ColorConv_8
csyang2 1:c0f972361605 225 #define GUICC_16 &LCD_API_ColorConv_16
csyang2 1:c0f972361605 226 #define GUICC_1616I &LCD_API_ColorConv_1616I
csyang2 1:c0f972361605 227 #define GUICC_111 &LCD_API_ColorConv_111
csyang2 1:c0f972361605 228 #define GUICC_222 &LCD_API_ColorConv_222
csyang2 1:c0f972361605 229 #define GUICC_233 &LCD_API_ColorConv_233
csyang2 1:c0f972361605 230 #define GUICC_323 &LCD_API_ColorConv_323
csyang2 1:c0f972361605 231 #define GUICC_332 &LCD_API_ColorConv_332
csyang2 1:c0f972361605 232 #define GUICC_M4444I &LCD_API_ColorConv_M4444I
csyang2 1:c0f972361605 233 #define GUICC_444_12 &LCD_API_ColorConv_444_12
csyang2 1:c0f972361605 234 #define GUICC_444_12_1 &LCD_API_ColorConv_444_12_1
csyang2 1:c0f972361605 235 #define GUICC_444_16 &LCD_API_ColorConv_444_16
csyang2 1:c0f972361605 236 #define GUICC_555 &LCD_API_ColorConv_555
csyang2 1:c0f972361605 237 #define GUICC_565 &LCD_API_ColorConv_565
csyang2 1:c0f972361605 238 #define GUICC_556 &LCD_API_ColorConv_556
csyang2 1:c0f972361605 239 #define GUICC_655 &LCD_API_ColorConv_655
csyang2 1:c0f972361605 240 #define GUICC_666 &LCD_API_ColorConv_666
csyang2 1:c0f972361605 241 #define GUICC_666_9 &LCD_API_ColorConv_666_9
csyang2 1:c0f972361605 242 #define GUICC_822216 &LCD_API_ColorConv_822216
csyang2 1:c0f972361605 243 #define GUICC_84444 &LCD_API_ColorConv_84444
csyang2 1:c0f972361605 244 #define GUICC_8666 &LCD_API_ColorConv_8666
csyang2 1:c0f972361605 245 #define GUICC_8666_1 &LCD_API_ColorConv_8666_1
csyang2 1:c0f972361605 246 #define GUICC_88666I &LCD_API_ColorConv_88666I
csyang2 1:c0f972361605 247 #define GUICC_888 &LCD_API_ColorConv_888
csyang2 1:c0f972361605 248 #define GUICC_8888 &LCD_API_ColorConv_8888
csyang2 1:c0f972361605 249 #define GUICC_M111 &LCD_API_ColorConv_M111
csyang2 1:c0f972361605 250 #define GUICC_M1555I &LCD_API_ColorConv_M1555I
csyang2 1:c0f972361605 251 #define GUICC_M222 &LCD_API_ColorConv_M222
csyang2 1:c0f972361605 252 #define GUICC_M233 &LCD_API_ColorConv_M233
csyang2 1:c0f972361605 253 #define GUICC_M323 &LCD_API_ColorConv_M323
csyang2 1:c0f972361605 254 #define GUICC_M332 &LCD_API_ColorConv_M332
csyang2 1:c0f972361605 255 #define GUICC_M444_12 &LCD_API_ColorConv_M444_12
csyang2 1:c0f972361605 256 #define GUICC_M444_12_1 &LCD_API_ColorConv_M444_12_1
csyang2 1:c0f972361605 257 #define GUICC_M444_16 &LCD_API_ColorConv_M444_16
csyang2 1:c0f972361605 258 #define GUICC_M555 &LCD_API_ColorConv_M555
csyang2 1:c0f972361605 259 #define GUICC_M565 &LCD_API_ColorConv_M565
csyang2 1:c0f972361605 260 #define GUICC_M556 &LCD_API_ColorConv_M556
csyang2 1:c0f972361605 261 #define GUICC_M655 &LCD_API_ColorConv_M655
csyang2 1:c0f972361605 262 #define GUICC_M666 &LCD_API_ColorConv_M666
csyang2 1:c0f972361605 263 #define GUICC_M666_9 &LCD_API_ColorConv_M666_9
csyang2 1:c0f972361605 264 #define GUICC_M8565 &LCD_API_ColorConv_M8565
csyang2 1:c0f972361605 265 #define GUICC_M888 &LCD_API_ColorConv_M888
csyang2 1:c0f972361605 266 #define GUICC_M8888 &LCD_API_ColorConv_M8888
csyang2 1:c0f972361605 267 #define GUICC_M8888I &LCD_API_ColorConv_M8888I
csyang2 1:c0f972361605 268
csyang2 1:c0f972361605 269 void GUICC_M1555I_SetCustColorConv(tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk);
csyang2 1:c0f972361605 270 void GUICC_M565_SetCustColorConv (tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk);
csyang2 1:c0f972361605 271 void GUICC_M4444I_SetCustColorConv(tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk);
csyang2 1:c0f972361605 272 void GUICC_M888_SetCustColorConv (tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk);
csyang2 1:c0f972361605 273 void GUICC_M8888I_SetCustColorConv(tLCDDEV_Color2IndexBulk * pfColor2IndexBulk, tLCDDEV_Index2ColorBulk * pfIndex2ColorBulk);
csyang2 1:c0f972361605 274
csyang2 1:c0f972361605 275 /*********************************************************************
csyang2 1:c0f972361605 276 *
csyang2 1:c0f972361605 277 * Compatibility defines for older versions
csyang2 1:c0f972361605 278 */
csyang2 1:c0f972361605 279 #define GUI_COLOR_CONV_1 GUICC_1
csyang2 1:c0f972361605 280 #define GUI_COLOR_CONV_2 GUICC_2
csyang2 1:c0f972361605 281 #define GUI_COLOR_CONV_4 GUICC_4
csyang2 1:c0f972361605 282 #define GUI_COLOR_CONV_8666 GUICC_8666
csyang2 1:c0f972361605 283 #define GUI_COLOR_CONV_888 GUICC_888
csyang2 1:c0f972361605 284 #define GUI_COLOR_CONV_8888 GUICC_8888
csyang2 1:c0f972361605 285 #define GUI_COLOR_CONV_565 GUICC_565
csyang2 1:c0f972361605 286 #define GUI_COLOR_CONV_M565 GUICC_M565
csyang2 1:c0f972361605 287
csyang2 1:c0f972361605 288 /*********************************************************************
csyang2 1:c0f972361605 289 *
csyang2 1:c0f972361605 290 * LCDDEV function table
csyang2 1:c0f972361605 291 *
csyang2 1:c0f972361605 292 * Below the routines which need to in an LCDDEV routine table are
csyang2 1:c0f972361605 293 * defined. All of these routines have to be in the low-level driver
csyang2 1:c0f972361605 294 * (LCD_L0) or in the memory device which can be used to replace the
csyang2 1:c0f972361605 295 * driver.
csyang2 1:c0f972361605 296 * The one exception to this is the SetClipRect routine, which would
csyang2 1:c0f972361605 297 * be identical for all drivers and is therefor contained in the
csyang2 1:c0f972361605 298 * level above (LCD).
csyang2 1:c0f972361605 299 */
csyang2 1:c0f972361605 300 typedef void tLCDDEV_DrawPixel (int x, int y);
csyang2 1:c0f972361605 301 typedef void tLCDDEV_DrawHLine (int x0, int y0, int x1);
csyang2 1:c0f972361605 302 typedef void tLCDDEV_DrawVLine (int x , int y0, int y1);
csyang2 1:c0f972361605 303 typedef void tLCDDEV_FillRect (int x0, int y0, int x1, int y1);
csyang2 1:c0f972361605 304 typedef unsigned int tLCDDEV_GetPixelIndex(int x, int y);
csyang2 1:c0f972361605 305 typedef void tLCDDEV_SetPixelIndex(int x, int y, int ColorIndex);
csyang2 1:c0f972361605 306 typedef void tLCDDEV_XorPixel (int x, int y);
csyang2 1:c0f972361605 307 typedef void tLCDDEV_FillPolygon (const GUI_POINT * pPoints, int NumPoints, int x0, int y0);
csyang2 1:c0f972361605 308 typedef void tLCDDEV_FillPolygonAA(const GUI_POINT * pPoints, int NumPoints, int x0, int y0);
csyang2 1:c0f972361605 309 typedef void tLCDDEV_GetRect (LCD_RECT * pRect);
csyang2 1:c0f972361605 310 typedef int tLCDDEV_Init (void);
csyang2 1:c0f972361605 311 typedef void tLCDDEV_On (void);
csyang2 1:c0f972361605 312 typedef void tLCDDEV_Off (void);
csyang2 1:c0f972361605 313 typedef void tLCDDEV_SetLUTEntry (U8 Pos, LCD_COLOR color);
csyang2 1:c0f972361605 314 typedef void * tLCDDEV_GetDevFunc (int Index);
csyang2 1:c0f972361605 315 typedef I32 tLCDDEV_GetDevProp (int Index);
csyang2 1:c0f972361605 316 typedef void tLCDDEV_SetOrg (int x, int y);
csyang2 1:c0f972361605 317
csyang2 1:c0f972361605 318 /*********************************************************************
csyang2 1:c0f972361605 319 *
csyang2 1:c0f972361605 320 * Memory device API tables
csyang2 1:c0f972361605 321 */
csyang2 1:c0f972361605 322 typedef struct GUI_DEVICE GUI_DEVICE;
csyang2 1:c0f972361605 323 typedef struct GUI_DEVICE_API GUI_DEVICE_API;
csyang2 1:c0f972361605 324
csyang2 1:c0f972361605 325 typedef void tLCDDEV_DrawBitmap (int x0, int y0, int xsize, int ysize,
csyang2 1:c0f972361605 326 int BitsPerPixel, int BytesPerLine,
csyang2 1:c0f972361605 327 const U8 * pData, int Diff,
csyang2 1:c0f972361605 328 const void * pTrans); /* Really LCD_PIXELINDEX, but is void to avoid compiler warnings */
csyang2 1:c0f972361605 329 #define GUI_MEMDEV_APILIST_1 &GUI_MEMDEV_DEVICE_1
csyang2 1:c0f972361605 330 #define GUI_MEMDEV_APILIST_8 &GUI_MEMDEV_DEVICE_8
csyang2 1:c0f972361605 331 #define GUI_MEMDEV_APILIST_16 &GUI_MEMDEV_DEVICE_16
csyang2 1:c0f972361605 332 #define GUI_MEMDEV_APILIST_32 &GUI_MEMDEV_DEVICE_32
csyang2 1:c0f972361605 333
csyang2 1:c0f972361605 334 /*********************************************************************
csyang2 1:c0f972361605 335 *
csyang2 1:c0f972361605 336 * Defines for device capabilities
csyang2 1:c0f972361605 337 *
csyang2 1:c0f972361605 338 * The following is the list of device capabilities which can, but do
csyang2 1:c0f972361605 339 * not have to be implemented in the driver. This way the driver can be
csyang2 1:c0f972361605 340 * enhanced in the future without affecting the driver interface,
csyang2 1:c0f972361605 341 * keeping older drivers compatible.
csyang2 1:c0f972361605 342 * More DevCaps can always be added in the future, as older drivers
csyang2 1:c0f972361605 343 * are guaranteed to return 0 for all unimplemented features or queries.
csyang2 1:c0f972361605 344 *
csyang2 1:c0f972361605 345 * The values below define the legal parameters to the LCD_GetDeviceCaps
csyang2 1:c0f972361605 346 * and the LCD_GetpCapFunc routines.
csyang2 1:c0f972361605 347 */
csyang2 1:c0f972361605 348
csyang2 1:c0f972361605 349 #define LCD_DEVCAP_XSIZE 0x01 /* Quest horiz. res. of display */
csyang2 1:c0f972361605 350 #define LCD_DEVCAP_YSIZE 0x02 /* Quest vert. res. of display */
csyang2 1:c0f972361605 351 #define LCD_DEVCAP_VXSIZE 0x03 /* Quest vert. res. of virtual disp.*/
csyang2 1:c0f972361605 352 #define LCD_DEVCAP_VYSIZE 0x04 /* Quest vert. res. of virtual disp.*/
csyang2 1:c0f972361605 353 #define LCD_DEVCAP_XORG 0x05 /* X-origin ... usually 0 */
csyang2 1:c0f972361605 354 #define LCD_DEVCAP_YORG 0x06 /* Y-origin ... usually 0 */
csyang2 1:c0f972361605 355 #define LCD_DEVCAP_CONTROLLER 0x07 /* LCD Controller (Numerical) */
csyang2 1:c0f972361605 356 #define LCD_DEVCAP_BITSPERPIXEL 0x08 /* Bits per pixel ... 1/2/4/8 */
csyang2 1:c0f972361605 357 #define LCD_DEVCAP_NUMCOLORS 0x09 /* Quest number of colors */
csyang2 1:c0f972361605 358 #define LCD_DEVCAP_XMAG 0x0A
csyang2 1:c0f972361605 359 #define LCD_DEVCAP_YMAG 0x0B
csyang2 1:c0f972361605 360 #define LCD_DEVCAP_MIRROR_X 0x0C
csyang2 1:c0f972361605 361 #define LCD_DEVCAP_MIRROR_Y 0x0D
csyang2 1:c0f972361605 362 #define LCD_DEVCAP_SWAP_XY 0x0E
csyang2 1:c0f972361605 363 #define LCD_DEVCAP_SWAP_RB 0x0F
csyang2 1:c0f972361605 364
csyang2 1:c0f972361605 365 int LCD_GetXSizeMax(void);
csyang2 1:c0f972361605 366 int LCD_GetYSizeMax(void);
csyang2 1:c0f972361605 367 int LCD_GetVXSizeMax(void);
csyang2 1:c0f972361605 368 int LCD_GetVYSizeMax(void);
csyang2 1:c0f972361605 369 int LCD_GetBitsPerPixelMax(void);
csyang2 1:c0f972361605 370 void LCD_SetDisplaySize(int xSizeDisplay, int ySizeDisplay);
csyang2 1:c0f972361605 371 int LCD_GetXSizeDisplay(void);
csyang2 1:c0f972361605 372 int LCD_GetYSizeDisplay(void);
csyang2 1:c0f972361605 373
csyang2 1:c0f972361605 374 int LCD_GetXSizeEx (int LayerIndex);
csyang2 1:c0f972361605 375 int LCD_GetYSizeEx (int LayerIndex);
csyang2 1:c0f972361605 376 int LCD_GetVXSizeEx (int LayerIndex);
csyang2 1:c0f972361605 377 int LCD_GetVYSizeEx (int LayerIndex);
csyang2 1:c0f972361605 378 int LCD_GetBitsPerPixelEx (int LayerIndex);
csyang2 1:c0f972361605 379 U32 LCD_GetNumColorsEx (int LayerIndex);
csyang2 1:c0f972361605 380 int LCD_GetXMagEx (int LayerIndex);
csyang2 1:c0f972361605 381 int LCD_GetYMagEx (int LayerIndex);
csyang2 1:c0f972361605 382 int LCD_GetMirrorXEx (int LayerIndex);
csyang2 1:c0f972361605 383 int LCD_GetMirrorYEx (int LayerIndex);
csyang2 1:c0f972361605 384 int LCD_GetSwapXYEx (int LayerIndex);
csyang2 1:c0f972361605 385 int LCD_GetReversLUTEx (int LayerIndex);
csyang2 1:c0f972361605 386 int LCD_GetPhysColorsInRAMEx(int LayerIndex);
csyang2 1:c0f972361605 387
csyang2 1:c0f972361605 388 int LCD_GetXSize (void);
csyang2 1:c0f972361605 389 int LCD_GetYSize (void);
csyang2 1:c0f972361605 390 int LCD_GetVXSize (void);
csyang2 1:c0f972361605 391 int LCD_GetVYSize (void);
csyang2 1:c0f972361605 392 int LCD_GetBitsPerPixel (void);
csyang2 1:c0f972361605 393 U32 LCD_GetNumColors (void);
csyang2 1:c0f972361605 394 int LCD_GetXMag (void);
csyang2 1:c0f972361605 395 int LCD_GetYMag (void);
csyang2 1:c0f972361605 396 int LCD_GetMirrorX (void);
csyang2 1:c0f972361605 397 int LCD_GetMirrorY (void);
csyang2 1:c0f972361605 398 int LCD_GetSwapXY (void);
csyang2 1:c0f972361605 399 int LCD_GetReversLUT (void);
csyang2 1:c0f972361605 400 int LCD_GetPhysColorsInRAM (void);
csyang2 1:c0f972361605 401
csyang2 1:c0f972361605 402 I32 LCD__GetBPP (U32 IndexMask);
csyang2 1:c0f972361605 403 I32 LCD__GetBPPDevice(U32 IndexMask);
csyang2 1:c0f972361605 404
csyang2 1:c0f972361605 405 tLCDDEV_Index2Color * LCD_GetpfIndex2ColorEx(int LayerIndex);
csyang2 1:c0f972361605 406 tLCDDEV_Color2Index * LCD_GetpfColor2IndexEx(int LayerIndex);
csyang2 1:c0f972361605 407
csyang2 1:c0f972361605 408 tLCDDEV_Color2Index * LCD_GetpfColor2Index(void);
csyang2 1:c0f972361605 409
csyang2 1:c0f972361605 410 int LCD_GetNumLayers(void);
csyang2 1:c0f972361605 411
csyang2 1:c0f972361605 412 LCD_COLOR * LCD_GetPalette (void);
csyang2 1:c0f972361605 413 LCD_COLOR * LCD_GetPaletteEx (int LayerIndex);
csyang2 1:c0f972361605 414 void * LCD_GetVRAMAddr (void);
csyang2 1:c0f972361605 415 void * LCD_GetVRAMAddrEx(int LayerIndex);
csyang2 1:c0f972361605 416
csyang2 1:c0f972361605 417 void (* LCD_GetDevFunc(int LayerIndex, int Item))(void);
csyang2 1:c0f972361605 418
csyang2 1:c0f972361605 419 /*********************************************************************
csyang2 1:c0f972361605 420 *
csyang2 1:c0f972361605 421 * Runtime rotation of drivers
csyang2 1:c0f972361605 422 */
csyang2 1:c0f972361605 423 int LCD_ROTATE_AddDriver (const GUI_DEVICE_API * pDriver);
csyang2 1:c0f972361605 424 int LCD_ROTATE_AddDriverEx(const GUI_DEVICE_API * pDeviceAPI, int LayerIndex);
csyang2 1:c0f972361605 425 int LCD_ROTATE_DecSel (void);
csyang2 1:c0f972361605 426 int LCD_ROTATE_DecSelEx (int LayerIndex);
csyang2 1:c0f972361605 427 int LCD_ROTATE_IncSel (void);
csyang2 1:c0f972361605 428 int LCD_ROTATE_IncSelEx (int LayerIndex);
csyang2 1:c0f972361605 429 int LCD_ROTATE_SetCallback(void (* pCbOnConfig)(GUI_DEVICE *, int, int), int LayerIndex);
csyang2 1:c0f972361605 430 int LCD_ROTATE_SetSel (int Index);
csyang2 1:c0f972361605 431 int LCD_ROTATE_SetSelEx (int Index, int LayerIndex);
csyang2 1:c0f972361605 432
csyang2 1:c0f972361605 433 /*********************************************************************
csyang2 1:c0f972361605 434 *
csyang2 1:c0f972361605 435 * Values for requesting and setting function pointers (display driver)
csyang2 1:c0f972361605 436 */
csyang2 1:c0f972361605 437 /* Request of a function pointer for... */
csyang2 1:c0f972361605 438 #define LCD_DEVFUNC_READRECT 0x01 /* ...reading a rectangular display area */
csyang2 1:c0f972361605 439 #define LCD_DEVFUNC_SETALPHA 0x02 /* ...setting the alpha blending factor */
csyang2 1:c0f972361605 440 #define LCD_DEVFUNC_SETPOS 0x03 /* ...setting the layer position */
csyang2 1:c0f972361605 441 #define LCD_DEVFUNC_GETPOS 0x04 /* ...getting the layer position */
csyang2 1:c0f972361605 442 #define LCD_DEVFUNC_SETSIZE 0x05 /* ...setting the layer size */
csyang2 1:c0f972361605 443 #define LCD_DEVFUNC_SETVIS 0x06 /* ...setting the visibility of a layer */
csyang2 1:c0f972361605 444 #define LCD_DEVFUNC_24BPP 0x07 /* ...drawing 24bpp bitmaps */
csyang2 1:c0f972361605 445 #define LCD_DEVFUNC_NEXT_PIXEL 0x08 /* ...drawing a bitmap pixel by pixel */
csyang2 1:c0f972361605 446 #define LCD_DEVFUNC_SET_VRAM_ADDR 0x09 /* ...setting the VRAM address */
csyang2 1:c0f972361605 447 #define LCD_DEVFUNC_SET_VSIZE 0x0A /* ...setting the VRAM size */
csyang2 1:c0f972361605 448 #define LCD_DEVFUNC_SET_SIZE 0x0B /* ...setting the display size */
csyang2 1:c0f972361605 449 #define LCD_DEVFUNC_INIT 0x0C /* ...initializing the display controller */
csyang2 1:c0f972361605 450 #define LCD_DEVFUNC_CONTROLCACHE 0x0D /* ...controlling the cache */
csyang2 1:c0f972361605 451 #define LCD_DEVFUNC_ON 0x0E /* ...switching the display on */
csyang2 1:c0f972361605 452 #define LCD_DEVFUNC_OFF 0x0F /* ...switching the display off */
csyang2 1:c0f972361605 453 #define LCD_DEVFUNC_SETLUTENTRY 0x10 /* ...setting a LUT entry */
csyang2 1:c0f972361605 454 #define LCD_DEVFUNC_FILLPOLY 0x11 /* ...filling a polygon */
csyang2 1:c0f972361605 455 #define LCD_DEVFUNC_FILLPOLYAA 0x12 /* ...filling an antialiased polygon */
csyang2 1:c0f972361605 456 #define LCD_DEVFUNC_ALPHAMODE 0x13 /* ...setting the alpha blending mode */
csyang2 1:c0f972361605 457 #define LCD_DEVFUNC_CHROMAMODE 0x14 /* ...setting the chroma blending mode */
csyang2 1:c0f972361605 458 #define LCD_DEVFUNC_CHROMA 0x15 /* ...setting the chroma values */
csyang2 1:c0f972361605 459 #define LCD_DEVFUNC_SETFUNC 0x16 /* ...setting a function pointer */
csyang2 1:c0f972361605 460 #define LCD_DEVFUNC_REFRESH 0x17 /* ...refreshing the display */
csyang2 1:c0f972361605 461 #define LCD_DEVFUNC_SETRECT 0x18 /* ...setting the drawing rectangle */
csyang2 1:c0f972361605 462 /* Setting a function pointer for... */
csyang2 1:c0f972361605 463 #define LCD_DEVFUNC_FILLRECT 0x19 /* ...filling a rectangular area */
csyang2 1:c0f972361605 464 #define LCD_DEVFUNC_DRAWBMP_1BPP 0x20 /* ...drawing a 1bpp bitmap */
csyang2 1:c0f972361605 465 #define LCD_DEVFUNC_COPYBUFFER 0x21 /* ...copying complete frame buffers */
csyang2 1:c0f972361605 466 #define LCD_DEVFUNC_SHOWBUFFER 0x22 /* ...shows the given buffer */
csyang2 1:c0f972361605 467 #define LCD_DEVFUNC_COPYRECT 0x23 /* ...filling a rectangular area */
csyang2 1:c0f972361605 468 #define LCD_DEVFUNC_DRAWBMP_16BPP 0x24 /* ...drawing a 16bpp bitmap */
csyang2 1:c0f972361605 469 #define LCD_DEVFUNC_DRAWBMP_8BPP 0x25 /* ...drawing a 8bpp bitmap */
csyang2 1:c0f972361605 470 #define LCD_DEVFUNC_READPIXEL 0x26 /* ...reading a pixel index */
csyang2 1:c0f972361605 471 #define LCD_DEVFUNC_READMPIXELS 0x27 /* ...reading multiple pixel indices */
csyang2 1:c0f972361605 472 #define LCD_DEVFUNC_DRAWBMP_32BPP 0x28 /* ...drawing a 32bpp bitmap */
csyang2 1:c0f972361605 473 #define LCD_DEVFUNC_SET_BUFFERPTR 0x29 /* ...setting an array of buffer pointers */
csyang2 1:c0f972361605 474 #define LCD_DEVFUNC_EXIT 0x30 /* ...free memory and shut down controller */
csyang2 1:c0f972361605 475
csyang2 1:c0f972361605 476 /*********************************************************************
csyang2 1:c0f972361605 477 *
csyang2 1:c0f972361605 478 * Values for requesting function pointers (memory devices)
csyang2 1:c0f972361605 479 */
csyang2 1:c0f972361605 480 /* Request of a function pointer for... */
csyang2 1:c0f972361605 481 #define MEMDEV_DEVFUNC_WRITETOACTIVE 0x16 /* ...writing the memory device */
csyang2 1:c0f972361605 482
csyang2 1:c0f972361605 483 /*********************************************************************
csyang2 1:c0f972361605 484 *
csyang2 1:c0f972361605 485 * Values for requesting data
csyang2 1:c0f972361605 486 */
csyang2 1:c0f972361605 487 /* Request pointer to... */
csyang2 1:c0f972361605 488 #define LCD_DEVDATA_MEMDEV 0x01 /* ...default memory device API */
csyang2 1:c0f972361605 489 #define LCD_DEVDATA_PHYSPAL 0x02 /* ...physical palette */
csyang2 1:c0f972361605 490 #define LCD_DEVDATA_VRAMADDR 0x03 /* ...VRAM address */
csyang2 1:c0f972361605 491
csyang2 1:c0f972361605 492 /*********************************************************************
csyang2 1:c0f972361605 493 *
csyang2 1:c0f972361605 494 * Structures for passing data to LCD_X_DisplayDriver()
csyang2 1:c0f972361605 495 */
csyang2 1:c0f972361605 496 typedef struct {
csyang2 1:c0f972361605 497 void * pVRAM;
csyang2 1:c0f972361605 498 } LCD_X_SETVRAMADDR_INFO;
csyang2 1:c0f972361605 499
csyang2 1:c0f972361605 500 typedef struct {
csyang2 1:c0f972361605 501 int xPos, yPos;
csyang2 1:c0f972361605 502 } LCD_X_SETORG_INFO;
csyang2 1:c0f972361605 503
csyang2 1:c0f972361605 504 typedef struct {
csyang2 1:c0f972361605 505 LCD_COLOR Color;
csyang2 1:c0f972361605 506 U8 Pos;
csyang2 1:c0f972361605 507 } LCD_X_SETLUTENTRY_INFO;
csyang2 1:c0f972361605 508
csyang2 1:c0f972361605 509 typedef struct {
csyang2 1:c0f972361605 510 int xSize, ySize;
csyang2 1:c0f972361605 511 } LCD_X_SETSIZE_INFO;
csyang2 1:c0f972361605 512
csyang2 1:c0f972361605 513 typedef struct {
csyang2 1:c0f972361605 514 int xPos, yPos;
csyang2 1:c0f972361605 515 int xLen, yLen;
csyang2 1:c0f972361605 516 int BytesPerPixel;
csyang2 1:c0f972361605 517 U32 Off;
csyang2 1:c0f972361605 518 } LCD_X_SETPOS_INFO;
csyang2 1:c0f972361605 519
csyang2 1:c0f972361605 520 typedef struct {
csyang2 1:c0f972361605 521 int Alpha;
csyang2 1:c0f972361605 522 } LCD_X_SETALPHA_INFO;
csyang2 1:c0f972361605 523
csyang2 1:c0f972361605 524 typedef struct {
csyang2 1:c0f972361605 525 int OnOff;
csyang2 1:c0f972361605 526 } LCD_X_SETVIS_INFO;
csyang2 1:c0f972361605 527
csyang2 1:c0f972361605 528 typedef struct {
csyang2 1:c0f972361605 529 int AlphaMode;
csyang2 1:c0f972361605 530 } LCD_X_SETALPHAMODE_INFO;
csyang2 1:c0f972361605 531
csyang2 1:c0f972361605 532 typedef struct {
csyang2 1:c0f972361605 533 int ChromaMode;
csyang2 1:c0f972361605 534 } LCD_X_SETCHROMAMODE_INFO;
csyang2 1:c0f972361605 535
csyang2 1:c0f972361605 536 typedef struct {
csyang2 1:c0f972361605 537 LCD_COLOR ChromaMin;
csyang2 1:c0f972361605 538 LCD_COLOR ChromaMax;
csyang2 1:c0f972361605 539 } LCD_X_SETCHROMA_INFO;
csyang2 1:c0f972361605 540
csyang2 1:c0f972361605 541 typedef struct {
csyang2 1:c0f972361605 542 int Index;
csyang2 1:c0f972361605 543 } LCD_X_SHOWBUFFER_INFO;
csyang2 1:c0f972361605 544
csyang2 1:c0f972361605 545 /*********************************************************************
csyang2 1:c0f972361605 546 *
csyang2 1:c0f972361605 547 * Commands for LCD_X_DisplayDriver()
csyang2 1:c0f972361605 548 */
csyang2 1:c0f972361605 549 #define LCD_X_INITCONTROLLER 0x01 /* Initializing the display controller */
csyang2 1:c0f972361605 550 #define LCD_X_SETVRAMADDR 0x02 /* Setting the video RAM address */
csyang2 1:c0f972361605 551 #define LCD_X_SETORG 0x03 /* Setting the origin within a layer */
csyang2 1:c0f972361605 552 #define LCD_X_SETLUTENTRY 0x04 /* Setting an entry of the LUT */
csyang2 1:c0f972361605 553 #define LCD_X_ON 0x05 /* Switching the display on */
csyang2 1:c0f972361605 554 #define LCD_X_OFF 0x06 /* Switching the display off */
csyang2 1:c0f972361605 555 #define LCD_X_SETSIZE 0x07 /* Setting the layer size */
csyang2 1:c0f972361605 556 #define LCD_X_SETPOS 0x08 /* Setting the layer position */
csyang2 1:c0f972361605 557 #define LCD_X_SETVIS 0x09 /* Setting the visibility of a layer */
csyang2 1:c0f972361605 558 #define LCD_X_SETALPHA 0x0A /* Setting the alpha value of the layer */
csyang2 1:c0f972361605 559 #define LCD_X_SETALPHAMODE 0x0B /* Setting the alpha blending mode */
csyang2 1:c0f972361605 560 #define LCD_X_SETCHROMAMODE 0x0C /* Setting the chroma blending mode */
csyang2 1:c0f972361605 561 #define LCD_X_SETCHROMA 0x0D /* Setting the chroma values */
csyang2 1:c0f972361605 562 #define LCD_X_SHOWBUFFER 0x0E /* Switching to the given buffer */
csyang2 1:c0f972361605 563
csyang2 1:c0f972361605 564 int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData);
csyang2 1:c0f972361605 565 void LCD_X_Config(void);
csyang2 1:c0f972361605 566
csyang2 1:c0f972361605 567 /*********************************************************************
csyang2 1:c0f972361605 568 *
csyang2 1:c0f972361605 569 * Get/Set layer properties
csyang2 1:c0f972361605 570 */
csyang2 1:c0f972361605 571 int LCD_GetPosEx (int LayerIndex, int * pxPos, int * pyPos);
csyang2 1:c0f972361605 572 int LCD_OffEx (int LayerIndex);
csyang2 1:c0f972361605 573 int LCD_OnEx (int LayerIndex);
csyang2 1:c0f972361605 574 int LCD_RefreshEx (int LayerIndex);
csyang2 1:c0f972361605 575 int LCD_SetAlphaEx (int LayerIndex, int Alpha);
csyang2 1:c0f972361605 576 int LCD_SetAlphaModeEx (int LayerIndex, int AlphaMode);
csyang2 1:c0f972361605 577 int LCD_SetBufferPtrEx (int LayerIndex, void ** pBufferPTR);
csyang2 1:c0f972361605 578 int LCD_SetChromaEx (int LayerIndex, LCD_COLOR ChromaMin, LCD_COLOR ChromaMax);
csyang2 1:c0f972361605 579 int LCD_SetChromaModeEx(int LayerIndex, int ChromaMode);
csyang2 1:c0f972361605 580 int LCD_SetDevFunc (int LayerIndex, int IdFunc, void (* pDriverFunc)(void));
csyang2 1:c0f972361605 581 int LCD_SetLUTEntryEx (int LayerIndex, U8 Pos, LCD_COLOR Color);
csyang2 1:c0f972361605 582 int LCD_SetPosEx (int LayerIndex, int xPos, int yPos);
csyang2 1:c0f972361605 583 int LCD_SetSizeEx (int LayerIndex, int xSize, int ySize);
csyang2 1:c0f972361605 584 int LCD_SetVisEx (int LayerIndex, int OnOff);
csyang2 1:c0f972361605 585 int LCD_SetVRAMAddrEx (int LayerIndex, void * pVRAM);
csyang2 1:c0f972361605 586 int LCD_SetVSizeEx (int LayerIndex, int xSize, int ySize);
csyang2 1:c0f972361605 587
csyang2 1:c0f972361605 588 int LCD_GetPos (int * pxPos, int * pyPos);
csyang2 1:c0f972361605 589 int LCD_Off (void);
csyang2 1:c0f972361605 590 int LCD_On (void);
csyang2 1:c0f972361605 591 int LCD_Refresh (void);
csyang2 1:c0f972361605 592 int LCD_SetAlpha (int Alpha);
csyang2 1:c0f972361605 593 int LCD_SetAlphaMode (int AlphaMode);
csyang2 1:c0f972361605 594 int LCD_SetBufferPtr (void ** pBufferPTR);
csyang2 1:c0f972361605 595 int LCD_SetChroma (LCD_COLOR ChromaMin, LCD_COLOR ChromaMax);
csyang2 1:c0f972361605 596 int LCD_SetChromaMode (int ChromaMode);
csyang2 1:c0f972361605 597 int LCD_SetLUTEntry (U8 Pos, LCD_COLOR Color);
csyang2 1:c0f972361605 598 void LCD_SetOrg (int xOrg, int yOrg);
csyang2 1:c0f972361605 599 int LCD_SetPos (int xPos, int yPos);
csyang2 1:c0f972361605 600 int LCD_SetSize (int xSize, int ySize);
csyang2 1:c0f972361605 601 int LCD_SetVis (int OnOff);
csyang2 1:c0f972361605 602 int LCD_SetVRAMAddr (void * pVRAM);
csyang2 1:c0f972361605 603 int LCD_SetVSize (int xSize, int ySize);
csyang2 1:c0f972361605 604
csyang2 1:c0f972361605 605 /*********************************************************************
csyang2 1:c0f972361605 606 *
csyang2 1:c0f972361605 607 * NEXT_PIXEL API support
csyang2 1:c0f972361605 608 */
csyang2 1:c0f972361605 609 typedef struct {
csyang2 1:c0f972361605 610 int (* pfStart) (int x0, int y0, int x1, int y1);
csyang2 1:c0f972361605 611 void (* pfSetPixel)(LCD_PIXELINDEX PixelIndex);
csyang2 1:c0f972361605 612 void (* pfNextLine)(void);
csyang2 1:c0f972361605 613 void (* pfEnd) (void);
csyang2 1:c0f972361605 614 } LCD_API_NEXT_PIXEL;
csyang2 1:c0f972361605 615
csyang2 1:c0f972361605 616 LCD_API_NEXT_PIXEL * LCD_GetNextPixelAPI(void);
csyang2 1:c0f972361605 617
csyang2 1:c0f972361605 618 /*********************************************************************
csyang2 1:c0f972361605 619 *
csyang2 1:c0f972361605 620 * LCD_CLIP function table
csyang2 1:c0f972361605 621 */
csyang2 1:c0f972361605 622 typedef void tLCD_HL_DrawHLine (int x0, int y0, int x1);
csyang2 1:c0f972361605 623 typedef void tLCD_HL_DrawPixel (int x0, int y0);
csyang2 1:c0f972361605 624
csyang2 1:c0f972361605 625 typedef struct {
csyang2 1:c0f972361605 626 tLCD_HL_DrawHLine * pfDrawHLine;
csyang2 1:c0f972361605 627 tLCD_HL_DrawPixel * pfDrawPixel;
csyang2 1:c0f972361605 628 } tLCD_HL_APIList;
csyang2 1:c0f972361605 629
csyang2 1:c0f972361605 630 void LCD_DrawHLine(int x0, int y0, int x1);
csyang2 1:c0f972361605 631 void LCD_DrawPixel(int x0, int y0);
csyang2 1:c0f972361605 632 void LCD_DrawVLine(int x, int y0, int y1);
csyang2 1:c0f972361605 633
csyang2 1:c0f972361605 634
csyang2 1:c0f972361605 635 /*********************************************************************
csyang2 1:c0f972361605 636 *
csyang2 1:c0f972361605 637 * Declarations for LCD_
csyang2 1:c0f972361605 638 */
csyang2 1:c0f972361605 639 void LCD_SetClipRectEx(const LCD_RECT * pRect);
csyang2 1:c0f972361605 640 void LCD_SetClipRectMax(void);
csyang2 1:c0f972361605 641
csyang2 1:c0f972361605 642 /* Get device capabilities (0 if not supported) */
csyang2 1:c0f972361605 643 I32 LCD_GetDevCap (int Index);
csyang2 1:c0f972361605 644 I32 LCD_GetDevCapEx(int LayerIndex, int Index);
csyang2 1:c0f972361605 645
csyang2 1:c0f972361605 646 /* Initialize LCD using config-parameters */
csyang2 1:c0f972361605 647 int LCD_Init(void);
csyang2 1:c0f972361605 648 int LCD_InitColors(void);
csyang2 1:c0f972361605 649 int LCD_InitEx(GUI_DEVICE * pDevice, int ClearScreen);
csyang2 1:c0f972361605 650 int LCD_ExitEx(int LayerIndex);
csyang2 1:c0f972361605 651
csyang2 1:c0f972361605 652 void LCD_SetBkColor (LCD_COLOR Color); /* Set background color */
csyang2 1:c0f972361605 653 void LCD_SetColor (LCD_COLOR Color); /* Set foreground color */
csyang2 1:c0f972361605 654 void LCD_SetPixelIndex(int x, int y, int ColorIndex);
csyang2 1:c0f972361605 655
csyang2 1:c0f972361605 656 /* Palette routines (Not available on all drivers) */
csyang2 1:c0f972361605 657 void LCD_InitLUT(void);
csyang2 1:c0f972361605 658 void LCD_SetLUTEx(int LayerIndex, const LCD_PHYSPALETTE * pPalette);
csyang2 1:c0f972361605 659 void LCD_SetLUT (const LCD_PHYSPALETTE * pPalette);
csyang2 1:c0f972361605 660
csyang2 1:c0f972361605 661 LCD_DRAWMODE LCD_SetDrawMode (LCD_DRAWMODE dm);
csyang2 1:c0f972361605 662 void LCD_SetColorIndex(unsigned PixelIndex);
csyang2 1:c0f972361605 663 void LCD_SetBkColorIndex(unsigned PixelIndex);
csyang2 1:c0f972361605 664 void LCD_FillRect(int x0, int y0, int x1, int y1);
csyang2 1:c0f972361605 665 typedef void tLCD_SetPixelAA(int x, int y, U8 Intens);
csyang2 1:c0f972361605 666
csyang2 1:c0f972361605 667 void LCD_SetPixelAA4_Trans (int x, int y, U8 Intens);
csyang2 1:c0f972361605 668 void LCD_SetPixelAA4_NoTrans(int x, int y, U8 Intens);
csyang2 1:c0f972361605 669
csyang2 1:c0f972361605 670 void LCD_SetPixelAA8_Trans (int x, int y, U8 Intens);
csyang2 1:c0f972361605 671 void LCD_SetPixelAA8_NoTrans(int x, int y, U8 Intens);
csyang2 1:c0f972361605 672
csyang2 1:c0f972361605 673 void LCD_AA_EnableGamma(int OnOff);
csyang2 1:c0f972361605 674 void LCD_AA_SetGamma (U8 * pGamma);
csyang2 1:c0f972361605 675 void LCD_AA_GetGamma (U8 * pGamma);
csyang2 1:c0f972361605 676
csyang2 1:c0f972361605 677 LCD_COLOR LCD_AA_MixColors16 (LCD_COLOR Color, LCD_COLOR BkColor, U8 Intens);
csyang2 1:c0f972361605 678 LCD_COLOR LCD_AA_MixColors256(LCD_COLOR Color, LCD_COLOR BkColor, U8 Intens);
csyang2 1:c0f972361605 679 LCD_COLOR LCD_MixColors256 (LCD_COLOR Color, LCD_COLOR BkColor, unsigned Intens);
csyang2 1:c0f972361605 680 LCD_COLOR LCD_GetPixelColor(int x, int y); /* Get RGB color of pixel */
csyang2 1:c0f972361605 681 unsigned int LCD_GetPixelIndex(int x, int y);
csyang2 1:c0f972361605 682 int LCD_GetBkColorIndex (void);
csyang2 1:c0f972361605 683 int LCD_GetColorIndex (void);
csyang2 1:c0f972361605 684 #if (GUI_USE_ARGB)
csyang2 1:c0f972361605 685 U32 LCD_AA_SetOrMask(U32 OrMask);
csyang2 1:c0f972361605 686 #else
csyang2 1:c0f972361605 687 U32 LCD_AA_SetAndMask(U32 AndMask);
csyang2 1:c0f972361605 688 #endif
csyang2 1:c0f972361605 689
csyang2 1:c0f972361605 690 /* Configuration */
csyang2 1:c0f972361605 691 int LCD_SetMaxNumColors(unsigned MaxNumColors);
csyang2 1:c0f972361605 692 int LCD_GetMaxNumColors(void);
csyang2 1:c0f972361605 693 void LCD__SetPaletteConversionHook(void (* pfPaletteConversionHook)(const LCD_LOGPALETTE * pLogPal));
csyang2 1:c0f972361605 694
csyang2 1:c0f972361605 695 /*********************************************************************
csyang2 1:c0f972361605 696 *
csyang2 1:c0f972361605 697 * Optional support for rotation
csyang2 1:c0f972361605 698 */
csyang2 1:c0f972361605 699 #if GUI_SUPPORT_ROTATION
csyang2 1:c0f972361605 700
csyang2 1:c0f972361605 701 typedef void tLCD_DrawBitmap(int x0, int y0, int xsize, int ysize,
csyang2 1:c0f972361605 702 int xMul, int yMul, int BitsPerPixel, int BytesPerLine,
csyang2 1:c0f972361605 703 const U8 * pPixel, const void * pTrans);
csyang2 1:c0f972361605 704 typedef void tRect2TextRect (LCD_RECT * pRect);
csyang2 1:c0f972361605 705
csyang2 1:c0f972361605 706 struct tLCD_APIList_struct {
csyang2 1:c0f972361605 707 tLCD_DrawBitmap * pfDrawBitmap;
csyang2 1:c0f972361605 708 tRect2TextRect * pfRect2TextRect;
csyang2 1:c0f972361605 709 tRect2TextRect * pfTransformRect;
csyang2 1:c0f972361605 710 };
csyang2 1:c0f972361605 711
csyang2 1:c0f972361605 712 typedef struct tLCD_APIList_struct tLCD_APIList;
csyang2 1:c0f972361605 713
csyang2 1:c0f972361605 714 extern tLCD_APIList LCD_APIListCCW;
csyang2 1:c0f972361605 715 extern tLCD_APIList LCD_APIListCW;
csyang2 1:c0f972361605 716 extern tLCD_APIList LCD_APIList180;
csyang2 1:c0f972361605 717
csyang2 1:c0f972361605 718 #define GUI_ROTATION tLCD_APIList
csyang2 1:c0f972361605 719 #define GUI_ROTATE_CCW &LCD_APIListCCW
csyang2 1:c0f972361605 720 #define GUI_ROTATE_CW &LCD_APIListCW
csyang2 1:c0f972361605 721 #define GUI_ROTATE_180 &LCD_APIList180
csyang2 1:c0f972361605 722 #define GUI_ROTATE_0 0
csyang2 1:c0f972361605 723
csyang2 1:c0f972361605 724 tLCD_SetPixelAA * LCD__GetPfSetPixel(int BitsPerPixel);
csyang2 1:c0f972361605 725
csyang2 1:c0f972361605 726 #endif
csyang2 1:c0f972361605 727
csyang2 1:c0f972361605 728 /*********************************************************************
csyang2 1:c0f972361605 729 *
csyang2 1:c0f972361605 730 * Physical color access, internally used only
csyang2 1:c0f972361605 731 */
csyang2 1:c0f972361605 732 void LCD__SetPhysColor(U8 Pos, LCD_COLOR Color);
csyang2 1:c0f972361605 733
csyang2 1:c0f972361605 734 /*********************************************************************
csyang2 1:c0f972361605 735 *
csyang2 1:c0f972361605 736 * Cache control
csyang2 1:c0f972361605 737 */
csyang2 1:c0f972361605 738 #define LCD_CC_UNLOCK (0) /* Default mode: Cache is transparent */
csyang2 1:c0f972361605 739 #define LCD_CC_LOCK (1) /* Cache is locked, no write operations */
csyang2 1:c0f972361605 740 #define LCD_CC_FLUSH (2) /* Flush cache, do not change mode */
csyang2 1:c0f972361605 741
csyang2 1:c0f972361605 742 int LCD_ControlCache (int Cmd);
csyang2 1:c0f972361605 743 int LCD_ControlCacheEx(int LayerIndex, int Cmd);
csyang2 1:c0f972361605 744
csyang2 1:c0f972361605 745 /*********************************************************************
csyang2 1:c0f972361605 746 *
csyang2 1:c0f972361605 747 * Color conversion
csyang2 1:c0f972361605 748 */
csyang2 1:c0f972361605 749 LCD_PIXELINDEX LCD_Color2Index (LCD_COLOR Color);
csyang2 1:c0f972361605 750 LCD_COLOR LCD_Index2Color (int Index);
csyang2 1:c0f972361605 751 LCD_COLOR LCD_Index2ColorEx (int i, unsigned LayerIndex);
csyang2 1:c0f972361605 752
csyang2 1:c0f972361605 753 /*********************************************************************
csyang2 1:c0f972361605 754 *
csyang2 1:c0f972361605 755 * LCD_X_...
csyang2 1:c0f972361605 756 */
csyang2 1:c0f972361605 757 unsigned char LCD_X_Read00(void);
csyang2 1:c0f972361605 758 unsigned char LCD_X_Read01(void);
csyang2 1:c0f972361605 759 void LCD_X_Write00 (unsigned char c);
csyang2 1:c0f972361605 760 void LCD_X_Write01 (unsigned char c);
csyang2 1:c0f972361605 761 void LCD_X_WriteM01(unsigned char * pData, int NumBytes);
csyang2 1:c0f972361605 762
csyang2 1:c0f972361605 763 #if defined(__cplusplus)
csyang2 1:c0f972361605 764 }
csyang2 1:c0f972361605 765 #endif
csyang2 1:c0f972361605 766
csyang2 1:c0f972361605 767 #endif /* LCD_H */
csyang2 1:c0f972361605 768
csyang2 1:c0f972361605 769 /*************************** End of file ****************************/