⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 2460test.cpp.bak

📁 三星s3c2460开发板完整功能测试代码
💻 BAK
字号:

#include <stdio.h>
#include <stdlib.h>

#include "2460addr.h"
#include "2460lib.h"
#include "2460slib.h"
#include "Console.h"

#include "mmu.h"
#include "PLL.h"
#include "DRAM.h"

#include "TeakDSP.h"
#include "BurdenTest.h"
#include "memtest.h"
#include "VFP9.h"
#include "dma.h"

#include "flash.h"
#include "am29f800.h"
#include "strata16.h"
#include "nand.h"

#include "LCD.h"
#include "LCDlib.h"
#include "Camif.h"
#include "IrDA.h"
#include "Post.h"
#include "IIC.h"
#include "Mobile_Demo.h"

#include "spi01.h"

#include "AC97.h"
#include "pcm.h"
#include "iis.h"
#include "keypad.h"
#include "sdi.h"
#include "mstick.h"
#include "RTC.h"
#include "watchdog.h"
#include "timer.h"
#include "eint.h"
#include "power.h"
#include "adcts.h"
#include "modemif.h"
#include "uart.h"

#include "cs8900.h"

void VFP9( void);

void *function[][2]=
{   //  								"123456789012345678901"
	(void *) VFP9,						"VFP9                 ",
    (void *) TeakDSP,					"Teak DSP             ",
    (void *) System_Burden_Test,		"System burden Test   ",
    (void *) Mem_Test,					"Memory Test          ",
    (void *) Ch9_DMA,					"DMA                  ",
	(void *) Ch3_Power_Test,			"Power mode Test      ",
	(void *) Ch4_NAND_FLASH_CONTROLLER,	"NAND FLASH           ",
    (void *) Ch6_INTERRUPT_CONTROLLER,	"Interrupt Con.       ",
	(void *) Ch28_LCD,					"LCD                  ",
	(void *) Ch21_CAMERA,				"Camera               ",
	(void *) Ch12_IrDA,					"IrDA                 ",
	(void *) Ch27_POST,					"Post processor       ",
	(void *) Ch13_Iic_Test,				"IIC                  ",
	(void *) Ch22_mpeg4_test,			"MPEG4 demo           ",
	(void *) ProgramFlash,				"NOR Flash            ",
    (void *) Ch15_SPI,					"spi test             ",
    (void *) Ch3_Pll_Test,				"Pll test             ",
    (void *) AC97_Test,		 			"AC97                 ",
    (void *) PCM_Test,		 			"PCM                  ",
    (void *) IIS_Test, 		 			"IIS                  ",
	(void *) Ch33_KEYPAD,               "Keypad test          ",
	(void *) Ch28_SD_MMC,               "SD/MMC test          ",
	(void *) Ch29_MEMORY_STICK,         "Memory stick         ",
	(void *) Ch12_RTC,                  "RTC timer            ",
	(void *) Ch11_WDT_Test,             "Watch dog            ",
	(void *) Ch10_PwmTimer_test,        "Timer test           ",
	(void *) Ch34_CS8900_Test,			"CS8900 test          ",
	(void *) Ch30_ADC,					"ADC&Touch Screen     ",
	(void *) Ch27_MODEM,				"Modem test           ",
	(void *) Uart_Test,					"UART                 ",
0,0
};

void Isr_Init(void)
{
    pISR_UNDEF	=	(unsigned)HaltUndef;
    pISR_SWI  	=	(unsigned)HaltSwi;
    pISR_PABORT	=	(unsigned)HaltPabort;
    pISR_DABORT	=	(unsigned)HaltDabort;
	pISR_IRQ	=	(unsigned)IsrIRQ;
    
    rINTMOD     = 0x0;                     //All=IRQ mode
    rINTMSK     = BIT_ALLMSK;              //All interrupt is masked.
    rINTSUBMSK  = BIT_SUB_ALLMSK1;          //All sub-interrupt is masked.
    rINTSUBMSK2 = BIT_SUB_ALLMSK2;          //All sub-interrupt is masked.
   	
	rEINTCON0	= 0x22222222;			//EINT2~0
	rEINTCON1 	= 0x22222222;			//EINT10~3

   	CLR_IF();
}

int main( void)
{
	int i;

    //To make margin
	PreChangeSDRAMParameter();

	SetCLKDIV( Startup_ARMCLKdiv, Startup_HCLKdiv, Startup_PCLKdiv);
	SetMPLL( Startup_MDIV, Startup_PDIV, Startup_SDIV);

	GlobalCLK();
	ChangeSDRAMParameter(HCLK);

    Isr_Init();
    MMU_Init();

#if !SEMIHOSTING
    Delay(0); //calibrate Delay()
#endif
    
//	CamDemoDisplay(); // camera demo
//	Mpeg4_camera_image(); // MPEG&Camif demo


//--------------------------------------------------------------------------------------------
    while(1)
    {
   		GlobalCLK();
		Init_LogicalConsole();
		
		Init_LED();
	    Led_Display(0xf);//all on
		
	   	printf("\n\nSMDK2460 Test Program Ver 0.1 (20040715)\n");
	   	printf("MPLL=%.2fMHz, ARMCLK=%.2fMHz (%d:%d:%d), HCLK=%.2fMHz, PCLK=%.2fMHz\n\n",
	   		(float)MPLL/1000000,(float)ARMCLK/1000000,ARMCLKdiv+1,(ARMCLKdiv+1)*(HCLKdiv+1),(ARMCLKdiv+1)*(HCLKdiv+1)*(PCLKdiv+1),(float)HCLK/1000000,(float)PCLK/1000000);

		i = 0;
		while(1)
		{   //display menu
	    	printf("%2d:%s",i,function[i][1]);
	    	i++;
	    	if((int)(function[i][0])==0)
	    	{
				printf("\n");
				break;
	    	}
	    	if((i%4)==0) printf("\n");
		}

		printf("\nSelect the function to test : ");
		i = GetIntNum();
		printf("\n");

		if( i>=0 && (i<sizeof(function)/8-1) ) 
		   ( (void (*)(void)) (function[i][0]) )();
    }	
}

⌨️ 快捷键说明

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