Library for VS1053 chip with non blocking call to check dreq and cancel playback function
Dependents: VS1053Player MP3_test MP3_final_S4P_ANDRIAMARO_RAKOTO_1
Fork of VS1053lib by
Revision 4:ce980c240ae1, committed 2013-12-26
- Comitter:
- ollie8
- Date:
- Thu Dec 26 09:14:07 2013 +0000
- Parent:
- 3:59c27531f18e
- Commit message:
- fixed bug
Changed in this revision
VLSIcodec.cpp | Show annotated file Show diff for this revision Revisions of this file |
VLSIcodec.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 59c27531f18e -r ce980c240ae1 VLSIcodec.cpp --- a/VLSIcodec.cpp Tue Jun 11 16:24:39 2013 +0000 +++ b/VLSIcodec.cpp Thu Dec 26 09:14:07 2013 +0000 @@ -490,6 +490,12 @@ writereg(VLSI_DECODE_TIME, 0); writereg(VLSI_DECODE_TIME, 0); } + +void VS1053Codec::cancelplayback() { + unsigned int i = (unsigned short)readreg(VLSI_MODE); + writereg( VLSI_MODE, ( i | SM_CANCEL )); +} + /**************************************************************************** Function: void setvolume(unsigned char vRight, unsigned char vLeft)
diff -r 59c27531f18e -r ce980c240ae1 VLSIcodec.h --- a/VLSIcodec.h Tue Jun 11 16:24:39 2013 +0000 +++ b/VLSIcodec.h Thu Dec 26 09:14:07 2013 +0000 @@ -148,6 +148,8 @@ */ void resetplaytime(); + void cancelplayback(); + /** Start a sine test to verify codec functionality * * @param pitch is a composite value. Use 0x7E to play a tone at 5KHz sampled at 22050Hz.