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

Dependents:   RSALB_hbridge_helloworld RSALB_lobster WavPlayer_test AudioCODEC_HelloWorld

RingBuffer/RingBuffer.h

Committer:
p07gbar
Date:
2012-09-21
Revision:
3:a7380cfc1987
Parent:
0:3695886f3495

File content as of revision 3:a7380cfc1987:

#ifndef RINGBUFFER_H
#define RINGBUFFER_H

#include "mbed.h"

#define RBLENGTH 1000
#define RBWIDTH 2

class RingBuffer {

public:

RingBuffer();

int addToBuffer(int* input);
int addToBufferS(int input, int across);
int nextBuffer();

void readFirst(int* output);
int readFirstS(int across);

void readAt(int* output, int at);
int readAtS(int at, int across);

void readLast(int*output);
int readLastS(int across);

void usedFirst();
void usedLast();

int numberStored();

protected:

int16_t Buffer[RBLENGTH][RBWIDTH];

int Start;
int Finish;
int Samples;

void sortFinishNS();
void sortStartUS();
};
#endif