#ifndef _USART_H_
#define _USART_H_

#include <stdio.h>
#include <string.h>
#include "AD18F06A.h"

extern volatile unsigned char Chip_ID;

#define     IC_ID                   0xE2

#define     Tx_RX_r_Pin_TRIS        TRISA3
#define     Tx_RX_r_Pin_PUPD        PA3PU
#define     Tx_RX_r_Pin             PA3
#define     Tx_RX_t_Pin             PA3
#define     Tx_Init                 0
#define     Rx_Init                 1

#define     TX_DIR                  TRISA1
#define     TX_PIN                  PA1

#define     RX_DIR                  TRISA2
#define     RX_PIN                  PA2

void usart_init(void);
void putch(unsigned char tmp);
unsigned char getch(void);

void Tx_Rx_Init(unsigned char UaRt_MoDe);
unsigned char get_dat();
void Send_ch(unsigned char Temp);
void Send_CMD(unsigned char Addr,unsigned char Dat);
void Data_Receive(void);

#endif
