summaryrefslogtreecommitdiff
path: root/fs/fifo.h
blob: 27af38986380eaf9eef3400709af8b3460fb371a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SIMPLE FIFO DRIVER //

#ifndef FIFO_H
#define FIFO_H

#include <stdint.h>
#include <stdbool.h>

typedef struct fifo_struct
{
    bool	(*put)(struct fifo_struct*,uint8_t);
    uint8_t	(*get)(struct fifo_struct*);	    
    bool	(*has)(struct fifo_struct*);
    bool	(*full)(struct fifo_struct*);
    void *data; // opaque data

}fifo;

bool    fifo_put(fifo*,uint8_t);
uint8_t fifo_get(fifo*);
bool    fifo_has(fifo*);
bool    fifo_full(fifo*);

fifo fifo_create_buffered(uint8_t size);
#endif