www.pudn.com > USBdiskRW.rar > cmd_menu.c


#include "def.h" 
#include "option.h" 
#include "44b.h" 
#include "utils.h" 
 
void SL811Main(void); 
void D12Main(void); 
void LoadFromUart(void); 
void IISMain(void); 
 
void Timer_Test( void ) ; 
void Test_Iic( void ) ; 
void ADC_Test(void); 
 
void Test_LcdMono(void); 
void Test_LcdStr(void) ; 
void Test_LcdG4(void); 
void Test_LcdG16(void); 
void Test_LcdColor(void); 
 
void ADS7843_C256LCD_Test( void ) ; 
void Eint567_Test( void ) ; 
 
//*************************************************************************** 
extern char Image$$RO$$Limit[]; 
extern char Image$$RO$$Base[]; 
extern char Image$$RW$$Limit[]; 
extern char Image$$RW$$Base[]; 
extern char Image$$ZI$$Limit[]; 
extern char Image$$ZI$$Base[]; 
//*************************************************************************** 
 
void About_Function(void) 
{  
    printf( "\t Image$$RO$$Base  = %x\n", Image$$RO$$Base ); 
	printf( "\t Image$$RO$$Limit = %x\n", Image$$RO$$Limit ); 
	printf( "\t Image$$RW$$Base  = %x\n", Image$$RW$$Base ); 
	printf( "\t Image$$RW$$Limit = %x\n", Image$$RW$$Limit ); 
    printf( "\t Image$$ZI$$Base  = %x\n", Image$$ZI$$Base ); 
    printf( "\t Image$$ZI$$Limit = %x\n", Image$$ZI$$Limit ); 
    printf( "\n" ); 
 } 
 
//***************************************************************************** 
void Memoey_Test( void ) 
{	 
	#define ADDRESS_ADD	0x100000 
	 
	int i, j ; 
	int memError = 0 ; 
	 
	CacheDisable() ; 
	CacheFlush() ; 
	 
    printf( "\nMemory Test(0x%xh--0x%xh) : WR\n", (_RAM_STARTADDRESS+ADDRESS_ADD), (_ISR_STARTADDRESS&0xfff0000) ) ; 
     
    for( i = (_RAM_STARTADDRESS+ADDRESS_ADD); i < (_ISR_STARTADDRESS&0xfff0000); i += 4 ) 
    { 
		*((volatile unsigned *)i) = i ; 
		if( (i%0x10000) == 0 )	WrUTXH0( '.' ) ; 
    } 
     
    printf( "\nMemory Test(0x%xh--0x%xh) : RD\n", (_RAM_STARTADDRESS+ADDRESS_ADD), (_ISR_STARTADDRESS&0xfff0000) ) ; 
     
    for( i = (_RAM_STARTADDRESS+ADDRESS_ADD); i < (_ISR_STARTADDRESS&0xfff0000); i += 4 ) 
    { 
		j = *((volatile unsigned *)i ) ; 
		if( j != i ) 
		{ 
			memError = 1 ; 
			break ; 
		} 
 
		if( (i%0x10000) == 0 )	WrUTXH0( '.' ) ; 
    } 
 
    if( memError == 0 ) 
		printf("\n\nMemory Test is OK!\n"); 
    else 
    { 
		printf( "\n\nMemory Test is FAIL!\n" ) ; 
		printf( "  Write the memory address (0x%xh) with data (0x%xh)\n", i, i ) ; 
		printf( "  But read the memory is 0x%xh!\n", j ) ; 
	} 
 
	CacheEnable() ; 
} 
 
//***************************************************************************** 
CmdMenu cmd_menu[] = { 
			{"Please input a number", About_Function } , 
			 
			{"Memory test", Memoey_Test } , 
			 
			{"Timer PWM test ( Beep )", Timer_Test } , 
			{"IIC EEPROM test", Test_Iic } , 
			{"ADC test", ADC_Test } , 
			 
			{"Download File by uart(DNW)", LoadFromUart } , 
			{"IIS Play test(Please download *.wav by Uart first)", IISMain } ,		 
			 
			{"SL811 test", SL811Main } , 
			{"PDIUSBD12 test", D12Main } , 
			 
			{"LCD test Mono", Test_LcdMono } , 
			{"LCD test Mono printf string", Test_LcdStr } , 
			{"LCD test Grey 4", Test_LcdG4 } , 
			{"LCD test Gray 16", Test_LcdG16 } , 
			{"LCD test Color 256", Test_LcdColor } , 
			 
			{"Interrupt test", Eint567_Test } , 
			{"TouchPanel(ADS7843) test", ADS7843_C256LCD_Test } ,		//本测试程序仅支持C57彩屏 
			 
			 
			{"Get SmartMedia Card information", NandFlashStatusRep } ,		//获取Smart Media Card信息	 
			{"Get IDE information", GetIdeInfo } ,		//获取IDE硬盘信息	 
			{0, 0} 
			 
			}; 
//*****************************************************************************