⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd.h

📁 S3C2410用于WINCE启动的BOOT程序
💻 H
字号:
/**************************************************************
The initial and control for 240×320 16Bpp TFT LCD----LtS350Q1 & LQ035Q7DB02
**************************************************************/
#ifndef __LCD_HH_H__
#define __LCD_HH_H__

#define LCD_ZF640480    1//振丰
#define LCD_YF320240    2//远峰
#define LCD_XL480272    3//信利
#define LCD_LD240320    4//零点
#define LCD_TYPE        LCD_XL480272 

#define LCD_CN     1

#define MVAL		(13)
#define MVAL_USED 	(0)		//0=each frame   1=rate by MVAL
#define INVVDEN		(1)		//0=normal       1=inverted
#define BSWP		(0)		//Byte swap control
#define HWSWP		(1)		//Half word swap control

#define M5D(n) ((n) & 0x1fffff)	// To get lower 21bits


#if (LCD_TYPE == LCD_ZF640480 )
#define LCD_XSIZE 	(640)	
#define LCD_YSIZE 	(480)

#define SCR_XSIZE 	(LCD_XSIZE)
#define SCR_YSIZE 	(LCD_YSIZE)

//Timing parameter for LCD ---- LQ035Q7DB02

#define VBPD 		((20) & 0xff)		//垂直同步信号的后肩
#define VFPD 		((2)  & 0xff)		//垂直同步信号的前肩
#define VSPW 	    ((1)  & 0x3f)		//垂直同步信号的脉宽

#define HBPD 		((121) & 0x7f)          //水平同步信号的后肩
#define HFPD 		((15)  & 0xff)		//水平同步信号的前肩
#define HSPW        ((13)  & 0xff)		//水平同步信号的脉宽
#define LCD_CLKVAL   	(1)    //刷新率		
#define LCD_ROTATE  0

#if LCD_ROTATE
  #define BmpWidth	  50
  #define BmpHeight   126
#else
  #define BmpWidth	  126
  #define BmpHeight   50
#endif



#endif

#if (LCD_TYPE == LCD_YF320240 )
#define LCD_XSIZE 	(320)	
#define LCD_YSIZE 	(240)

#define SCR_XSIZE 	(LCD_XSIZE)
#define SCR_YSIZE 	(LCD_YSIZE)

//Timing parameter for LCD ---- LQ035Q7DB02

  #define VBPD                ((1) & 0xff)  //垂直同步信号的后肩
  #define VFPD                ((2) & 0xff)  //垂直同步信号的前肩
  #define VSPW                ((1) & 0x3f)  //垂直同步信号的脉宽

  #define HBPD                ((49) & 0x7f)  //水平同步信号的后肩
  #define HFPD                ((15) & 0xff)  //水平同步信号的前肩
  #define HSPW                ((13) & 0xff)  //水平同步信号的脉宽
  #define CLKVAL_TFT          (6)		
#define LCD_ROTATE  0
#if LCD_ROTATE
  #define BmpWidth	  50
  #define BmpHeight   126
#else
  #define BmpWidth	  126
  #define BmpHeight   50
#endif


#endif



#if (LCD_TYPE == LCD_LD240320 )
#define LCD_XSIZE 	(240)	
#define LCD_YSIZE 	(320)

#define SCR_XSIZE 	(LCD_XSIZE)
#define SCR_YSIZE 	(LCD_YSIZE)

//Timing parameter for LCD ---- LQ035Q7DB02

#define VBPD				((1)&0xff)//垂直同步信号的后肩
#define VFPD				((2)&0xff)//垂直同步信号的前肩
#define VSPW				((1)&0x3f)//垂直同步信号的脉宽 
#define HBPD				((6)&0x7f)//水平同步信号的后肩
#define HFPD				((3)&0xff)//水平同步信号的前肩
#define HSPW				((1)&0xff)//水平同步信号的脉宽
#define LCD_CLKVAL   	(6)    //刷新率	
#define LCD_ROTATE  1
#if LCD_ROTATE
  #define BmpWidth	  50
  #define BmpHeight   126
#else
  #define BmpWidth	  126
  #define BmpHeight   50
#endif


#endif

#if (LCD_TYPE == LCD_XL480272 )
#define LCD_XSIZE 	(480)	
#define LCD_YSIZE 	(272)

#define SCR_XSIZE 	(LCD_XSIZE)
#define SCR_YSIZE 	(LCD_YSIZE)

//Timing parameter for LCD ---- LQ035Q7DB02

#define VBPD 		((2) & 0xff)		//垂直同步信号的后肩
#define VFPD 		((2)  & 0xff)		//垂直同步信号的前肩
#define VSPW 	    ((10)  & 0x3f)		//垂直同步信号的脉宽

#define HBPD 		((2) & 0x7f)          //水平同步信号的后肩
#define HFPD 		((2)  & 0xff)		//水平同步信号的前肩
#define HSPW        ((41)  & 0xff)		//水平同步信号的脉宽
#define LCD_CLKVAL   	(2)    //刷新率	
#define LCD_ROTATE  1
#if LCD_ROTATE
  #define BmpWidth	  50
  #define BmpHeight   126
#else
  #define BmpWidth	  126
  #define BmpHeight   50
#endif


#endif

#define LCD_HOZVAL 	    (LCD_XSIZE-1)
#define LCD_LINEVAL 	(LCD_YSIZE-1)

/*
//Timing parameter for LCD ---- LTS350Q1-PE1
#define VBPD_240320		(14)	//垂直同步信号的后肩
#define VFPD_240320		(2)		//垂直同步信号的前肩
#define VSPW_240320		(4)		//垂直同步信号的脉宽

#define HBPD_240320		(8)		//水平同步信号的后肩
#define HFPD_240320		(8)		//水平同步信号的前肩
#define HSPW_240320		(4)		//水平同步信号的脉宽
*/
#endif


//TFT 240320
extern volatile unsigned short LCD_BUFER[SCR_YSIZE][SCR_XSIZE];

void Lcd_Init(void);
void Lcd_EnvidOnOff(int onoff);
void Lcd_Lpc3600Enable(void);
void Lcd_PowerEnable(int invpwren,int pwren);

void MoveViewPort(void);
void Lcd_MoveViewPort(int vx,int vy);

void PutPixel(U32 x,U32 y,U32 c);

void Glib_Rectangle(int x1,int y1,int x2,int y2,int color);
void Glib_FilledRectangle(int x1,int y1,int x2,int y2,int color);
void Glib_Line(int x1,int y1,int x2,int y2,int color);
void Lcd_ClearScr(U16 c);

void Paint_Bmp(int x0,int y0,int h,int l,const unsigned short bmp[]);

void Test_Lcd_Tft_16Bpp_240_320(void);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -