Graphical demo for the LPC4088 Experiment Base Board with one of the Display Expansion Kits. This program displays how to write text in different fonts.

Dependencies:   EALib mbed

Committer:
embeddedartists
Date:
Thu Jun 25 10:30:15 2015 +0000
Revision:
0:5e5e9ec91fc8
First version

Who changed what in which revision?

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