Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MagneWave by
MagneWave.h@7:b0bb700d8383, 2013-11-08 (annotated)
- Committer:
- doctorura
- Date:
- Fri Nov 08 23:05:35 2013 +0000
- Revision:
- 7:b0bb700d8383
- Parent:
- 5:a1c57d771887
- Child:
- 9:486d9fde3e64
bugfix
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| doctorura | 0:5a700113dd87 | 1 | #ifndef MAGNE_WAVE_H |
| doctorura | 0:5a700113dd87 | 2 | #define MAGNE_WAVE_H |
| doctorura | 0:5a700113dd87 | 3 | |
| doctorura | 0:5a700113dd87 | 4 | #include "mbed.h" |
| doctorura | 0:5a700113dd87 | 5 | #include "SoftMCP4922.h" |
| doctorura | 0:5a700113dd87 | 6 | |
| doctorura | 0:5a700113dd87 | 7 | class MagneWave |
| doctorura | 0:5a700113dd87 | 8 | { |
| doctorura | 0:5a700113dd87 | 9 | public: |
| doctorura | 0:5a700113dd87 | 10 | /* |
| doctorura | 0:5a700113dd87 | 11 | * MagneWave - Magnetone wave player |
| doctorura | 0:5a700113dd87 | 12 | * param |
| doctorura | 0:5a700113dd87 | 13 | * [in] dac: dac address |
| doctorura | 0:5a700113dd87 | 14 | */ |
| doctorura | 0:5a700113dd87 | 15 | MagneWave( SoftMCP4922 *dac ); |
| doctorura | 0:5a700113dd87 | 16 | |
| doctorura | 0:5a700113dd87 | 17 | /* |
| doctorura | 0:5a700113dd87 | 18 | * play - player function |
| doctorura | 0:5a700113dd87 | 19 | * param |
| doctorura | 0:5a700113dd87 | 20 | * [in] wavefile: file pointer |
| doctorura | 0:5a700113dd87 | 21 | */ |
| doctorura | 0:5a700113dd87 | 22 | void play( FILE *wavefile ); |
| doctorura | 0:5a700113dd87 | 23 | |
| doctorura | 0:5a700113dd87 | 24 | private: |
| doctorura | 5:a1c57d771887 | 25 | void dacOut(); |
| doctorura | 4:8b4be75fd97a | 26 | |
| doctorura | 0:5a700113dd87 | 27 | SoftMCP4922 *m_wave_DAC; |
| doctorura | 7:b0bb700d8383 | 28 | //FILE *m_wavefile; |
| doctorura | 4:8b4be75fd97a | 29 | Ticker tick; |
| doctorura | 5:a1c57d771887 | 30 | unsigned short m_fifo[128]; |
| doctorura | 4:8b4be75fd97a | 31 | short m_wptr; |
| doctorura | 4:8b4be75fd97a | 32 | volatile short m_rptr; |
| doctorura | 4:8b4be75fd97a | 33 | bool m_dacOn; |
| doctorura | 4:8b4be75fd97a | 34 | bool m_fileEnd; |
| doctorura | 0:5a700113dd87 | 35 | }; |
| doctorura | 0:5a700113dd87 | 36 | |
| doctorura | 0:5a700113dd87 | 37 | |
| doctorura | 0:5a700113dd87 | 38 | |
| doctorura | 0:5a700113dd87 | 39 | #endif // MAGNE_WAVE_H |
