LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
lcd_001.h
Go to the documentation of this file.
1 /*
2  * @brief LCD controller Registers and control functions
3  *
4  * @note
5  * Copyright(C) NXP Semiconductors, 2012
6  * All rights reserved.
7  *
8  * @par
9  * Software that is described herein is for illustrative purposes only
10  * which provides customers with programming information regarding the
11  * LPC products. This software is supplied "AS IS" without any warranties of
12  * any kind, and NXP Semiconductors and its licensor disclaim any and
13  * all warranties, express or implied, including all implied warranties of
14  * merchantability, fitness for a particular purpose and non-infringement of
15  * intellectual property rights. NXP Semiconductors assumes no responsibility
16  * or liability for the use of the software, conveys no license or rights under any
17  * patent, copyright, mask work right, or any other intellectual property rights in
18  * or to any products. NXP Semiconductors reserves the right to make changes
19  * in the software without notification. NXP Semiconductors also makes no
20  * representation or warranty that such application will be suitable for the
21  * specified use without further testing or modification.
22  *
23  * @par
24  * Permission to use, copy, modify, and distribute this software and its
25  * documentation is hereby granted, under NXP Semiconductors' and its
26  * licensor's relevant copyrights in the software, without fee, provided that it
27  * is used in conjunction with NXP Semiconductors microcontrollers. This
28  * copyright, permission, and disclaimer notice must appear in all copies of
29  * this code.
30  */
31 
32 #ifndef __LCD_001_H_
33 #define __LCD_001_H_
34 
35 #include "sys_config.h"
36 #include "cmsis.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
50 typedef struct {
51  __IO uint32_t TIMH;
52  __IO uint32_t TIMV;
53  __IO uint32_t POL;
54  __IO uint32_t LE;
57  __IO uint32_t CTRL;
64  __I uint32_t RESERVED0[115];
65  __IO uint16_t PAL[256];
66  __I uint32_t RESERVED1[256];
67  __IO uint32_t CRSR_IMG[256];
74  __I uint32_t RESERVED2[2];
80 
84 typedef struct {
85  uint32_t Rl : 5;
86  uint32_t Gl : 5;
87  uint32_t Bl : 5;
88  uint32_t Il : 1;
89  uint32_t Ru : 5;
90  uint32_t Gu : 5;
91  uint32_t Bu : 5;
92  uint32_t Iu : 1;
94 
98 typedef enum {
99  LCD_TFT = 0x02,
100  LCD_MONO_4 = 0x01,
101  LCD_MONO_8 = 0x05,
102  LCD_CSTN = 0x00
103 } LCD_PANEL_OPT;
104 
108 typedef enum {
112 
114 #define LCD_INTMSK_FUFIM 0x2
115 #define LCD_INTMSK_LNBUIM 0x4
116 #define LCD_INTMSK_VCOMPIM 0x8
117 #define LCD_INTMSK_BERIM 0x10
119 #define CLCDC_LCDCTRL_ENABLE _BIT(0)
120 #define CLCDC_LCDCTRL_PWR _BIT(11)
125 typedef struct {
126  uint8_t HBP;
127  uint8_t HFP;
128  uint8_t HSW;
129  uint16_t PPL;
130  uint8_t VBP;
131  uint8_t VFP;
132  uint8_t VSW;
133  uint16_t LPP;
134  uint8_t IOE;
135  uint8_t IPC;
136  uint8_t IHS;
137  uint8_t IVS;
138  uint8_t ACB;
139  uint8_t BPP;
142  uint8_t Dual;
144 
148 typedef enum {
152 
160 {
161  LCDx->INTMSK = ints;
162 }
163 
171 {
172  LCDx->INTMSK = LCDx->INTMSK & ~(ints);
173 }
174 
182 {
183  LCDx->INTCLR = LCDx->INTMSK & (ints);
184 }
185 
192 void IP_LCD_Init(IP_LCD_001_Type *LCDx, LCD_Config_Type *LCD_ConfigStruct);
193 
200 void IP_LCD_Power(IP_LCD_001_Type *LCDx, FunctionalState OnOff);
201 
209 
217 void IP_LCD_SetUPFrameBuffer(IP_LCD_001_Type *LCDx, void *buffer);
218 
225 void IP_LCD_SetLPFrameBuffer(IP_LCD_001_Type *LCDx, void *buffer);
226 
238 void IP_LCD_Cursor_Config(IP_LCD_001_Type *LCDx, LCD_CURSOR_SIZE_OPT cursor_size, bool sync);
239 
247 void *IP_LCD_Cursor_GetImageBufferAddress(IP_LCD_001_Type *LCDx, uint8_t cursor_num);
248 
257 void IP_LCD_Cursor_Enable(IP_LCD_001_Type *LCDx, uint8_t cursor_num, FunctionalState OnOff);
258 
265 void IP_LCD_Cursor_LoadPalette0(IP_LCD_001_Type *LCDx, uint32_t palette_color);
266 
273 void IP_LCD_Cursor_LoadPalette1(IP_LCD_001_Type *LCDx, uint32_t palette_color);
274 
282 void IP_LCD_Cursor_SetPos(IP_LCD_001_Type *LCDx, uint16_t x, uint16_t y);
283 
291 void IP_LCD_Cursor_SetClip(IP_LCD_001_Type *LCDx, uint16_t x, uint16_t y);
292 
300 void IP_LCD_Color_LoadPalette(IP_LCD_001_Type *LCDx, uint32_t *palette_addr, uint32_t index);
301 
306 #ifdef __cplusplus
307 }
308 #endif
309 
310 #endif /* __LCD_001_H_ */