Serial Port FIFO

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


Defines

#define SERIAL_BUFFER_SIZE   64
 Size of serial port FIFO in bytes. It 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]
 Circular buffer (FIFO) 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).

Definition at line 1910 of file PicoBeacon.c.

Referenced by serialRead(), and serialUpdate().

#define SERIAL_BUFFER_SIZE   64

Size of serial port FIFO in bytes. It must be a power of 2, i.e. 2, 4, 8, 16, etc.

Definition at line 1907 of file PicoBeacon.c.


Function Documentation

bool_t serialHasData (  ) 

Determine if the FIFO contains data.

Returns:
true if data present; otherwise false

Definition at line 1926 of file PicoBeacon.c.

References serialHead, and serialTail.

Referenced by gpsUpdate().

void serialInit (  ) 

Initialize the serial processor.

Definition at line 1937 of file PicoBeacon.c.

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

Definition at line 1948 of file PicoBeacon.c.

References SERIAL_BUFFER_MASK, serialBuffer, serialHead, serialTail, and value.

Referenced by gpsUpdate().

void serialUpdate (  ) 

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

Definition at line 1968 of file PicoBeacon.c.

References SERIAL_BUFFER_MASK, serialBuffer, and serialHead.

Referenced by timeUpdate().


Variable Documentation

uint8_t serialBuffer[SERIAL_BUFFER_SIZE]

Circular buffer (FIFO) to hold serial data.

Definition at line 1919 of file PicoBeacon.c.

Referenced by serialRead(), and serialUpdate().

Index to the next free location in the buffer.

Definition at line 1913 of file PicoBeacon.c.

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

Index to the next oldest data in the buffer.

Definition at line 1916 of file PicoBeacon.c.

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


Generated on Sun Oct 5 11:25:49 2008 for Pico Beacon by  doxygen 1.5.7