| 152 |
Kevin |
1 |
#ifndef __uart_h
|
|
|
2 |
#define __uart_h
|
|
|
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 |
|
|
|
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;
|
|
|
16 |
unsigned char buffer_in_len_tmp;
|
|
|
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 char *fmt, ...);
|
|
|
27 |
void UART1_WriteB(const char *msg, unsigned char length);
|
|
|
28 |
void UART1_WriteC(const unsigned char c);
|
|
|
29 |
unsigned char UART1_Buffer_Len(void);
|
|
|
30 |
unsigned char UART1_Read_Buffer(unsigned char *buffer);
|
|
|
31 |
#endif
|