Subversion Repositories Code-Repo

Rev

Rev 130 | Rev 154 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef __uart_h
#define __uart_h

#define MAXUARTBUF 125

#define UART1_BREAK_CHAR        0x0D    //(CR)

#define UART1_RECV_BUFFER
//#define UART1_RECV_XBEE

typedef struct __UART_DATA {
    unsigned char buffer_in[MAXUARTBUF];
    unsigned char buffer_in_read_ind;
    unsigned char buffer_in_write_ind;
    unsigned char buffer_in_len;
    unsigned char buffer_in_len_tmp;

    unsigned char buffer_out[MAXUARTBUF];
    unsigned char buffer_out_ind;
    unsigned char buffer_out_len;
} UART_DATA;

void UART1_Init(void);
//void uart_2_init(void);
void UART1_Recv_Interrupt_Handler(void);
//void uart_2_recv_interrupt_handler(void);
void UART1_Send_Interrupt_Handler(void);
void UART1_WriteS(const rom char *fmt, ...);
void UART1_WriteF(float f, unsigned char m);
void UART1_WriteB(const char *msg, unsigned char length);
void UART1_WriteC(const unsigned char c);
unsigned char UART1_Buffer_Len(void);
unsigned char UART1_Read_Buffer(unsigned char *buffer);
#endif