/*
 * 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 CUCON	0x0
#define CUSTAT	0x4
#define CUINT	0x8
#define CUTXBUF	0xC
#define CURXBUF	0x10
#define CUBRD	0x14
#define CUCHAR1 0x18
#define CUCHAR2 0x1C

#define DTR			0x00000010
#define	RDV			0x00000001
#define	THE			0x00040000
#define	TI			0x00020000


#if 0
/*This is using system clock as uart clock*/
#define B9600	432	
#define B19200	215
#define B38400	107
#define B57600	71
#define B115200	35
#else
/*This is using external 33M clock as usrt clock*/
#define B9600	191
#define B19200	95
#define B38400	47
#define B57600	31
#define B115200	15
#endif



#endif //__UART_EV4510_
