1 Star 2 Fork 2

蓝凌风/EmbeddedLib

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tft_lcd.h 3.63 KB
一键复制 编辑 原始数据 按行查看 历史
蓝凌风 提交于 2023-11-06 10:27 . 最新修改
#ifndef TFT_LCD_H
#define TFT_LCD_H
#include "bsp.h"
struct _s_lcd
{
uint16_t LCD_HS_CNT;
uint16_t LCD_VS_CNT;
uint16_t POINT_COLOR;
uint16_t BACK_COLOR;
uint8_t(*Init)(void);
void (*DrawPoint)(uint16_t x,uint16_t y,uint16_t color);
uint16_t (*GetPoint)(uint16_t x,uint16_t y);
void (*DrawLine)(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2,uint16_t color);
void (*Draw_Circle)(uint16_t syear,uint8_t smon,uint8_t sday,uint8_t hour,uint8_t min,uint8_t sec);
void (*ShowNum)(uint16_t x,uint16_t y,uint32_t num,uint8_t len,uint8_t size);
void (*ShowxNum)(uint16_t x,uint16_t y,uint32_t num,uint8_t len,uint8_t size,uint8_t mode);
void (*ShowString)(uint16_t x,uint16_t y,uint16_t width,uint16_t height,uint8_t size,uint8_t *p);
void (*DrawBMP)(uint16_t x,uint16_t y,uint16_t width,uint16_t height,uint16_t *p);
void (*Fill)(uint16_t x,uint16_t y,uint16_t width,uint16_t height,uint16_t color);
};
extern struct _s_lcd lcd;
void LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2,uint16_t color);
void LCD_DrawRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2,uint16_t color);
void LCD_Draw_Circle(uint16_t x0,uint16_t y0,uint8_t r);
void LCD_ShowNum(uint16_t x,uint16_t y,uint32_t num,uint8_t len,uint8_t size);
void LCD_ShowChar(uint16_t x,uint16_t y,uint8_t num,uint8_t size,uint8_t mode);
void LCD_ShowxNum(uint16_t x,uint16_t y,uint32_t num,uint8_t len,uint8_t size,uint8_t mode);
void LCD_ShowString(uint16_t x,uint16_t y,uint16_t width,uint16_t height,uint8_t size,uint8_t *p);
//void LCD_DrawBMP(uint16_t x,uint16_t y,uint16_t width,uint16_t height,uint16_t *p);
void LCD_Fill(uint16_t x,uint16_t y,uint16_t width,uint16_t height,uint16_t color);
void GUI_HZ(uint16_t x, uint16_t y, uint8_t c,uint16_t Color, uint16_t bkColor);
void GUI_HZ24(uint16_t x, uint16_t y, uint8_t c,uint16_t Color, uint16_t bkColor);
void GUI_SZ(uint16_t x, uint16_t y, uint8_t c,uint16_t Color, uint16_t bkColor);
void GUI_SZ16(uint16_t x, uint16_t y, uint8_t c,uint16_t Color, uint16_t bkColor);
void GUI_SZ24(uint16_t x, uint16_t y, uint8_t c,uint16_t Color, uint16_t bkColor);
void GUI_SZ32(uint16_t x, uint16_t y, uint8_t c,uint16_t Color, uint16_t bkColor);
void GUI_JT(uint16_t x, uint16_t y, uint8_t c,uint16_t Color, uint16_t bkColor);
void GUI_Rectangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1,uint16_t color,uint8_t fill);
void GUI_HZ32(uint16_t x, uint16_t y, uint8_t c,uint16_t Color, uint16_t bkColor);
void GUI_Text(uint16_t x, uint16_t y, uint8_t *str, uint16_t len,uint16_t Color, uint16_t bkColor);
void lcd_printf(const char *fmt, ...);
//GUI颜色
#define RGB565(RGB) (((( RGB>>19)&0x1f)<<11) + (((RGB>>10)&0x3f)<<5) + ((RGB>>3)&0x1f))
#define DARKBLUE 0XCF //深蓝色
#define LIGHTBLUE 0X7C //浅蓝色
#define GRAYBLUE 0X58 //灰蓝色
//以上三色为PANEL的颜色
#define LIGHTGREEN 0X1F //浅绿色
//#define LIGHTGRAY 0XEF5B //浅灰色(PANNEL)
#define LGRAY 0X18 //浅灰色(PANNEL),窗体背景色
#define LGRAYBLUE 0X51 //浅灰蓝色(中间层颜色)
#define LBBLUE 0X12 //浅棕蓝色(选择条目的反色)
/* definitions of color */
#define LCD_COLOR_WHITE 0xFFFF
#define LCD_COLOR_BLACK 0x0000
#define LCD_COLOR_GREY 0xF7DE
#define LCD_COLOR_BLUE 0x001F
#define LCD_COLOR_BLUE2 0x051F
#define LCD_COLOR_RED 0xF800
#define LCD_COLOR_MAGENTA 0xF81F
#define LCD_COLOR_GREEN 0x07E0
#define LCD_COLOR_CYAN 0x7FFF
#define LCD_COLOR_YELLOW 0xFFE0
#define LCD_COLOR_GBLUE 0X7497
#endif //TFT_LCD_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/mzwhhwj/EmbeddedLib.git
git@gitee.com:mzwhhwj/EmbeddedLib.git
mzwhhwj
EmbeddedLib
EmbeddedLib
master

搜索帮助