📄 lcdconf.h
字号:
/*********************************************************************
* SEGGER MICROCONTROLLER SYSTEME GmbH *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2007 SEGGER Microcontroller Systeme GmbH *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V4.14 - Graphical user interface for embedded applications **
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with a license and should not be re-
distributed in any way. We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LCDConf_66766_C16_C128x160.h
Purpose : Sample configuration file
----------------------------------------------------------------------
*/
#ifndef LCDCONF_H
#define LCDCONF_H
/*********************************************************************
*
* General configuration of LCD
*
**********************************************************************
*/
#define LCD_CONTROLLER 66708 /* Ilitek ILI9320 */
#define LCD_BITSPERPIXEL 16
#define LCD_SWAP_RB 0
#define LCD_USE_PARALLEL_16 1
#define _XSIZE 240
#define _YSIZE 320
#define LCD_SWAP_XY 1
#define LCD_MIRROR_X 0
#define LCD_MIRROR_Y 1
#if LCD_SWAP_XY
#define LCD_XSIZE _YSIZE
#define LCD_YSIZE _XSIZE
#else
#define LCD_XSIZE _XSIZE
#define LCD_YSIZE _YSIZE
#endif
/*********************************************************************
*
* Simple bus configuration
*
**********************************************************************
*/
void LCD_X_Init(void);
void LCD_X_Write01_16(unsigned short c);
void LCD_X_Write00_16(unsigned short c);
void LCD_X_WriteM01_16(unsigned short * pData, int NumWords);
void LCD_X_WriteM00_16(unsigned short * pData, int NumWords);
void LCD_X_ReadM01_16 (unsigned short * pData, int NumWords);
#define LCD_WRITE_A1(Word) LCD_X_Write01_16(Word)
#define LCD_WRITE_A0(Word) LCD_X_Write00_16(Word)
#define LCD_WRITEM_A1(Word, NumWords) LCD_X_WriteM01_16(Word, NumWords)
#define LCD_WRITEM_A0(Word, NumWords) LCD_X_WriteM00_16(Word, NumWords)
#define LCD_READM_A1(Word, NumWords) LCD_X_ReadM01_16(Word, NumWords)
/*********************************************************************
*
* Initialisation macro
*
**********************************************************************
*/
#define LCD_INIT_CONTROLLER() \
LCD_X_Init(); \
/* Start Initial Sequence */ \
_WriteU16_A0(229); _WriteU16_A1(0x8000); \
_WriteU16_A0( 0); _WriteU16_A1(0x0001); \
_WriteU16_A0( 1); _WriteU16_A1(0x0100); \
_WriteU16_A0( 2); _WriteU16_A1(0x0700); \
_WriteU16_A0( 3); _WriteU16_A1(0x1030); \
_WriteU16_A0( 4); _WriteU16_A1(0x0000); \
_WriteU16_A0( 8); _WriteU16_A1(0x0202); \
_WriteU16_A0( 9); _WriteU16_A1(0x0000); \
_WriteU16_A0( 10); _WriteU16_A1(0x0000); \
_WriteU16_A0( 12); _WriteU16_A1(0x0000); \
_WriteU16_A0( 13); _WriteU16_A1(0x0000); \
_WriteU16_A0( 15); _WriteU16_A1(0x0000); \
/* Power On sequence */ \
_WriteU16_A0( 16); _WriteU16_A1(0x0000); \
_WriteU16_A0( 17); _WriteU16_A1(0x0000); \
_WriteU16_A0( 18); _WriteU16_A1(0x0000); \
_WriteU16_A0( 19); _WriteU16_A1(0x0000); \
GUI_Delay(20); \
_WriteU16_A0( 16); _WriteU16_A1(0x17B0); \
_WriteU16_A0( 17); _WriteU16_A1(0x0137); \
GUI_Delay(5); \
_WriteU16_A0( 18); _WriteU16_A1(0x0139); \
GUI_Delay(5); \
_WriteU16_A0( 19); _WriteU16_A1(0x1d00); \
_WriteU16_A0( 41); _WriteU16_A1(0x0013); \
GUI_Delay(5); \
_WriteU16_A0( 32); _WriteU16_A1(0x0000); \
_WriteU16_A0( 33); _WriteU16_A1(0x0000); \
/* Adjust the Gamma Curve */ \
_WriteU16_A0( 48); _WriteU16_A1(0x0006); \
_WriteU16_A0( 49); _WriteU16_A1(0x0101); \
_WriteU16_A0( 50); _WriteU16_A1(0x0003); \
_WriteU16_A0( 53); _WriteU16_A1(0x0106); \
_WriteU16_A0( 54); _WriteU16_A1(0x0b02); \
_WriteU16_A0( 55); _WriteU16_A1(0x0302); \
_WriteU16_A0( 56); _WriteU16_A1(0x0707); \
_WriteU16_A0( 57); _WriteU16_A1(0x0007); \
_WriteU16_A0( 60); _WriteU16_A1(0x0600); \
_WriteU16_A0( 61); _WriteU16_A1(0x020b); \
/* Set GRAM area */ \
_WriteU16_A0( 80); _WriteU16_A1(0x0000); \
_WriteU16_A0( 81); _WriteU16_A1(0x00EF); \
_WriteU16_A0( 82); _WriteU16_A1(0x0000); \
_WriteU16_A0( 83); _WriteU16_A1(0x013F); \
_WriteU16_A0( 96); _WriteU16_A1(0x2700); \
_WriteU16_A0( 97); _WriteU16_A1(0x0001); \
_WriteU16_A0(106); _WriteU16_A1(0x0000); \
/* Partial Display Control */ \
_WriteU16_A0(128); _WriteU16_A1(0x0000); \
_WriteU16_A0(129); _WriteU16_A1(0x0000); \
_WriteU16_A0(130); _WriteU16_A1(0x0000); \
_WriteU16_A0(131); _WriteU16_A1(0x0000); \
_WriteU16_A0(132); _WriteU16_A1(0x0000); \
_WriteU16_A0(133); _WriteU16_A1(0x0000); \
/* Panel Control */ \
_WriteU16_A0(144); _WriteU16_A1(0x0010); \
_WriteU16_A0(146); _WriteU16_A1(0x0000); \
_WriteU16_A0(147); _WriteU16_A1(0x0003); \
_WriteU16_A0(149); _WriteU16_A1(0x0110); \
_WriteU16_A0(151); _WriteU16_A1(0x0000); \
_WriteU16_A0(152); _WriteU16_A1(0x0000); \
/* Set GRAM write direction and BGR = 0 */ \
/* I/D=01 (Horizontal : increment, Vertical : decrement) */ \
/* AM=1 (address is updated in vertical writing direction) */ \
_WriteU16_A0(3); _WriteU16_A1(0x0018); \
_WriteU16_A0(7); _WriteU16_A1(0x0173); /* 262K color and display ON */
#define LCD_REG01 0x10
#endif /* LCDCONF_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -