Add the RTOS processing. for the Network radio streaming receiver.
Fork of VS1053b by
Diff: VS1053.h
- Revision:
- 5:ead95c0f7800
- Parent:
- 4:cacb5e663fa9
- Child:
- 6:eed008905159
--- a/VS1053.h Fri Dec 24 23:52:55 2010 +0000 +++ b/VS1053.h Sat Dec 25 00:29:04 2010 +0000 @@ -208,17 +208,11 @@ * */ void reset(void); - - /** Write data stream to vs1053b. - * - * @param data - * Data to be sent to vs1053b. - * @param length - * Length of data. - */ - void writeStream(unsigned char* data, unsigned int length); - - //void stop(void); + + /** Stop the playback if the song is completed. + * You must call this function for default playback. + * + */ void terminateStream(void); /** Initialize the vs1053b device. @@ -311,17 +305,62 @@ /** Set the speed of a playback. * * @param speed - * Speed 0, 1, .. 4 (0, 1 normal speed). + * Speed 0, 1, .. (0, 1 normal speed). + * Speeds greater 2 are not recommended, buffer must be filled quickly enough. */ void setPlaySpeed(unsigned short speed); + /** Copy a byte into the audio data buffer. + * + * @param c + * Data for the buffer. + * + * @return + * TRUE on success; FALSE on failure, c isn't copied in the buffer. + */ bool bufferSetByte(unsigned char c); + + /** Copy a array of bytes into the audio data buffer. + * + * @param s + * Data for the buffer. + * + * @param length + * Size of data array. + * + * @return + * TRUE on success; FALSE on failure, s isn't copied in the buffer. + */ bool bufferPutStream(const unsigned char *s, unsigned int length); + + /** Get the free space of the audio data buffer. + * + * @return + * Space 0 .. BUFFER_SIZE - 1. + */ unsigned int bufferFree(void); + + /** Get the busy space of the audio data buffer. + * + * @return + * Space 0 .. BUFFER_SIZE - 1. + */ unsigned int bufferCount(void); + /** Start playing audio from buffer. + * + */ void play(void); + + /** Interrupt the playback. + * + */ void pause(void); + + /** Stop the playback in the middle of a song. + * After this call, you can now send the next audio file to buffer. + * + */ void stop(void); protected: