uCOSIII uCGUI STM32 平台移植(4)
- UID
- 1029342
- 性别
- 男
|
uCOSIII uCGUI STM32 平台移植(4)
如下代码:
[url=][/url]
1 /********************************************************************* 2 * 3 * Exported functions 4 * 5 ********************************************************************** 6 */ 7 8 /********************************************************************* 9 *10 * LCD_L0_SetPixelIndex11 *12 * Purpose:13 * Sets the index of the given pixel. The upper layers14 * calling this routine make sure that the coordinates are in range, so15 * that no check on the parameters needs to be performed.16 */17 void LCD_L0_SetPixelIndex(int x, int y, int PixelIndex) {18 int xPhys = 0;19 int yPhys = 0; 20 GUI_USE_PARA(x);21 GUI_USE_PARA(y);22 GUI_USE_PARA(PixelIndex);23 /* Convert logical into physical coordinates (Dep. on LCDConf.h) */24 #if LCD_SWAP_XY | LCD_MIRROR_X| LCD_MIRROR_Y25 xPhys = LOG2PHYS_X(x, y);26 yPhys = LOG2PHYS_Y(x, y);27 #else28 xPhys = x;29 yPhys = y;30 #endif31 /* Write into hardware ... Adapt to your system */32 {33 ili9320_SetPoint(xPhys, yPhys, PixelIndex);/* ... */34 }35 }36 37 /*********************************************************************38 *39 * LCD_L0_GetPixelIndex40 *41 * Purpose:42 * Returns the index of the given pixel. The upper layers43 * calling this routine make sure that the coordinates are in range, so44 * that no check on the parameters needs to be performed.45 */46 unsigned int LCD_L0_GetPixelIndex(int x, int y) {47 int xPhys = 0;48 int yPhys = 0;49 LCD_PIXELINDEX PixelIndex;50 51 GUI_USE_PARA(x);52 GUI_USE_PARA(y);53 /* Convert logical into physical coordinates (Dep. on LCDConf.h) */54 #if LCD_SWAP_XY | LCD_MIRROR_X| LCD_MIRROR_Y55 xPhys = LOG2PHYS_X(x, y);56 yPhys = LOG2PHYS_Y(x, y);57 #else58 xPhys = x;59 yPhys = y;60 #endif61 /* Read from hardware ... Adapt to your system */62 {63 PixelIndex = ili9320_GetPoint(xPhys, yPhys);/* ... */64 }65 return PixelIndex;66 }[url=][/url]
在uCGUI\Config找到三个配置文件。
LCDConf.h
在pdf的第20章有详细介绍
图10
先设定这几个必需的。
初始化宏定义
驱动如果是自己写的需要以下宏定义
#define LCD_CONTROLLER -1
#define LCD_INIT_CONTROLLER() ili9320_Initializtion();
GUIConf.h
可以用默认配置
GUITouchConf.h
先用默认值,等运行Dome后,有个校准,获得校准值,再进行修改。 |
|
|
|
|
|