A library which allows the playing of Wav files using the TLV320

Dependents:   RSALB_hbridge_helloworld RSALB_lobster WavPlayer_test AudioCODEC_HelloWorld

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RingBuffer.h Source File

RingBuffer.h

00001 #ifndef RINGBUFFER_H
00002 #define RINGBUFFER_H
00003 
00004 #include "mbed.h"
00005 
00006 #define RBLENGTH 1000
00007 #define RBWIDTH 2
00008 
00009 class RingBuffer {
00010 
00011 public:
00012 
00013 RingBuffer();
00014 
00015 int addToBuffer(int* input);
00016 int addToBufferS(int input, int across);
00017 int nextBuffer();
00018 
00019 void readFirst(int* output);
00020 int readFirstS(int across);
00021 
00022 void readAt(int* output, int at);
00023 int readAtS(int at, int across);
00024 
00025 void readLast(int*output);
00026 int readLastS(int across);
00027 
00028 void usedFirst();
00029 void usedLast();
00030 
00031 int numberStored();
00032 
00033 protected:
00034 
00035 int16_t Buffer[RBLENGTH][RBWIDTH];
00036 
00037 int Start;
00038 int Finish;
00039 int Samples;
00040 
00041 void sortFinishNS();
00042 void sortStartUS();
00043 };
00044 #endif