]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_lcd.h
Slight modification to license blub text in header comments.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC / ThirdParty / CMSISv2p10_LPC18xx_DriverLib / inc / lpc18xx_lcd.h
1 /**********************************************************************\r
2 * $Id$          lpc18xx_lcd.h           2011-06-02\r
3 *//**\r
4 * @file         lpc18xx_lcd.h\r
5 * @brief        Contains all macro definitions and function prototypes\r
6 *                       support for LCD Driver\r
7 * @version      1.0\r
8 * @date         02. June. 2011\r
9 * @author       NXP MCU SW Application Team\r
10 *\r
11 * Copyright(C) 2011, NXP Semiconductor\r
12 * All rights reserved.\r
13 *\r
14 ***********************************************************************\r
15 * Software that is described herein is for illustrative purposes only\r
16 * which provides customers with programming information regarding the\r
17 * products. This software is supplied "AS IS" without any warranties.\r
18 * NXP Semiconductors assumes no responsibility or liability for the\r
19 * use of the software, conveys no license or title under any patent,\r
20 * copyright, or mask work right to the product. NXP Semiconductors\r
21 * reserves the right to make changes in the software without\r
22 * notification. NXP Semiconductors also make no representation or\r
23 * warranty that such application will be suitable for the specified\r
24 * use without further testing or modification.\r
25 **********************************************************************/\r
26 \r
27 /* Peripheral group ----------------------------------------------------------- */\r
28 /** @defgroup LCD LCD\r
29  * @ingroup LPC1800CMSIS_FwLib_Drivers\r
30  * @{\r
31  */\r
32 \r
33 #ifndef __LPC18XX_LCD_H_\r
34 #define __LPC18XX_LCD_H_\r
35 \r
36 /* Includes ------------------------------------------------------------------- */\r
37 #include "LPC18xx.h"\r
38 #include "lpc_types.h"\r
39 \r
40 #ifdef __cplusplus\r
41 extern "C"\r
42 {\r
43 #endif\r
44 \r
45 /* Private Macros ------------------------------------------------------------- */\r
46 /** @defgroup LCD_Private_Macros LCD Private Macros\r
47  * @{\r
48  */\r
49 \r
50 /* --------------------- BIT DEFINITIONS -------------------------------------- */\r
51 /* LCD control enable bit */\r
52 #define CLCDC_LCDCTRL_ENABLE    _BIT(0)\r
53 /* LCD control power enable bit */\r
54 #define CLCDC_LCDCTRL_PWR       _BIT(11)\r
55 \r
56 /**\r
57  * @}\r
58  */\r
59 \r
60 \r
61 /* Public Types --------------------------------------------------------------- */\r
62 /** @defgroup LCD_Public_Types LCD Public Types\r
63  * @{\r
64  */\r
65 \r
66 /*********************************************************************//**\r
67  * @brief LCD enumeration\r
68  **********************************************************************/\r
69 \r
70 /** @brief LCD Interrupt Source */\r
71 typedef enum{\r
72         LCD_INT_FUF = _BIT(1),          /* FIFO underflow bit */\r
73         LCD_INT_LNBU = _BIT(2),         /* LCD next base address update bit */\r
74         LCD_INT_VCOMP = _BIT(3),        /* vertical compare bit */\r
75         LCD_INT_BER = _BIT(4)           /* AHB master error interrupt bit */\r
76 } LCD_INT_SRC;\r
77 \r
78 /** @brief LCD signal polarity */\r
79 typedef enum {\r
80         LCD_SIGNAL_ACTIVE_HIGH = 0,\r
81         LCD_SIGNAL_ACTIVE_LOW = 1\r
82 } LCD_SIGNAL_POLARITY_OPT;\r
83 \r
84 /** @brief LCD clock edge polarity */\r
85 typedef enum {\r
86         LCD_CLK_RISING = 0,\r
87         LCD_CLK_FALLING= 1\r
88 } LCD_CLK_EDGE_OPT;\r
89 \r
90 /** @brief LCD bits per pixel and pixel format */\r
91 typedef enum {\r
92         LCD_BPP1 = 0,\r
93         LCD_BPP2,\r
94         LCD_BPP4,\r
95         LCD_BPP8,\r
96         LCD_BPP16,\r
97         LCD_BPP24,\r
98         LCD_BPP16_565,\r
99         LCD_BPP12_444\r
100 }LCD_PIXEL_FORMAT_OPT;\r
101 \r
102 /** @brief LCD color format */\r
103 typedef enum {\r
104         LCD_COLOR_FORMAT_RGB = 0,\r
105         LCD_COLOR_FORMAT_BGR\r
106 }LCD_COLOR_FORMAT_OPT;\r
107 \r
108 \r
109 /*********************************************************************//**\r
110  * @brief LCD structure definitions\r
111  **********************************************************************/\r
112 /** @brief LCD Palette entry format */\r
113 typedef struct\r
114 {\r
115         uint32_t Rl:5;\r
116         uint32_t Gl:5;\r
117         uint32_t Bl:5;\r
118         uint32_t Il:1;\r
119         uint32_t Ru:5;\r
120         uint32_t Gu:5;\r
121         uint32_t Bu:5;\r
122         uint32_t Iu:1;\r
123 } LCD_PALETTE_ENTRY_Type;\r
124 \r
125 /** @brief LCD cursor format in 1 byte LBBP */\r
126 typedef struct\r
127 {\r
128         uint8_t Pixel3:2;\r
129         uint8_t Pixel2:2;\r
130         uint8_t Pixel1:2;\r
131         uint8_t Pixel0:2;\r
132 } LCD_CURSOR_PIXEL_Type;\r
133 \r
134 /** @brief LCD cursor size */\r
135 typedef enum\r
136 {\r
137         LCD_CURSOR_32x32 = 0,\r
138         LCD_CURSOR_64x64\r
139 } LCD_CURSOR_SIZE_OPT;\r
140 \r
141 /** @brief LCD panel type */\r
142 typedef enum\r
143 {\r
144         LCD_TFT = 0x02,         /* standard TFT */\r
145         LCD_MONO_4 = 0x01,  /* 4-bit STN mono */\r
146         LCD_MONO_8 = 0x05,  /* 8-bit STN mono */\r
147         LCD_CSTN = 0x00     /* color STN */\r
148 } LCD_PANEL_OPT;\r
149 \r
150 /** @brief LCD porch configuration structure */\r
151 typedef struct {\r
152         uint16_t front;         /* front porch setting in clocks */\r
153         uint16_t back;          /* back porch setting in clocks */\r
154 }LCD_PORCHCFG_Type;\r
155 \r
156 /** @brief LCD configuration structure */\r
157 typedef struct {\r
158         uint16_t                                screen_width;                   /* Pixels per line */\r
159         uint16_t                                screen_height;                  /* Lines per panel */\r
160         LCD_PORCHCFG_Type               horizontal_porch;               /* porch setting for horizontal */\r
161         LCD_PORCHCFG_Type               vertical_porch;                 /* porch setting for vertical */\r
162         uint16_t                                HSync_pulse_width;              /* HSYNC pulse width in clocks */\r
163         uint16_t                                VSync_pulse_width;              /* VSYNC pulse width in clocks */\r
164         uint8_t                         ac_bias_frequency;      /* AC bias frequency in clocks */\r
165         LCD_SIGNAL_POLARITY_OPT HSync_pol;                              /* HSYNC polarity */\r
166         LCD_SIGNAL_POLARITY_OPT VSync_pol;                              /* VSYNC polarity */\r
167         LCD_CLK_EDGE_OPT                panel_clk_edge;                 /* Panel Clock Edge Polarity */\r
168         LCD_SIGNAL_POLARITY_OPT OE_pol;                                 /* Output Enable polarity */\r
169         uint32_t                                line_end_delay;                 /* 0 if not use */\r
170         LCD_PIXEL_FORMAT_OPT    bits_per_pixel;         /* Maximum bits per pixel the display supports */\r
171         LCD_PANEL_OPT                   lcd_panel_type;         /* LCD panel type */\r
172         LCD_COLOR_FORMAT_OPT    color_format;                   /* BGR or RGB */\r
173         Bool                            dual_panel;             /* Dual panel, TRUE = dual panel display */\r
174         uint16_t                                pcd;\r
175 } LCD_CFG_Type;\r
176 \r
177 /**\r
178  * @}\r
179  */\r
180 \r
181 /* Public Functions ----------------------------------------------------------- */\r
182 /** @defgroup LCD_Public_Functions LCD Public Functions\r
183  * @{\r
184  */\r
185 \r
186 void LCD_Init(LPC_LCD_Type *LCDx, LCD_CFG_Type *LCD_ConfigStruct);\r
187 void LCD_DeInit(LPC_LCD_Type *LCDx);\r
188 \r
189 void LCD_Power(LPC_LCD_Type *LCDx, FunctionalState OnOff);\r
190 void LCD_Enable(LPC_LCD_Type *LCDx, FunctionalState EnDis);\r
191 void LCD_SetFrameBuffer(LPC_LCD_Type *LCDx, void* buffer);\r
192 void LCD_SetLPFrameBuffer(LPC_LCD_Type *LCDx, void* buffer);\r
193 void LCD_LoadPalette(LPC_LCD_Type *LCDx, void* palette);\r
194 void LCD_SetInterrupt(LPC_LCD_Type *LCDx, LCD_INT_SRC Int);\r
195 void LCD_ClrInterrupt(LPC_LCD_Type *LCDx, LCD_INT_SRC Int);\r
196 LCD_INT_SRC LCD_GetInterrupt(LPC_LCD_Type *LCDx);\r
197 \r
198 void LCD_Cursor_Config(LPC_LCD_Type *LCDx, LCD_CURSOR_SIZE_OPT cursor_size, Bool sync);\r
199 void LCD_Cursor_WriteImage(LPC_LCD_Type *LCDx, uint8_t cursor_num, void* Image);\r
200 void* LCD_Cursor_GetImageBufferAddress(LPC_LCD_Type *LCDx, uint8_t cursor_num);\r
201 void LCD_Cursor_Enable(LPC_LCD_Type *LCDx, uint8_t cursor_num, FunctionalState OnOff);\r
202 void LCD_Cursor_LoadPalette0(LPC_LCD_Type *LCDx, uint32_t palette_color);\r
203 void LCD_Cursor_LoadPalette1(LPC_LCD_Type *LCDx, uint32_t palette_color);\r
204 void LCD_Cursor_SetInterrupt(LPC_LCD_Type *LCDx);\r
205 void LCD_Cursor_ClrInterrupt(LPC_LCD_Type *LCDx);\r
206 void LCD_Cursor_SetPos(LPC_LCD_Type *LCDx, uint16_t x, uint16_t y);\r
207 void LCD_Cursor_SetClipPos(LPC_LCD_Type *LCDx, uint16_t x, uint16_t y);\r
208 \r
209 /**\r
210  * @}\r
211  */\r
212 \r
213 #ifdef __cplusplus\r
214 }\r
215 #endif\r
216 \r
217 #endif /* __LPC18XX_LCD_H_ */\r
218 \r
219 /**\r
220  * @}\r
221  */\r
222 \r
223 /* --------------------------------- End Of File ------------------------------ */\r
224 \r