| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Functions
SWIM color definitions
Simple Windows Interface manager (SWIM) graphics Library

## Detailed Description

The Simple Windows Interface manager (SWIM) supports 8-bit RGB323, 12-bit RGB 444 (in a 16-bit field), 15-bit RGB555, 16-bit RGB565, and 24-bit RGB888 (in a 32-bit field) color.

SWIM is configured for the color type at build-time based on the the COLORS_DEF definitions. Select one of the following values to configure SWIM. 8-bit RGB323 : COLORS_DEF = 8 12-bit RGB323: COLORS_DEF = 12 15-bit RGB323: COLORS_DEF = 15 16-bit RGB323: COLORS_DEF = 16 24-bit RGB323: COLORS_DEF = 24

## Macros
#define | COLORS_DEF 16 /* 16-bit 565 color mode */
#define | COLORS_8_565_MODE
#define | BLACK 0x0000
#define | LIGHTGRAY 0X7BEF
#define | DARKGRAY 0x39E7
#define | WHITE 0xffff
#define | RED 0xF800
#define | GREEN 0x07E0
#define | BLUE 0x001F
#define | LIGHTRED 0x7800
#define | LIGHTGREEN 0x03E0
#define | LIGHTBLUE 0x000F
#define | MINRED 0x0800
#define | MINGREEN 0x0020
#define | MINBLUE 0x0001
#define | REDMASK 0xF800
#define | REDSHIFT 11
#define | GREENMASK 0x07E0
#define | GREENSHIFT 5
#define | BLUEMASK 0x001F
#define | BLUESHIFT 0
#define | NUM_COLORS 65536
#define | RED_COLORS 0x20
#define | GREEN_COLORS 0x40
#define | BLUE_COLORS 0x20

## Typedefs
typedef uint16_t | COLOR_T

## Functions
void | lpc_colors_set_palette (uint16_t *palette_table)
| Generate a palette table (only in 8-bit mode)

## Macro Definition Documentation

#define BLACK 0x0000

Definition at line 137 of file lpc_colors.h.

#define BLUE 0x001F

Definition at line 149 of file lpc_colors.h.

#define BLUE_COLORS 0x20

Definition at line 185 of file lpc_colors.h.

#define BLUEMASK 0x001F

Definition at line 174 of file lpc_colors.h.

#define BLUESHIFT 0

Definition at line 176 of file lpc_colors.h.

#define COLORS_8_565_MODE

Setup the palette table for RGB565 mode if COLORS_8_565_MODE is defined, other use RGB555 mode if not defined.

Definition at line 75 of file lpc_colors.h.

#define COLORS_DEF 16 /* 16-bit 565 color mode */

Default configuration values

Definition at line 65 of file lpc_colors.h.

#define DARKGRAY 0x39E7

Definition at line 141 of file lpc_colors.h.

#define GREEN 0x07E0

Definition at line 147 of file lpc_colors.h.

#define GREEN_COLORS 0x40

Definition at line 183 of file lpc_colors.h.

#define GREENMASK 0x07E0

Definition at line 170 of file lpc_colors.h.

#define GREENSHIFT 5

Definition at line 172 of file lpc_colors.h.

#define LIGHTBLUE 0x000F

Definition at line 156 of file lpc_colors.h.

#define LIGHTGRAY 0X7BEF

Definition at line 139 of file lpc_colors.h.

#define LIGHTGREEN 0x03E0

Definition at line 154 of file lpc_colors.h.

#define LIGHTRED 0x7800

Definition at line 152 of file lpc_colors.h.

#define MINBLUE 0x0001

Definition at line 163 of file lpc_colors.h.

#define MINGREEN 0x0020

Definition at line 161 of file lpc_colors.h.

#define MINRED 0x0800

Definition at line 159 of file lpc_colors.h.

#define NUM_COLORS 65536

Definition at line 179 of file lpc_colors.h.

#define RED 0xF800

Definition at line 145 of file lpc_colors.h.

#define RED_COLORS 0x20

Definition at line 181 of file lpc_colors.h.

#define REDMASK 0xF800

Definition at line 166 of file lpc_colors.h.

#define REDSHIFT 11

Definition at line 168 of file lpc_colors.h.

#define WHITE 0xffff

Definition at line 143 of file lpc_colors.h.

## Typedef Documentation

typedef uint16_t COLOR_T

Definition at line 188 of file lpc_colors.h.

## Function Documentation

void lpc_colors_set_palette | ( | uint16_t * | palette_table | ) |

Generate a palette table (only in 8-bit mode)

Parameters

  palette_table | : Pointer to palette table (256 entries)

Returns
  Nothing

Note
  Depending on the target LCD color mapping (either 555 or 565), a palette table will be generated to convert colors stored in 233 format to either 555 or 565 format through a lookup table. If compiled in 16-bit color mode, this will be a NULL function. Select the appropriate define in this function for 555 or 565 color mode displays when using an 256 color frame buffer.

Definition at line 51 of file lpc_colors.c.