![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
mbeduino MP3 Sheild player MP3 player that runs on mebeduin with MP3 Shield. Regarding mbeduino, refer to: http://mbed.org/users/okini3939/notebook/mbeduino/ Regarding MP3 Shiled, refer to: http://www.sparkfun.com/commerce/product_info.php?products_id=9736
Dependencies: mbed SDFileSystem
Diff: VS1053.h
- Revision:
- 0:67cb2f650c15
- Child:
- 1:c47269f0e9e1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/VS1053.h Tue Oct 12 14:11:52 2010 +0000 @@ -0,0 +1,73 @@ +#ifndef VS1053_H +#define VS1053_H + +#define FIXED_VOL + +#include "mbed.h" +//#include "SDFileSystem.h" +#include "string" +#include "string.h" + +//SCI_MODE register bits as of p.38 of the datasheet +#define SM_DIFF 0x0001 +#define SM_LAYER12 0x0002 +#define SM_RESET 0x0004 +#define SM_CANCEL 0x0008 +#define SM_EARSPEAKER_LO 0x0010 +#define SM_TESTS 0x0020 +#define SM_STREAM 0x0040 +#define SM_EARSPEAKER_HI 0x0080 +#define SM_DACT 0x0100 +#define SM_SDIORD 0x0200 +#define SM_SDISHARE 0x0400 +#define SM_SDINEW 0x0800 +#define SM_ADPCM 0x1000 +#define SM_B13 0x2000 +#define SM_LINE1 0x4000 +#define SM_CLK_RANGE 0x8000 + +class VS1053 { + +public: + VS1053( + //PinName _mmosi, PinName _mmiso, PinName _ssck, PinName _ccs, const char* _name, + PinName _mosi, PinName _miso, PinName _sck, PinName _cs, PinName _rst, PinName _dreq, + PinName _dcs, PinName _vol); + + void cs_low(void); + void cs_high(void); + void dcs_low(void); + void dcs_high(void); + void sci_en(void); + void sci_dis(void); + void sdi_en(void); + void sdi_dis(void); + + void sci_initialise(void); + void sdi_initialise(void); + void reset(void); + void power_down(void); + + void sci_write(unsigned char, unsigned short int); + void sdi_write(unsigned char); + unsigned short int read(unsigned short int); + void sine_test_activate(unsigned char); + void volume(void); + void sine_test_deactivate(void); + void writeStream(unsigned char *, int); +#if 0 + void putcStream(unsigned char); +#endif + void terminateStream(void); + + DigitalIn _DREQ; + DigitalOut _RST; + AnalogIn _VOL; + +protected: + SPI _spi; + DigitalOut _CS; + DigitalOut _DCS; + +}; +#endif