2410test.c

来自「瑞泰创新的GX-ARM9-2410EP教学实验系统的所有基础实验源代码,内容齐全」· C语言 代码 · 共 118 行

C
118
字号
//====================================================================
// File Name : 2410test.c
// Function  : S3C2410 Test Main Menu
// Program   : Shin, On Pil (SOP)
// Date      : June 13, 2003
// Version   : 0.0
// History
//   0.0 : Programming start (February 20,2002) -> SOP
//====================================================================

#include <stdlib.h>
#include <string.h>

#include "def.h"
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"
#include "mmu.h"

#include "SUPERIO.h"

void Isr_Init(void);
void HaltUndef(void);
void HaltSwi(void);
void HaltPabort(void);
void HaltDabort(void);


//===================================================================
void Main(void)
{
    MMU_Init();
   
#if ADS10   
    __rt_lib_init();                //for ADS 1.0
#endif
   

    ChangeClockDivider(0,0);          // 1:1:1    
//    ChangeClockDivider(0,1);          // 1:1:2    
//    rCLKDIVN |= (1<<2);                     // 1:4:4
//    ChangeClockDivider(1,0);          // 1:2:2 
//    ChangeClockDivider(1,1);          // 1:2:4    

    ChangeMPllValue(0xa1,0x3,0x3);    // FCLK=50.7MHz    
//    ChangeMPllValue(0x7f,0x2,0x2);    // FCLK=101.25MHz
//    ChangeMPllValue(0x96,0x5,0x1);    // FCLK=135428571Hz 
//    ChangeMPllValue(0x2a,0x1,0x0);    // FCLK=200MHz   
//    ChangeMPllValue(0x5c,0x1,0x1);    // FCLK=200MHz
//    ChangeMPllValue(0x5c,0x4,0x0);    // FCLK=200MHz
//    ChangeMPllValue(0x8e,0x7,0x0);    // FCLK=200MHz        
//    ChangeMPllValue(0xa1,0x3,0x1);    // FCLK=202.8MHz  


   
//    ChangeClockDivider(1,1);          // 1:2:4    

//    ChangeMPllValue(0xa1,0x3,0x1);    // FCLK=202.8MHz  
    
    Port_Init();
    Isr_Init();
    Uart_Init(0,115200);
    Uart_Select(0);

    Delay(0);	//calibrate Delay()
	

   // Uart_Printf("\nDA(DAC0832) Test:\n");	
	
		Test_SUPERIO();
        Uart_Getch();		
	
        Uart_Getch();
}

//===================================================================
void Isr_Init(void)
{
    pISR_UNDEF  = (unsigned)HaltUndef;
    pISR_SWI    = (unsigned)HaltSwi;
    pISR_PABORT = (unsigned)HaltPabort;
    pISR_DABORT = (unsigned)HaltDabort;
    
    rINTMOD     = 0x0;                     //All=IRQ mode
    rINTMSK     = BIT_ALLMSK;              //All interrupt is masked.
    rINTSUBMSK  = BIT_SUB_ALLMSK;          //All sub-interrupt is masked. <- April 01, 2002 SOP
}

//===================================================================
void HaltUndef(void)
{
    Uart_Printf("Undefined instruction exception.\n");
    while(1);
}

//===================================================================
void HaltSwi(void)
{
    Uart_Printf("SWI exception.\n");
    while(1);
}

//===================================================================
void HaltPabort(void)
{
    Uart_Printf("Pabort exception.\n");
    while(1);
}

//===================================================================
void HaltDabort(void)
{
    Uart_Printf("Dabort exception.\n");
    while(1);
}

⌨️ 快捷键说明

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