Add the RTOS processing. for the Network radio streaming receiver.
Fork of VS1053b by
Diff: VS1053.h
- Revision:
- 7:b6853a2c88c2
- Parent:
- 6:eed008905159
- Child:
- 8:5e4a21202223
--- a/VS1053.h Sat Jan 08 15:45:58 2011 +0000 +++ b/VS1053.h Sat Jan 08 16:36:00 2011 +0000 @@ -137,32 +137,40 @@ #define INTERRUPT_HANDLER_DISABLE _DREQ_INTERUPT_IN.rise(NULL); timer.detach() - +/** Types of audio streams + * + */ typedef enum AudioType { - WAV, - AAC, - WMA, - MIDI, - OGG_VORBIS, - MP3, - UNKNOWN + WAV, /*!< WAVE audio stream */ + AAC, /*!< AAC audio stream (ADTS (.aac), MPEG2 ADIF (.aac) and MPEG4 AUDIO (.mp4 / .m4a / .3gp / .3g2)) */ + WMA, /*!< Windows Media Audio (WMA) stream */ + MIDI, /*!< Midi audio stream */ + OGG_VORBIS, /*!< Ogg Vorbis audio stream */ + MP3, /*!< MPEG Audio Layer */ + UNKNOWN /*!< Unknown */ } AudioType; +/** Types of MPEG Audio Layer stream IDs. + * + */ typedef enum MP3_ID { - MPG2_5a = 0, - MPG2_5b = 1, - MPG2_0 = 2, - MPG1_0 = 3 + MPG2_5a = 0, /*!< MPG 2.5, nonstandard, proprietary */ + MPG2_5b = 1, /*!< MPG 2.5, nonstandard, proprietary */ + MPG2_0 = 2, /*!< ISO 13818-3 MPG 2.0 */ + MPG1_0 = 3 /*!< ISO 11172-3 MPG 1.0 */ } MP3_ID; +/** Types of MPEG Audio Layer channel modes. + * + */ typedef enum MP3_MODE { - STEREO = 0, - JOINT_STEREO = 1, - DUAL_CHANNEL = 2, - MONO = 3 + STEREO = 0, /*!< Stereo */ + JOINT_STEREO = 1, /*!< Joint Stereo */ + DUAL_CHANNEL = 2, /*!< Dual Channel */ + MONO = 3 /*!< Mono */ } MP3_MODE; /** Struct for informations about audio streams. @@ -170,36 +178,37 @@ */ typedef struct AudioInfo { - AudioType type : 4; - unsigned short kBitRate; - unsigned short decodeTime; + AudioType type : 4; /*!< Type of the audio stream - important for the interpretation of the lower union */ + unsigned short kBitRate; /*!< Average bitrate of the audio stream - in kBit/s */ + unsigned short decodeTime; /*!< Decode time */ union { struct { - MP3_ID id : 2; - char layer : 2; - char protrectBit : 1; - char padBit : 1; - MP3_MODE mode : 2; - char extension : 2; - char copyright : 1; - char original : 1; - char emphasis : 2; - char kSampleRate : 6; - } mp3; + MP3_ID id : 2; /*!< ID */ + char layer : 2; /*!< Layer */ + char protrectBit : 1; /*!< Protect bit, see p.44 of the datasheet */ + char padBit : 1; /*!< Pad bit, see p.44 of the datasheet */ + MP3_MODE mode : 2; /*!< Channel mode */ + char extension : 2; /*!< Extension, see p.44 of the datasheet */ + char copyright : 1; /*!< Copyright, see p.44 of the datasheet */ + char original : 1; /*!< Original, see p.44 of the datasheet */ + char emphasis : 2; /*!< Emphasis, see p.44 of the datasheet */ + char kSampleRate : 6; /*!< Samplerate - in kHz (rounded) */ + } mp3; /*!< MPEG Audio Layer */ struct { - } wma; + } wma; /*!< Windows Media Audio (WMA) stream */ struct { - } aac; + } aac; /*!< AAC audio stream */ struct { - } other; + } other; /*!< Other */ } ext; } AudioInfo; /** Class for VS1053 - Ogg Vorbis / MP3 / AAC / WMA / FLAC / MIDI Audio Codec Chip. + * Datasheet, see http://www.vlsi.fi/fileadmin/datasheets/vlsi/vs1053.pdf * * This code based on: * mbeduino_MP3_Shield_MP3Player @@ -233,9 +242,11 @@ * //#define VS1053_SPECANA * //#define VS1053B_PCM_RECORDER_0_9 * - * #endif //_DEFINES_H + * #endif //_DEFINES_H + *@endcode * - *@endcode + * For a complete sample, see http://mbed.org/users/christi_s/programs/Lib_VS1053b + * */ class VS1053 {