Serial Port FIFO

FIFO for the built-in serial port. More...


Defines

#define SERIAL_BUFFER_SIZE   64
 Note this size must be a power of 2, i.e. 2, 4, 8, 16, etc.
#define SERIAL_BUFFER_MASK   0x3f
 Mask to wrap around at end of circular buffer. (SERIAL_BUFFER_SIZE - 1).

Functions

bool_t serialHasData ()
 Determine if the FIFO contains data.
void serialInit ()
 Initialize the serial processor.
uint8_t serialRead ()
 Get the oldest character from the FIFO.
void serialUpdate ()
 Read and store any characters in the PIC serial port in a FIFO.

Variables

uint8_t serialHead
 Index to the next free location in the buffer.
uint8_t serialTail
 Index to the next oldest data in the buffer.
uint8_t serialBuffer [SERIAL_BUFFER_SIZE]
 Buffer to hold serial data.


Detailed Description

FIFO for the built-in serial port.

Define Documentation

#define SERIAL_BUFFER_MASK   0x3f

Mask to wrap around at end of circular buffer. (SERIAL_BUFFER_SIZE - 1).

Referenced by serialRead(), and serialUpdate().

#define SERIAL_BUFFER_SIZE   64

Note this size must be a power of 2, i.e. 2, 4, 8, 16, etc.


Function Documentation

bool_t serialHasData (  ) 

Determine if the FIFO contains data.

Returns:
true if data present; otherwise false

References serialHead, and serialTail.

Referenced by gpsUpdate().

void serialInit (  ) 

Initialize the serial processor.

References serialHead, and serialTail.

Referenced by main().

uint8_t serialRead (  ) 

Get the oldest character from the FIFO.

Returns:
oldest character; 0 if FIFO is empty

References SERIAL_BUFFER_MASK, serialBuffer, serialHead, and serialTail.

Referenced by gpsUpdate().

void serialUpdate (  ) 

Read and store any characters in the PIC serial port in a FIFO.

References SERIAL_BUFFER_MASK, serialBuffer, and serialHead.

Referenced by timeUpdate().


Variable Documentation

uint8_t serialBuffer[SERIAL_BUFFER_SIZE]

Buffer to hold serial data.

Referenced by serialRead(), and serialUpdate().

Index to the next free location in the buffer.

Referenced by serialHasData(), serialInit(), serialRead(), and serialUpdate().

Index to the next oldest data in the buffer.

Referenced by serialHasData(), serialInit(), and serialRead().


Generated on Sun Oct 5 11:29:38 2008 for HF-APRS Beacon by  doxygen 1.5.7