Subversion Repositories Code-Repo

Rev

Rev 156 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
156 Kevin 1
#ifndef UART_H
2
#define UART_H
119 Kevin 3
 
130 Kevin 4
#define MAXUARTBUF 125
119 Kevin 5
 
122 Kevin 6
#define UART1_BREAK_CHAR        0x0D    //(CR)
119 Kevin 7
 
126 Kevin 8
#define UART1_RECV_BUFFER
9
//#define UART1_RECV_XBEE
10
 
119 Kevin 11
typedef struct __UART_DATA {
12
    unsigned char buffer_in[MAXUARTBUF];
13
    unsigned char buffer_in_read_ind;
14
    unsigned char buffer_in_write_ind;
15
    unsigned char buffer_in_len;
122 Kevin 16
    unsigned char buffer_in_len_tmp;
119 Kevin 17
 
18
    unsigned char buffer_out[MAXUARTBUF];
19
    unsigned char buffer_out_ind;
20
    unsigned char buffer_out_len;
21
} UART_DATA;
22
 
23
void UART1_Init(void);
24
void UART1_Recv_Interrupt_Handler(void);
25
void UART1_Send_Interrupt_Handler(void);
26
void UART1_WriteS(const rom char *fmt, ...);
150 Kevin 27
void UART1_WriteF(float f, unsigned char m);
119 Kevin 28
void UART1_WriteB(const char *msg, unsigned char length);
127 Kevin 29
void UART1_WriteC(const unsigned char c);
122 Kevin 30
unsigned char UART1_Buffer_Len(void);
31
unsigned char UART1_Read_Buffer(unsigned char *buffer);
119 Kevin 32
#endif