/*
 * MICETEK International Inc., (shanghai) 
 * 	By Qinwei , 2003.05.28 (CopyRight)
 * 
 *  Version 0.1
 */

#ifndef __UART_EV4510_

#define __UART_EV4510_

int dev_uart_init (int sys_clock, int reg_base, int ch);
//dev_uart_init returns non-negative number on  succuess, 0 on failing.

int crtio (int baund);
//crtio returns the old baund rate on success, 0 on failing.

int outbyte (int);
//outbyte returns the written char on success or EOF on failing.

int inbyte (void);
//inbyte returns the byte it reads on success or EOF on failing.

#define ULCON	0x0
#define UCON	0x4
#define USTAT	0x8
#define UTXBUF	0xC
#define URXBUF	0x10
#define UBRDIV	0x14

#define DTR			0x00000010
#define	RDV			0x00000020
#define	TH_empty	0x00000040
#define	TC			0x00000080


#if 0
/*This is using system clock as uart clock*/
#define B9600	162
#define B19200	80
#define B38400	40
#define B57600	26
#define B115200	13
#else
/*This is using external 33M clock as usrt clock*/
#define B9600	216
#define B19200	108
#define B38400	53
#define B57600	35
#define B115200	17
#endif



#endif //__UART_EV4510_
