![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
TI CC1101 Transceiver
Diff: RingBuffer.h
- Revision:
- 0:9df942ea84f4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RingBuffer.h Sun Nov 21 11:37:56 2010 +0000 @@ -0,0 +1,39 @@ +/* + * mbed library for RingBuffer + * Copyright (c) 2010 Hiroshi Suga + * Released under the MIT License: http://mbed.org/license/mit + */ + +#ifndef RingBuffer_H +#define RingBuffer_H + +#include "mbed.h" + +class RingBuffer : public Stream { +public: + RingBuffer (int p_size); +// ~RingBuffer (); + +#if DOXYGEN_ONLY + int putc(int c); + int printf(const char* format, ...); +#endif +// int putc (char); + int put (char *, int); + char get (); + int get (char *, int); + void clear (); + int available (); + int use (); + +private: + // Stream implementation functions + virtual int _putc(int value); + virtual int _getc(); + + char *buf; + int size; + int addr_w, addr_r; +}; + +#endif