Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: high speed light Bracelet
Fork of USBDevice by
Diff: USBAudio/USBAudio.h
- Revision:
- 25:7c72828865f3
- Parent:
- 4:eaa07ce86d49
--- a/USBAudio/USBAudio.h Fri May 16 09:00:39 2014 +0100
+++ b/USBAudio/USBAudio.h Tue Jun 03 11:30:32 2014 +0100
@@ -50,7 +50,7 @@
*
* int main() {
* int16_t buf[AUDIO_LENGTH_PACKET/2];
-*
+*
* while (1) {
* // read an audio packet
* audio.read((uint8_t *)buf);
@@ -88,7 +88,7 @@
* @returns volume
*/
float getVolume();
-
+
/**
* Read an audio packet. During a frame, only a single reading (you can't write and read an audio packet during the same frame)can be done using this method. Warning: Blocking
*
@@ -97,7 +97,7 @@
* @returns true if successfull
*/
bool read(uint8_t * buf);
-
+
/**
* Try to read an audio packet. During a frame, only a single reading (you can't write and read an audio packet during the same frame)can be done using this method. Warning: Non Blocking
*
@@ -106,7 +106,7 @@
* @returns true if successfull
*/
bool readNB(uint8_t * buf);
-
+
/**
* Write an audio packet. During a frame, only a single writing (you can't write and read an audio packet during the same frame)can be done using this method.
*
@@ -114,7 +114,7 @@
* @returns true if successful
*/
bool write(uint8_t * buf);
-
+
/**
* Write and read an audio packet at the same time (on the same frame)
*
@@ -123,7 +123,7 @@
* @returns true if successful
*/
bool readWrite(uint8_t * buf_read, uint8_t * buf_write);
-
+
/** attach a handler to update the volume
*
@@ -212,12 +212,12 @@
* Callback called on each Start of Frame event
*/
virtual void SOF(int frameNumber);
-
+
/*
* Callback called when a packet is received
*/
virtual bool EP3_OUT_callback();
-
+
/*
* Callback called when a packet has been sent
*/
@@ -227,13 +227,13 @@
// stream available ?
volatile bool available;
-
+
// interrupt OUT has been received
volatile bool interruptOUT;
-
+
// interrupt IN has been received
volatile bool interruptIN;
-
+
// audio packet has been written
volatile bool writeIN;
@@ -248,7 +248,7 @@
// mono, stereo,...
uint8_t channel_nb_in;
uint8_t channel_nb_out;
-
+
// channel config: master, left, right
uint8_t channel_config_in;
uint8_t channel_config_out;
@@ -270,16 +270,16 @@
// Buffer containing one audio packet (to be read)
volatile uint8_t * buf_stream_in;
-
+
// Buffer containing one audio packet (to be written)
volatile uint8_t * buf_stream_out;
-
+
// callback to update volume
FunctionPointer updateVol;
-
+
// boolean showing that the SOF handler has been called. Useful for readNB.
volatile bool SOF_handler;
-
+
volatile float volume;
};
