Functions

fifo.c File Reference

FIFO implementation. More...

#include "fifo.h"
#include "rtc.h"

Functions

void fifo_init (fifo_t *f, fifo_item_t *buffer, fifo_size_t size)
 initialize FIFO state
fifo_item_t fifo_get_item (fifo_t *f)
 get from FIFO
void fifo_put_item (fifo_t *f, fifo_item_t c)
 put into FIFO

Detailed Description

FIFO implementation.


Function Documentation

void fifo_init ( fifo_t fifo,
fifo_item_t buffer,
fifo_size_t  size 
)

initialize FIFO state

Parameters:
fifo pointer to state structure to initialize
buffer pointer to buffer to use
size size of buffer (in fifo_item_t units)

{
  f->buffer = buffer;
  f->size = size;
  f->head = 0;
  f->tail = 0;
  f->num_items = 0;
  f->overflow = 0;
  f->underflow = 0;
}