-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUART_FIFO.h
34 lines (29 loc) · 1.05 KB
/
UART_FIFO.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef UART_FIFO_H
#define UART_FIFO_H
long StartCritical (void); // previous I bit, disable interrupts
void EndCritical(long sr); // restore I bit to previous value
typedef char tx_UARTDataType;
typedef char rx_UARTDataType;
// initialize index FIFO
void Tx_UARTFifo_Init(void);
// add element to end of index FIFO
// return TXFIFOSUCCESS if successful
int Tx_UARTFifo_Put(tx_UARTDataType data);
// remove element from front of index FIFO
// return TXFIFOSUCCESS if successful
int Tx_UARTFifo_Get(tx_UARTDataType *datapt);
// number of elements in index FIFO
// 0 to TXFIFOSIZE-1
unsigned short Tx_UARTFifo_Size(void);
// initialize pointer FIFO
void Rx_UARTFifo_Init(void);
// add element to end of pointer FIFO
// return RXFIFOSUCCESS if successful
int Rx_UARTFifo_Put(rx_UARTDataType data);
// remove element from front of pointer FIFO
// return RXFIFOSUCCESS if successful
int Rx_UARTFifo_Get(rx_UARTDataType *datapt);
// number of elements in pointer FIFO
// 0 to RXFIFOSIZE-1
unsigned short Rx_UARTFifo_Size(void);
#endif