/* ************BITFIFO.H*************** Pointer implementation of the a bitFIFO These routines can be used to save (PutBit) and recall (GetBit) binary data 1 bit at a time (bit streams) Information is saved/recalled in a first in first out manner FifoSize is the number of 16 bit words in the Fifo the FIFO is full when it has 16*FifoSize-1 bits */ // Last modified 1/12/02 by Jonathan W. Valvano // Copyright 2002 by Jonathan W. Valvano, valvano@uts.cc.utexas.edu // You may use, edit, run or distribute this file // as long as the above copyright notice remains #define FIFOSIZE 4 // 16*4-1=63 bits of storage // Initialize BitFifo // Make it empty void BitFifo_Init(void); // Enter a bit (data) into the BitFifo // returns TRUE=1 if successful, FALSE=0 if full and data not saved // input is boolean FALSE if data==0 int BitFifo_Put(int data); // Remove a bit (*datapt) from the BitFifo // returns TRUE=1 if successful, // FALSE=0 if empty and data not removed // output (return by reference is boolean // 0 means FALSE, nonzero is true int BitFifo_Get(unsigned int *datapt);