Basic swim GUI for LPC4088
Fork of DMBasicGUI by
lpc_swim/lpc_colors.h@38:1b7c79a10e14, 2016-03-14 (annotated)
- Committer:
- redbird
- Date:
- Mon Mar 14 20:14:06 2016 -0600
- Revision:
- 38:1b7c79a10e14
- Parent:
- 35:fd0fab867e51
revert programming
Who changed what in which revision?
User | Revision | Line number | New 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 | */ |
redbird | 35:fd0fab867e51 | 31 | |
embeddedartists | 0:4977187e90c7 | 32 | #ifndef __LPC_COLOR_H_ |
embeddedartists | 0:4977187e90c7 | 33 | #define __LPC_COLOR_H_ |
redbird | 35:fd0fab867e51 | 34 | |
embeddedartists | 0:4977187e90c7 | 35 | #include "lpc_types.h" |
redbird | 35:fd0fab867e51 | 36 | |
embeddedartists | 0:4977187e90c7 | 37 | #if defined(__cplusplus) |
embeddedartists | 0:4977187e90c7 | 38 | extern "C" |
embeddedartists | 0:4977187e90c7 | 39 | { |
embeddedartists | 0:4977187e90c7 | 40 | #endif |
redbird | 35:fd0fab867e51 | 41 | |
embeddedartists | 0:4977187e90c7 | 42 | /** @defgroup GUI_SWIM_COLORS SWIM color definitions |
embeddedartists | 0:4977187e90c7 | 43 | * @ingroup GUI_SWIM |
embeddedartists | 11:265884fa7fdd | 44 | * The Simple Windows Interface manager (SWIM) supports 8-bit RGB332, |
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 | 11:265884fa7fdd | 51 | * 8-bit RGB332 : COLORS_DEF = 8 |
embeddedartists | 11:265884fa7fdd | 52 | * 12-bit RGB444: COLORS_DEF = 12 |
embeddedartists | 11:265884fa7fdd | 53 | * 15-bit RGB555: COLORS_DEF = 15 |
embeddedartists | 11:265884fa7fdd | 54 | * 16-bit RGB565: COLORS_DEF = 16 |
embeddedartists | 11:265884fa7fdd | 55 | * 24-bit RGB888: COLORS_DEF = 24 |
embeddedartists | 0:4977187e90c7 | 56 | * @{ |
embeddedartists | 0:4977187e90c7 | 57 | */ |
redbird | 35:fd0fab867e51 | 58 | |
embeddedartists | 0:4977187e90c7 | 59 | /** |
embeddedartists | 0:4977187e90c7 | 60 | * Default configuration values |
embeddedartists | 0:4977187e90c7 | 61 | */ |
redbird | 35:fd0fab867e51 | 62 | |
embeddedartists | 0:4977187e90c7 | 63 | #ifndef COLORS_DEF |
redbird | 35:fd0fab867e51 | 64 | //#define COLORS_DEF 24 /* 24-bit 888 color mode */ |
redbird | 35:fd0fab867e51 | 65 | #define COLORS_DEF 16 /* 16-bit 565 color mode */ |
redbird | 35:fd0fab867e51 | 66 | // #define COLORS_DEF 15 /* 15-bit 555 color mode */ |
redbird | 35:fd0fab867e51 | 67 | // #define COLORS_DEF 12 /* 12-bit 444 color mode */ |
redbird | 35:fd0fab867e51 | 68 | // #define COLORS_DEF 8 /* 8-bit color mode */ |
embeddedartists | 0:4977187e90c7 | 69 | #endif |
redbird | 35:fd0fab867e51 | 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 |
redbird | 35:fd0fab867e51 | 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 |
redbird | 35:fd0fab867e51 | 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 |
redbird | 35:fd0fab867e51 | 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 |
redbird | 35:fd0fab867e51 | 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 |
redbird | 35:fd0fab867e51 | 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 |
redbird | 35:fd0fab867e51 | 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 |
redbird | 35:fd0fab867e51 | 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 |
redbird | 35:fd0fab867e51 | 150 | |
embeddedartists | 11:265884fa7fdd | 151 | /* Magenta color, 565 mode */ |
embeddedartists | 11:265884fa7fdd | 152 | #define MAGENTA (RED | BLUE) |
embeddedartists | 11:265884fa7fdd | 153 | /* Cyan color, 565 mode */ |
embeddedartists | 11:265884fa7fdd | 154 | #define CYAN (GREEN | BLUE) |
embeddedartists | 11:265884fa7fdd | 155 | /* Yellow color, 565 mode */ |
embeddedartists | 11:265884fa7fdd | 156 | #define YELLOW (RED | GREEN) |
redbird | 35:fd0fab867e51 | 157 | |
embeddedartists | 0:4977187e90c7 | 158 | /* Light red color, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 159 | #define LIGHTRED 0x7800 |
embeddedartists | 0:4977187e90c7 | 160 | /* Light green color, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 161 | #define LIGHTGREEN 0x03E0 |
embeddedartists | 0:4977187e90c7 | 162 | /* Light blue color, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 163 | #define LIGHTBLUE 0x000F |
redbird | 35:fd0fab867e51 | 164 | |
embeddedartists | 0:4977187e90c7 | 165 | /* Minimum red color, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 166 | #define MINRED 0x0800 |
embeddedartists | 0:4977187e90c7 | 167 | /* Light green color, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 168 | #define MINGREEN 0x0020 |
embeddedartists | 0:4977187e90c7 | 169 | /* Light blue color, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 170 | #define MINBLUE 0x0001 |
redbird | 35:fd0fab867e51 | 171 | |
embeddedartists | 0:4977187e90c7 | 172 | /* Red color mask, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 173 | #define REDMASK 0xF800 |
embeddedartists | 0:4977187e90c7 | 174 | /* Red shift value, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 175 | #define REDSHIFT 11 |
embeddedartists | 0:4977187e90c7 | 176 | /* Green color mask, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 177 | #define GREENMASK 0x07E0 |
embeddedartists | 0:4977187e90c7 | 178 | /* Green shift value, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 179 | #define GREENSHIFT 5 |
embeddedartists | 0:4977187e90c7 | 180 | /* Blue color mask, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 181 | #define BLUEMASK 0x001F |
embeddedartists | 0:4977187e90c7 | 182 | /* Blue shift value, 565 mode */ |
embeddedartists | 0:4977187e90c7 | 183 | #define BLUESHIFT 0 |
redbird | 35:fd0fab867e51 | 184 | |
embeddedartists | 0:4977187e90c7 | 185 | /* Number of colors in 565 mode */ |
embeddedartists | 0:4977187e90c7 | 186 | #define NUM_COLORS 65536 |
embeddedartists | 0:4977187e90c7 | 187 | /* Number of red colors in 565 mode */ |
embeddedartists | 0:4977187e90c7 | 188 | #define RED_COLORS 0x20 |
embeddedartists | 0:4977187e90c7 | 189 | /* Number of green colors in 565 mode */ |
embeddedartists | 0:4977187e90c7 | 190 | #define GREEN_COLORS 0x40 |
embeddedartists | 0:4977187e90c7 | 191 | /* Number of blue colors in 565 mode */ |
embeddedartists | 0:4977187e90c7 | 192 | #define BLUE_COLORS 0x20 |
redbird | 35:fd0fab867e51 | 193 | |
embeddedartists | 0:4977187e90c7 | 194 | /* Color type is a 16-bit value */ |
embeddedartists | 0:4977187e90c7 | 195 | typedef uint16_t COLOR_T; |
embeddedartists | 0:4977187e90c7 | 196 | #endif |
redbird | 35:fd0fab867e51 | 197 | |
embeddedartists | 0:4977187e90c7 | 198 | #if COLORS_DEF == 15 |
embeddedartists | 0:4977187e90c7 | 199 | /* Black color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 200 | #define BLACK 0x0000 |
embeddedartists | 0:4977187e90c7 | 201 | /* Llight gray color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 202 | #define LIGHTGRAY 0x3DEF |
embeddedartists | 0:4977187e90c7 | 203 | /* Drak gray color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 204 | #define DARKGRAY 0x1CE7 |
embeddedartists | 0:4977187e90c7 | 205 | /* White color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 206 | #define WHITE 0xffff |
embeddedartists | 0:4977187e90c7 | 207 | /* Red color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 208 | #define RED 0x7C00 |
embeddedartists | 0:4977187e90c7 | 209 | /* Green color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 210 | #define GREEN 0x03E0 |
embeddedartists | 0:4977187e90c7 | 211 | /* Blue color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 212 | #define BLUE 0x001F |
embeddedartists | 0:4977187e90c7 | 213 | /* Magenta color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 214 | #define MAGENTA (RED | BLUE) |
embeddedartists | 0:4977187e90c7 | 215 | /* Cyan color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 216 | #define CYAN (GREEN | BLUE) |
embeddedartists | 0:4977187e90c7 | 217 | /* Yellow color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 218 | #define YELLOW (RED | GREEN) |
embeddedartists | 0:4977187e90c7 | 219 | /* Light red color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 220 | #define LIGHTRED 0x3C00 |
embeddedartists | 0:4977187e90c7 | 221 | /* Light green color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 222 | #define LIGHTGREEN 0x01E0 |
embeddedartists | 0:4977187e90c7 | 223 | /* Light blue color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 224 | #define LIGHTBLUE 0x000F |
embeddedartists | 0:4977187e90c7 | 225 | /* Light magenta color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 226 | #define LIGHTMAGENTA (LIGHTRED | LIGHTBLUE) |
embeddedartists | 0:4977187e90c7 | 227 | /* Light cyan color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 228 | #define LIGHTCYAN (LIGHTGREEN | LIGHTBLUE) |
embeddedartists | 0:4977187e90c7 | 229 | /* Light yellow color, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 230 | #define LIGHTYELLOW (LIGHTRED | LIGHTGREEN) |
redbird | 35:fd0fab867e51 | 231 | |
embeddedartists | 0:4977187e90c7 | 232 | /* Red color mask, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 233 | #define REDMASK 0x7C00 |
embeddedartists | 0:4977187e90c7 | 234 | /* Red shift value, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 235 | #define REDSHIFT 10 |
embeddedartists | 0:4977187e90c7 | 236 | /* Green color mask, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 237 | #define GREENMASK 0x03E0 |
embeddedartists | 0:4977187e90c7 | 238 | /* Green shift value, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 239 | #define GREENSHIFT 5 |
embeddedartists | 0:4977187e90c7 | 240 | /* Blue color mask, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 241 | #define BLUEMASK 0x001F |
embeddedartists | 0:4977187e90c7 | 242 | /* Blue shift value, 555 mode */ |
embeddedartists | 0:4977187e90c7 | 243 | #define BLUESHIFT 0 |
redbird | 35:fd0fab867e51 | 244 | |
embeddedartists | 0:4977187e90c7 | 245 | /* Number of colors in 555 mode */ |
embeddedartists | 0:4977187e90c7 | 246 | #define NUM_COLORS 32768 |
embeddedartists | 0:4977187e90c7 | 247 | /* Number of red colors in 555 mode */ |
embeddedartists | 0:4977187e90c7 | 248 | #define RED_COLORS 0x20 |
embeddedartists | 0:4977187e90c7 | 249 | /* Number of green colors in 555 mode */ |
embeddedartists | 0:4977187e90c7 | 250 | #define GREEN_COLORS 0x20 |
embeddedartists | 0:4977187e90c7 | 251 | /* Number of blue colors in 555 mode */ |
embeddedartists | 0:4977187e90c7 | 252 | #define BLUE_COLORS 0x20 |
redbird | 35:fd0fab867e51 | 253 | |
embeddedartists | 0:4977187e90c7 | 254 | /* Color type is a 16-bit value */ |
embeddedartists | 0:4977187e90c7 | 255 | typedef uint16_t COLOR_T; |
embeddedartists | 0:4977187e90c7 | 256 | #endif |
redbird | 35:fd0fab867e51 | 257 | |
embeddedartists | 0:4977187e90c7 | 258 | #if COLORS_DEF == 12 |
embeddedartists | 0:4977187e90c7 | 259 | /* Black color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 260 | #define BLACK 0x0000 |
embeddedartists | 0:4977187e90c7 | 261 | /* Llight gray color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 262 | #define LIGHTGRAY 0x3DEF |
embeddedartists | 0:4977187e90c7 | 263 | /* Drak gray color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 264 | #define DARKGRAY 0x1CE7 |
embeddedartists | 0:4977187e90c7 | 265 | /* White color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 266 | #define WHITE 0x7fff |
embeddedartists | 0:4977187e90c7 | 267 | /* Red color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 268 | #define RED 0x3C00 |
embeddedartists | 0:4977187e90c7 | 269 | /* Green color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 270 | #define GREEN 0x01E0 |
embeddedartists | 0:4977187e90c7 | 271 | /* Blue color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 272 | #define BLUE 0x000F |
embeddedartists | 0:4977187e90c7 | 273 | /* Magenta color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 274 | #define MAGENTA (RED | BLUE) |
embeddedartists | 0:4977187e90c7 | 275 | /* Cyan color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 276 | #define CYAN (GREEN | BLUE) |
embeddedartists | 0:4977187e90c7 | 277 | /* Yellow color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 278 | #define YELLOW (RED | GREEN) |
embeddedartists | 0:4977187e90c7 | 279 | /* Light red color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 280 | #define LIGHTRED 0x3C00 |
embeddedartists | 0:4977187e90c7 | 281 | /* Light green color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 282 | #define LIGHTGREEN 0x01E0 |
embeddedartists | 0:4977187e90c7 | 283 | /* Light blue color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 284 | #define LIGHTBLUE 0x000F |
embeddedartists | 0:4977187e90c7 | 285 | /* Light magenta color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 286 | #define LIGHTMAGENTA (LIGHTRED | LIGHTBLUE) |
embeddedartists | 0:4977187e90c7 | 287 | /* Light cyan color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 288 | #define LIGHTCYAN (LIGHTGREEN | LIGHTBLUE) |
embeddedartists | 0:4977187e90c7 | 289 | /* Light yellow color, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 290 | #define LIGHTYELLOW (LIGHTRED | LIGHTGREEN) |
redbird | 35:fd0fab867e51 | 291 | |
embeddedartists | 0:4977187e90c7 | 292 | /* Red color mask, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 293 | #define REDMASK 0x3C00 |
embeddedartists | 0:4977187e90c7 | 294 | /* Red shift value, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 295 | #define REDSHIFT 10 |
embeddedartists | 0:4977187e90c7 | 296 | /* Green color mask, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 297 | #define GREENMASK 0x01E0 |
embeddedartists | 0:4977187e90c7 | 298 | /* Green shift value, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 299 | #define GREENSHIFT 5 |
embeddedartists | 0:4977187e90c7 | 300 | /* Blue color mask, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 301 | #define BLUEMASK 0x000F |
embeddedartists | 0:4977187e90c7 | 302 | /* Blue shift value, 444 mode */ |
embeddedartists | 0:4977187e90c7 | 303 | #define BLUESHIFT 0 |
redbird | 35:fd0fab867e51 | 304 | |
embeddedartists | 0:4977187e90c7 | 305 | /* Number of colors in 444 mode */ |
embeddedartists | 0:4977187e90c7 | 306 | #define NUM_COLORS 4096 |
embeddedartists | 0:4977187e90c7 | 307 | /* Number of red colors in 444 mode */ |
embeddedartists | 0:4977187e90c7 | 308 | #define RED_COLORS 0x10 |
embeddedartists | 0:4977187e90c7 | 309 | /* Number of green colors in 444 mode */ |
embeddedartists | 0:4977187e90c7 | 310 | #define GREEN_COLORS 0x10 |
embeddedartists | 0:4977187e90c7 | 311 | /* Number of blue colors in 444 mode */ |
embeddedartists | 0:4977187e90c7 | 312 | #define BLUE_COLORS 0x10 |
redbird | 35:fd0fab867e51 | 313 | |
embeddedartists | 0:4977187e90c7 | 314 | /* Color type is a 16-bit value */ |
embeddedartists | 0:4977187e90c7 | 315 | typedef uint16_t COLOR_T; |
embeddedartists | 0:4977187e90c7 | 316 | #endif |
redbird | 35:fd0fab867e51 | 317 | |
embeddedartists | 0:4977187e90c7 | 318 | #if COLORS_DEF == 8 |
embeddedartists | 11:265884fa7fdd | 319 | /* Black color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 320 | #define BLACK 0x00 |
embeddedartists | 11:265884fa7fdd | 321 | /* Light gray color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 322 | #define LIGHTGRAY 0x6E |
embeddedartists | 11:265884fa7fdd | 323 | /* Dark gray color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 324 | #define DARKGRAY 0x25 |
embeddedartists | 11:265884fa7fdd | 325 | /* White color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 326 | #define WHITE 0xFF |
embeddedartists | 11:265884fa7fdd | 327 | /* Red color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 328 | #define RED 0xE0 |
embeddedartists | 11:265884fa7fdd | 329 | /* Green color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 330 | #define GREEN 0x1C |
embeddedartists | 11:265884fa7fdd | 331 | /* Blue color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 332 | #define BLUE 0x03 |
embeddedartists | 11:265884fa7fdd | 333 | /* Magenta color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 334 | #define MAGENTA (RED | BLUE) |
embeddedartists | 11:265884fa7fdd | 335 | /* Cyan color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 336 | #define CYAN (GREEN | BLUE) |
embeddedartists | 11:265884fa7fdd | 337 | /* Yellow color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 338 | #define YELLOW (RED | GREEN) |
embeddedartists | 11:265884fa7fdd | 339 | /* Light red color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 340 | #define LIGHTRED 0x60 |
embeddedartists | 11:265884fa7fdd | 341 | /* Light green color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 342 | #define LIGHTGREEN 0x0C |
embeddedartists | 11:265884fa7fdd | 343 | /* Light blue color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 344 | #define LIGHTBLUE 0x01 |
embeddedartists | 11:265884fa7fdd | 345 | /* Light magenta color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 346 | #define LIGHTMAGENTA (LIGHTRED | LIGHTBLUE) |
embeddedartists | 11:265884fa7fdd | 347 | /* Light cyan color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 348 | #define LIGHTCYAN (LIGHTGREEN | LIGHTBLUE) |
embeddedartists | 11:265884fa7fdd | 349 | /* Light yellow color, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 350 | #define LIGHTYELLOW (LIGHTRED | LIGHTGREEN) |
redbird | 35:fd0fab867e51 | 351 | |
embeddedartists | 11:265884fa7fdd | 352 | /* Red color mask, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 353 | #define REDMASK 0xE0 |
embeddedartists | 11:265884fa7fdd | 354 | /* Red shift value, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 355 | #define REDSHIFT 5 |
embeddedartists | 11:265884fa7fdd | 356 | /* Green color mask, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 357 | #define GREENMASK 0x1C |
embeddedartists | 11:265884fa7fdd | 358 | /* Green shift value, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 359 | #define GREENSHIFT 2 |
embeddedartists | 11:265884fa7fdd | 360 | /* Blue color mask, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 361 | #define BLUEMASK 0x3 |
embeddedartists | 11:265884fa7fdd | 362 | /* Blue shift value, 332 mode */ |
embeddedartists | 0:4977187e90c7 | 363 | #define BLUESHIFT 0 |
redbird | 35:fd0fab867e51 | 364 | |
embeddedartists | 0:4977187e90c7 | 365 | /* Number of colors in 332 mode */ |
embeddedartists | 0:4977187e90c7 | 366 | #define NUM_COLORS 256 |
embeddedartists | 0:4977187e90c7 | 367 | /* Number of red colors in 332 mode */ |
embeddedartists | 0:4977187e90c7 | 368 | #define RED_COLORS 0x08 |
embeddedartists | 0:4977187e90c7 | 369 | /* Number of green colors in 332 mode */ |
embeddedartists | 11:265884fa7fdd | 370 | #define GREEN_COLORS 0x06 |
embeddedartists | 0:4977187e90c7 | 371 | /* Number of blue colors in 332 mode */ |
embeddedartists | 11:265884fa7fdd | 372 | #define BLUE_COLORS 0x04 |
redbird | 35:fd0fab867e51 | 373 | |
embeddedartists | 0:4977187e90c7 | 374 | /* Color type is a 8-bit value */ |
embeddedartists | 0:4977187e90c7 | 375 | typedef uint8_t COLOR_T; |
embeddedartists | 0:4977187e90c7 | 376 | #endif |
redbird | 35:fd0fab867e51 | 377 | |
embeddedartists | 0:4977187e90c7 | 378 | /** |
redbird | 35:fd0fab867e51 | 379 | * @brief Generate a palette table (only in 8-bit mode) |
redbird | 35:fd0fab867e51 | 380 | * @param palette_table : Pointer to palette table (256 entries) |
redbird | 35:fd0fab867e51 | 381 | * @return Nothing |
redbird | 35:fd0fab867e51 | 382 | * @note Depending on the target LCD color mapping (either 555 or 565), a |
embeddedartists | 0:4977187e90c7 | 383 | * palette table will be generated to convert colors stored in 233 |
embeddedartists | 0:4977187e90c7 | 384 | * format to either 555 or 565 format through a lookup table. |
embeddedartists | 0:4977187e90c7 | 385 | * If compiled in 16-bit color mode, this will be a NULL function. |
embeddedartists | 0:4977187e90c7 | 386 | * Select the appropriate define in this function for 555 or 565 |
embeddedartists | 0:4977187e90c7 | 387 | * color mode displays when using an 256 color frame buffer. |
embeddedartists | 0:4977187e90c7 | 388 | */ |
embeddedartists | 0:4977187e90c7 | 389 | void lpc_colors_set_palette(uint16_t *palette_table); |
redbird | 35:fd0fab867e51 | 390 | |
embeddedartists | 0:4977187e90c7 | 391 | /** |
embeddedartists | 0:4977187e90c7 | 392 | * @} |
embeddedartists | 0:4977187e90c7 | 393 | */ |
redbird | 35:fd0fab867e51 | 394 | |
embeddedartists | 0:4977187e90c7 | 395 | #if defined(__cplusplus) |
embeddedartists | 0:4977187e90c7 | 396 | } |
embeddedartists | 0:4977187e90c7 | 397 | #endif /*__cplusplus */ |
redbird | 35:fd0fab867e51 | 398 | |
redbird | 35:fd0fab867e51 | 399 | #endif /* __LPC_COLOR_H_ */ |