? ? ? ? ? ? ? ? ? ? ? ? ? ? #ifndef _tftlcd_H
?? ??? ??? ??? ??? ??? ??? ?#define _tftlcd_H
?? ??? ??? ??? ??? ??? ??? ?#include "system.h"
?? ??? ??? ??? ??? ??? ??? ?//定義LCD彩屏的驅動類型 ?可根據自己手上的彩屏背面型號來選擇打開哪種驅動
?? ??? ??? ??? ??? ??? ??? ?//#define TFTLCD_HX8357D?
?? ??? ??? ??? ??? ??? ??? ?//#define TFTLCD_HX8352C
?? ??? ??? ??? ??? ??? ??? ?//#define TFTLCD_ILI9488
?? ??? ??? ??? ??? ??? ??? ?//#define TFTLCD_ST7793
?? ??? ??? ??? ??? ??? ??? ?#define TFTLCD_ILI9327
?? ??? ??? ??? ??? ??? ??? ?//#define TFTLCD_NT35510
?? ??? ??? ??? ??? ??? ??? ?//TFTLCD地址結構體
?? ??? ??? ??? ??? ??? ??? ?typedef struct
?? ??? ??? ??? ??? ??? ??? ?{
?? ??? ??? ??? ??? ??? ??? ??? ?u16 LCD_CMD;
?? ??? ??? ??? ??? ??? ??? ??? ?u16 LCD_DATA;
?? ??? ??? ??? ??? ??? ??? ?}TFTLCD_TypeDef;
?? ??? ??? ??? ??? ??? ??? ?//使用NOR/SRAM的 Bank1.sector4,地址位HADDR[27,26]=11 A6作為數據命令區分線?
?? ??? ??? ??? ??? ??? ??? ?//注意設置時STM32內部會右移一位對齊! 111 1110=0X7E?? ??? ??? ? ? ?
?? ??? ??? ??? ??? ??? ??? ?#define TFTLCD_BASE ? ? ? ?((u32)(0x6C000000 | 0x0000007E))
?? ??? ??? ??? ??? ??? ??? ?#define TFTLCD ? ? ? ? ? ? ((TFTLCD_TypeDef *) TFTLCD_BASE)
?? ??? ??? ??? ??? ??? ??? ?//TFTLCD重要參數集
?? ??? ??? ??? ??? ??? ??? ?typedef struct ?
?? ??? ??? ??? ??? ??? ??? ?{?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? ? ?
?? ??? ??? ??? ??? ??? ??? ??? ?u16 width;?? ??? ??? ?//LCD 寬度
?? ??? ??? ??? ??? ??? ??? ??? ?u16 height;?? ??? ??? ?//LCD 高度
?? ??? ??? ??? ??? ??? ??? ??? ?u16 id;?? ??? ??? ??? ?//LCD ID
?? ??? ??? ??? ??? ??? ??? ??? ?u8 ?dir; ? ? ? ? ? ?//LCD 方向
?? ??? ??? ??? ??? ??? ??? ?}_tftlcd_data;
?? ??? ??? ??? ??? ??? ??? ?//LCD參數
?? ??? ??? ??? ??? ??? ??? ?extern _tftlcd_data tftlcd_data;?? ?//管理LCD重要參數
?? ??? ??? ??? ??? ??? ??? ?//LCD的前端顏色和背景色?? ? ??
?? ??? ??? ??? ??? ??? ??? ?extern u16 ?FRONT_COLOR;//前端顏色 默認紅色 ? ?
?? ??? ??? ??? ??? ??? ??? ?extern u16 ?BACK_COLOR; //背景顏色.默認為白色
?? ??? ??? ??? ??? ??? ??? ?//畫筆顏色
?? ??? ??? ??? ??? ??? ??? ?#define WHITE ? ? ? ? ?? ? 0xFFFF
?? ??? ??? ??? ??? ??? ??? ?#define BLACK ? ? ? ? ?? ? 0x0000?? ? ?
?? ??? ??? ??? ??? ??? ??? ?#define BLUE ? ? ? ? ?? ? ? 0x001F ?
?? ??? ??? ??? ??? ??? ??? ?#define BRED ? ? ? ? ? ? 0XF81F
?? ??? ??? ??? ??? ??? ??? ?#define GRED ?? ??? ??? ? ? ? ? 0XFFE0
?? ??? ??? ??? ??? ??? ??? ?#define GBLUE?? ??? ??? ? ? ? ? 0X07FF
?? ??? ??? ??? ??? ??? ??? ?#define RED ? ? ? ? ? ?? ? 0xF800
?? ??? ??? ??? ??? ??? ??? ?#define MAGENTA ? ? ? ?? ? 0xF81F
?? ??? ??? ??? ??? ??? ??? ?#define GREEN ? ? ? ? ?? ? 0x07E0
?? ??? ??? ??? ??? ??? ??? ?#define CYAN ? ? ? ? ??? ? 0x7FFF
?? ??? ??? ??? ??? ??? ??? ?#define YELLOW ? ? ? ??? ? 0xFFE0
?? ??? ??? ??? ??? ??? ??? ?#define BROWN ?? ??? ??? ? ? ? 0XBC40 //棕色
?? ??? ??? ??? ??? ??? ??? ?#define BRRED ?? ??? ??? ? ? ? 0XFC07 //棕紅色
?? ??? ??? ??? ??? ??? ??? ?#define GRAY ??? ??? ??? ? ? ? 0X8430 //灰色
?? ??? ??? ??? ??? ??? ??? ?void LCD_WriteCmd(u16 cmd);
?? ??? ??? ??? ??? ??? ??? ?void LCD_WriteData(u16 data);
?? ??? ??? ??? ??? ??? ??? ?void LCD_WriteCmdData(u16 cmd,u16 data);
?? ??? ??? ??? ??? ??? ??? ?void LCD_WriteData_Color(u16 color);
?? ??? ??? ??? ??? ??? ??? ?void TFTLCD_Init(void); ? ? ? ? ? //初始化
?? ??? ??? ??? ??? ??? ??? ?void LCD_Set_Window(u16 sx,u16 sy,u16 width,u16 height);
?? ??? ??? ??? ??? ??? ??? ?void LCD_Clear(u16 Color);?? ? ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?//清屏
?? ??? ??? ??? ??? ??? ??? ?void LCD_Fill(u16 xState,u16 yState,u16 xEnd,u16 yEnd,u16 color);
?? ??? ??? ??? ??? ??? ??? ?void LCD_DrawPoint(u16 x,u16 y);//畫點
?? ??? ??? ??? ??? ??? ??? ?void LCD_DrawFRONT_COLOR(u16 x,u16 y,u16 color);
?? ??? ??? ??? ??? ??? ??? ?u16 LCD_ReadPoint(u16 x,u16 y);
?? ??? ??? ??? ??? ??? ??? ?void LCD_DrawLine(u16 x1, u16 y1, u16 x2, u16 y2);
?? ??? ??? ??? ??? ??? ??? ?void LCD_DrawLine_Color(u16 x1, u16 y1, u16 x2, u16 y2,u16 color);
?? ??? ??? ??? ??? ??? ??? ?void LCD_DrowSign(uint16_t x, uint16_t y, uint16_t color);
?? ??? ??? ??? ??? ??? ??? ?void LCD_DrawRectangle(u16 x1, u16 y1, u16 x2, u16 y2);
?? ??? ??? ??? ??? ??? ??? ?void LCD_Draw_Circle(u16 x0,u16 y0,u8 r);
?? ??? ??? ??? ??? ??? ??? ?void LCD_ShowChar(u16 x,u16 y,u8 num,u8 size,u8 mode);
?? ??? ??? ??? ??? ??? ??? ?void LCD_ShowNum(u16 x,u16 y,u32 num,u8 len,u8 size);
?? ??? ??? ??? ??? ??? ??? ?void LCD_ShowxNum(u16 x,u16 y,u32 num,u8 len,u8 size,u8 mode);
?? ??? ??? ??? ??? ??? ??? ?void LCD_ShowString(u16 x,u16 y,u16 width,u16 height,u8 size,u8 *p);
?? ??? ??? ??? ??? ??? ??? ?void LCD_ShowFontHZ(u16 x, u16 y, u8 *cn);
?? ??? ??? ??? ??? ??? ??? ?void LCD_ShowPicture(u16 x, u16 y, u16 wide, u16 high,u8 *pic);
?? ??? ??? ??? ??? ??? ??? ?#endif
?