MSPM0_ValvanoWare  1.0
ECE445L starter code
Files | Macros | Functions
FIFO

First in first out queue. More...

Files

file  FIFO.h
 Provide functions for a first in first out queue.
 

Macros

#define TXFIFOSIZE   64
 TXFIFOSIZE the size of the transmit FIFO, which can hold 0 to TXFIFOSIZE-1 elements. The size must be a power of 2.
 
#define RXFIFOSIZE   16
 RXFIFOSIZE the size of the receive FIFO, which can hold 0 to RXFIFOSIZE-1 elements The size must be a power of 2.
 

Functions

void TxFifo_Init (void)
 Initialize FIFO. More...
 
int TxFifo_Put (char data)
 Put FIFO. More...
 
char TxFifo_Get (void)
 Get FIFO. More...
 
uint32_t TxFifo_Size (void)
 number of elements in FIFO More...
 
void RxFifo_Init (void)
 Initialize FIFO. More...
 
int RxFifo_Put (char data)
 Put FIFO. More...
 
char RxFifo_Get (void)
 Get FIFO. More...
 
uint32_t RxFifo_Size (void)
 number of elements in FIFO More...
 

Detailed Description

First in first out queue.

Function Documentation

◆ RxFifo_Get()

char RxFifo_Get ( void  )

Get FIFO.

Get character from the receive FIFO

Parameters
none
Returns
0 for fail because empty, nonzero is data
See also
RxFifo_Init() RxFifo_Put() RxFifo_Size()
Note
RXFIFOSIZE the size of the receive FIFO

◆ RxFifo_Init()

void RxFifo_Init ( void  )

Initialize FIFO.

Initialize the receive FIFO

Parameters
none
Returns
none
See also
RxFifo_Put() RxFifo_Get() RxFifo_Size()
Note
RXFIFOSIZE the size of the receive FIFO

◆ RxFifo_Put()

int RxFifo_Put ( char  data)

Put FIFO.

Put character into the receive FIFO

Parameters
datais a new character to save
Returns
0 for fail because full, 1 for success
See also
RxFifo_Init() RxFifo_Get() RxFifo_Size()
Note
RXFIFOSIZE the size of the receive FIFO

◆ RxFifo_Size()

uint32_t RxFifo_Size ( void  )

number of elements in FIFO

Determine how many elements are currently stored in the receive FIFO

Parameters
none
Returns
number of elements in FIFO
See also
RxFifo_Init() RxFifo_Put() RxFifo_Get()
Note
Does not change the FIFO

◆ TxFifo_Get()

char TxFifo_Get ( void  )

Get FIFO.

Get character from the transmit FIFO

Parameters
none
Returns
0 for fail because empty, nonzero is data
See also
TxFifo_Init() TxFifo_Put() TxFifo_Size()
Note
TXFIFOSIZE the size of the transmit FIFO

◆ TxFifo_Init()

void TxFifo_Init ( void  )

Initialize FIFO.

Initialize the transmit FIFO

Parameters
none
Returns
none
See also
TxFifo_Put() TxFifo_Get() TxFifo_Size()
Note
TXFIFOSIZE the size of the transmit FIFO

◆ TxFifo_Put()

int TxFifo_Put ( char  data)

Put FIFO.

Put character into the transmit FIFO

Parameters
datais a new character to save
Returns
0 for fail because full, 1 for success
See also
TxFifo_Init() TxFifo_Get() TxFifo_Size()
Note
TXFIFOSIZE the size of the transmit FIFO

◆ TxFifo_Size()

uint32_t TxFifo_Size ( void  )

number of elements in FIFO

Determine how many elements are currently stored in the transmit FIFO

Parameters
none
Returns
number of elements in FIFO
See also
TxFifo_Init() TxFifo_Put() TxFifo_Get()
Note
Does not change the FIFO