| Kinetis SDK Demo Applications User Guide 1.0.0-beta Freescale Semiconductor, Inc.

- Main Page
- Related Pages
- Demos

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
sai_playsound/src/main.c File Reference
`#include <string.h>`
`#include "fsl_clock_manager.h"`
`#include "fsl_uart_hal.h"`
`#include "fsl_uart_driver.h"`
`#include "playsound.h"`
`#include "shell.h"`
`#include "PCM_S16B_44100_2C.h"`
`#include "board.h"`

## Macros
#define | WAV_FILE_DECODE_BUFFER_SIZE

## Functions
static uint8_t | Getchar (void)
| get a char More...
static void | Putchar (uint8_t ch)
| put a char More...
uint32_t | AppGetDataCallBack (uint32_t NumBytesReq, uint8_t **ppData, uint32_t offest)
| Callback function for getting data. More...
uint32_t | main (void)
| Main function. More...
static int | Do_PlaySound (int argc, char *const argv[])
| Shell play audio function. More...
static int | Do_SetVolume (int argc, char *const argv[])
| Shell set volume function. More...
static int | Do_ShowWavInfo (int argc, char *const argv[])
| Shell display wave file information function. More...

## Variables
const cmd_tbl_t | CommandFun_Help
static const cmd_tbl_t | CommandFun_PlaySound
static const cmd_tbl_t | CommandFun_SetVolume
static const cmd_tbl_t | CommandFun_ShowWaveInfo
static uart_state_t | gUARTState
static uart_user_config_t | gShellUARTConfig
static shell_io_install_t | Shell_IOInstallStruct1
static uint8_t | WavBuffer [WAV_FILE_DECODE_BUFFER_SIZE]
sound_card_t | g_card

## Macro Definition Documentation

#define WAV_FILE_DECODE_BUFFER_SIZE

## Function Documentation

uint32_t AppGetDataCallBack | ( | uint32_t | NumBytesReq,
|  | uint8_t ** | ppData,
|  | uint32_t | offest
| ) |  |

Parameters

  NumBytesReq | request data len
  ppData | Pointer to a buffer memory area
  offest | file offset

Returns
  MUST return the acutal requested btyes, It can be less or equal then NumBytesReq.

static int Do_PlaySound | ( | int | argc,
|  | char *const | argv[]
| ) |  |
| static

static int Do_SetVolume | ( | int | argc,
|  | char *const | argv[]
| ) |  |
| static

<volume> should be in the range of 0-150 to indicate 0 - -75db. User should avoid set the volume to large for that it may cause distortion in codec.

static int Do_ShowWavInfo | ( | int | argc,
|  | char *const | argv[]
| ) |  |
| static

static uint8_t Getchar | ( | void |  | ) |
| static

uint32_t main | ( | void |  | ) |

static void Putchar | ( | uint8_t | ch | ) |
| static

## Variable Documentation

const cmd_tbl_t CommandFun_Help

static const cmd_tbl_t CommandFun_PlaySound
| static

static const cmd_tbl_t CommandFun_SetVolume
| static

static const cmd_tbl_t CommandFun_ShowWaveInfo
| static

sound_card_t g_card

uart_user_config_t gShellUARTConfig
| static

uart_state_t gUARTState
| static

shell_io_install_t Shell_IOInstallStruct1
| static

uint8_t WavBuffer[WAV_FILE_DECODE_BUFFER_SIZE]
| static