
#ifndef UART_H_
#define UART_H_

#include "type.h"

#define BAUDRATE	115200

extern UINT8  gRxFlag;
//extern UINT8  gRxBuf[];
extern UINT16 gRxfist;
extern UINT8 busyflag;

extern UINT8 Frame_AA_OK;
extern UINT16 Frame_count;

extern UINT8 Rx_Buffer_short[256];
extern UINT8 Rx_Buffer_long[1024+2];

extern UINT16  Rx_Count_short;
extern UINT16 Rx_Count_long;
extern UINT16 Rx_Num;
extern UINT16 Respond_Num ;
extern UINT16 Respond_Count;

extern UINT8 Respond_AA_OK;
extern UINT8 Frameend[4];

void LT_UsartRxEnable(void);
void LT_UsartRxDisable(void);

void Uart_Init(UINT32 pclk,UINT32 bound);
//void SCI0_Handler(void);
void SerialOutChar(char c);
void SerialOutString(char *c);

void SendData(UINT16 data);
void LT_SingleByteToPc(UINT8 val);
void LT_ClearRxBuf(void);
void LT_DataToPc(UINT8 *buf,UINT8 len);
void LT_DataToPc_NoFrame(UINT8 *buf,UINT8 len);

#endif /* UART_H_ */
