Alejandro Giraldo Martinez / Buffer2

Dependents:   esclavo_maestro

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Buffer.h Source File

Buffer.h

00001 #include "mbed.h"
00002 
00003 #ifndef BUFFER_H
00004 #define BUFFER_H
00005 
00006 typedef struct {
00007     uint8_t * buffer;
00008     size_t head;
00009     size_t tail;
00010     size_t size; //of the buffer
00011 } circular_buf_t;
00012 
00013 int circular_buf_reset(circular_buf_t * cbuf);
00014 int circular_buf_put(circular_buf_t * cbuf, uint8_t data);
00015 int circular_buf_get(circular_buf_t * cbuf, uint8_t* data);
00016 bool circular_buf_empty(circular_buf_t cbuf);
00017 bool circular_buf_full(circular_buf_t cbuf);
00018 
00019 #endif