#ifndef __GUI_H_ #define __GUI_H_ #include "stm32f10x.h" #define LCD_TYPE 1 //新屏 #define HZK16_FILE_NAME "HZK16" #define HZK12_FILE_NAME "HZK12" //以下定义各种颜色,原色按0xRRGGBB格式 #define COLOR_BLACK 0x000000 #define COLOR_WHITE 0xFFFFFF #define COLOR_RED 0x0000FF //0xB5003E #define COLOR_GREEN 0x00FF00 #define COLOR_BLUE 0xFF0000 #define COLOR_YELLOW 0xFFFF00 #define COLOR_PURPLE 0x800080 #define COLOR_SEL_BULUE 0xFF6464 //选定框颜色 #define COLOR_DARKBLUE 0x8B0000 //RGB(139,0,0) ■★●◆darkblue(深红) #define USING_DRAW_WITH_COLOR_OPTION #define COLOR_DEFAULT_BLUE 1 #define COLOR_WARN_RED 2 #define COLOR_WHITE_BACK 3 #define COLOR_SELECT_BLUE 4 #define STATUS_BAR_HEIGH 13 #define STATUS_ITEM_HEIGH (STATUS_BAR_HEIGH+14) #define MIDDLE_CONTENT_HEIGH 110 #define SUBSCRIPT_LOCATION 114 //下方提示汉字位置 //汉字库 typedef struct SUT_HZK { unsigned char width;//字库点阵宽度 unsigned char heigh;//字库点阵高度 unsigned char len; //字库点阵数据长度,一般等于width*heigh/8 int FileIndex; //字库文件在sFlash中索引 int FileLen; //字库文件大小 }SUT_HZK; void GuiInit(void); //GUI初始化 void GuiSetColor(unsigned long ForeColor,unsigned long BackColor,unsigned long WarnColor,unsigned long SelColor);//设置前景色和背景色 void GuiSetForeColor(unsigned long ForeColor);//设置前景色 void GuiSetBackColor(unsigned long BackColor);//设置背景色 void GuiShowStr(u16 x, u16 y,const char *string,u8 mode,u8 rev);//显示字符串 font=mode&0xf0 cover=mode&0x0f void GuiShowBmp(u16 x,u16 y,const char * filename);//显示BMP图片 filename为在sFlash中存储的BMP文件名 void GuiDrawHLine(u16 x1, u16 x2, u16 y, u8 width);//画水平线 #ifdef USING_DRAW_WITH_COLOR_OPTION void GuiDrawVLine(u16 y1, u16 y2, u16 x, u8 width, u8 colorIndex);//画垂直线 void GuiFillRect(u16 x1, u16 y1, u16 x2, u16 y2,u8 colorIndex);//画矩形框并填充为前景色 #else void GuiDrawVLine(u16 y1, u16 y2, u16 x, u8 width); void GuiFillRect(u16 x1, u16 y1, u16 x2, u16 y2);//画矩形框并填充为前景色 #endif void GuiDrawRect(u16 x1, u16 y1, u16 x2, u16 y2,u8 width);//画矩形框,只画边框,内部不填充 void GuiClearRect(u16 x1, u16 y1, u16 x2, u16 y2);//清空矩形区域,填充背景色 void GuiClearArea(u16 x, u16 y, u16 width, u16 heigh);//清空一个区域,填充背景色,和GuiClearRect等效,只是入口参数有区别 void GuiClearAll(void); void GuiShowArrow(u16 x,u16 y,u16 len,u8 mode); void GuiShowSingle(int CSQ);//显示信号 void GuiShowBat(int bat);//显示电量 u16 RGB888toRGB565(unsigned char R,unsigned char G, unsigned char B);//将RGB888格式转RGB565格式 extern u8 g_ucWarnColorId; extern u8 g_ucBackColorId; //背景颜色索引 void ShowButton(u16 x,u16 y,const char *str); void ShowMessageBox(char *msg); void lcdTestFlash(); #endif