结合上一篇文章中的LCD理论知识,下面是结合FL2440开发板的实例程序,所用的LCD是16位320*240
操作的大概步骤是先初始化LCD,然后是写我们所需要的函数,最基础的是像素点显示函数,然后是划线函数,字符显示函数,图片显示函数等等,然后就是写主函数完成我们的任务。
#include "def.h"
#include "option.h"
#include "2440addr.h"
#include "2440lib.h"
#include "2440slib.h"
#define MVAL
#define MVAL_USED
#define INVVDEN
#define BSWP
#define HWSWP
#define M5D(n) ((n) & 0x1fffff)
//TFT 320240
#define LCD_XSIZE_TFT_320240
#define LCD_YSIZE_TFT_320240
//TFT 320240
#define SCR_XSIZE_TFT_320240
#define SCR_YSIZE_TFT_320240
//TFT320240
#define HOZVAL_TFT_320240
#define LINEVAL_TFT_320240
//Timing parameter for LCD LQ035Q7DB02
#define VBPD_320240
#define VFPD_320240
#define VSPW_320240
#define HBPD_320240
#define HFPD_320240
#define HSPW_320240
#define CLKVAL_TFT_320240
//FCLK=180MHz,HCLK=90MHz,VCLK=6.5MHz
extern unsigned char tu[];//这就是由软件转化的图片数据,是加入到工程中的C语言文件
volatile static unsigned short LCD_BUFFER[SCR_YSIZE_TFT_320240][SCR_XSIZE_TFT_320240];//数据缓冲区
unsigned char nian1616[]={0x08,0x00,0x0F,0xFC,0x10,0x80,0x10,0x80,0x20,0x80,0x4F,0xF8,0x88,0x80,0x08,0x80,
0x08,0x80,0x08,0x80,0xFF,0xFE,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80
};//年//取模软件生成的字符数据
unsigned char nian2424[]={0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x03,0x00,0x00,0x06,0x00,0x08,0x07,
0xFF,0xFC,0x0C,0x08,0x00,0x08,0x08,0x00,0x10,0x08,0x00,0x20,0x08,0x20,0x46,0x08,
0x70,0x07,0xFF,0x80,0x06,0x08,0x00,0x06,0x08,0x00,0x06,0x08,0x00,0x06,0x08,0x0C,
0x39,0xFF,0xF0,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x08,0x00,0x00,0x0C,0x00,0x00,
0x0C,0x00,0x00,0x0C,0x00,0x00,0x00,0x00};
unsigned char yue2424[]={0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x20,0x01,0xFF,0xF0,0x01,0x00,0x20,0x01,
0x00,0x20,0x01,0x00,0x20,0x01,0x00,0x20,0x01,0xFF,0xE0,0x01,0x00,0x20,0x01,0x00,
0x20,0x01,0x00,0x20,0x01,0x00,0x20,0x01,0x00,0x20,0x01,0xFF,0xE0,0x01,0x00,0x20,
0x01,0x00,0x20,0x03,0x00,0x20,0x02,0x00,0x20,0x06,0x00,0x20,0x04,0x04,0x60,0x08,
0x03,0xE0,0x10,0x00,0xC0,0x00,0x00,0x00};
unsigned char yue1616[]={0x07,0xF0,0x04,0x10,0x04,0x10,0x04,0x10,0x07,0xF0,0x04,0x10,0x04,0x10,0x04,0x10,
0x07,0xF0,0x04,0x10,0x08,0x10,0x08,0x10,0x10,0x10,0x20,0x50,0x40,0x20,0x00,0x00};//月
unsigned char ri1616[]={0x00,0x00,0x1F,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0xF0,0x10,0x10,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0xF0,0x10,0x10,0x00,0x00,0x00,0x00};//日
static void Lcd_Init(void)
{
}
static void Lcd_EnvidOnOff(int onoff)
{
}
static void Lcd_PowerEnable(int invpwren,int pwren)
{
}
static void PutPixel(U32 x,U32 y, U32 c )//实际上c在这是16位数据,即是三种颜色调成的颜色数据
{
}
static void Lcd_ClearScr( U32 c)
{
}
static void Glib_Rectangle(int x1,int y1,int x2,int y2,int color)
{
}
static void Glib_FilledRectangle(int x1,int y1,int x2,int y2,int color)
{
}
static void Paint_Bmp(int x0,int y0,int h,int l,unsigned char bmp[])
{
}
void Draw_Text16(int x,int y,int color,unsigned char ch[])//显示16*16汉字
{
}
void Draw_Text24(int x,int y,int color,unsigned char ch[])//显示24*24汉字
{
}
//绘制大小为8×16的ASCII码
void Draw_ASCII(int x,int y,int color, unsigned char ch[])
{
}
void Lcd_Tft_LTV350QV_F05_Init(void)//初始化LCD
{
}
void Lcd_Tft_LTV350QV_F05_Test( void )
{
}
//*************************************************************