Codebase from CC1101_Transceiver, ported to LPC1114/LPC824/STM32F103 and other micros, will be merged with panStamp project to replace AVR/MSP.

Dependencies:   mbed

Fork of CC1101_Transceiver_LPC1114 by Kai Liu

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RingBuffer.h Source File

RingBuffer.h

00001 /*
00002  * mbed library for RingBuffer
00003  * Copyright (c) 2010 Hiroshi Suga
00004  * Released under the MIT License: http://mbed.org/license/mit
00005  */
00006 
00007 #ifndef RingBuffer_H
00008 #define RingBuffer_H
00009 
00010 #include "mbed.h"
00011 
00012 class RingBuffer : public Stream  {
00013 public:
00014     RingBuffer (int p_size);
00015 //    ~RingBuffer ();
00016 
00017 #if DOXYGEN_ONLY
00018     int putc(int c);
00019     int printf(const char* format, ...);
00020 #endif
00021 //    int putc (char);
00022     int put (char *, int);
00023     char get ();
00024     int get (char *, int);
00025     void clear ();
00026     int available ();
00027     int use ();
00028 
00029 private:
00030     // Stream implementation functions
00031     virtual int _putc(int value);
00032     virtual int _getc();
00033 
00034     char *buf;
00035     int size;
00036     int addr_w, addr_r;
00037 };
00038 
00039 #endif