RA Flexible Software Package Documentation  Release v5.2.0

 
AUDIO PLAYBACK Interface

Detailed Description

Interface for the Audio Playback.

Defines the API and data structures for the Audio Playback implementation.

Summary

This module provides common interface for Audio Playback.

Data Structures

struct  audio_playback_callback_args_t
 
struct  audio_playback_cfg_t
 
struct  audio_playback_api_t
 
struct  audio_playback_instance_t
 

Typedefs

typedef void audio_playback_ctrl_t
 

Enumerations

enum  audio_playback_event_t
 

Data Structure Documentation

◆ audio_playback_callback_args_t

struct audio_playback_callback_args_t

Callback function parameter data

Data Fields
void * p_context

Placeholder for user data.

audio_playback_event_t event Event that triggered the callback.

◆ audio_playback_cfg_t

struct audio_playback_cfg_t

Audio Playback configuration parameters.

Data Fields

void const * p_extend
 Hardware dependent configuration.
 
void(* p_callback )(audio_playback_callback_args_t *p_args)
 
void * p_context
 

Field Documentation

◆ p_callback

void(* audio_playback_cfg_t::p_callback) (audio_playback_callback_args_t *p_args)

Callback called when play is complete.

◆ p_context

void* audio_playback_cfg_t::p_context

Placeholder for user data. Passed to the user callback in audio_playback_callback_args_t.

◆ audio_playback_api_t

struct audio_playback_api_t

Audio Playback functions implemented by the Audio Playback drivers will follow this API.

Data Fields

fsp_err_t(* open )(audio_playback_ctrl_t *const p_ctrl, audio_playback_cfg_t const *const p_cfg)
 
fsp_err_t(* start )(audio_playback_ctrl_t *const p_ctrl)
 
fsp_err_t(* stop )(audio_playback_ctrl_t *const p_ctrl)
 
fsp_err_t(* play )(audio_playback_ctrl_t *const p_ctrl, void const *const p_buffer, uint32_t length)
 
fsp_err_t(* close )(audio_playback_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* audio_playback_api_t::open) (audio_playback_ctrl_t *const p_ctrl, audio_playback_cfg_t const *const p_cfg)

Open a audio playback module.

Parameters
[in]p_ctrlPointer to memory allocated for control block.
[in]p_cfgPointer to the hardware configurations.

◆ start

fsp_err_t(* audio_playback_api_t::start) (audio_playback_ctrl_t *const p_ctrl)

Start audio playback hardware.

Parameters
[in]p_ctrlPointer to control block.

◆ stop

fsp_err_t(* audio_playback_api_t::stop) (audio_playback_ctrl_t *const p_ctrl)

Stop audio playback hardware.

Parameters
[in]p_ctrlPointer to control block.

◆ play

fsp_err_t(* audio_playback_api_t::play) (audio_playback_ctrl_t *const p_ctrl, void const *const p_buffer, uint32_t length)

Play audio buffer.

Parameters
[in]p_ctrlPointer to control block.
[in]p_bufferPointer to buffer with PCM samples to play. Data must be scaled for audio playback hardware.
[in]lengthLength of data in p_buffer.

◆ close

fsp_err_t(* audio_playback_api_t::close) (audio_playback_ctrl_t *const p_ctrl)

Close the audio driver.

Parameters
[in]p_ctrlPointer to control block initialized in audio_playback_api_t::open.

◆ audio_playback_instance_t

struct audio_playback_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
audio_playback_ctrl_t * p_ctrl Pointer to the control structure for this instance.
audio_playback_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
audio_playback_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ audio_playback_ctrl_t

typedef void audio_playback_ctrl_t

Audio Playback control block. Allocate an instance specific control block to pass into the AUDIO_PLAYBACK API calls.

Enumeration Type Documentation

◆ audio_playback_event_t

Callback event types.

Enumerator
AUDIO_PLAYBACK_EVENT_PLAYBACK_COMPLETE 

Audio playback complete event.