Smart pole

Dependencies:   FTPClient SDFileSystem WIZnetInterface mbed

Fork of FTP_Streaming_Music_Player_WIZwiki-W7500 by justin kim

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