Subversion Repositories Code-Repo

Rev

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

Rev Author Line No. Line
163 Kevin 1
#ifndef UART_H
2
#define UART_H
3
 
4
#define UART_TX_ONLY
5
 
6
#define UART_BUFFER_SIZE 32
7
#define UART_BREAK_CHAR 0x0D
8
 
9
typedef struct {
10
#ifndef UART_TX_ONLY
11
    char buffer_in[UART_BUFFER_SIZE];
12
    volatile char buffer_in_read_ind;
13
    volatile char buffer_in_write_ind;
14
    volatile char buffer_in_len;
15
    volatile char buffer_in_len_tmp;
16
#endif
17
 
18
    volatile char buffer_out[UART_BUFFER_SIZE];
19
    volatile char buffer_out_ind;
20
    volatile char buffer_out_len;
21
} UART_DATA;
22
 
23
void UART_Init(UART_DATA *data);
24
void UART_Send_Interrupt_Handler(void);
25
void UART_Write(const char *string, char length);
26
void UART_WriteD(const char *string, char length);
27
#ifndef UART_TX_ONLY
28
void UART_Recv_Interrupt_Handler(void);
29
char UART_Buffer_Len(void);
30
char UART_Read_Buffer(char *buffer);
31
#endif
32
 
33
#endif