Hirokazu enya / MagneWave

Fork of MagneWave by kouzi osaki

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MagneWave.h Source File

MagneWave.h

00001 #ifndef MAGNE_WAVE_H
00002 #define MAGNE_WAVE_H
00003 
00004 #include "mbed.h"
00005 #include "SoftMCP4922.h"
00006 
00007 class MagneWave
00008 {
00009 public:
00010     /*
00011      * MagneWave - Magnetone wave player
00012      * param
00013      * [in] dac: dac address
00014      */
00015     MagneWave( SoftMCP4922 *dac );
00016     
00017     /*
00018      * play - player function
00019      * param
00020      * [in] wavefile: file pointer
00021      */
00022     void play( FILE *wavefile );
00023 
00024 private:
00025     void dacOut();
00026 
00027     SoftMCP4922 *m_wave_DAC;
00028     //FILE *m_wavefile;
00029     Ticker tick;
00030     unsigned short m_fifo[128];
00031     volatile short m_wptr;
00032     volatile short m_rptr;
00033     bool m_dacOn;
00034     bool m_fileEnd;
00035 };
00036 
00037 
00038 
00039 #endif  // MAGNE_WAVE_H