📄 ep7312_lcd.h
字号:
/*
* ep7312_lcd.h --- Primary header file of
* LCD Device Driver with Framebuffer
* for MGUI
* (C)opyright 2004 Bit 920 Labs
*
* Written by: Ye Nan <bye200009123@163.com>
* Created on: Sat. Mar 6 22:03:45 GMT +8:00 2004
*/
#ifndef __GAL_DRIVER_EP7312_H
#define __GAL_DRIVER_EP7312_H
#include "../gal.h"
#include "../../include/sysdef.h"
/* LCD颜色类型
* COLOR[0-3] : 红
* COLOR[4-7] : 绿
* COLOR[8-11] : 蓝
* COLOR[12-15]: 保留半字节
*/
typedef unsigned short COLOR;
// 保存屏幕缓冲区结构
struct save_struct
{
int save_w;
int save_h;
unsigned char * save_buf;
};
// LCD显示命令的参数结构
struct lcd_display
{
int x1, y1; /* 第一个点的x, y坐标 */
int x2, y2; /* 第二个点的x, y坐标 */
unsigned char codes[32]; /* 字符点阵数据 */
COLOR color; /* 显示颜色 */
};
// LCD屏幕命令的参数结构
struct lcd_screen
{
int x1, y1; /* 第一个点的x, y坐标 */
int x2, y2; /* 第二个点的x, y坐标 */
struct save_struct * buffer; /* 保存屏幕缓冲区 */
};
#define DEV_LCD 0
#define LCD_Clear 0
#define LCD_Draw_Pixel 1
#define LCD_Draw_VLine 2
#define LCD_Draw_HLine 3
#define LCD_Draw_Rectangle 4
#define LCD_Write_EN 10
#define LCD_Write_CN 11
#define LCD_Save_SCR 12
#define LCD_Load_SCR 13
#define LCD_Release_SCR 14
#define SCREEN_WIDTH 240
#define SCREEN_HEIGHT 320
#define SCREEN_BPP 12
#define RED 0x000f
#define ORANGE 0x007f
#define YELLOW 0x00ff
#define GREEN 0x00f0
#define CYAN 0x0ff0
#define BLUE 0x0f00
#define PURPLE 0x0f07
#define WHITE 0x0fff
#define BLACK 0x0000
#define GRAY 0x0777
// Define color convertion macro
#define _RGB2COLOR12(r, g, b) (((((r) >> 4) << 8) | (((g) >> 4) << 4) | ((b) >> 4)) & 0x00ffffff)
#define _COLOR24_RED(color) ((color) & 0xff)
#define _COLOR24_GREEN(color) (((color) >> 8) & 0xff)
#define _COLOR24_BLUE(color) (((color) >> 16) & 0xff)
#define _COLOR24_12(color) _RGB2COLOR12(_COLOR24_RED(color), _COLOR24_GREEN(color), _COLOR24_BLUE(color))
void Assert_Device(int DevType);
void OpenLCD(char * devFile);
void CloseLCD();
// Interface functions
int InitLCD_EP7312(GFX * gfx);
void ReleaseLCD_EP7312(GFX * gfx);
#endif // __GAL_DRIVER_EP7312_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -