Subversion Repositories Code-Repo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 Kevin 1
#ifndef __uart_h
2
#define __uart_h
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 uart_2_init(void);
25
void UART1_Recv_Interrupt_Handler(void);
26
//void uart_2_recv_interrupt_handler(void);
27
void UART1_Send_Interrupt_Handler(void);
28
void UART1_WriteS(const rom char *fmt, ...);
150 Kevin 29
void UART1_WriteF(float f, unsigned char m);
119 Kevin 30
void UART1_WriteB(const char *msg, unsigned char length);
127 Kevin 31
void UART1_WriteC(const unsigned char c);
122 Kevin 32
unsigned char UART1_Buffer_Len(void);
33
unsigned char UART1_Read_Buffer(unsigned char *buffer);
119 Kevin 34
#endif