A basic graphics package for the LPC4088 Display Module.

Dependents:   lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI lpc4088_displaymodule_fs_aid ... more

Fork of DMBasicGUI by EmbeddedArtists AB

Committer:
embeddedartists
Date:
Thu Dec 11 11:03:57 2014 +0000
Revision:
0:4977187e90c7
Child:
11:265884fa7fdd
First version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 0:4977187e90c7 1 /*
embeddedartists 0:4977187e90c7 2 * @brief SWIM color definitions and palette table setup
embeddedartists 0:4977187e90c7 3 *
embeddedartists 0:4977187e90c7 4 * @note
embeddedartists 0:4977187e90c7 5 * Copyright(C) NXP Semiconductors, 2012
embeddedartists 0:4977187e90c7 6 * All rights reserved.
embeddedartists 0:4977187e90c7 7 *
embeddedartists 0:4977187e90c7 8 * @par
embeddedartists 0:4977187e90c7 9 * Software that is described herein is for illustrative purposes only
embeddedartists 0:4977187e90c7 10 * which provides customers with programming information regarding the
embeddedartists 0:4977187e90c7 11 * LPC products. This software is supplied "AS IS" without any warranties of
embeddedartists 0:4977187e90c7 12 * any kind, and NXP Semiconductors and its licensor disclaim any and
embeddedartists 0:4977187e90c7 13 * all warranties, express or implied, including all implied warranties of
embeddedartists 0:4977187e90c7 14 * merchantability, fitness for a particular purpose and non-infringement of
embeddedartists 0:4977187e90c7 15 * intellectual property rights. NXP Semiconductors assumes no responsibility
embeddedartists 0:4977187e90c7 16 * or liability for the use of the software, conveys no license or rights under any
embeddedartists 0:4977187e90c7 17 * patent, copyright, mask work right, or any other intellectual property rights in
embeddedartists 0:4977187e90c7 18 * or to any products. NXP Semiconductors reserves the right to make changes
embeddedartists 0:4977187e90c7 19 * in the software without notification. NXP Semiconductors also makes no
embeddedartists 0:4977187e90c7 20 * representation or warranty that such application will be suitable for the
embeddedartists 0:4977187e90c7 21 * specified use without further testing or modification.
embeddedartists 0:4977187e90c7 22 *
embeddedartists 0:4977187e90c7 23 * @par
embeddedartists 0:4977187e90c7 24 * Permission to use, copy, modify, and distribute this software and its
embeddedartists 0:4977187e90c7 25 * documentation is hereby granted, under NXP Semiconductors' and its
embeddedartists 0:4977187e90c7 26 * licensor's relevant copyrights in the software, without fee, provided that it
embeddedartists 0:4977187e90c7 27 * is used in conjunction with NXP Semiconductors microcontrollers. This
embeddedartists 0:4977187e90c7 28 * copyright, permission, and disclaimer notice must appear in all copies of
embeddedartists 0:4977187e90c7 29 * this code.
embeddedartists 0:4977187e90c7 30 */
embeddedartists 0:4977187e90c7 31
embeddedartists 0:4977187e90c7 32 #ifndef __LPC_COLOR_H_
embeddedartists 0:4977187e90c7 33 #define __LPC_COLOR_H_
embeddedartists 0:4977187e90c7 34
embeddedartists 0:4977187e90c7 35 #include "lpc_types.h"
embeddedartists 0:4977187e90c7 36
embeddedartists 0:4977187e90c7 37 #if defined(__cplusplus)
embeddedartists 0:4977187e90c7 38 extern "C"
embeddedartists 0:4977187e90c7 39 {
embeddedartists 0:4977187e90c7 40 #endif
embeddedartists 0:4977187e90c7 41
embeddedartists 0:4977187e90c7 42 /** @defgroup GUI_SWIM_COLORS SWIM color definitions
embeddedartists 0:4977187e90c7 43 * @ingroup GUI_SWIM
embeddedartists 0:4977187e90c7 44 * The Simple Windows Interface manager (SWIM) supports 8-bit RGB323,
embeddedartists 0:4977187e90c7 45 * 12-bit RGB 444 (in a 16-bit field), 15-bit RGB555, 16-bit RGB565,
embeddedartists 0:4977187e90c7 46 * and 24-bit RGB888 (in a 32-bit field) color.
embeddedartists 0:4977187e90c7 47 *
embeddedartists 0:4977187e90c7 48 * SWIM is configured for the color type at build-time based on the
embeddedartists 0:4977187e90c7 49 * the COLORS_DEF definitions. Select one of the following values to
embeddedartists 0:4977187e90c7 50 * configure SWIM.
embeddedartists 0:4977187e90c7 51 * 8-bit RGB323 : COLORS_DEF = 8
embeddedartists 0:4977187e90c7 52 * 12-bit RGB323: COLORS_DEF = 12
embeddedartists 0:4977187e90c7 53 * 15-bit RGB323: COLORS_DEF = 15
embeddedartists 0:4977187e90c7 54 * 16-bit RGB323: COLORS_DEF = 16
embeddedartists 0:4977187e90c7 55 * 24-bit RGB323: COLORS_DEF = 24
embeddedartists 0:4977187e90c7 56 * @{
embeddedartists 0:4977187e90c7 57 */
embeddedartists 0:4977187e90c7 58
embeddedartists 0:4977187e90c7 59 /**
embeddedartists 0:4977187e90c7 60 * Default configuration values
embeddedartists 0:4977187e90c7 61 */
embeddedartists 0:4977187e90c7 62
embeddedartists 0:4977187e90c7 63 #ifndef COLORS_DEF
embeddedartists 0:4977187e90c7 64 //#define COLORS_DEF 24 /* 24-bit 888 color mode */
embeddedartists 0:4977187e90c7 65 #define COLORS_DEF 16 /* 16-bit 565 color mode */
embeddedartists 0:4977187e90c7 66 // #define COLORS_DEF 15 /* 15-bit 555 color mode */
embeddedartists 0:4977187e90c7 67 // #define COLORS_DEF 12 /* 12-bit 444 color mode */
embeddedartists 0:4977187e90c7 68 // #define COLORS_DEF 8 /* 8-bit color mode */
embeddedartists 0:4977187e90c7 69 #endif
embeddedartists 0:4977187e90c7 70
embeddedartists 0:4977187e90c7 71 #if defined(COLORS_DEF)
embeddedartists 0:4977187e90c7 72 #ifndef COLORS_8_565_MODE
embeddedartists 0:4977187e90c7 73 /** Setup the palette table for RGB565 mode if COLORS_8_565_MODE
embeddedartists 0:4977187e90c7 74 is defined, other use RGB555 mode if not defined. */
embeddedartists 0:4977187e90c7 75 #define COLORS_8_565_MODE
embeddedartists 0:4977187e90c7 76 #endif
embeddedartists 0:4977187e90c7 77 #endif
embeddedartists 0:4977187e90c7 78
embeddedartists 0:4977187e90c7 79 #if COLORS_DEF == 24
embeddedartists 0:4977187e90c7 80 /* Black color, 888 mode */
embeddedartists 0:4977187e90c7 81 #define BLACK 0x000000
embeddedartists 0:4977187e90c7 82 /* Light gray color, 888 mode */
embeddedartists 0:4977187e90c7 83 #define LIGHTGRAY 0x545454
embeddedartists 0:4977187e90c7 84 /* Dark gray color, 888 mode */
embeddedartists 0:4977187e90c7 85 #define DARKGRAY 0xA8A8A8
embeddedartists 0:4977187e90c7 86 /* White color, 888 mode */
embeddedartists 0:4977187e90c7 87 #define WHITE 0xFFFFFF
embeddedartists 0:4977187e90c7 88 /* Red color, 888 mode */
embeddedartists 0:4977187e90c7 89 #define RED 0xFF0000
embeddedartists 0:4977187e90c7 90 /* Green color, 888 mode */
embeddedartists 0:4977187e90c7 91 #define GREEN 0x00FF00
embeddedartists 0:4977187e90c7 92 /* Blue color, 888 mode */
embeddedartists 0:4977187e90c7 93 #define BLUE 0x0000FF
embeddedartists 0:4977187e90c7 94
embeddedartists 0:4977187e90c7 95 /* Light red color, 888 mode */
embeddedartists 0:4977187e90c7 96 #define LIGHTRED 0x3F0000
embeddedartists 0:4977187e90c7 97 /* Light green color, 888 mode */
embeddedartists 0:4977187e90c7 98 #define LIGHTGREEN 0x003F00
embeddedartists 0:4977187e90c7 99 /* Light blue color, 888 mode */
embeddedartists 0:4977187e90c7 100 #define LIGHTBLUE 0x00003F
embeddedartists 0:4977187e90c7 101
embeddedartists 0:4977187e90c7 102 /* Minimum red color, 888 mode */
embeddedartists 0:4977187e90c7 103 #define MINRED 0x010000
embeddedartists 0:4977187e90c7 104 /* Light green color, 888 mode */
embeddedartists 0:4977187e90c7 105 #define MINGREEN 0x000100
embeddedartists 0:4977187e90c7 106 /* Light blue color, 888 mode */
embeddedartists 0:4977187e90c7 107 #define MINBLUE 0x000001
embeddedartists 0:4977187e90c7 108
embeddedartists 0:4977187e90c7 109 /* Red color mask, 888 mode */
embeddedartists 0:4977187e90c7 110 #define REDMASK 0xFF0000
embeddedartists 0:4977187e90c7 111 /* Red shift value, 888 mode */
embeddedartists 0:4977187e90c7 112 #define REDSHIFT 16
embeddedartists 0:4977187e90c7 113 /* Green color mask, 888 mode */
embeddedartists 0:4977187e90c7 114 #define GREENMASK 0x00FF00
embeddedartists 0:4977187e90c7 115 /* Green shift value, 888 mode */
embeddedartists 0:4977187e90c7 116 #define GREENSHIFT 8
embeddedartists 0:4977187e90c7 117 /* Blue color mask, 888 mode */
embeddedartists 0:4977187e90c7 118 #define BLUEMASK 0x0000FF
embeddedartists 0:4977187e90c7 119 /* Blue shift value, 888 mode */
embeddedartists 0:4977187e90c7 120 #define BLUESHIFT 0
embeddedartists 0:4977187e90c7 121
embeddedartists 0:4977187e90c7 122 /* Number of colors in 888 mode */
embeddedartists 0:4977187e90c7 123 #define NUM_COLORS 16777216
embeddedartists 0:4977187e90c7 124 /* Number of red colors in 888 mode */
embeddedartists 0:4977187e90c7 125 #define RED_COLORS 0x100
embeddedartists 0:4977187e90c7 126 /* Number of green colors in 888 mode */
embeddedartists 0:4977187e90c7 127 #define GREEN_COLORS 0x100
embeddedartists 0:4977187e90c7 128 /* Number of blue colors in 888 mode */
embeddedartists 0:4977187e90c7 129 #define BLUE_COLORS 0x100
embeddedartists 0:4977187e90c7 130
embeddedartists 0:4977187e90c7 131 /* Color type is a 16-bit value */
embeddedartists 0:4977187e90c7 132 typedef uint32_t COLOR_T;
embeddedartists 0:4977187e90c7 133 #endif
embeddedartists 0:4977187e90c7 134
embeddedartists 0:4977187e90c7 135 #if COLORS_DEF == 16
embeddedartists 0:4977187e90c7 136 /* Black color, 565 mode */
embeddedartists 0:4977187e90c7 137 #define BLACK 0x0000
embeddedartists 0:4977187e90c7 138 /* Light gray color, 565 mode */
embeddedartists 0:4977187e90c7 139 #define LIGHTGRAY 0X7BEF
embeddedartists 0:4977187e90c7 140 /* Dark gray color, 565 mode */
embeddedartists 0:4977187e90c7 141 #define DARKGRAY 0x39E7
embeddedartists 0:4977187e90c7 142 /* White color, 565 mode */
embeddedartists 0:4977187e90c7 143 #define WHITE 0xffff
embeddedartists 0:4977187e90c7 144 /* Red color, 565 mode */
embeddedartists 0:4977187e90c7 145 #define RED 0xF800
embeddedartists 0:4977187e90c7 146 /* Green color, 565 mode */
embeddedartists 0:4977187e90c7 147 #define GREEN 0x07E0
embeddedartists 0:4977187e90c7 148 /* Blue color, 565 mode */
embeddedartists 0:4977187e90c7 149 #define BLUE 0x001F
embeddedartists 0:4977187e90c7 150
embeddedartists 0:4977187e90c7 151 /* Light red color, 565 mode */
embeddedartists 0:4977187e90c7 152 #define LIGHTRED 0x7800
embeddedartists 0:4977187e90c7 153 /* Light green color, 565 mode */
embeddedartists 0:4977187e90c7 154 #define LIGHTGREEN 0x03E0
embeddedartists 0:4977187e90c7 155 /* Light blue color, 565 mode */
embeddedartists 0:4977187e90c7 156 #define LIGHTBLUE 0x000F
embeddedartists 0:4977187e90c7 157
embeddedartists 0:4977187e90c7 158 /* Minimum red color, 565 mode */
embeddedartists 0:4977187e90c7 159 #define MINRED 0x0800
embeddedartists 0:4977187e90c7 160 /* Light green color, 565 mode */
embeddedartists 0:4977187e90c7 161 #define MINGREEN 0x0020
embeddedartists 0:4977187e90c7 162 /* Light blue color, 565 mode */
embeddedartists 0:4977187e90c7 163 #define MINBLUE 0x0001
embeddedartists 0:4977187e90c7 164
embeddedartists 0:4977187e90c7 165 /* Red color mask, 565 mode */
embeddedartists 0:4977187e90c7 166 #define REDMASK 0xF800
embeddedartists 0:4977187e90c7 167 /* Red shift value, 565 mode */
embeddedartists 0:4977187e90c7 168 #define REDSHIFT 11
embeddedartists 0:4977187e90c7 169 /* Green color mask, 565 mode */
embeddedartists 0:4977187e90c7 170 #define GREENMASK 0x07E0
embeddedartists 0:4977187e90c7 171 /* Green shift value, 565 mode */
embeddedartists 0:4977187e90c7 172 #define GREENSHIFT 5
embeddedartists 0:4977187e90c7 173 /* Blue color mask, 565 mode */
embeddedartists 0:4977187e90c7 174 #define BLUEMASK 0x001F
embeddedartists 0:4977187e90c7 175 /* Blue shift value, 565 mode */
embeddedartists 0:4977187e90c7 176 #define BLUESHIFT 0
embeddedartists 0:4977187e90c7 177
embeddedartists 0:4977187e90c7 178 /* Number of colors in 565 mode */
embeddedartists 0:4977187e90c7 179 #define NUM_COLORS 65536
embeddedartists 0:4977187e90c7 180 /* Number of red colors in 565 mode */
embeddedartists 0:4977187e90c7 181 #define RED_COLORS 0x20
embeddedartists 0:4977187e90c7 182 /* Number of green colors in 565 mode */
embeddedartists 0:4977187e90c7 183 #define GREEN_COLORS 0x40
embeddedartists 0:4977187e90c7 184 /* Number of blue colors in 565 mode */
embeddedartists 0:4977187e90c7 185 #define BLUE_COLORS 0x20
embeddedartists 0:4977187e90c7 186
embeddedartists 0:4977187e90c7 187 /* Color type is a 16-bit value */
embeddedartists 0:4977187e90c7 188 typedef uint16_t COLOR_T;
embeddedartists 0:4977187e90c7 189 #endif
embeddedartists 0:4977187e90c7 190
embeddedartists 0:4977187e90c7 191 #if COLORS_DEF == 15
embeddedartists 0:4977187e90c7 192 /* Black color, 555 mode */
embeddedartists 0:4977187e90c7 193 #define BLACK 0x0000
embeddedartists 0:4977187e90c7 194 /* Llight gray color, 555 mode */
embeddedartists 0:4977187e90c7 195 #define LIGHTGRAY 0x3DEF
embeddedartists 0:4977187e90c7 196 /* Drak gray color, 555 mode */
embeddedartists 0:4977187e90c7 197 #define DARKGRAY 0x1CE7
embeddedartists 0:4977187e90c7 198 /* White color, 555 mode */
embeddedartists 0:4977187e90c7 199 #define WHITE 0xffff
embeddedartists 0:4977187e90c7 200 /* Red color, 555 mode */
embeddedartists 0:4977187e90c7 201 #define RED 0x7C00
embeddedartists 0:4977187e90c7 202 /* Green color, 555 mode */
embeddedartists 0:4977187e90c7 203 #define GREEN 0x03E0
embeddedartists 0:4977187e90c7 204 /* Blue color, 555 mode */
embeddedartists 0:4977187e90c7 205 #define BLUE 0x001F
embeddedartists 0:4977187e90c7 206 /* Magenta color, 555 mode */
embeddedartists 0:4977187e90c7 207 #define MAGENTA (RED | BLUE)
embeddedartists 0:4977187e90c7 208 /* Cyan color, 555 mode */
embeddedartists 0:4977187e90c7 209 #define CYAN (GREEN | BLUE)
embeddedartists 0:4977187e90c7 210 /* Yellow color, 555 mode */
embeddedartists 0:4977187e90c7 211 #define YELLOW (RED | GREEN)
embeddedartists 0:4977187e90c7 212 /* Light red color, 555 mode */
embeddedartists 0:4977187e90c7 213 #define LIGHTRED 0x3C00
embeddedartists 0:4977187e90c7 214 /* Light green color, 555 mode */
embeddedartists 0:4977187e90c7 215 #define LIGHTGREEN 0x01E0
embeddedartists 0:4977187e90c7 216 /* Light blue color, 555 mode */
embeddedartists 0:4977187e90c7 217 #define LIGHTBLUE 0x000F
embeddedartists 0:4977187e90c7 218 /* Light magenta color, 555 mode */
embeddedartists 0:4977187e90c7 219 #define LIGHTMAGENTA (LIGHTRED | LIGHTBLUE)
embeddedartists 0:4977187e90c7 220 /* Light cyan color, 555 mode */
embeddedartists 0:4977187e90c7 221 #define LIGHTCYAN (LIGHTGREEN | LIGHTBLUE)
embeddedartists 0:4977187e90c7 222 /* Light yellow color, 555 mode */
embeddedartists 0:4977187e90c7 223 #define LIGHTYELLOW (LIGHTRED | LIGHTGREEN)
embeddedartists 0:4977187e90c7 224
embeddedartists 0:4977187e90c7 225 /* Red color mask, 555 mode */
embeddedartists 0:4977187e90c7 226 #define REDMASK 0x7C00
embeddedartists 0:4977187e90c7 227 /* Red shift value, 555 mode */
embeddedartists 0:4977187e90c7 228 #define REDSHIFT 10
embeddedartists 0:4977187e90c7 229 /* Green color mask, 555 mode */
embeddedartists 0:4977187e90c7 230 #define GREENMASK 0x03E0
embeddedartists 0:4977187e90c7 231 /* Green shift value, 555 mode */
embeddedartists 0:4977187e90c7 232 #define GREENSHIFT 5
embeddedartists 0:4977187e90c7 233 /* Blue color mask, 555 mode */
embeddedartists 0:4977187e90c7 234 #define BLUEMASK 0x001F
embeddedartists 0:4977187e90c7 235 /* Blue shift value, 555 mode */
embeddedartists 0:4977187e90c7 236 #define BLUESHIFT 0
embeddedartists 0:4977187e90c7 237
embeddedartists 0:4977187e90c7 238 /* Number of colors in 555 mode */
embeddedartists 0:4977187e90c7 239 #define NUM_COLORS 32768
embeddedartists 0:4977187e90c7 240 /* Number of red colors in 555 mode */
embeddedartists 0:4977187e90c7 241 #define RED_COLORS 0x20
embeddedartists 0:4977187e90c7 242 /* Number of green colors in 555 mode */
embeddedartists 0:4977187e90c7 243 #define GREEN_COLORS 0x20
embeddedartists 0:4977187e90c7 244 /* Number of blue colors in 555 mode */
embeddedartists 0:4977187e90c7 245 #define BLUE_COLORS 0x20
embeddedartists 0:4977187e90c7 246
embeddedartists 0:4977187e90c7 247 /* Color type is a 16-bit value */
embeddedartists 0:4977187e90c7 248 typedef uint16_t COLOR_T;
embeddedartists 0:4977187e90c7 249 #endif
embeddedartists 0:4977187e90c7 250
embeddedartists 0:4977187e90c7 251 #if COLORS_DEF == 12
embeddedartists 0:4977187e90c7 252 /* Black color, 444 mode */
embeddedartists 0:4977187e90c7 253 #define BLACK 0x0000
embeddedartists 0:4977187e90c7 254 /* Llight gray color, 444 mode */
embeddedartists 0:4977187e90c7 255 #define LIGHTGRAY 0x3DEF
embeddedartists 0:4977187e90c7 256 /* Drak gray color, 444 mode */
embeddedartists 0:4977187e90c7 257 #define DARKGRAY 0x1CE7
embeddedartists 0:4977187e90c7 258 /* White color, 444 mode */
embeddedartists 0:4977187e90c7 259 #define WHITE 0x7fff
embeddedartists 0:4977187e90c7 260 /* Red color, 444 mode */
embeddedartists 0:4977187e90c7 261 #define RED 0x3C00
embeddedartists 0:4977187e90c7 262 /* Green color, 444 mode */
embeddedartists 0:4977187e90c7 263 #define GREEN 0x01E0
embeddedartists 0:4977187e90c7 264 /* Blue color, 444 mode */
embeddedartists 0:4977187e90c7 265 #define BLUE 0x000F
embeddedartists 0:4977187e90c7 266 /* Magenta color, 444 mode */
embeddedartists 0:4977187e90c7 267 #define MAGENTA (RED | BLUE)
embeddedartists 0:4977187e90c7 268 /* Cyan color, 444 mode */
embeddedartists 0:4977187e90c7 269 #define CYAN (GREEN | BLUE)
embeddedartists 0:4977187e90c7 270 /* Yellow color, 444 mode */
embeddedartists 0:4977187e90c7 271 #define YELLOW (RED | GREEN)
embeddedartists 0:4977187e90c7 272 /* Light red color, 444 mode */
embeddedartists 0:4977187e90c7 273 #define LIGHTRED 0x3C00
embeddedartists 0:4977187e90c7 274 /* Light green color, 444 mode */
embeddedartists 0:4977187e90c7 275 #define LIGHTGREEN 0x01E0
embeddedartists 0:4977187e90c7 276 /* Light blue color, 444 mode */
embeddedartists 0:4977187e90c7 277 #define LIGHTBLUE 0x000F
embeddedartists 0:4977187e90c7 278 /* Light magenta color, 444 mode */
embeddedartists 0:4977187e90c7 279 #define LIGHTMAGENTA (LIGHTRED | LIGHTBLUE)
embeddedartists 0:4977187e90c7 280 /* Light cyan color, 444 mode */
embeddedartists 0:4977187e90c7 281 #define LIGHTCYAN (LIGHTGREEN | LIGHTBLUE)
embeddedartists 0:4977187e90c7 282 /* Light yellow color, 444 mode */
embeddedartists 0:4977187e90c7 283 #define LIGHTYELLOW (LIGHTRED | LIGHTGREEN)
embeddedartists 0:4977187e90c7 284
embeddedartists 0:4977187e90c7 285 /* Red color mask, 444 mode */
embeddedartists 0:4977187e90c7 286 #define REDMASK 0x3C00
embeddedartists 0:4977187e90c7 287 /* Red shift value, 444 mode */
embeddedartists 0:4977187e90c7 288 #define REDSHIFT 10
embeddedartists 0:4977187e90c7 289 /* Green color mask, 444 mode */
embeddedartists 0:4977187e90c7 290 #define GREENMASK 0x01E0
embeddedartists 0:4977187e90c7 291 /* Green shift value, 444 mode */
embeddedartists 0:4977187e90c7 292 #define GREENSHIFT 5
embeddedartists 0:4977187e90c7 293 /* Blue color mask, 444 mode */
embeddedartists 0:4977187e90c7 294 #define BLUEMASK 0x000F
embeddedartists 0:4977187e90c7 295 /* Blue shift value, 444 mode */
embeddedartists 0:4977187e90c7 296 #define BLUESHIFT 0
embeddedartists 0:4977187e90c7 297
embeddedartists 0:4977187e90c7 298 /* Number of colors in 444 mode */
embeddedartists 0:4977187e90c7 299 #define NUM_COLORS 4096
embeddedartists 0:4977187e90c7 300 /* Number of red colors in 444 mode */
embeddedartists 0:4977187e90c7 301 #define RED_COLORS 0x10
embeddedartists 0:4977187e90c7 302 /* Number of green colors in 444 mode */
embeddedartists 0:4977187e90c7 303 #define GREEN_COLORS 0x10
embeddedartists 0:4977187e90c7 304 /* Number of blue colors in 444 mode */
embeddedartists 0:4977187e90c7 305 #define BLUE_COLORS 0x10
embeddedartists 0:4977187e90c7 306
embeddedartists 0:4977187e90c7 307 /* Color type is a 16-bit value */
embeddedartists 0:4977187e90c7 308 typedef uint16_t COLOR_T;
embeddedartists 0:4977187e90c7 309 #endif
embeddedartists 0:4977187e90c7 310
embeddedartists 0:4977187e90c7 311 #if COLORS_DEF == 8
embeddedartists 0:4977187e90c7 312 /* Black color, 323 mode */
embeddedartists 0:4977187e90c7 313 #define BLACK 0x00
embeddedartists 0:4977187e90c7 314 /* Light gray color, 323 mode */
embeddedartists 0:4977187e90c7 315 #define LIGHTGRAY 0x6E
embeddedartists 0:4977187e90c7 316 /* Dark gray color, 323 mode */
embeddedartists 0:4977187e90c7 317 #define DARKGRAY 0x25
embeddedartists 0:4977187e90c7 318 /* White color, 323 mode */
embeddedartists 0:4977187e90c7 319 #define WHITE 0xFF
embeddedartists 0:4977187e90c7 320 /* Red color, 323 mode */
embeddedartists 0:4977187e90c7 321 #define RED 0xE0
embeddedartists 0:4977187e90c7 322 /* Green color, 323 mode */
embeddedartists 0:4977187e90c7 323 #define GREEN 0x1C
embeddedartists 0:4977187e90c7 324 /* Blue color, 323 mode */
embeddedartists 0:4977187e90c7 325 #define BLUE 0x03
embeddedartists 0:4977187e90c7 326 /* Magenta color, 323 mode */
embeddedartists 0:4977187e90c7 327 #define MAGENTA (RED | BLUE)
embeddedartists 0:4977187e90c7 328 /* Cyan color, 323 mode */
embeddedartists 0:4977187e90c7 329 #define CYAN (GREEN | BLUE)
embeddedartists 0:4977187e90c7 330 /* Yellow color, 323 mode */
embeddedartists 0:4977187e90c7 331 #define YELLOW (RED | GREEN)
embeddedartists 0:4977187e90c7 332 /* Light red color, 323 mode */
embeddedartists 0:4977187e90c7 333 #define LIGHTRED 0x60
embeddedartists 0:4977187e90c7 334 /* Light green color, 323 mode */
embeddedartists 0:4977187e90c7 335 #define LIGHTGREEN 0x0C
embeddedartists 0:4977187e90c7 336 /* Light blue color, 323 mode */
embeddedartists 0:4977187e90c7 337 #define LIGHTBLUE 0x01
embeddedartists 0:4977187e90c7 338 /* Light magenta color, 323 mode */
embeddedartists 0:4977187e90c7 339 #define LIGHTMAGENTA (LIGHTRED | LIGHTBLUE)
embeddedartists 0:4977187e90c7 340 /* Light cyan color, 323 mode */
embeddedartists 0:4977187e90c7 341 #define LIGHTCYAN (LIGHTGREEN | LIGHTBLUE)
embeddedartists 0:4977187e90c7 342 /* Light yellow color, 323 mode */
embeddedartists 0:4977187e90c7 343 #define LIGHTYELLOW (LIGHTRED | LIGHTGREEN)
embeddedartists 0:4977187e90c7 344
embeddedartists 0:4977187e90c7 345 /* Red color mask, 323 mode */
embeddedartists 0:4977187e90c7 346 #define REDMASK 0xE0
embeddedartists 0:4977187e90c7 347 /* Red shift value, 323 mode */
embeddedartists 0:4977187e90c7 348 #define REDSHIFT 5
embeddedartists 0:4977187e90c7 349 /* Green color mask, 323 mode */
embeddedartists 0:4977187e90c7 350 #define GREENMASK 0x1C
embeddedartists 0:4977187e90c7 351 /* Green shift value, 323 mode */
embeddedartists 0:4977187e90c7 352 #define GREENSHIFT 2
embeddedartists 0:4977187e90c7 353 /* Blue color mask, 323 mode */
embeddedartists 0:4977187e90c7 354 #define BLUEMASK 0x3
embeddedartists 0:4977187e90c7 355 /* Blue shift value, 323 mode */
embeddedartists 0:4977187e90c7 356 #define BLUESHIFT 0
embeddedartists 0:4977187e90c7 357
embeddedartists 0:4977187e90c7 358 /* Number of colors in 332 mode */
embeddedartists 0:4977187e90c7 359 #define NUM_COLORS 256
embeddedartists 0:4977187e90c7 360 /* Number of red colors in 332 mode */
embeddedartists 0:4977187e90c7 361 #define RED_COLORS 0x08
embeddedartists 0:4977187e90c7 362 /* Number of green colors in 332 mode */
embeddedartists 0:4977187e90c7 363 #define GREEN_COLORS 0x08
embeddedartists 0:4977187e90c7 364 /* Number of blue colors in 332 mode */
embeddedartists 0:4977187e90c7 365 #define BLUE_COLORS 0x08
embeddedartists 0:4977187e90c7 366
embeddedartists 0:4977187e90c7 367 /* Color type is a 8-bit value */
embeddedartists 0:4977187e90c7 368 typedef uint8_t COLOR_T;
embeddedartists 0:4977187e90c7 369 #endif
embeddedartists 0:4977187e90c7 370
embeddedartists 0:4977187e90c7 371 /**
embeddedartists 0:4977187e90c7 372 * @brief Generate a palette table (only in 8-bit mode)
embeddedartists 0:4977187e90c7 373 * @param palette_table : Pointer to palette table (256 entries)
embeddedartists 0:4977187e90c7 374 * @return Nothing
embeddedartists 0:4977187e90c7 375 * @note Depending on the target LCD color mapping (either 555 or 565), a
embeddedartists 0:4977187e90c7 376 * palette table will be generated to convert colors stored in 233
embeddedartists 0:4977187e90c7 377 * format to either 555 or 565 format through a lookup table.
embeddedartists 0:4977187e90c7 378 * If compiled in 16-bit color mode, this will be a NULL function.
embeddedartists 0:4977187e90c7 379 * Select the appropriate define in this function for 555 or 565
embeddedartists 0:4977187e90c7 380 * color mode displays when using an 256 color frame buffer.
embeddedartists 0:4977187e90c7 381 */
embeddedartists 0:4977187e90c7 382 void lpc_colors_set_palette(uint16_t *palette_table);
embeddedartists 0:4977187e90c7 383
embeddedartists 0:4977187e90c7 384 /**
embeddedartists 0:4977187e90c7 385 * @}
embeddedartists 0:4977187e90c7 386 */
embeddedartists 0:4977187e90c7 387
embeddedartists 0:4977187e90c7 388 #if defined(__cplusplus)
embeddedartists 0:4977187e90c7 389 }
embeddedartists 0:4977187e90c7 390 #endif /*__cplusplus */
embeddedartists 0:4977187e90c7 391
embeddedartists 0:4977187e90c7 392 #endif /* __LPC_COLOR_H_ */
embeddedartists 0:4977187e90c7 393