1 /**********************************************************************
\r
2 * $Id$ lpc18xx_lcd.h 2011-06-02
\r
4 * @file lpc18xx_lcd.h
\r
5 * @brief Contains all macro definitions and function prototypes
\r
6 * support for LCD Driver
\r
8 * @date 02. June. 2011
\r
9 * @author NXP MCU SW Application Team
\r
11 * Copyright(C) 2011, NXP Semiconductor
\r
12 * All rights reserved.
\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
27 /* Peripheral group ----------------------------------------------------------- */
\r
28 /** @defgroup LCD LCD
\r
29 * @ingroup LPC1800CMSIS_FwLib_Drivers
\r
33 #ifndef __LPC18XX_LCD_H_
\r
34 #define __LPC18XX_LCD_H_
\r
36 /* Includes ------------------------------------------------------------------- */
\r
37 #include "LPC18xx.h"
\r
38 #include "lpc_types.h"
\r
45 /* Private Macros ------------------------------------------------------------- */
\r
46 /** @defgroup LCD_Private_Macros LCD Private Macros
\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
61 /* Public Types --------------------------------------------------------------- */
\r
62 /** @defgroup LCD_Public_Types LCD Public Types
\r
66 /*********************************************************************//**
\r
67 * @brief LCD enumeration
\r
68 **********************************************************************/
\r
70 /** @brief LCD Interrupt Source */
\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
78 /** @brief LCD signal polarity */
\r
80 LCD_SIGNAL_ACTIVE_HIGH = 0,
\r
81 LCD_SIGNAL_ACTIVE_LOW = 1
\r
82 } LCD_SIGNAL_POLARITY_OPT;
\r
84 /** @brief LCD clock edge polarity */
\r
90 /** @brief LCD bits per pixel and pixel format */
\r
100 }LCD_PIXEL_FORMAT_OPT;
\r
102 /** @brief LCD color format */
\r
104 LCD_COLOR_FORMAT_RGB = 0,
\r
105 LCD_COLOR_FORMAT_BGR
\r
106 }LCD_COLOR_FORMAT_OPT;
\r
109 /*********************************************************************//**
\r
110 * @brief LCD structure definitions
\r
111 **********************************************************************/
\r
112 /** @brief LCD Palette entry format */
\r
123 } LCD_PALETTE_ENTRY_Type;
\r
125 /** @brief LCD cursor format in 1 byte LBBP */
\r
132 } LCD_CURSOR_PIXEL_Type;
\r
134 /** @brief LCD cursor size */
\r
137 LCD_CURSOR_32x32 = 0,
\r
139 } LCD_CURSOR_SIZE_OPT;
\r
141 /** @brief LCD panel type */
\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
150 /** @brief LCD porch configuration structure */
\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
156 /** @brief LCD configuration structure */
\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
181 /* Public Functions ----------------------------------------------------------- */
\r
182 /** @defgroup LCD_Public_Functions LCD Public Functions
\r
186 void LCD_Init(LPC_LCD_Type *LCDx, LCD_CFG_Type *LCD_ConfigStruct);
\r
187 void LCD_DeInit(LPC_LCD_Type *LCDx);
\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
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
217 #endif /* __LPC18XX_LCD_H_ */
\r
223 /* --------------------------------- End Of File ------------------------------ */
\r