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 |
229 | voidLCD_Delay(u32 nCount); |
230 | voidLCD_Config(void); |
231 | voidLCD_DisplayOn(void); |
232 | voidLCD_DisplayOff(void); |
233 | voidLCD_Clear(u16 Color); |
234 | voidLCD_SetCursor(u8 Xpos, u16 Ypos); |
235 | voidLCD_DrawPoint(u16 x,u16 y);//画点 |
236 | u16 LCD_ReadPoint(u16 x,u16 y);//读点 |
237 | voidDraw_Circle(u8 x0,u16 y0,u8 r); |
238 | voidLCD_DrawLine(u16 x1, u16 y1, u16 x2, u16 y2); |
239 | voidLCD_DrawRectangle(u8 x1, u16 y1, u8 x2, u16 y2); |
240 | voidLCD_Fill(u8 xsta,u16 ysta,u8 xend,u16 yend,u16 color); |
241 | voidLCD_ShowChar(u8 x,u16 y,u8 num,u8 size,u8 mode);//显示一个字符 |
242 | voidLCD_ShowNum(u8 x,u16 y,u32 num,u8 len,u8 size);//显示一个数字 |
243 | voidLCD_ShowString(u8 x,u16 y,constu8 *p);//显示一个字符串,16字体 |
244 |
245 | voidLCD_WriteReg(u8 LCD_Reg, u16 LCD_RegValue); |
246 | u16 LCD_ReadReg(u8 LCD_Reg); |
247 | voidLCD_WriteRAM_Prepare(void); |
248 | voidLCD_WriteRAM(u16 RGB_Code); |
249 | u16 LCD_ReadRAM(void); |
FONT.h (字库文件)
001 | //常用ASCII表 |
002 | //偏移量32 |
003 | //ASCII字符集 |
004 | //偏移量32 |
005 | //大小:12*6 |
006 | constunsignedcharasc2_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*/ |
stm32TFTLC 相关文章:
- Stm32的TFT LCD显示器控制学习笔记(12-01)
- STM32之TFT-LCD液晶(11-13)
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)