f303k8 wav player
Dependencies: SDFileSystem mbed
wavPlayer.h@0:1561c4efda0e, 2016-07-31 (annotated)
- Committer:
- nameless129
- Date:
- Sun Jul 31 12:13:36 2016 +0000
- Revision:
- 0:1561c4efda0e
- Child:
- 1:7a3f34b2d18b
wabPlayer??????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nameless129 | 0:1561c4efda0e | 1 | #include <stdio.h> |
nameless129 | 0:1561c4efda0e | 2 | #include "SDFileSystem.h" |
nameless129 | 0:1561c4efda0e | 3 | #include "wavChunks.h" |
nameless129 | 0:1561c4efda0e | 4 | |
nameless129 | 0:1561c4efda0e | 5 | #define WAV_READ_SIZE (1024) |
nameless129 | 0:1561c4efda0e | 6 | |
nameless129 | 0:1561c4efda0e | 7 | class wavPlayerOnDAC { |
nameless129 | 0:1561c4efda0e | 8 | public: |
nameless129 | 0:1561c4efda0e | 9 | uint16_t DACData[2][WAV_READ_SIZE]; |
nameless129 | 0:1561c4efda0e | 10 | volatile uint16_t rp; |
nameless129 | 0:1561c4efda0e | 11 | bool dac_flag[2]; |
nameless129 | 0:1561c4efda0e | 12 | bool dac_on; |
nameless129 | 0:1561c4efda0e | 13 | uint8_t dac_c; |
nameless129 | 0:1561c4efda0e | 14 | |
nameless129 | 0:1561c4efda0e | 15 | FIL wavfil; |
nameless129 | 0:1561c4efda0e | 16 | uint16_t wavReadData[WAV_READ_SIZE]; |
nameless129 | 0:1561c4efda0e | 17 | uint32_t wavReadByte; |
nameless129 | 0:1561c4efda0e | 18 | uint8_t fWavPlaying; |
nameless129 | 0:1561c4efda0e | 19 | |
nameless129 | 0:1561c4efda0e | 20 | wavPlayerOnDAC(PinName pinDAC); |
nameless129 | 0:1561c4efda0e | 21 | void setFile(FIL* tgtFile); |
nameless129 | 0:1561c4efda0e | 22 | uint8_t readProc(void); |
nameless129 | 0:1561c4efda0e | 23 | void rewind(void); |
nameless129 | 0:1561c4efda0e | 24 | void stop(void); |
nameless129 | 0:1561c4efda0e | 25 | void DACOutProc(void); |
nameless129 | 0:1561c4efda0e | 26 | |
nameless129 | 0:1561c4efda0e | 27 | private: |
nameless129 | 0:1561c4efda0e | 28 | AnalogOut DACout; |
nameless129 | 0:1561c4efda0e | 29 | }; |