![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
seeing i robot - with all the file systems and complete code
Dependencies: mbed SRF05 Servo CMPS03
VS1002.h
00001 #ifndef VS1002_H 00002 #define VS1002_H 00003 00004 //#define FS_ONLY 00005 #define FIXED_VOL 00006 00007 #include "mbed.h" 00008 #include "SDFileSystem.h" 00009 #include "string" 00010 #include "string.h" 00011 00012 //SCI_MODE register bits as of p.26 of the datasheet 00013 #define SM_DIFF 0x0001 00014 #define SM_SETTOZERO 0x0002 00015 #define SM_RESET 0x0004 00016 #define SM_OUTOFWAV 0x0008 00017 #define SM_PDOWN 0x0010 00018 #define SM_TESTS 0x0020 00019 #define SM_STREAM 0x0040 00020 #define SM_PLUSV 0x0080 00021 #define SM_DACT 0x0100 00022 #define SM_SDIORD 0x0200 00023 #define SM_SDISHARE 0x0400 00024 #define SM_SDINEW 0x0800 00025 #define SM_ADPCM 0x1000 00026 #define SM_ADPCM_HP 0x2000 00027 00028 00029 class VS1002 { 00030 00031 public: 00032 // VS1002(int _mmosi, int _mmiso, int _ssck, int _ccs, const char* _name, 00033 // int _mosi, int _miso, int _sck, int _cs, int _rst, int _dreq, int _dcs, int _vol); 00034 VS1002(PinName _mmosi, PinName _mmiso, PinName _ssck, PinName _ccs, const char* _name, 00035 PinName _mosi, PinName _miso, PinName _sck, PinName _cs, PinName _rst, PinName _dreq, 00036 PinName _dcs, PinName _vol); 00037 00038 void cs_low(void); 00039 void cs_high(void); 00040 void dcs_low(void); 00041 void dcs_high(void); 00042 void sci_en(void); 00043 void sci_dis(void); 00044 void sdi_en(void); 00045 void sdi_dis(void); 00046 00047 void sci_initialise(void); 00048 void sdi_initialise(void); 00049 void reset(void); 00050 void power_down(void); 00051 00052 void sci_write(unsigned char, unsigned short int); 00053 void sdi_write(unsigned char); 00054 unsigned short int read(unsigned short int); 00055 void sine_test_activate(unsigned char); 00056 void volume(void); 00057 void sine_test_deactivate(void); 00058 void play_song(int); 00059 00060 int num_of_files; 00061 00062 DigitalIn _DREQ; 00063 DigitalOut _RST; 00064 AnalogIn _VOL; 00065 00066 protected: 00067 00068 SPI _spi; 00069 DigitalOut _CS; 00070 DigitalOut _DCS; 00071 SDFileSystem _sd; 00072 00073 }; 00074 #endif
Generated on Sun Jul 24 2022 09:54:37 by
![doxygen](doxygen.png)