| 119 |
Kevin |
1 |
#ifndef __uart_h
|
|
|
2 |
#define __uart_h
|
|
|
3 |
|
|
|
4 |
#define MAXUARTBUF 64
|
|
|
5 |
|
|
|
6 |
// FIFO circular buffer
|
|
|
7 |
|
|
|
8 |
typedef struct __UART_DATA {
|
|
|
9 |
unsigned char buffer_in[MAXUARTBUF];
|
|
|
10 |
unsigned char buffer_in_read_ind;
|
|
|
11 |
unsigned char buffer_in_write_ind;
|
|
|
12 |
unsigned char buffer_in_len;
|
|
|
13 |
|
|
|
14 |
unsigned char buffer_out[MAXUARTBUF];
|
|
|
15 |
unsigned char buffer_out_ind;
|
|
|
16 |
unsigned char buffer_out_len;
|
|
|
17 |
} UART_DATA;
|
|
|
18 |
|
|
|
19 |
void UART1_Init(void);
|
|
|
20 |
//void uart_2_init(void);
|
|
|
21 |
void UART1_Recv_Interrupt_Handler(void);
|
|
|
22 |
//void uart_2_recv_interrupt_handler(void);
|
|
|
23 |
void UART1_Send_Interrupt_Handler(void);
|
|
|
24 |
void UART1_WriteS(const rom char *fmt, ...);
|
|
|
25 |
void UART1_WriteB(const char *msg, unsigned char length);
|
|
|
26 |
unsigned char UART1_Read(char *buffer);
|
|
|
27 |
#endif
|