1 //*****************************************************************************
\r
8 // +----+ Copyright (c) 2009 Code Red Technologies Ltd.
\r
10 // lcd.h - Routines containing primitives for writing to the LCD
\r
13 // Software License Agreement
\r
15 // The software is owned by Code Red Technologies and/or its suppliers, and is
\r
16 // protected under applicable copyright laws. All rights are reserved. Any
\r
17 // use in violation of the foregoing restrictions may subject the user to criminal
\r
18 // sanctions under applicable laws, as well as to civil liability for the breach
\r
19 // of the terms and conditions of this license.
\r
21 // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
\r
22 // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
\r
23 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
\r
24 // USE OF THIS SOFTWARE FOR COMMERCIAL DEVELOPMENT AND/OR EDUCATION IS SUBJECT
\r
25 // TO A CURRENT END USER LICENSE AGREEMENT (COMMERCIAL OR EDUCATIONAL) WITH
\r
26 // CODE RED TECHNOLOGIES LTD.
\r
32 // Define size of LCD screen.
\r
34 #define LCD_MAX_X 128
\r
35 #define LCD_MAX_Y 128
\r
37 // Translates a 24-bit RGB color to RGB565
\r
38 #define TRANSLATE24BIT_TO_RGB565(c) ((((c) & 0x00ff0000) >> 19) | \
\r
39 ((((c) & 0x0000ff00) >> 5) & 0x000007e0) | \
\r
40 ((((c) & 0x000000ff) << 8) & 0x0000f800))
\r
42 // Define a basic set of 24bit colors, based on the standard "websafe" set
\r
43 #define COLOR24_AQUA 0x00FFFF
\r
44 #define COLOR24_GREY 0x808080
\r
45 #define COLOR24_NAVY 0x000080
\r
46 #define COLOR24_SILVER 0xC0C0C0
\r
47 #define COLOR24_BLACK 0x000000
\r
48 #define COLOR24_GREEN 0x008000
\r
49 #define COLOR24_OLIVE 0x808000
\r
50 #define COLOR24_TEAL 0x008080
\r
51 #define COLOR24_BLUE 0x0000FF
\r
52 #define COLOR24_LIME 0x00FF00
\r
53 #define COLOR24_PURPLE 0x800080
\r
54 #define COLOR24_WHITE 0xFFFFFF
\r
55 #define COLOR24_FUCHSIA 0xFF00FF
\r
56 #define COLOR24_MAROON 0x800000
\r
57 #define COLOR24_RED 0xFF0000
\r
58 #define COLOR24_YELLOW 0xFFFF00
\r
60 // Create a set of RGB565 colors that can be used directly within code
\r
61 #define COLOR_AQUA TRANSLATE24BIT_TO_RGB565(COLOR24_AQUA)
\r
62 #define COLOR_GREY TRANSLATE24BIT_TO_RGB565(COLOR24_GREY)
\r
63 #define COLOR_NAVY TRANSLATE24BIT_TO_RGB565(COLOR24_NAVY)
\r
64 #define COLOR_SILVER TRANSLATE24BIT_TO_RGB565(COLOR24_SILVER)
\r
65 #define COLOR_BLACK TRANSLATE24BIT_TO_RGB565(COLOR24_BLACK)
\r
66 #define COLOR_GREEN TRANSLATE24BIT_TO_RGB565(COLOR24_GREEN)
\r
67 #define COLOR_OLIVE TRANSLATE24BIT_TO_RGB565(COLOR24_OLIVE)
\r
68 #define COLOR_TEAL TRANSLATE24BIT_TO_RGB565(COLOR24_TEAL)
\r
69 #define COLOR_BLUE TRANSLATE24BIT_TO_RGB565(COLOR24_BLUE)
\r
70 #define COLOR_LIME TRANSLATE24BIT_TO_RGB565(COLOR24_LIME)
\r
71 #define COLOR_PURPLE TRANSLATE24BIT_TO_RGB565(COLOR24_PURPLE)
\r
72 #define COLOR_WHITE TRANSLATE24BIT_TO_RGB565(COLOR24_WHITE)
\r
73 #define COLOR_FUCHSIA TRANSLATE24BIT_TO_RGB565(COLOR24_FUCHSIA)
\r
74 #define COLOR_MAROON TRANSLATE24BIT_TO_RGB565(COLOR24_MAROON)
\r
75 #define COLOR_RED TRANSLATE24BIT_TO_RGB565(COLOR24_RED)
\r
76 #define COLOR_YELLOW TRANSLATE24BIT_TO_RGB565(COLOR24_YELLOW)
\r
79 void LCD_Line (int xmin,int xmax,int ymin,int ymax,int color);
\r
80 void LCD_FilledRect(int xmin,int xmax,int ymin,int ymax,int color);
\r
81 void LCD_Rect(int xmin,int xmax,int ymin,int ymax,int color);
\r
82 void LCD_WriteBitMap8x15(int x, int y, int height, int width, unsigned char *pBitMap, int color);
\r
83 void LCD_PlotPoint(int x,int y,int color);
\r
84 void LCD_Circle (int x0, int y0, int radius, int color);
\r
85 void LCD_FilledCircle (int x0, int y0, int radius, int color);
\r
86 void LCD_ClearScreen(void);
\r
87 void LCD_WriteBitMap8x15(int x, int y, int height, int width, unsigned char *pBitMap, int color);
\r
88 void LCD_PrintChar(int x, int y, unsigned char c, int color );
\r
89 void LCD_PrintString(int x, int y, char *pcString, int iStrLen, int color);
\r