?? lcd_config.h
字號(hào):
#ifndef __LCD_CONFIG_H__
#define __LCD_CONFIG_H__
typedef unsigned short LCDBYTE; //重定義有關(guān)LCD的,也即LCD當(dāng)中的數(shù)據(jù)位寬
typedef unsigned short DOTBYTE; //重定義有關(guān)LCD的,也即LCD的點(diǎn)陣數(shù)量
typedef signed short DISWORD; //重定義在LCD_Dis.c文件中一些中間處理的數(shù)據(jù)的寬度
typedef const unsigned char FLASH; //重定義驅(qū)動(dòng)當(dāng)中存放到CODE的數(shù)據(jù)類(lèi)型聲明
#ifndef NULL
#define NULL ((void *)0)
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (1)
#endif
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned int BOOL;
#define LCD_X_MAX 240-1 //屏幕的X軸的物理寬度
#define LCD_Y_MAX 320-1 //屏幕的Y軸的物理寬度
#define LCD_XY_Switch 1 //顯示時(shí)X軸和Y由交換
#define LCD_X_Rev 0 //顯示時(shí)X軸反轉(zhuǎn)
#define LCD_Y_Rev 1 //顯示時(shí)Y軸反轉(zhuǎn)
#if LCD_XY_Switch == 0
#define Dis_X_MAX LCD_X_MAX
#define Dis_Y_MAX LCD_Y_MAX
#endif
#if LCD_XY_Switch == 1
#define Dis_X_MAX LCD_Y_MAX
#define Dis_Y_MAX LCD_X_MAX
#endif
#define LCD_INITIAL_COLOR 0x0000 //定義LCD屏初始化時(shí)的背景色
#define LCD_DIS_CIRCLE 1 //定義是否需要繪制圓形的功能
//========================================================================
// 函數(shù): void Pos_Switch(unsigned int * x,unsigned int * y)
// 描述: 將畫(huà)面的坐標(biāo)變換為實(shí)際LCD的坐標(biāo)體系,以便于快速畫(huà)圓形以及矩形
// 參數(shù): x X軸坐標(biāo) y Y軸坐標(biāo)
// 返回: 無(wú)
// 備注: 這里以及之前的所有x和y坐標(biāo)系都是用戶(hù)層的,并不是實(shí)際LCD的坐標(biāo)體系
// 本函數(shù)提供可進(jìn)行坐標(biāo)變換的接口
// 版本:
// 2006/10/15 First version
//========================================================================
//========================================================================
// 函數(shù): void Writ_Dot(int x,int y,unsigned int Color)
// 描述: 填充以x,y為坐標(biāo)的象素
// 參數(shù): x X軸坐標(biāo) y Y軸坐標(biāo) Color 像素顏色
// 返回: 無(wú)
// 備注: 這里以及之前的所有x和y坐標(biāo)系都是用戶(hù)層的,并不是實(shí)際LCD的坐標(biāo)體系
// 本函數(shù)提供可進(jìn)行坐標(biāo)變換的接口
// 版本:
// 2006/10/15 First version
//========================================================================
//========================================================================
// 函數(shù): unsigned int Get_Dot(int x,int y)
// 描述: 獲取x,y為坐標(biāo)的象素
// 參數(shù): x X軸坐標(biāo) y Y軸坐標(biāo)
// 返回: Color 像素顏色
// 備注: 這里以及之前的所有x和y坐標(biāo)系都是用戶(hù)層的,并不是實(shí)際LCD的坐標(biāo)體系
// 本函數(shù)提供可進(jìn)行坐標(biāo)變換的接口
// 版本:
// 2006/10/15 First version
//========================================================================
//========================================================================
// 函數(shù): void Set_Dot_Addr(int x,int y)
// 描述: 設(shè)置當(dāng)前需要操作的象素地址
// 參數(shù): x X軸坐標(biāo) y Y軸坐標(biāo)
// 返回: 無(wú)
// 備注: 這里以及之前的所有x和y坐標(biāo)系都是用戶(hù)層的,并不是實(shí)際LCD的坐標(biāo)體系
// 本函數(shù)提供可進(jìn)行坐標(biāo)變換的接口
// 版本:
// 2006/10/15 First version
//========================================================================
#if LCD_XY_Switch==0&&LCD_X_Rev==0&&LCD_Y_Rev==0
#define Pos_Switch(x,y)
#define Writ_Dot(x,y,c) Write_Dot_LCD(x,y,c)
#define Get_Dot(x,y) Get_Dot_LCD(x,y)
#define Set_Dot_Addr(x,y) Set_Dot_Addr_LCD(x,y)
#endif
#if LCD_XY_Switch==0&&LCD_X_Rev==1&&LCD_Y_Rev==0
#define Pos_Switch(x,y) x = Dis_X_MAX-x
#define Writ_Dot(x,y,c) Write_Dot_LCD(Dis_X_MAX-x,y,c)
#define Get_Dot(x,y) Get_Dot_LCD(Dis_X_MAX-x,y)
#define Set_Dot_Addr(x,y) Set_Dot_Addr_LCD(Dis_X_MAX-x,y)
#endif
#if LCD_XY_Switch==0&&LCD_X_Rev==0&&LCD_Y_Rev==1
#define Pos_Switch(x,y) y = Dis_Y_MAX-y
#define Writ_Dot(x,y,c) Write_Dot_LCD(x,Dis_Y_MAX-y,c)
#define Get_Dot(x,y) Get_Dot_LCD(x,Dis_Y_MAX-y)
#define Set_Dot_Addr(x,y) Set_Dot_Addr_LCD(x,Dis_Y_MAX-y)
#endif
#if LCD_XY_Switch==0&&LCD_X_Rev==1&&LCD_Y_Rev==1
#define Pos_Switch(x,y) x = Dis_X_MAX-x;\
y = Dos_Y_MAX-y
#define Writ_Dot(x,y,c) Write_Dot_LCD(Dis_X_MAX-x,Dis_Y_MAX-y,c)
#define Get_Dot(x,y) Get_Dot_LCD(Dis_X_MAX-x,Dis_Y_MAX-y)
#define Set_Dot_Addr(x,y) Set_Dot_Addr_LCD(Dis_X_MAX-x,Dis_Y_MAX-y)
#endif
#if LCD_XY_Switch==1&&LCD_X_Rev==0&&LCD_Y_Rev==0
#define Pos_Switch(x,y) x = x+y;\
y = x-y;\
x = x-y;
#define Writ_Dot(x,y,c) Write_Dot_LCD(y,x,c)
#define Get_Dot(x,y) Get_Dot_LCD(y,x)
#define Set_Dot_Addr(x,y) Set_Dot_Addr_LCD(y,x)
#endif
#if LCD_XY_Switch==1&&LCD_X_Rev==1&&LCD_Y_Rev==0
#define Pos_Switch(x,y) x = Dis_X_MAX-x;\
x = x+y;\
y = x-y;\
x = x-y;
#define Writ_Dot(x,y,c) Write_Dot_LCD(y,Dis_X_MAX-x,c)
#define Get_Dot(x,y) Get_Dot_LCD(y,Dis_X_MAX-x)
#define Set_Dot_Addr(x,y) Set_Dot_Addr_LCD(y,Dis_X_MAX-x)
#endif
#if LCD_XY_Switch==1&&LCD_X_Rev==0&&LCD_Y_Rev==1
#define Pos_Switch(x,y) y = Dis_Y_MAX-y;\
x = x+y;\
y = x-y;\
x = x-y;
#define Writ_Dot(x,y,c) Write_Dot_LCD(Dis_Y_MAX-y,x,c)
#define Get_Dot(x,y) Get_Dot_LCD(Dis_Y_MAX-y,x)
#define Set_Dot_Addr(x,y) Set_Dot_Addr_LCD(Dis_Y_MAX-y,x)
#endif
#if LCD_XY_Switch==1&&LCD_X_Rev==1&&LCD_Y_Rev==1
#define Pos_Switch(x,y) x = Dis_X_MAX-x;\
y = Dis_Y_MAX-y;\
x = x+y;\
y = x-y;\
x = x-y;
#define Writ_Dot(x,y,c) Write_Dot_LCD(Dis_Y_MAX-y,Dis_X_MAX-x,c)
#define Get_Dot(x,y) Get_Dot_LCD(Dis_Y_MAX-y,Dis_X_MAX-x)
#define Set_Dot_Addr(x,y) Set_Dot_Addr_LCD(Dis_Y_MAX-y,Dis_X_MAX-x)
#endif
//
#define Match_xy(s,e) if(s>e){s = s+e;e = s-e;s = s-e;}
#endif
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -