![]() |
Kinetis SDK v.1.2 Demo Applications User's Guide
Rev. 0
Freescale Semiconductor, Inc.
|
#include <string.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include "fsl_soundcard.h"
#include "fsl_sai_driver.h"
#include "fsl_sgtl5000_driver.h"
#include "fsl_debug_console.h"
#include "audio.h"
#include "terminal_menu.h"
#include "arm_math.h"
Functions | |
void | audio_wav_init (wave_file_t *newWav) |
Initialize audio WAV. More... | |
void | audio_stream_init (void) |
Initialize I2S, I2C, & TWR-AUDIO-SGTL board. More... | |
uint32_t | config_volume (sgtl_handler_t *handler, sgtl_module_t module, uint32_t volumeCtrl) |
Sets volume from user input. More... | |
snd_status_t | get_wav_data (wave_file_t *waveFile) |
Collects data from wav file header. More... | |
snd_status_t | stream_audio (dsp_types_t dspType, uint8_t volumeCtrl) |
Plays a stream of audio. More... | |
snd_status_t | play_wav (uint32_t *pcmBuffer, uint8_t volumeCtrl) |
Play PCM audio data from wav format array. More... | |
void | send_wav (uint8_t *dataBuffer, uint32_t length, sai_data_format_t *dataFormat) |
Send audio data to sound card. More... | |
Variables | |
float32_t | g_dspStore [2 *AUDIO_BUFFER_BLOCK_SIZE] |
float32_t | g_dspResult [AUDIO_BUFFER_BLOCK_SIZE] |
static sai_data_format_t | g_format |
static sound_card_t | g_txCard |
static sound_card_t | g_rxCard |
static sai_user_config_t | g_txConfig |
static sai_user_config_t | g_rxConfig |
static sai_state_t | g_txState |
static sai_state_t | g_rxState |
static volatile bool | g_firstCopy |
static sgtl_handler_t | g_codecHandler |
void audio_stream_init | ( | void | ) |
void audio_wav_init | ( | wave_file_t * | newWav | ) |
[in] | newWav | Pointer to a WAV file. |
uint32_t config_volume | ( | sgtl_handler_t * | handler, |
sgtl_module_t | module, | ||
uint32_t | volumeCtrl | ||
) |
[in] | handler | Pointer to SGTL handler. |
[in] | module | SGTL module. |
[in] | volumeCtrl | Input data from terminal menu. |
kStatus_Success | if function completed successfully. |
kStatusFail | if function failed. |
snd_status_t get_wav_data | ( | wave_file_t * | waveFile | ) |
[in] | waveFile | Data structure of pcm data array. |
kStatus_Success | if function completed successfully. |
kStatusFail | if function failed. |
snd_status_t play_wav | ( | uint32_t * | pcmBuffer, |
uint8_t | volumeCtrl | ||
) |
[in] | pcmBuffer | Pointer to data array containing wav formatted audio data. |
[in] | volumeCtrl | Input data from terminal menu. |
kStatus_Success | if function completed successfully. |
kStatusFail | if function failed. |
void send_wav | ( | uint8_t * | dataBuffer, |
uint32_t | length, | ||
sai_data_format_t * | dataFormat | ||
) |
[in] | dataBuffer | Pointer to data array containing wav formatted audio data. |
[in] | length | Length of the dataBuffer |
[in] | dataFormat | Point to audio_data_format_t for sound card. |
snd_status_t stream_audio | ( | dsp_types_t | dspType, |
uint8_t | volumeCtrl | ||
) |
[in] | dspType | Used to select one DSP function to perform on the data |
[in] | volumeCtrl | Input data from terminal menu. |
|
static |
float32_t g_dspResult[AUDIO_BUFFER_BLOCK_SIZE] |
float32_t g_dspStore[2 *AUDIO_BUFFER_BLOCK_SIZE] |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |