www.pudn.com > s3c2410_code_Test.rar > 2410lib.h


/* 
********************************************************* 
* Copyright  
* All rights reserved.				             
* 
* 文件名称:2410lib.h 
* 文件标识:头文件 
* 摘    要:本文件是定义了2410基本配置操作。 
*          
* 当前版本:1.0 
* 作    者:刘征 
* 完成日期:2005.4.3 
* 
* 取代版本: 
* 作    者: 
* 完成日期: 
********************************************************* 
*/ 
#ifndef __2410LIB_H__ 
#define __2410LIB_H__ 
 
#ifdef __cplusplus 
extern "C" { 
#endif 
/* 
********************************************************* 
*   					 头文件 
********************************************************* 
*/ 
#include "Def.H" 
#include "2410addr.h" 
/* 
********************************************************* 
*   					 宏定义 
********************************************************* 
*/ 
#define DebugOut Uart_Printf 
 
#define min(x1,x2) (((x1)<(x2))? (x1):(x2)) 
#define max(x1,x2) (((x1)>(x2))? (x1):(x2)) 
 
#define ONESEC0 (62500)	             //16us resolution, max 1.04 sec 
#define ONESEC1 (31250)	             //32us resolution, max 2.09 sec 
#define ONESEC2 (15625)	             //64us resolution, max 4.19 sec 
#define ONESEC3 (7812)	             //128us resolution, max 8.38 sec 
#define ONESEC4 (PCLK/128/(0xff+1))  //@60Mhz, 128*4us resolution, max 32.53 sec 
#define EnterPWDN(clkcon) ((void (*)(int))0x20)(clkcon) 
 
/* 
********************************************************* 
*   					函数声明 
********************************************************* 
*/ 
void StartPointAfterPowerOffWakeUp(void); //purnnamu:Mar.29.2002 
void Delay(int time);              //Watchdog Timer is used. 
 
void *malloc(unsigned nbyte);  
void free(void *pt); 
 
void Port_Init(void); 
void Uart_Select(int ch); 
void Uart_TxEmpty(int ch); 
void Uart_Init(int mclk,int baud); 
char Uart_Getch(void); 
char Uart_GetKey(void); 
int  Uart_GetIntNum(void); 
void Uart_SendByte(int data); 
void Uart_Printf(char *fmt,...); 
void Uart_SendString(char *pt); 
 
void Timer_Start(int divider);    //Watchdog Timer is used. 
int  Timer_Stop(void);            //Watchdog Timer is used. 
 
void Led_Display(int data); 
 
void ChangeMPllValue(int m,int p,int s); 
void ChangeClockDivider(int hdivn,int pdivn); 
void ChangeUPllValue(int m,int p,int s); 
 
void Isr_Init(void); 
void HaltUndef(void); 
void HaltSwi(void); 
void HaltPabort(void); 
void HaltDabort(void); 
 
#ifdef __cplusplus 
} 
#endif 
 
#endif  //__2410LIB_H__