?? lcddriver.h
字號(hào):
/****************************************Copyright (c)**************************************************
** Guangzhou ZHIYUAN electronics Co.,LTD.
**
** http://www.zyinside.com
**
**--------------File Info-------------------------------------------------------------------------------
** File Name: lcddrive.h
** Last modified Date: 2005-12-31
** Last Version: v1.0
** Description: S3C2410的LCD驅(qū)動(dòng)程序 (頭文件)
** 針對(duì)LQ080V3DG01液晶模塊的驅(qū)動(dòng)程序 (640x480, TFT, 18BPP)
**------------------------------------------------------------------------------------------------------
** Created By: 黃紹斌
** Created date: 2005-12-31
** Version: v1.0
** Descriptions:
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
*******************************************************************************************************/
#ifndef __LCDDRIVE_H
#define __LCDDRIVE_H
// 定義顏色數(shù)據(jù)類型(可以是數(shù)據(jù)結(jié)構(gòu))
#define TCOLOR uint16
// 定義LCM像素?cái)?shù)宏
#define GUI_LCM_XMAX 640 /* 定義液晶x軸的點(diǎn)數(shù) */
#define GUI_LCM_YMAX 480 /* 定義液晶y軸的點(diǎn)數(shù) */
// 設(shè)置顏色宏定義 (格式: R=5, G=6, B=5)
#define BLACK 0x0000 /* 黑色: 0, 0, 0 */
#define NAVY 0x000F /* 深藍(lán)色: 0, 0, 128 */
#define DGREEN 0x03E0 /* 深綠色: 0, 128, 0 */
#define DCYAN 0x03EF /* 深青色: 0, 128, 128 */
#define MAROON 0x7800 /* 深紅色:128, 0, 0 */
#define PURPLE 0x780F /* 紫色: 128, 0, 128 */
#define OLIVE 0x7BE0 /* 橄欖綠:128, 128, 0 */
#define LGRAY 0xC618 /* 灰白色:192, 192, 192 */
#define DGRAY 0x7BEF /* 深灰色:128, 128, 128 */
#define BLUE 0x001F /* 藍(lán)色: 0, 0, 255 */
#define GREEN 0x07E0 /* 綠色: 0, 255, 0 */
#define CYAN 0x07FF /* 青色: 0, 255, 255 */
#define RED 0xF800 /* 紅色: 255, 0, 0 */
#define MAGENTA 0xF81F /* 品紅: 255, 0, 255 */
#define YELLOW 0xFFE0 /* 黃色: 255, 255, 0 */
#define WHITE 0xFFFF /* 白色: 255, 255, 255 */
// 定義清屏色
#define GUI_CCOLOR BLACK
#ifndef IN_LCDDRIVE
#ifdef __cplusplus
extern "C" {
#endif
// 聲明顯示緩沖區(qū)
extern uint16 FrameBuffer[GUI_LCM_YMAX][GUI_LCM_XMAX];
/********************************************************************************************************
** Function name: GUI_Initialize
** Descriptions: 初始化GUI,包括初始化顯示緩沖區(qū),初始化LCM并清屏。
** 用戶根據(jù)LCM的實(shí)際情況編寫此函數(shù)。
** Input: 無
** Output: 無
********************************************************************************************************/
extern void GUI_Initialize(void);
/********************************************************************************************************
** Function name: GUI_FillSCR
** Descriptions: 全屏填充。直接使用數(shù)據(jù)填充顯示緩沖區(qū)。
** 用戶根據(jù)LCM的實(shí)際情況編寫此函數(shù)。
** Input: dat 填充的數(shù)據(jù)
** Output: 無
********************************************************************************************************/
extern void GUI_FillSCR(TCOLOR dat);
/********************************************************************************************************
** Function name: GUI_ClearSCR
** Descriptions: 清屏。
** 用戶根據(jù)LCM的實(shí)際情況編寫此函數(shù)。
** Input: 無
** Output: 無
********************************************************************************************************/
extern void GUI_ClearSCR(void);
/********************************************************************************************************
** Function name: GUI_Point
** Descriptions: 在指定位置上畫點(diǎn)。
** Input: x 指定點(diǎn)所在列的位置
** y 指定點(diǎn)所在行的位置
** color 顯示顏色
** Output: 返回值為1時(shí)表示操作成功,為0時(shí)表示操作失敗。
********************************************************************************************************/
extern uint32 GUI_Point(uint16 x, uint16 y, TCOLOR color);
/********************************************************************************************************
** Function name: GUI_ReadPoint
** Descriptions: 讀取指定位置點(diǎn)的顏色數(shù)據(jù)。
** Input: x 指定點(diǎn)所在列的位置
** y 指定點(diǎn)所在行的位置
** ret 用來保存顏色值的變量(指針)
** Output: 返回值為1時(shí)表示操作成功,為0時(shí)表示操作失敗。
********************************************************************************************************/
extern uint32 GUI_ReadPoint(uint16 x, uint16 y, TCOLOR *ret);
/********************************************************************************************************
** Function name: GUI_HLine
** Descriptions: 畫水平線。
** 操作失敗原因是指定地址超出緩沖區(qū)范圍。
** Input: x0 水平線起點(diǎn)所在列的位置
** y0 水平線起點(diǎn)所在行的位置
** x1 水平線終點(diǎn)所在列的位置
** color 顯示顏色
** Output: 無
********************************************************************************************************/
extern void GUI_HLine(uint16 x0, uint16 y0, uint16 x1, TCOLOR color);
/********************************************************************************************************
** Function name: GUI_RLine
** Descriptions: 畫垂直線。
** 操作失敗原因是指定地址超出緩沖區(qū)范圍。
** Input: x0 垂直線起點(diǎn)所在列的位置
** y0 垂直線起點(diǎn)所在行的位置
** y1 垂直線終點(diǎn)所在行的位置
** color 顯示顏色
** Output: 無
********************************************************************************************************/
extern void GUI_RLine(uint16 x0, uint16 y0, uint16 y1, TCOLOR color);
/********************************************************************************************************
** Function name: GUI_CmpColor
** Descriptions: 判斷顏色值是否一致。
** 由于顏色類型TCOLOR可以是結(jié)構(gòu)類型,所以需要用戶編寫比較函數(shù)。
** Input: color1 顏色值1
** color2 顏色值2
** Output: 返回1表示相同,返回0表示不相同。
********************************************************************************************************/
//extern int GUI_CmpColor(TCOLOR color1, TCOLOR color2);
#define GUI_CmpColor(color1, color2) (color1 == color2)
/********************************************************************************************************
** Function name: GUI_CopyColor
** Descriptions: 顏色值復(fù)制。
** 由于顏色類型TCOLOR可以是結(jié)構(gòu)類型,所以需要用戶編寫復(fù)制函數(shù)。
** Input: color1 目標(biāo)顏色變量
** color2 源顏色變量
** Output: 無
********************************************************************************************************/
//extern void GUI_CopyColor(TCOLOR *color1, TCOLOR color2);
#define GUI_CopyColor(color1, color2) *color1 = color2
/********************************************************************************************************
** Function name: GUI_Rectangle
** Descriptions: 畫矩形。
** 操作失敗原因是指定地址超出緩沖區(qū)范圍。
** Input: x0 矩形左上角的x坐標(biāo)值
** y0 矩形左上角的y坐標(biāo)值
** x1 矩形右下角的x坐標(biāo)值
** y1 矩形右下角的y坐標(biāo)值
** color 顯示顏色
** Output: 無
********************************************************************************************************/
extern void GUI_Rectangle(uint32 x0, uint32 y0, uint32 x1, uint32 y1, TCOLOR color);
/********************************************************************************************************
** Function name: GUI_RectangleFill
** Descriptions: 填充矩形。畫一個(gè)填充的矩形,填充色與邊框色一樣。
** 操作失敗原因是指定地址超出緩沖區(qū)范圍。
** Input: x0 矩形左上角的x坐標(biāo)值
** y0 矩形左上角的y坐標(biāo)值
** x1 矩形右下角的x坐標(biāo)值
** y1 矩形右下角的y坐標(biāo)值
** color 填充顏色
** Output: 無
********************************************************************************************************/
extern void GUI_RectangleFill(uint32 x0, uint32 y0, uint32 x1, uint32 y1, TCOLOR color);
/********************************************************************************************************
** Function name: GUI_Line
** Descriptions: 畫任意兩點(diǎn)之間的直線。
** 操作失敗原因是指定地址超出緩沖區(qū)范圍。
** Input: x0 直線起點(diǎn)的x坐標(biāo)值
** y0 直線起點(diǎn)的y坐標(biāo)值
** x1 直線終點(diǎn)的x坐標(biāo)值
** y1 直線終點(diǎn)的y坐標(biāo)值
** color 顯示顏色(對(duì)于黑白色LCM,為0時(shí)滅,為1時(shí)顯示)
** Output: 無
********************************************************************************************************/
extern void GUI_Line(uint32 x0, uint32 y0, uint32 x1, uint32 y1, TCOLOR color);
/********************************************************************************************************
** Function name: GUI_DispPic
** Descriptions: 指定位置顯示圖片(圖片大小為w、h)。
** 不能正確顯示原因可能是指定的起始點(diǎn)不對(duì),或高度、寬度超出液晶顯示范圍,或數(shù)據(jù)格式錯(cuò)誤。
** Input: x,y 更新區(qū)域的起始點(diǎn)(左上角)
* w,h 區(qū)域?qū)挾群透叨?* buffer 顯示數(shù)據(jù)緩沖區(qū)(uint16, 格式為 R:5, G:6, B:5)
** Output: 無
********************************************************************************************************/
extern void GUI_DispPic( uint16 x, uint16 y, uint16 w, uint16 h, uint16 *buffer);
/********************************************************************************************************/
#ifdef __cplusplus
}
#endif
#endif // IN_LCDDRIVE
#endif // __LCDDRIVE_H
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -