![]() |
RA Flexible Software Package Documentation
Release v5.8.0
|
|
Interface for the Audio Playback.
Defines the API and data structures for the Audio Playback implementation.
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 |
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. |
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 |
void(* audio_playback_cfg_t::p_callback) (audio_playback_callback_args_t *p_args) |
Callback called when play is complete.
void* audio_playback_cfg_t::p_context |
Placeholder for user data. Passed to the user callback in audio_playback_callback_args_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) |
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.
[in] | p_ctrl | Pointer to memory allocated for control block. |
[in] | p_cfg | Pointer to the hardware configurations. |
fsp_err_t(* audio_playback_api_t::start) (audio_playback_ctrl_t *const p_ctrl) |
Start audio playback hardware.
[in] | p_ctrl | Pointer to control block. |
fsp_err_t(* audio_playback_api_t::stop) (audio_playback_ctrl_t *const p_ctrl) |
Stop audio playback hardware.
[in] | p_ctrl | Pointer to control block. |
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.
[in] | p_ctrl | Pointer to control block. |
[in] | p_buffer | Pointer to buffer with PCM samples to play. Data must be scaled for audio playback hardware. |
[in] | length | Length of data in p_buffer. |
fsp_err_t(* audio_playback_api_t::close) (audio_playback_ctrl_t *const p_ctrl) |
Close the audio driver.
[in] | p_ctrl | Pointer to control block initialized in audio_playback_api_t::open. |
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 void audio_playback_ctrl_t |
Audio Playback control block. Allocate an instance specific control block to pass into the AUDIO_PLAYBACK API calls.