FTP Streaming Music Player with WIZwiki-W7500

Dependencies:   FTPClient SDFileSystem TextLCD WIZnetInterface mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers VS1002.h Source File

VS1002.h

00001 #ifndef VS1002_H
00002 #define VS1002_H
00003 
00004 #include "mbed.h"
00005 #include "SDFileSystem.h"
00006 #include "string"
00007 #include "string.h"
00008 #include "TextLCD.h"
00009 
00010 
00011 //SCI_MODE register bits as of p.26 of the datasheet
00012 #define SM_DIFF            0x0001
00013 #define SM_SETTOZERO    0x0002
00014 #define SM_RESET        0x0004
00015 #define SM_OUTOFWAV        0x0008
00016 #define SM_PDOWN        0x0010
00017 #define SM_TESTS        0x0020
00018 #define    SM_STREAM        0x0040
00019 #define SM_PLUSV        0x0080
00020 #define    SM_DACT            0x0100
00021 #define    SM_SDIORD        0x0200
00022 #define    SM_SDISHARE        0x0400
00023 #define    SM_SDINEW        0x0800
00024 #define    SM_ADPCM        0x1000
00025 #define    SM_ADPCM_HP        0x2000
00026 
00027 extern int new_song_number;
00028 extern int volume_set;
00029 extern bool pause;
00030 extern bool mute;
00031 extern char * song_name[9];
00032 
00033 
00034 class VS1002  {
00035 
00036 public:
00037 
00038     VS1002(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);
00039      
00040     void cs_low(void); 
00041     void cs_high(void);
00042     void dcs_low(void);
00043     void dcs_high(void);
00044     void sci_en(void);
00045     void sci_dis(void);
00046     void sdi_en(void);
00047     void sdi_dis(void);
00048     
00049     void sci_initialise(void);
00050     void sdi_initialise(void);
00051     void reset(void);
00052     void power_down(void);
00053  
00054     void sci_write(unsigned char, unsigned short int);
00055     void sdi_write(unsigned char);
00056     unsigned short int read(unsigned short int);
00057     void sine_test_activate(unsigned char);
00058     void volume(signed int,signed int);
00059     void sine_test_deactivate(void);
00060     void play_song(int);
00061     
00062     int num_of_files;
00063     
00064     DigitalIn _DREQ;
00065     DigitalOut _RST;
00066     
00067 protected:
00068 
00069     SPI _spi;
00070     DigitalOut _CS;
00071     DigitalOut _DCS;
00072     SDFileSystem _sd;
00073 
00074 };
00075 #endif