www.pudn.com > bu1566.rar > BUxx_Main.c


/* ************************************************************************ */ 
/*                                                                          */ 
/* ROHM BU15xx demo firmware on MD2306                                      */ 
/*     Client   : ROHM Co., Ltd.                                       */ 
/*     End User :                                                           */ 
/*                                                                          */ 
/*     Processor: ARM-7TDMI(THUMB Mode)                                     */ 
/*     Dev.Env. : ARM-SDTv2.51                                              */ 
/*                                                                          */ 
/*     Main Process & Entry Point                                           */ 
/*                                                                          */ 
/*     file     : BUxx_Main.c                                               */ 
/*     Auther   : J.SATO(NTC)                                              */ 
/*     Date     : 2004/Jul./1	                                            */ 
/*                                                                          */ 
/*     Copyright (c) 2002-04 Naritagiken Co., Ltd. All rights reserved.     */ 
/* ************************************************************************ */ 
 
/* ************************************************** */ 
/*		     INCLUDE FILES		      */ 
/* ************************************************** */ 
#include "BUxx_demoset.h" 
 
#include "BUxx_setuptable.h" 
 
#include "W_MenuMode.h" 
 
#include "BUxx_sample.h"  //shrek Del 051026 
#include  "config.h"      //shrek Del 051026 
 
int gl_timer_chk; 
volatile UINT16 gl_keystate; 
volatile UINT16 gl_keyoldst; 
volatile UINT16 gl_keydisp; 
 
volatile int gl_usb_input; 
volatile int gl_usb_oldin; 
UINT16 gl_productID; 
int gl_dl_version; 
volatile int gl_bus_access; 
int gl_busmode_flag; 
 
/* ************************************************** */ 
/*		     LOCAL FUNCTIONS		      */ 
/* ************************************************** */ 
void usb_init_disp(void); 
void usb_disp(void); 
 
//----------------------------------------------------------------------------- 
//                                                           main function 
//----------------------------------------------------------------------------- 
void C_Entry(void) 
{ 
 #if 1 
	 static int u16Reg1; 
	 static int u16Reg2; 
	 static int u16Reg3; 
	 static int u16Reg4; 
	 static int u16Reg5; 
 #endif 
  
	gl_keydisp = 0x00; 
	gl_keystate = 0; 
	gl_keyoldst = 0; 
	gl_usb_input = 1; 
	gl_usb_oldin = 0; 
	 
	 
		/* ********** Test register read and write ******************** */ 
 
#if 1 
	//----write and read test----// 
	 
		*INDEX_ACCESS = 0x58; 
		u16Reg1 = *REG_ACCESS; 
 
		*INDEX_ACCESS = 0x58; 
		*REG_ACCESS = 0x5aa5; 
 
		*INDEX_ACCESS = 0x59; 
		*REG_ACCESS = 0xa5a5; 
 
		*INDEX_ACCESS = 0x58; 
		u16Reg1 = *REG_ACCESS; 
		 
		*INDEX_ACCESS = 0x59; 
		u16Reg2 = *REG_ACCESS; 
	 
	    data_write(0x58,0x5aa5); 
	    data_write(0x59,0xa5a5); 
	    u16Reg3 = data_read(0x58); 
	    u16Reg4 = data_read(0x59); 
	    	 
	    u16Reg5 = data_read(0x00); 
           u16Reg4 = data_read(0x59); 
		    
		u16Reg1 = 0xffff; 
		u16Reg2 = 0xffff; 
		u16Reg4 = 0xffff; 
		u16Reg3 = 0xffff; 
		 
#endif 
 
	usb_init_disp(); 
 
	lcd_module_setup(); 
 
	aDSC_bu15xx_OPEN(); 
 
	cam_module_setup(); 
 
	gl_timer_chk = 1; 
 
}                               // End of Main         
 
//----------------------------------------------------------------------------- 
//                                      usb_init 
//----------------------------------------------------------------------------- 
void usb_init_disp(void) 
{ 
 
    gl_busmode_flag = BUSACCESS_BIT; 
	gl_productID = BU1563; 
	gl_bus_access = ARMBOARD;	 
 
} 
 
/********************************************************************************/ 
/*								IRQ HANDLER										*/ 
/********************************************************************************/ 
void IrqHandler(void) 
{ 
} 
 
/*======================================================*/ 
/*				==== FIQ Handler ====					*/ 
/*======================================================*/ 
void FiqHandler(void) 
{ 
}