DAC port driver macros and prototypes. More...
Go to the source code of this file.
Data Structures | |
struct | _vsl_ct |
Typedefs | |
typedef struct _vsl_ct | vsl_ct |
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 (void) |
Stop sound playing. More... | |
char * | vexAudioPlayRtttl (char *song, int amplitude, int repeat) |
Play ringtone string using the vsl sound library. More... | |
int | vexAudioInitChipToneSong (int len) |
Initialize a chiptone song. More... | |
void | vexAudioDeinitChipToneSong (void) |
Free memory occupied by a song. More... | |
void | vexAudioStartChipToneSong (int repeat) |
Start playback of the song. More... | |
void | vexAudioStopChipToneSong (void) |
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 (void) |
Print out the song data for debug. More... | |
int | vexAudioPlayNextChipTone (void) |
void | VSL_Factorize (int n, int *f1, int *f2) |
void | VSL_CreateSineWave (int amplitude) |
void | VSL_InitTimer (int prescale, int period) |
void | VSL_Init (void) |
void | VSL_Deinit (void) |
DAC port driver macros and prototypes.
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.
char* vexAudioPlayRtttl | ( | char * | song, |
int | amplitude, | ||
int | repeat | ||
) |
Play ringtone string using the vsl sound library.
[in] | song | Pointer to buffer with rtttl sound data |
[in] | amplitude | volume to play song at |
[in] | repeat | flag indicating song is played continuously in a loop |
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.
int vexAudioPlayNextChipTone | ( | void | ) |
void VSL_Factorize | ( | int | n, |
int * | f1, | ||
int * | f2 | ||
) |
void VSL_CreateSineWave | ( | int | amplitude) |
void VSL_InitTimer | ( | int | prescale, |
int | period | ||
) |
void VSL_Init | ( | void | ) |
void VSL_Deinit | ( | void | ) |