]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/LPCOpen/lpc_core/lpc_chip/chip_18xx_43xx/lcd_18xx_43xx.h
Update LPC18xx FreeRTOS+UDP demo to use LPCOpen USB and Ethernet drivers.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC / ThirdParty / LPCOpen / lpc_core / lpc_chip / chip_18xx_43xx / lcd_18xx_43xx.h
1 /*\r
2  * @brief LPC18xx/43xx LCD chip driver\r
3  *\r
4  * @note\r
5  * Copyright(C) NXP Semiconductors, 2012\r
6  * All rights reserved.\r
7  *\r
8  * @par\r
9  * Software that is described herein is for illustrative purposes only\r
10  * which provides customers with programming information regarding the\r
11  * LPC products.  This software is supplied "AS IS" without any warranties of\r
12  * any kind, and NXP Semiconductors and its licensor disclaim any and\r
13  * all warranties, express or implied, including all implied warranties of\r
14  * merchantability, fitness for a particular purpose and non-infringement of\r
15  * intellectual property rights.  NXP Semiconductors assumes no responsibility\r
16  * or liability for the use of the software, conveys no license or rights under any\r
17  * patent, copyright, mask work right, or any other intellectual property rights in\r
18  * or to any products. NXP Semiconductors reserves the right to make changes\r
19  * in the software without notification. NXP Semiconductors also makes no\r
20  * representation or warranty that such application will be suitable for the\r
21  * specified use without further testing or modification.\r
22  *\r
23  * @par\r
24  * Permission to use, copy, modify, and distribute this software and its\r
25  * documentation is hereby granted, under NXP Semiconductors' and its\r
26  * licensor's relevant copyrights in the software, without fee, provided that it\r
27  * is used in conjunction with NXP Semiconductors microcontrollers.  This\r
28  * copyright, permission, and disclaimer notice must appear in all copies of\r
29  * this code.\r
30  */\r
31 \r
32 #ifndef __LCD_18XX_43XX_H_\r
33 #define __LCD_18XX_43XX_H_\r
34 \r
35 #ifdef __cplusplus\r
36 extern "C" {\r
37 #endif\r
38 \r
39 /** @defgroup LCD_18XX_43XX CHIP: LPC18xx/43xx LCD driver\r
40  * @ingroup CHIP_18XX_43XX_Drivers\r
41  * @{\r
42  */\r
43 \r
44 /**\r
45  * @brief       Initialize the LCD controller\r
46  * @param       pLCD                            : The base of LCD peripheral on the chip\r
47  * @param       LCD_ConfigStruct        : Pointer to LCD configuration\r
48  * @return  LCD_FUNC_OK is executed successfully or LCD_FUNC_ERR on error\r
49  */\r
50 void Chip_LCD_Init(LPC_LCD_T *pLCD, LCD_Config_T *LCD_ConfigStruct);\r
51 \r
52 /**\r
53  * @brief       Shutdown the LCD controller\r
54  * @param       pLCD    : The base of LCD peripheral on the chip\r
55  * @return  Nothing\r
56  */\r
57 void Chip_LCD_DeInit(LPC_LCD_T *pLCD);\r
58 \r
59 /**\r
60  * @brief       Power-on the LCD Panel (power pin)\r
61  * @param       pLCD    : The base of LCD peripheral on the chip\r
62  * @return      None\r
63  */\r
64 STATIC INLINE void Chip_LCD_PowerOn(LPC_LCD_T *pLCD)\r
65 {\r
66         IP_LCD_PowerOn(pLCD);\r
67 }\r
68 \r
69 /**\r
70  * @brief       Power-off the LCD Panel (power pin)\r
71  * @param       pLCD    : The base of LCD peripheral on the chip\r
72  * @return      None\r
73  */\r
74 STATIC INLINE void Chip_LCD_PowerOff(LPC_LCD_T *pLCD)\r
75 {\r
76         IP_LCD_PowerOff(pLCD);\r
77 }\r
78 \r
79 /**\r
80  * @brief       Enable/Disable the LCD Controller\r
81  * @param       pLCD    : The base of LCD peripheral on the chip\r
82  * @return      None\r
83  */\r
84 STATIC INLINE void Chip_LCD_Enable(LPC_LCD_T *pLCD)\r
85 {\r
86         IP_LCD_Enable(pLCD);\r
87 }\r
88 \r
89 /**\r
90  * @brief       Enable/Disable the LCD Controller\r
91  * @param       pLCD    : The base of LCD peripheral on the chip\r
92  * @return      None\r
93  */\r
94 STATIC INLINE void Chip_LCD_Disable(LPC_LCD_T *pLCD)\r
95 {\r
96         IP_LCD_Disable(pLCD);\r
97 }\r
98 \r
99 /**\r
100  * @brief       Set LCD Upper Panel Frame Buffer for Single Panel or Upper Panel Frame\r
101  *                      Buffer for Dual Panel\r
102  * @param       pLCD    : The base of LCD peripheral on the chip\r
103  * @param       buffer  : address of buffer\r
104  * @return      None\r
105  */\r
106 STATIC INLINE void Chip_LCD_SetUPFrameBuffer(LPC_LCD_T *pLCD, void *buffer)\r
107 {\r
108         IP_LCD_SetUPFrameBuffer(pLCD, buffer);\r
109 }\r
110 \r
111 /**\r
112  * @brief       Set LCD Lower Panel Frame Buffer for Dual Panel\r
113  * @param       pLCD    : The base of LCD peripheral on the chip\r
114  * @param       buffer  : address of buffer\r
115  * @return      None\r
116  */\r
117 STATIC INLINE void Chip_LCD_SetLPFrameBuffer(LPC_LCD_T *pLCD, void *buffer)\r
118 {\r
119         IP_LCD_SetLPFrameBuffer(pLCD, buffer);\r
120 }\r
121 \r
122 /**\r
123  * @brief       Configure Cursor\r
124  * @param       pLCD            : The base of LCD peripheral on the chip\r
125  * @param       cursor_size     : specify size of cursor\r
126  *                  - LCD_CURSOR_32x32  :cursor size is 32x32 pixels\r
127  *                  - LCD_CURSOR_64x64  :cursor size is 64x64 pixels\r
128  * @param       sync            : cursor sync mode\r
129  *                  - TRUE      :cursor sync to the frame sync pulse\r
130  *                  - FALSE     :cursor async mode\r
131  * @return      None\r
132  */\r
133 void Chip_LCD_Cursor_Config(LPC_LCD_T *pLCD, IP_LCD_CURSOR_SIZE_OPT_T cursor_size, bool sync);\r
134 \r
135 /**\r
136  * @brief       Enable Cursor\r
137  * @param       pLCD            : The base of LCD peripheral on the chip\r
138  * @param       cursor_num      : specify number of cursor is going to be written\r
139  *                                                      this param must < 4\r
140  * @return      None\r
141  */\r
142 STATIC INLINE void Chip_LCD_Cursor_Enable(LPC_LCD_T *pLCD, uint8_t cursor_num)\r
143 {\r
144         IP_LCD_Cursor_Enable(pLCD, cursor_num);\r
145 }\r
146 \r
147 /**\r
148  * @brief       Disable Cursor\r
149  * @param       pLCD            : The base of LCD peripheral on the chip\r
150  * @param       cursor_num      : specify number of cursor is going to be written\r
151  *                                                      this param must < 4\r
152  * @return      None\r
153  */\r
154 STATIC INLINE void Chip_LCD_Cursor_Disable(LPC_LCD_T *pLCD, uint8_t cursor_num)\r
155 {\r
156         IP_LCD_Cursor_Disable(pLCD, cursor_num);\r
157 }\r
158 \r
159 /**\r
160  * @brief       Load Cursor Palette\r
161  * @param       pLCD                    : The base of LCD peripheral on the chip\r
162  * @param       palette_color   : cursor palette 0 value\r
163  * @return      None\r
164  */\r
165 STATIC INLINE void Chip_LCD_Cursor_LoadPalette0(LPC_LCD_T *pLCD, uint32_t palette_color)\r
166 {\r
167         IP_LCD_Cursor_LoadPalette0(pLCD, palette_color);\r
168 }\r
169 \r
170 /**\r
171  * @brief       Load Cursor Palette\r
172  * @param       pLCD                    : The base of LCD peripheral on the chip\r
173  * @param       palette_color   : cursor palette 1 value\r
174  * @return      None\r
175  */\r
176 STATIC INLINE void Chip_LCD_Cursor_LoadPalette1(LPC_LCD_T *pLCD, uint32_t palette_color)\r
177 {\r
178         IP_LCD_Cursor_LoadPalette1(pLCD, palette_color);\r
179 }\r
180 \r
181 /**\r
182  * @brief       Set Cursor Position\r
183  * @param       pLCD    : The base of LCD peripheral on the chip\r
184  * @param       x               : horizontal position\r
185  * @param       y               : vertical position\r
186  * @return      None\r
187  */\r
188 STATIC INLINE void Chip_LCD_Cursor_SetPos(LPC_LCD_T *pLCD, uint16_t x, uint16_t y)\r
189 {\r
190         IP_LCD_Cursor_SetPos(pLCD, x, y);\r
191 }\r
192 \r
193 /**\r
194  * @brief       Set Cursor Clipping Position\r
195  * @param       pLCD    : The base of LCD peripheral on the chip\r
196  * @param       x               : horizontal position, should be in range: 0..63\r
197  * @param       y               : vertical position, should be in range: 0..63\r
198  * @return      None\r
199  */\r
200 STATIC INLINE void Chip_LCD_Cursor_SetClip(LPC_LCD_T *pLCD, uint16_t x, uint16_t y)\r
201 {\r
202         IP_LCD_Cursor_SetClip(pLCD, x, y);\r
203 }\r
204 \r
205 /**\r
206  * @brief       Enable Controller Interrupt\r
207  * @param       pLCD    : The base of LCD peripheral on the chip\r
208  * @param       ints    : OR'ed interrupt bits to enable\r
209  * @return      None\r
210  */\r
211 STATIC INLINE void Chip_LCD_EnableInts(LPC_LCD_T *pLCD, uint32_t ints)\r
212 {\r
213         IP_LCD_EnableInts(pLCD, ints);\r
214 }\r
215 \r
216 /**\r
217  * @brief       Disable Controller Interrupt\r
218  * @param       pLCD    : The base of LCD peripheral on the chip\r
219  * @param       ints    : OR'ed interrupt bits to disable\r
220  * @return      None\r
221  */\r
222 STATIC INLINE void Chip_LCD_DisableInts(LPC_LCD_T *pLCD, uint32_t ints)\r
223 {\r
224         IP_LCD_DisableInts(pLCD, ints);\r
225 }\r
226 \r
227 /**\r
228  * @brief       Clear Controller Interrupt\r
229  * @param       pLCD    : The base of LCD peripheral on the chip\r
230  * @param       ints    : OR'ed interrupt bits to clear\r
231  * @return      None\r
232  */\r
233 STATIC INLINE void Chip_LCD_ClearInts(LPC_LCD_T *pLCD, uint32_t ints)\r
234 {\r
235         IP_LCD_ClearInts(pLCD, ints);\r
236 }\r
237 \r
238 /**\r
239  * @brief       Write Cursor Image into Internal Cursor Image Buffer\r
240  * @param       pLCD            : The base of LCD peripheral on the chip\r
241  * @param       cursor_num      : Cursor index\r
242  * @param       Image           : Pointer to image data\r
243  * @return      None\r
244  */\r
245 void Chip_LCD_Cursor_WriteImage(LPC_LCD_T *pLCD, uint8_t cursor_num, void *Image);\r
246 \r
247 /**\r
248  * @brief       Load LCD Palette\r
249  * @param       pLCD    : The base of LCD peripheral on the chip\r
250  * @param       palette : Address of palette table to load\r
251  * @return      None\r
252  */\r
253 void Chip_LCD_LoadPalette(LPC_LCD_T *pLCD, void *palette);\r
254 \r
255 #ifdef __cplusplus\r
256 }\r
257 #endif\r
258 \r
259 /**\r
260  * @}\r
261  */\r
262 \r
263 #endif /* __LCD_18XX_43XX_H_ */\r