www.pudn.com > s3c2410TouchScr.rar > 2410test.c


 
 
#include  
#include  
 
#include "def.h" 
#include "option.h" 
#include "2410addr.h" 
#include "2410lib.h" 
#include "2410slib.h" 
#include "mmu.h" 
 
#include "2410ts.h" 
 
 
void Isr_Init(void); 
void HaltUndef(void); 
void HaltSwi(void); 
void HaltPabort(void); 
void HaltDabort(void); 
 
 
//=================================================================== 
void Main(void) 
{ 
   
     
    MMU_Init(); 
    
    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() 
	 
 
    while(1) 
    { 
		Ts_Sep(); 
    } 
} 
 
//=================================================================== 
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); 
}