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

📄 func.h

📁 ARM9(S3C2410)的TFTLCD控制器原码
💻 H
字号:


/*系统时钟子程序*/
void SysCLK_Init(void);


/* I/O口初始化子程序*/
void IO_Port_Init(void);

/*延时子程序*/
void Delay(int time);

/*按键I/O口初始化*/
void KEY_PORT_Init(void);

/* UART子程序*/
void UART_Init(void);		// UART初始化
char Uart_Getch(void);
void Uart_SendString(char *pt);
void Uart_SendByte(int data);
void Uart_Printf(char *fmt,...);

/* LCD子程序*/
#define CLKVAL		7		// VCLK=(202.8/2)/((7+1)*2)=6.3375M
#define MMODE		0		// VM Signal toggle Each Frame
#define BPPMODE		0xc		// 16 bit per pixel
#define VBPD		3-1		// line rate=19.93kHz, frame rate=60.03Hz
#define LINEVAL		LCD_ySIZE-1
#define VFPD		4-1
#define VSPW		3-1
#define HBPD		14-1	//HBPD和HFPD取值不同,会影响画面在LCD中显示时的水平方向的位置
#define HOZVAL		LCD_xSIZE-1
#define HFPD		38-1
#define MVAL		13
#define HSPW		26-1
#define BPP24BL		0
#define FRM565		1		// 0=5:5:5:1 Format, 1=5:6:5 Format
#define INVVCLK		0
#define INVVLINE	1       // 0=Normal, 1=Inverted the HSYNC pulse polarity
#define INVVFRAME	1		// 0=Normal, 1=Inverted the VSYNC pulse polarity
#define INVVD		0		// 0=Normal, 1=Inverted the VD[23:0] pulse polarity
#define INVVDEN		0
#define INVPWREN	0
#define INVLEND		0
#define ENLEND		0
#define BSWP		0
#define HWSWP		1
#define OFFSIZE		SCR_xSIZE-LCD_xSIZE
#define PAGEWIDTH	LCD_xSIZE
#define TPALVAL		0xff00ff	// Temporary palette is Magenta color
#define INT_FrSyn	0x2
#define INT_FiCnt	0x1
#define FIWSEL		0x1

#define SCR_xSIZE   480			//虚拟屏幕尺寸
#define SCR_ySIZE   640
#define LCD_xSIZE   240			//实际显示尺寸,即LCD尺寸
#define LCD_ySIZE   320

#define LCDFRAMEBUFFER 0x31000000	//定义存储LCD数据的地址

void TPAL_TurnOnOff(U8 TPALEN,U32 vTPALVAL);
void LCD_Init(void);
void Lcd_EnvidOnOff(int onoff);
void PutPixel(U32 x,U32 y,U32 c);
void Glib_Line(int x1,int y1,int x2,int y2,int color);
void Glib_FilledRectangle(int x1,int y1,int x2,int y2,int color);

typedef struct tagBITMAPFILEHEADER		// bmfh: bitmap file header
{           
	U16 bfType;
	U32 bfSize;
	U32 bfReserved;
	U32 bfOffBits;
}BITMAPFILEHEADER;

typedef struct tagBITMAPINFOHEADER		 // bmih: bitmap file header
{
	U32 biSize;
	U32 biWidth;
	U32 biHeight;
	U16 biPlanes;
	U16 biBitCount;
	U32 biCompression;
	U32 biSizeImage;
	U32 biXPelsPerMeter;
	U32 biYPelsPerMeter;
	U32 biClrUsed;
	U32 biClrImportant;
}BITMAPINFOHEADER;

void Paint_Bmp(U32 x0,U32 y0,unsigned char bmp[]);
void Lcd_MoveViewPort(int vx,int vy);
void MoveViewPort(void);	

void UART0_RecvBmp(void);



































⌨️ 快捷键说明

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