#ifndef __UART_H
#define __UART_H


#if     UART_BRT == 0
    #define	UART_BPS_H		0x7F
    #define	UART_BPS_L		0x64
    #define	UART_BPS_F		0x04
#elif   UART_BRT == 1
    #define	UART_BPS_H		0x7F
    #define	UART_BPS_L		0xF3
    #define	UART_BPS_F		0x00
#endif

//#if ((0<=UART0_DEFINE <= 11))
/**********************************采用UART0模块**********************************/
#define UART_SLAVE_SADDR	            0x0A                        				//UART地址，默认为0x0A
#define Uart0RxEn()			            REN = 1; IO_485_DE = 0; 	    			//UART可以接收数据
#define Uart0TxEn(TxData)	            REN = 0; SBUF = TxData; IO_485_DE = 1; 	    //UART发送数据

//#define IrqUartEn()			            IrqUart0En()
//#define IrqUartDis()		            IrqUart0Dis()

//#define InterruptUart0AppRx(RxData)		InterruptUartAppRx(RxData)
//#define InterruptUart0AppTx()			InterruptUartAppTx()
//#define UARTInit()						UART0Init()

extern void UART0Init(void);

//#elif ((0<=UART1_DEFINE <=11))
/**********************************采用UART1模块**********************************/
//#define UART1_SLAVE_SADDR	            0x0A                        //UART地址，默认为0x0A
#define Uart1RxEn()			            McuBank1Sel(); REN1 = 1; McuBank0Sel();                   //UART可以接收数据
#define Uart1TxEn(TxData)	            McuBank1Sel(); REN1 = 0; SBUF1 = TxData; McuBank0Sel();   //UART发送数据

//#define IrqUartEn()			            IrqUart1En()
//#define IrqUartDis()		            IrqUart1Dis()

//#define InterruptUart1AppRx(RxData)		InterruptUartAppRx(RxData)
//#define InterruptUart1AppTx()			InterruptUartAppTx()
//#define UARTInit()						UART1Init()

extern void UART1Init(void);

//#elif UART2_DEFINE = 0
/**********************************采用UART2模块**********************************/
//#define UART2_SLAVE_SADDR	            0x0A                                                        //UART地址，默认为0x0A    
#define Uart2RxEn()			            McuBank1Sel(); REN2 = 1; McuBank0Sel();                     //UART可以接收数据
#define Uart2TxEn(TxData)	            McuBank1Sel(); REN2 = 0; SBUF2 = TxData; McuBank0Sel();     //UART发送数据

//#define IrqUartEn()			            IrqUart2En()
//#define IrqUartDis()		            IrqUart2Dis()

//#define InterruptUart2AppRx(RxData)		InterruptUartAppRx(RxData)
//#define InterruptUart2AppTx()			InterruptUartAppTx()
//#define UARTInit()						UART2Init()

extern void UART2Init(void);
//#endif //UART_DEFINE


//extern void InitUART0(void);






#endif