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


//=================================================================== 
// 文件名 : 2410lib.h 
// Function  : Test_uart.c中的提的能用函数  
// 建立日期:2006-2-15 
// Version   : 0.0 
//=================================================================== 
 
#ifndef __2410lib_h__ 
#define __2410lib_h__ 
 
#ifdef __cplusplus 
extern "C" { 
#endif 
 
#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 
 
 
void Timer_Start(int divider);    //Watchdog Timer is used. 
int  Timer_Stop(void);            //Watchdog Timer is used. 
 
void Delay(int time);              //Watchdog Timer is used. 
void Uart_Select(int ch); 
void Uart_Init(int mclk,int baud); 
char Uart_Getch(void); 
void Uart_Putch(char c); 
void Uart_SendByte(int data); 
void Uart_Printf(char *fmt,...); 
void Uart_SendString(char *pt); 
void Uart_SendString(char *pt); 
void clear(void); 
void show(char * address_buf); 
 
#ifdef __cplusplus 
} 
#endif 
 
#endif  //__2410lib_h__