【空气检测仪专题】4.STemWin移植
上次已经有了液晶的画点、画线、画矩阵函数了;为了移植STemWin做好了准备。
step 1:
下载en.stm32cubef1压缩包,其中包含STemWin,在en.stm32cubef1\STM32Cube_FW_F1_V1.6.0\Middlewares\ST文件下。
step 2:
- 在工程源文件中新建STemWinPortable文件夹,将用于存放STemWin移植相关的文件
从STemWing拷贝共7个文件到TemWinPortable文件夹下
GUIConf.c
GUIConf.h
GUIDRV_Template.c
GUIDRV_Template.h
LCDConf_FlexColor_Template.c
LCDConf_FlexColor_Template.h
GUI_X.c(在STemWin\OS文件下里)重命名一下文件
LCDConf_FlexColor_Template.c->LCDConf.c
LCDConf_FlexColor_Template.h->LCDConf.h- 把STemWinPortable文件夹下7个文件加入到IAR工程中;并STemWin\Lib\STemWin532_CM3_IAR.a也加入到IAR工程中。
- 把STemWin\inc,STemWinPortable的路径加入到IAR中,以便IAR能找到头文件。
step 3:
- 在GUIConf.c中
#define GUI_NUMBYTES 0x200000
改成
#define GUI_NUMBYTES (1024*20)//表示给emwin使用20k的RAM空间 - 在GUIDRV_Template.c中_SetPixelIndex函数增加画点函数
static void _SetPixelIndex(GUI_DEVICE * pDevice, int x, int y, int PixelIndex)
{
//
// Convert logical into physic