Subversion Repositories Code-Repo

Rev

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

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