www.pudn.com > zlggui.rar > main.c, change:2007-01-11,size:6634b


/****************************************Copyright (c)************************************************** 
**                               Guangzou ZLG-MCU Development Co.,LTD. 
**                                      graduate school 
**                                 http://www.zlgmcu.com 
** 
**--------------File Info------------------------------------------------------------------------------- 
** File name:			main.c 
** Last modified Date:  2004-09-16 
** Last Version:		1.0 
** Descriptions:		The main() function example template 
** 
**------------------------------------------------------------------------------------------------------ 
** Created by:			Chenmingji 
** Created date:		2004-09-16 
** Version:				1.0 
** Descriptions:		The original version 
** 
**------------------------------------------------------------------------------------------------------ 
** Modified by: 
** Modified date: 
** Version: 
** Descriptions: 
** 
********************************************************************************************************/ 
#include "config.h" 
#include "stdlib.h" 
 
#define	TaskStkLengh	64			//Define the Task0 stack length 定义用户任务0的堆栈长度 
OS_STK	TaskStk[TaskStkLengh];		//Define the Task0 stack 定义用户任务0的堆栈 
void 	Task0(void *pdata);			//Task0 任务0 
 
/**************************************************************************** 
* 名称: main() 
* 功能: 初始化uC/OS-II操作系统,建立第一个任务,然后启动系统。 
****************************************************************************/ 
int  main(void) 
{ 
	OSInit ();																										 
	OSTaskCreate (Task0,(void *)0, &TaskStk[TaskStkLengh - 1], 2);		 
	OSStart (); 
	return 0;															 
} 
 
// 汉字: 广  
// 宽x高=16x16 
uint8 const HZ1[]= 
{ 
0x01,0x00,0x00,0x80,0x3F,0xFE,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00, 
0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x80,0x00,0x00,0x00 
}; 
 
// 汉字: 州  
// 宽x高=16x16 
uint8 const HZ2[]= 
{ 
0x08,0x04,0x08,0x84,0x08,0x84,0x08,0x84,0x08,0xC4,0x4C,0xA4,0x4A,0xA4,0x4A,0x94, 
0x88,0x94,0x08,0x84,0x08,0x84,0x10,0x84,0x10,0x84,0x20,0x84,0x20,0x84,0x40,0x04 
}; 
 
 
// 汉字: 周  
// 宽x高=16x16 
uint8 const HZ3[]= 
{ 
0x00,0x00,0x1F,0xFC,0x10,0x84,0x13,0xE4,0x10,0x84,0x10,0x84,0x17,0xF4,0x10,0x04, 
0x13,0xE4,0x12,0x24,0x12,0x24,0x13,0xE4,0x22,0x24,0x20,0x04,0x40,0x14,0x80,0x08 
}; 
 
 
// 汉字: 立  
// 宽x高=16x16 
uint8 const HZ4[]= 
{ 
0x02,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x7F,0xFC,0x00,0x20,0x00,0x30,0x10,0x20, 
0x08,0x40,0x0C,0x40,0x04,0x40,0x04,0x80,0x00,0x80,0x01,0x04,0xFF,0xFE,0x00,0x00 
}; 
 
 
// 汉字: 功  
// 宽x高=16x16 
uint8 const HZ5[]= 
{ 
0x00,0x20,0x00,0x20,0x7F,0x20,0x08,0x20,0x0B,0xFC,0x08,0x24,0x08,0x24,0x08,0x44, 
0x09,0x44,0x0E,0x44,0xF0,0x84,0x40,0x84,0x01,0x04,0x02,0x78,0x04,0x10,0x00,0x00 
}; 
 
 
// 汉字: 单  
// 宽x高=16x16 
uint8 const HZ6[]= 
{ 
0x08,0x20,0x06,0x30,0x04,0x40,0x3F,0xF8,0x21,0x08,0x3F,0xF8,0x21,0x08,0x21,0x08, 
0x3F,0xF8,0x21,0x08,0x01,0x00,0xFF,0xFE,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00 
}; 
 
 
// 汉字: 片  
// 宽x高=16x16 
uint8 const HZ7[]= 
{ 
0x00,0x40,0x10,0x40,0x10,0x40,0x10,0x44,0x1F,0xFE,0x10,0x00,0x10,0x00,0x10,0x00, 
0x1F,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x20,0x10,0x20,0x10,0x40,0x10,0x80,0x10 
}; 
 
 
// 汉字: 机  
// 宽x高=16x16 
uint8 const HZ8[]= 
{ 
0x10,0x00,0x10,0xF8,0x10,0x88,0xFE,0x88,0x10,0x88,0x10,0x88,0x38,0x88,0x34,0x88, 
0x54,0x88,0x50,0x88,0x91,0x08,0x11,0x0A,0x12,0x0A,0x12,0x0A,0x14,0x06,0x10,0x00 
}; 
 
 
// 汉字: 发  
// 宽x高=16x16 
uint8 const HZ9[]= 
{ 
0x02,0x00,0x22,0x40,0x22,0x30,0x22,0x10,0x7F,0xFE,0x24,0x00,0x04,0x00,0x07,0xE0, 
0x0C,0x20,0x0A,0x20,0x0A,0x20,0x11,0x40,0x20,0x80,0x41,0x60,0x86,0x1C,0x18,0x08 
}; 
 
 
// 汉字: 展  
// 宽x高=16x16 
uint8 const HZ10[]= 
{ 
0x3F,0xF8,0x20,0x08,0x20,0x08,0x3F,0xF8,0x22,0x20,0x22,0x20,0x2F,0xFC,0x22,0x20, 
0x3F,0xFE,0x25,0x08,0x24,0x9C,0x24,0x60,0x44,0x20,0x45,0x18,0x8E,0x0E,0x04,0x04 
}; 
 
 
// 汉字: 有  
// 宽x高=16x16 
uint8 const HZ11[]= 
{ 
0x01,0x00,0x01,0x00,0x7F,0xFE,0x02,0x00,0x04,0x00,0x0F,0xF0,0x18,0x10,0x28,0x10, 
0x4F,0xF0,0x88,0x10,0x08,0x10,0x0F,0xF0,0x08,0x10,0x08,0x90,0x08,0x70,0x08,0x20 
}; 
 
 
// 汉字: 限  
// 宽x高=16x16 
uint8 const HZ12[]= 
{ 
0x00,0x00,0xFB,0xF8,0x92,0x08,0x93,0xF8,0xA2,0x08,0xA2,0x08,0x93,0xF8,0x8A,0x80, 
0x8A,0x48,0xAA,0x50,0x92,0x20,0x82,0x20,0x82,0x10,0x82,0x8E,0x83,0x04,0x82,0x00 
}; 
 
 
// 汉字: 公  
// 宽x高=16x16 
uint8 const HZ13[]= 
{ 
0x00,0x00,0x04,0x40,0x06,0x40,0x04,0x40,0x08,0x20,0x08,0x10,0x10,0x18,0x22,0x0E, 
0x43,0x04,0x02,0x00,0x04,0x20,0x08,0x10,0x11,0xF8,0x3F,0x18,0x10,0x10,0x00,0x00 
}; 
 
 
// 汉字: 司 
// 宽x高=16x16 
uint8 const HZ14[]= 
{ 
0x00,0x00,0x3F,0xFC,0x00,0x04,0x00,0x04,0x7F,0xE4,0x00,0x04,0x00,0x04,0x3F,0xC4, 
0x20,0x44,0x20,0x44,0x3F,0xC4,0x20,0x44,0x20,0x04,0x00,0x14,0x00,0x08,0x00,0x00 
}; 
 
 
/********************************************************************************************************* 
**                            Task0 任务0 
** 功能:使用ZLG/GUI实现汉字显示演示。 
**       显示16x16点阵汉字"广州周立功单片机发展有限公司" 
********************************************************************************************************/ 
void  Task0(void *pdata) 
{   int  x, y; 
 
	pdata = pdata; 
	TargetInit (); 
	 
	GUI_Initialize();       // 初始化LCM 
    GUI_SetColor(1, 0);     // 设置前景色和背景色 
     
    // 第1行显示"广州周立功" 
    x=20; y=5-5; 
    GUI_PutHZ(x, y, (uint8 *)HZ1, 16, 16); 
    x += 18; 
    GUI_PutHZ(x, y, (uint8 *)HZ2, 16, 16); 
    x += 18; 
    GUI_PutHZ(x, y, (uint8 *)HZ3, 16, 16); 
    x += 18; 
    GUI_PutHZ(x, y, (uint8 *)HZ4, 16, 16); 
    x += 18; 
    GUI_PutHZ(x, y, (uint8 *)HZ5, 16, 16); 
     
    // 第2行显示"单片机" 
    x=38; y += 21-5; 
    GUI_PutHZ(x, y, (uint8 *)HZ6, 16, 16); 
    x += 18; 
    GUI_PutHZ(x, y, (uint8 *)HZ7, 16, 16); 
    x += 18; 
    GUI_PutHZ(x, y, (uint8 *)HZ8, 16, 16); 
     
    // 第3行显示"发展有限公司" 
    x=10; y += 21-5; 
    GUI_PutHZ(x, y, (uint8 *)HZ9, 16, 16); 
    x += 18; 
    GUI_PutHZ(x, y, (uint8 *)HZ10, 16, 16); 
    x += 18; 
    GUI_PutHZ(x, y, (uint8 *)HZ11, 16, 16); 
    x += 18; 
    GUI_PutHZ(x, y, (uint8 *)HZ12, 16, 16); 
    x += 18; 
    GUI_PutHZ(x, y, (uint8 *)HZ13, 16, 16);  
    x += 18; 
    GUI_PutHZ(x, y, (uint8 *)HZ14, 16, 16); 
	 
	while (1) 
	{ 
		OSTimeDly(10); 
	} 
} 
    
/********************************************************************************************************* 
**                            End Of File 
********************************************************************************************************/