UCGUI学习记录1
发布: 2009-5-25 13:45 | 作者: 玲珑 | 查看: 14次
文件夹1:GUI_FS44B0XII_V3_LCDTP_Test 此文件可以正常运行。
文件夹2:44B0_uCGUI_G57 此文件中的程序运行后不能正常在LCD屏上显示任何东西,一开始我想可能是端口设置不对,但我将上文件1的端口初始化COPY到文件2,但发现还是不行,后续要查看是否是GUI_INIT()不对,或者是这个文件2中的时钟没有初始化?后续试一下将文件1中的时钟部份COPY到文件2中来。!另外要搞清楚那个结构GUI_CONTEXT. 还有一个NI问是可能是LCD_DISPON()和LCD_DISPOFF()不对,要查看一下,只可惜时间无多啊。。。。。
继续努力。!!!!!!!!!加油。。。。。。。。。。。
2006.12.4
GUI_Init( );函数执行流程:
GUI_DEBUG_LOG("\nGUI_Init()"); //一个空的宏定义
GUI_DecChar = '.';//全局变量定义,EXTERN GUI_SADDR char GUI_DecChar; 其中//GUI_SADDR为在GUI_Protected.h中定义的空定义。
GUI_X_Init() //进入这个函数。这是一个空函数。在进入LCD初始化时可以做一点事情。
_InitContext(&GUI_Context); //接着进入这个函数,其中参数GUI_Context是定义的一个结构体的变量,具体请参考后面附上的结构体声明。
static void _InitContext(GUI_CONTEXT* pContext) {
#if GUI_SUPPORT_MEMDEV //在GUICONF。H中已经被定义为有效,支持存储器设备。
GUI_SelectLCD();
void GUI_SelectLCD(void)
{
int hDevDataOld = GUI_Context.hDevData;
GUI_Context.hDevData = 0;
GUI_Context.pDeviceAPI = &LCD_L0_APIList;
GUI_Context.pClipRect_HL = &GUI_Context.ClipRect;
LCD_SetClipRectMax();
void LCD_SetClipRectMax(void)
{
LCDDEV_L0_GetRect(&GUI_Context.ClipRect);
#define LCDDEV_L0_GetRect GUI_Context.pDeviceAPI->pfGetRect
}
/* If we are switching batck, restore the former clip rect */
if (hDevDataOld)
GUI_Context.ClipRect = GUI_Context.ClipRectPrev;
#if GUI_WINSUPPORT
WM_Activate();
void WM_Activate(void)
{
WM_IsActive = 1; /* Running */
}
#endif
}
#else
LCD_SetClipRectMax();
#endif
pContext->pLCD_HL = &LCD_HL_APIList;
pContext->pAFont = GUI_DEFAULT_FONT;
pContext->pClipRect_HL = &GUI_Context.ClipRect;
pContext->PenSize = 1;
/* Variables in WM module */
#if GUI_WINSUPPORT
pContext->hAWin = WM_GetDesktopWindow();
#endif
/* Variables in GUI_AA module */
pContext->AA_Factor = 3;
LCD_SetBkColor(GUI_DEFAULT_BKCOLOR);// GUI_DEFAULT_BKCOLOR为黑色。
void LCD_SetBkColor(GUI_COLOR color)
{
LCD_SetBkColorIndex(LCD_Color2Index(color));
int LCD_Color2Index(LCD_COLOR Color)
{return LCDDEV_L0_Color2Index(Color);}
#define LCDDEV_L0_Color2Index GUI_Context.pDeviceAPI->pfColor2Index
void LCD_SetBkColorIndex(int Index)
{ LCD_ACOLORINDEX[GetColorIndex(0)] = Index; }
static int GetColorIndex(int i) /* i is 0 or 1 */
{return (GUI_Context.DrawMode & LCD_DRAWMODE_REV) ? i-1 : i;}
}
LCD_SetColor(GUI_DEFAULT_COLOR);//默认白色
void LCD_SetColor(GUI_COLOR color)
{
LCD_SetColorIndex(LCD_Color2Index(color));
static int GetColorIndex(int i) /* i is 0 or 1 */
{return (GUI_Context.DrawMode & LCD_DRAWMODE_REV) ? i-1 : i;}
void LCD_SetColorIndex(int Index) { LCD_ACOLORINDEX[GetColorIndex(1)] = Index; }
}
}




