Smart pole
Dependencies: FTPClient SDFileSystem WIZnetInterface mbed
Fork of FTP_Streaming_Music_Player_WIZwiki-W7500 by
VS1002.h@1:c47c255fcad4, 2015-10-30 (annotated)
- Committer:
- Ricky_Kwon
- Date:
- Fri Oct 30 03:53:23 2015 +0000
- Revision:
- 1:c47c255fcad4
- Parent:
- 0:fa775d326f9c
Smart pole
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
justinkim | 0:fa775d326f9c | 1 | #ifndef VS1002_H |
justinkim | 0:fa775d326f9c | 2 | #define VS1002_H |
justinkim | 0:fa775d326f9c | 3 | |
justinkim | 0:fa775d326f9c | 4 | #include "mbed.h" |
justinkim | 0:fa775d326f9c | 5 | #include "SDFileSystem.h" |
justinkim | 0:fa775d326f9c | 6 | #include "string" |
justinkim | 0:fa775d326f9c | 7 | #include "string.h" |
justinkim | 0:fa775d326f9c | 8 | |
justinkim | 0:fa775d326f9c | 9 | |
justinkim | 0:fa775d326f9c | 10 | //SCI_MODE register bits as of p.26 of the datasheet |
justinkim | 0:fa775d326f9c | 11 | #define SM_DIFF 0x0001 |
justinkim | 0:fa775d326f9c | 12 | #define SM_SETTOZERO 0x0002 |
justinkim | 0:fa775d326f9c | 13 | #define SM_RESET 0x0004 |
justinkim | 0:fa775d326f9c | 14 | #define SM_OUTOFWAV 0x0008 |
justinkim | 0:fa775d326f9c | 15 | #define SM_PDOWN 0x0010 |
justinkim | 0:fa775d326f9c | 16 | #define SM_TESTS 0x0020 |
justinkim | 0:fa775d326f9c | 17 | #define SM_STREAM 0x0040 |
justinkim | 0:fa775d326f9c | 18 | #define SM_PLUSV 0x0080 |
justinkim | 0:fa775d326f9c | 19 | #define SM_DACT 0x0100 |
justinkim | 0:fa775d326f9c | 20 | #define SM_SDIORD 0x0200 |
justinkim | 0:fa775d326f9c | 21 | #define SM_SDISHARE 0x0400 |
justinkim | 0:fa775d326f9c | 22 | #define SM_SDINEW 0x0800 |
justinkim | 0:fa775d326f9c | 23 | #define SM_ADPCM 0x1000 |
justinkim | 0:fa775d326f9c | 24 | #define SM_ADPCM_HP 0x2000 |
justinkim | 0:fa775d326f9c | 25 | |
justinkim | 0:fa775d326f9c | 26 | extern int new_song_number; |
justinkim | 0:fa775d326f9c | 27 | extern int volume_set; |
justinkim | 0:fa775d326f9c | 28 | extern bool pause; |
justinkim | 0:fa775d326f9c | 29 | extern bool mute; |
justinkim | 0:fa775d326f9c | 30 | extern char * song_name[9]; |
justinkim | 0:fa775d326f9c | 31 | |
justinkim | 0:fa775d326f9c | 32 | |
justinkim | 0:fa775d326f9c | 33 | class VS1002 { |
justinkim | 0:fa775d326f9c | 34 | |
justinkim | 0:fa775d326f9c | 35 | public: |
justinkim | 0:fa775d326f9c | 36 | |
justinkim | 0:fa775d326f9c | 37 | 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); |
justinkim | 0:fa775d326f9c | 38 | |
justinkim | 0:fa775d326f9c | 39 | void cs_low(void); |
justinkim | 0:fa775d326f9c | 40 | void cs_high(void); |
justinkim | 0:fa775d326f9c | 41 | void dcs_low(void); |
justinkim | 0:fa775d326f9c | 42 | void dcs_high(void); |
justinkim | 0:fa775d326f9c | 43 | void sci_en(void); |
justinkim | 0:fa775d326f9c | 44 | void sci_dis(void); |
justinkim | 0:fa775d326f9c | 45 | void sdi_en(void); |
justinkim | 0:fa775d326f9c | 46 | void sdi_dis(void); |
justinkim | 0:fa775d326f9c | 47 | |
justinkim | 0:fa775d326f9c | 48 | void sci_initialise(void); |
justinkim | 0:fa775d326f9c | 49 | void sdi_initialise(void); |
justinkim | 0:fa775d326f9c | 50 | void reset(void); |
justinkim | 0:fa775d326f9c | 51 | void power_down(void); |
justinkim | 0:fa775d326f9c | 52 | |
justinkim | 0:fa775d326f9c | 53 | void sci_write(unsigned char, unsigned short int); |
justinkim | 0:fa775d326f9c | 54 | void sdi_write(unsigned char); |
justinkim | 0:fa775d326f9c | 55 | unsigned short int read(unsigned short int); |
justinkim | 0:fa775d326f9c | 56 | void sine_test_activate(unsigned char); |
justinkim | 0:fa775d326f9c | 57 | void volume(signed int,signed int); |
justinkim | 0:fa775d326f9c | 58 | void sine_test_deactivate(void); |
justinkim | 0:fa775d326f9c | 59 | void play_song(int); |
justinkim | 0:fa775d326f9c | 60 | |
justinkim | 0:fa775d326f9c | 61 | int num_of_files; |
justinkim | 0:fa775d326f9c | 62 | |
justinkim | 0:fa775d326f9c | 63 | DigitalIn _DREQ; |
justinkim | 0:fa775d326f9c | 64 | DigitalOut _RST; |
justinkim | 0:fa775d326f9c | 65 | |
justinkim | 0:fa775d326f9c | 66 | protected: |
justinkim | 0:fa775d326f9c | 67 | |
justinkim | 0:fa775d326f9c | 68 | SPI _spi; |
justinkim | 0:fa775d326f9c | 69 | DigitalOut _CS; |
justinkim | 0:fa775d326f9c | 70 | DigitalOut _DCS; |
justinkim | 0:fa775d326f9c | 71 | SDFileSystem _sd; |
justinkim | 0:fa775d326f9c | 72 | |
justinkim | 0:fa775d326f9c | 73 | }; |
justinkim | 0:fa775d326f9c | 74 | #endif |