微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > stm32 驱动 TFT LCD

stm32 驱动 TFT LCD

时间:11-26 来源:互联网 点击:

210#define GREEN 0x07E0

211#define CYAN 0x7FFF

212#define YELLOW 0xFFE0

213#define BROWN 0XBC40 //棕色

214#define BRRED 0XFC07 //棕红色

215#define GRAY 0X8430 //灰色

216//GUI颜色

217

218#define DARKBLUE 0X01CF //深蓝色

219#define LIGHTBLUE 0X7D7C //浅蓝色

220#define GRAYBLUE 0X5458 //灰蓝色

221//以上三色为PANEL的颜色

222

223#define LIGHTGREEN 0X841F //浅绿色

224//#define LIGHTGRAY 0XEF5B //浅灰色(PANNEL)

225#define LGRAY 0XC618 //浅灰色(PANNEL),窗体背景色

226#define LGRAYBLUE 0XA651 //浅灰蓝色(中间层颜色)

227#define LBBLUE 0X2B12 //浅棕蓝色(选择条目的反色)

228

229voidLCD_Delay(u32 nCount);

230voidLCD_Config(void);

231voidLCD_DisplayOn(void);

232voidLCD_DisplayOff(void);

233voidLCD_Clear(u16 Color);

234voidLCD_SetCursor(u8 Xpos, u16 Ypos);

235voidLCD_DrawPoint(u16 x,u16 y);//画点

236u16 LCD_ReadPoint(u16 x,u16 y);//读点

237voidDraw_Circle(u8 x0,u16 y0,u8 r);

238voidLCD_DrawLine(u16 x1, u16 y1, u16 x2, u16 y2);

239voidLCD_DrawRectangle(u8 x1, u16 y1, u8 x2, u16 y2);

240voidLCD_Fill(u8 xsta,u16 ysta,u8 xend,u16 yend,u16 color);

241voidLCD_ShowChar(u8 x,u16 y,u8 num,u8 size,u8 mode);//显示一个字符

242voidLCD_ShowNum(u8 x,u16 y,u32 num,u8 len,u8 size);//显示一个数字

243voidLCD_ShowString(u8 x,u16 y,constu8 *p);//显示一个字符串,16字体

244

245voidLCD_WriteReg(u8 LCD_Reg, u16 LCD_RegValue);

246u16 LCD_ReadReg(u8 LCD_Reg);

247voidLCD_WriteRAM_Prepare(void);

248voidLCD_WriteRAM(u16 RGB_Code);

249u16 LCD_ReadRAM(void);

FONT.h (字库文件)

001//常用ASCII表

002//偏移量32

003//ASCII字符集

004//偏移量32

005//大小:12*6

006constunsignedcharasc2_1206[95][12]={

007{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/

008{0x00,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x00,0x04,0x00,0x00},/*"!",1*/

009{0x00,0x14,0x0A,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*""",2*/

010{0x00,0x00,0x14,0x14,0x3F,0x14,0x0A,0x3F,0x0A,0x0A,0x00,0x00},/*"#",3*/

011{0x00,0x04,0x1E,0x15,0x05,0x06,0x0C,0x14,0x15,0x0F,0x04,0x00},/*"$",4*/

012{0x00,0x00,0x12,0x15,0x0D,0x0A,0x14,0x2C,0x2A,0x12,0x00,0x00},/*"%",5*/

013{0x00,0x00,0x04,0x0A,0x0A,0x1E,0x15,0x15,0x09,0x36,0x00,0x00},/*"&",6*/

014{0x00,0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"",7*/

015{0x00,0x20,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x20,0x00},/*"(",8*/

016{0x00,0x02,0x04,0x08,0x08,0x08,0x08,0x08,0x08,0x04,0x02,0x00},/*")",9*/

017{0x00,0x00,0x00,0x04,0x15,0x0E,0x0E,0x15,0x04,0x00,0x00,0x00},/*"*",10*/

018{0x00,0x00,0x04,0x04,0x04,0x1F,0x04,0x04,0x04,0x00,0x00,0x00},/*"+",11*/

019{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x01},/*",",12*/

020{0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00},/*"-",13*/

021{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00},/*".",14*/

022{0x00,0x10,0x08,0x08,0x08,0x04,0x04,0x02,0x02,0x02,0x01,0x00},/*"/",15*/

023{0x00,0x00,0x0E,0x11,0x11,0x11,0x11,0x11,0x11,0x0E,0x00,0x00},/*"0",16*/

024{0x00,0x00,0x04,0x06,0x04,0x04,0x04,0x04,0x04,0x0E,0x00,0x00},/*"1",17*/

025{0x00,0x00,0x0E,0x11,0x11,0x08,0x04,0x02,0x01,0x1F,0x00,0x00},/*"2",18*/

026{0x00,0x00,0x0E,0x11,0x10,0x0C,0x10,0x10,0x11,0x0E,0x00,0x00},/*"3",19*/

027{0x00,0x00,0x08,0x0C,0x0A,0x0A,0x09,0x1E,0x08,0x18,0x00,0x00},/*"4",20*/

028{0x00,0x00,0x1F,0x01,0x01,0x0F,0x10,0x10,0x11,0x0E,0x00,0x00},/*"5",21*/

029{0x00,0x00,0x0E,0x09,0x01,0x0F,0x11,0x11,0x11,0x0E,0x00,0x00},/*"6",22*/

030{0x00,0x00,0x1F,0x09,0x08,0x04,0x04,0x04,0x04,0x04,0x00,0x00},/*"7",23*/

031{0x00,0x00,0x0E,0x11,0x11,0x0E,0x11,0x11,0x11,0x0E,0x00,0x00},/*"8",24*/

032{0x00,0x00,0x0E,0x11,0x11,0x11,0x1E,0x10,0x12,0x0E,0x00,0x00},/*"9",25*/

033{0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x04,0x00,0x00},/*":",26*/

034{0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x04,0x00},/*";",27*/

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top