Headers for emWin lib

Dependents:   DISCO-F746NG_rtos_test

Committer:
redbird
Date:
Sat Mar 26 22:49:50 2016 +0000
Revision:
0:1bf8f02b0770
new code integration

Who changed what in which revision?

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