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