1、TFT底层驱动,包括初始化、打点、读点
2、编写GUI访问接口
void TFT_DrawHLine(unsigned short int _usX1 , unsigned short int _usY1 , unsigned short int _usX2 , unsigned short int _usColor);
void TFT_DrawVLine(unsigned short int _usX1 , unsigned short int _usY1 , unsigned short int _usY2 , unsigned short int _usColor);
void TFT_FillRect(unsigned short int _usX, unsigned short int _usY, unsigned short int _usHeight, unsigned short int _usWidth, unsigned short int _usColor);
void TFT_ClearScreen(unsigned short int stx,unsigned short int sty,unsigned short int endx,unsigned short int endy, unsigned short int uiColor);
void TFT_DrawHColorLine(unsigned short int _usX1 , unsigned short int _usY1, unsigned short int _usWidth, const unsigned short int *_pColor);
unsigned short int LCD_GetHeight(void);
unsigned short int LCD_GetWidth(void);
3、GUI_X.c里的GUI_X_Delay()的 实现
4、GUI_Conf.c、GUI_Conf.h、LCDConf.c的配置
5、开启CRC校验,RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
6、编写应用
7、触摸注意:移植好底层之后,一般使用指针输入作为触摸反馈。
变量:GUI_PID_STATE State={0};
有检测到触摸时:
{
State.x = tp_dev.x[0];
State.y = tp_dev.y[0];
State.Pressed = 1;
GUI_PID_StoreState(&State);
}
释放时:
{
State.Pressed = 0;
GUI_PID_StoreState(&State);
}
main需要开启一个循环,定时刷新,要不然,调试时明明看到触摸点出来了,但是按键没响应的状态,事实是屏幕没刷新而已。
使用GUI_Exec();或者GUI_Delay(x);
当屏幕扫描方向跟硬件已经匹配时,但emwin扫描扫描方向不对或者X,Y轴不对应:
1、先确保不调用emwin时,单独刷色的时候,屏幕是否占满。
2、尝试更改宏定义的值或者函数返回值。把X,Y互换一下。
#define LCDWIDTH 320
#define LCDHEIGHT 480
unsigned short int LCD_GetHeight(void)
{
return g_LcdHeight;
//return g_LcdWidth;
}
unsigned short int LCD_GetWidth(void)
{
return g_LcdWidth;
// return g_LcdHeight;
}
3、使用F1+ILI9488时,
修改LCDConf.c的DISPLAY_ORIENTATION,并没有更改到emwin扫描方向。直接屏蔽也没报错。不知道有啥用