main.c

来自「开发环境:ADS 1.2/SDT 2.51 GUI测试」· C语言 代码 · 共 222 行

C
222
字号
/*
 *Module: main.C		
 *Programed by: 
 *Programed on: Date: 
 *Modified  by:
 *Modified  on: Date:
*/

#define	TASK_GLOBALS
#include "option.h"
#include "def.h"
#include "44b.h"
#include "44blib.h"

#include	"includes.h"



#include "GUI.H"
#include "DIALOG.H"
#include "WM.h"

#include "button.h"
#include "progbar.h"


extern const GUI_BITMAP bmucdragon;
extern const GUI_BITMAP bmfantsy;
extern const GUI_BITMAP bmfrog;
extern const GUI_BITMAP bmWaterlilies;

extern const GUI_BITMAP bmHondaS2K1;
extern const GUI_BITMAP bmHondaS2K2;
extern const GUI_BITMAP bmLuigi;
extern const GUI_BITMAP bmMario;
extern const GUI_BITMAP bmRebeccaRomijnStamos;
extern const GUI_BITMAP bmtwins;

extern const GUI_BITMAP bm_1bpp_1;



extern  void  ShowColorBar(void);
extern  void  DrawPolygon(void);
extern  void  DemoAntialiasing(void);
extern  void  GUIDEMO_Messagebox(void);
extern  void  Dialog_Radio(void);
extern  void  Dialog_SliderClolor(void);
extern  void  Dialog_All(void);
extern  void  ShowHiresAntialiasing(void);
extern  void  Widget_Progbar(void);
extern  void  DemoListbox(void);
extern  void  DemoScale(void);
extern  void  DemoScale(void);
extern  void  DemoButton(void);
extern  void  DemoBandingMemdev(void);
extern  void  Demo_DrawGraph(void);
extern  void LCD_Init_Controler(void);

extern	void Timer_init ( void );
#define DELAY_TIME 50
extern	int GUI_Init(void);

void Delay(int time)
{
    int i;
	int delayLoopCount=400;

    for(;time>0;time--)
	for(i=0;i<delayLoopCount;i++);
}
//void	test()
//{	
//
//}   
    
//*----------------------------------------------------------------------------
//* Function Name       : SystemInitialization
//* Object              : Setup timer interrupt every 10ms 
//* Input Parameters    : none
//* Output Parameters   : none
//*----------------------------------------------------------------------------
void SystemInitialization (void)
{   
	char	*pWOTHER;
	char	Other;
	 
    AT91F_PS_EnablePeriphClock ( AT91C_BASE_PS, 1<<AT91C_ID_PIO ) ;// First, enable the clock of the PIOB

	AT91F_PIO_CfgOutput( AT91C_BASE_PIO, I2C_MASK );	// define PIO output

	AT91F_PIO_CfgOutput( AT91C_BASE_PIO, LED_MASK | BSB_MASK | COM0_DTR0 | NANDFR_B );// define PIO output
    
   	AT91F_PIO_SetOutput( AT91C_BASE_PIO, NANDFR_B) ;// setb	3BSB
        
    AT91F_PIO_CfgInput( AT91C_BASE_PIO, KEY_MASK | UPDATA_EA | COM0_MASK | NANDFR_B );// define PIO input
    	
	AT91F_PIO_SetOutput( AT91C_BASE_PIO, BSB_MASK) ;// setb	3BSB
	   
    pWOTHER = (char *)WOTHER;
    Other = 0;
    *pWOTHER = Other;
   // LoopNop(1000);	//delay 1000 * 1.4us
    Other = LINIT | PINIT;
    *pWOTHER = Other;    
}

//*----------------------------------------------------------------------------
//* Function Name       : main
//* Object              : Main function 
//* Input Parameters    : none
//* Output Parameters   : none
//*----------------------------------------------------------------------------
int main( void )
{
	
	uchar i;
	SystemInitialization();	 /* Hardware and software module related initializations */
    
//    Usart_init();			 //USART initialization 
//    
//
//	
//	Timer_init();
	
	
	

 	GUI_Init();
 	Widget_Progbar();
 //	DemoButton();
 	//LCD_Init_Controler();
while(1) 
 {
    
	//GUI_Clear();
	//LCD_L0_FillRect(0, 0, 120, 40);
   //GUI_DrawBitmap(&bmucdragon,0,0);
    GUI_DrawBitmap(&bm_1bpp_1,0,0);
	
/*	GUI_Clear();
//	
//    GUI_DrawBitmap(&bmHondaS2K1,0,0);Delay( DELAY_TIME) ; //WaitKey();
//    GUI_DrawBitmap(&bmHondaS2K2,219,0);Delay( DELAY_TIME) ; //WaitKey();
//    GUI_DrawBitmap(&bmLuigi,0,160);Delay( DELAY_TIME) ; //WaitKey();
//    GUI_DrawBitmap(&bmMario,219,160);Delay( DELAY_TIME) ; //WaitKey();
//    GUI_DrawBitmap(&bmtwins,110,80);Delay( DELAY_TIME) ; //WaitKey();
//	
//	GUI_Clear();
//    GUI_DrawBitmap(&bmfantsy,0,0);Delay( DELAY_TIME) ; //WaitKey();
//	
//	GUI_Clear();
//    GUI_DrawBitmap(&bmfrog,0,0);Delay( DELAY_TIME) ; //WaitKey();
//	
//	GUI_Clear();
//    GUI_DrawBitmap(&bmWaterlilies,0,0);Delay( DELAY_TIME) ; //WaitKey();
//    
//	GUI_Clear();
//	GUI_SetBkColor(GUI_BLUE);
//    GUI_SetColor(GUI_WHITE);
//    GUI_SetFont(&GUI_Font_HZK16);
//	GUI_DispString("绘图函数演示");
//    GUI_SetDrawMode(GUI_DRAWMODE_NORMAL);
//    GUI_FillCircle(120, 64, 40);
//    GUI_SetDrawMode(GUI_DRAWMODE_XOR);
//    GUI_FillCircle(140, 84, 40);
//   // Delay( DELAY_TIME) ; //WaitKey();
//	
//	GUI_Clear();
//	DrawPolygon();
//	//Delay( DELAY_TIME) ; //WaitKey();
	
	GUI_Clear();
	for (i=10; i<50; i++)
		GUI_DrawCircle(100,100,i);
	//Delay( DELAY_TIME) ; //WaitKey();
	
    GUI_Clear();
    GUI_SetColor(0xff);
    GUI_FillEllipse(100, 100, 50, 70);
    GUI_SetColor(0x0);
    GUI_DrawEllipse(100, 100, 50, 70);
    GUI_SetColor(0x000000);
    GUI_FillEllipse(100, 100, 10, 50);
   // Delay( DELAY_TIME) ; //WaitKey();
    
    GUI_Clear();
    DemoAntialiasing();
   // Delay( DELAY_TIME) ; //WaitKey();
	
	GUI_SetDefault();
	GUI_Clear();
	GUI_SetFont(&GUI_Font_HZK16);
	GUI_DispString("对话框演示");
	GUI_SetFont(&GUI_Font6x8);
	GUIDEMO_Messagebox();
	
	Dialog_Radio();
	
	Dialog_SliderClolor();
	
    Dialog_All();
    
    GUI_Clear();
    ShowHiresAntialiasing();
    
    Widget_Progbar();
    
    DemoListbox();
    
    DemoButton();
    
 	DemoScale();
    
 	GUI_Clear();	
    DemoBandingMemdev();
    
 	GUI_Clear();	
    Demo_DrawGraph();*/
    
 }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?