Subversion Repositories Code-Repo

Rev

Rev 119 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 119 Rev 122
Line 1... Line 1...
1
#ifndef __uart_h
1
#ifndef __uart_h
2
#define __uart_h
2
#define __uart_h
3
 
3
 
4
#define MAXUARTBUF 64
4
#define MAXUARTBUF 128
5
 
5
 
6
// FIFO circular buffer
6
#define UART1_BREAK_CHAR        0x0D    //(CR)
7
 
7
 
8
typedef struct __UART_DATA {
8
typedef struct __UART_DATA {
9
    unsigned char buffer_in[MAXUARTBUF];
9
    unsigned char buffer_in[MAXUARTBUF];
10
    unsigned char buffer_in_read_ind;
10
    unsigned char buffer_in_read_ind;
11
    unsigned char buffer_in_write_ind;
11
    unsigned char buffer_in_write_ind;
12
    unsigned char buffer_in_len;
12
    unsigned char buffer_in_len;
-
 
13
    unsigned char buffer_in_len_tmp;
13
 
14
 
14
    unsigned char buffer_out[MAXUARTBUF];
15
    unsigned char buffer_out[MAXUARTBUF];
15
    unsigned char buffer_out_ind;
16
    unsigned char buffer_out_ind;
16
    unsigned char buffer_out_len;
17
    unsigned char buffer_out_len;
17
} UART_DATA;
18
} UART_DATA;
Line 21... Line 22...
21
void UART1_Recv_Interrupt_Handler(void);
22
void UART1_Recv_Interrupt_Handler(void);
22
//void uart_2_recv_interrupt_handler(void);
23
//void uart_2_recv_interrupt_handler(void);
23
void UART1_Send_Interrupt_Handler(void);
24
void UART1_Send_Interrupt_Handler(void);
24
void UART1_WriteS(const rom char *fmt, ...);
25
void UART1_WriteS(const rom char *fmt, ...);
25
void UART1_WriteB(const char *msg, unsigned char length);
26
void UART1_WriteB(const char *msg, unsigned char length);
-
 
27
unsigned char UART1_Buffer_Len(void);
26
unsigned char UART1_Read(char *buffer);
28
unsigned char UART1_Read_Buffer(unsigned char *buffer);
27
#endif
29
#endif