![]()  | 
  
DAC port driver. More...
Macros | |
| #define | WAVE_SAMPLES 32 | 
| #define | AUDIO_WA_SIZE THD_WA_SIZE(AUDIO_TASK_STACK_SIZE) | 
Functions | |
| void | vexAudioPlaySound (int freq, int amplitude, int timems) | 
| Play frequency at given amplitude.  More... | |
| void | vexAudioPlaySoundWait (int freq, int amplitude, int timems) | 
| Play frequency at given amplitude and wait for completion.  More... | |
| void | vexAudioStopSound () | 
| Stop sound playing.  More... | |
| int | vexAudioInitChipToneSong (int len) | 
| Initialize a chiptone song.  More... | |
| void | vexAudioDeinitChipToneSong () | 
| Free memory occupied by a song.  More... | |
| void | vexAudioStartChipToneSong (int repeat) | 
| Start playback of the song.  More... | |
| void | vexAudioStopChipToneSong () | 
| Stop playback of the song.  More... | |
| void | vexAudioSetNextChipTone (int freq, int amplitude, int timems) | 
| Add a tone to the array for the song.  More... | |
| void | vexAudioDebugChipTone () | 
| Print out the song data for debug.  More... | |
DAC port driver.
| #define WAVE_SAMPLES 32 | 
| #define AUDIO_WA_SIZE THD_WA_SIZE(AUDIO_TASK_STACK_SIZE) | 
| void vexAudioPlaySound | ( | int | freq, | 
| int | amplitude, | ||
| int | timems | ||
| ) | 
Play frequency at given amplitude.
| [in] | freq | desired frequency in Hz | 
| [in] | amplitude | desired amplitude 0 = silence, 128 = max | 
| [in] | timems | duration of tone | 
This is the base function that all sound playback uses. The first time this is called all the DAC and DMA initialization is done, a thread is created to stop the sound after the requested playback time
| void vexAudioPlaySoundWait | ( | int | freq, | 
| int | amplitude, | ||
| int | timems | ||
| ) | 
Play frequency at given amplitude and wait for completion.
| void vexAudioStopSound | ( | void | ) | 
Stop sound playing.
This clears the counter used for tone duration and resets the semaphore the audio task is blocking on causing it to wake.
| int vexAudioInitChipToneSong | ( | int | len) | 
Initialize a chiptone song.
| [in] | len | number of tones in the song | 
Initalize a chiptone song, allocate memory and clear all variables memory will be reused for subsequent songs if there is enough space to avoid multiple calls to malloc/free
| void vexAudioDeinitChipToneSong | ( | void | ) | 
Free memory occupied by a song.
| void vexAudioStartChipToneSong | ( | int | repeat) | 
Start playback of the song.
| void vexAudioStopChipToneSong | ( | void | ) | 
Stop playback of the song.
| void vexAudioSetNextChipTone | ( | int | freq, | 
| int | amplitude, | ||
| int | timems | ||
| ) | 
Add a tone to the array for the song.
| [in] | freq | desired frequency in Hz | 
| [in] | amplitude | desired amplitude 0 = silence, 128 = max | 
| [in] | timems | duration of tone | 
| void vexAudioDebugChipTone | ( | void | ) | 
Print out the song data for debug.