![]() |
Synergy Software Package User's Manual
|
#include <sf_audio_playback_api.h>
Data Fields | |
| ssp_err_t(* | open )(sf_audio_playback_ctrl_t *const p_ctrl, sf_audio_playback_cfg_t const *const p_cfg) |
| Configure the audio framework by creating a thread for audio playback and configuring HAL layer drivers used. This function must be called before any other audio functions. More... | |
| ssp_err_t(* | close )(sf_audio_playback_ctrl_t *const p_ctrl) |
| The close API handles cleans up internal driver data. More... | |
| ssp_err_t(* | start )(sf_audio_playback_ctrl_t *const p_ctrl, sf_audio_playback_data_t *const p_data, UINT const timeout) |
| Play audio. Currently only 16-bit mono PCM buffers are supported. More... | |
| ssp_err_t(* | pause )(sf_audio_playback_ctrl_t *const p_ctrl) |
| Pause audio playback. This stops the peripheral that triggers the DMA/DTC transfer and posts a flag to notify SF_AUDIO_PLAYBACK_Start() to pause any playback in progress. More... | |
| ssp_err_t(* | stop )(sf_audio_playback_ctrl_t *const p_ctrl) |
| Stop audio playback. Causes SF_AUDIO_PLAYBACK_Start() halt playback and return. More... | |
| ssp_err_t(* | resume )(sf_audio_playback_ctrl_t *const p_ctrl) |
| Resume audio playback. Posts a flag to notify SF_AUDIO_PLAYBACK_Start() to restart the peripheral that triggers the DMA/DTC transfer. More... | |
| ssp_err_t(* | volumeSet )(sf_audio_playback_ctrl_t *const p_ctrl, uint8_t const volume) |
| Set software volume control. Software volume control is applied globally to all streams on the hardware. More... | |
| ssp_err_t(* | versionGet )(ssp_version_t *const p_version) |
| Store version information in provided pointer. More... | |
Audio playback API structure. Audio playback implementations use the following API.
| ssp_err_t(* sf_audio_playback_api_t::close) (sf_audio_playback_ctrl_t *const p_ctrl) |
The close API handles cleans up internal driver data.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for audio driver. |
| ssp_err_t(* sf_audio_playback_api_t::open) (sf_audio_playback_ctrl_t *const p_ctrl, sf_audio_playback_cfg_t const *const p_cfg) |
Configure the audio framework by creating a thread for audio playback and configuring HAL layer drivers used. This function must be called before any other audio functions.
| [in,out] | p_ctrl | Pointer to a device structure allocated by user. The device control structure is initialized in this function. |
| [in] | p_cfg | Pointer to configuration structure. All elements of the structure must be set by user. |
| ssp_err_t(* sf_audio_playback_api_t::pause) (sf_audio_playback_ctrl_t *const p_ctrl) |
Pause audio playback. This stops the peripheral that triggers the DMA/DTC transfer and posts a flag to notify SF_AUDIO_PLAYBACK_Start() to pause any playback in progress.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for audio driver. |
| ssp_err_t(* sf_audio_playback_api_t::resume) (sf_audio_playback_ctrl_t *const p_ctrl) |
Resume audio playback. Posts a flag to notify SF_AUDIO_PLAYBACK_Start() to restart the peripheral that triggers the DMA/DTC transfer.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for audio driver. |
| ssp_err_t(* sf_audio_playback_api_t::start) (sf_audio_playback_ctrl_t *const p_ctrl, sf_audio_playback_data_t *const p_data, UINT const timeout) |
Play audio. Currently only 16-bit mono PCM buffers are supported.
| [in,out] | p_ctrl | Pointer to device control block initialized in Open call for audio driver. |
| [in] | p_data | Pointer to data, description, timeout values, and synchronization options. |
| [in] | timeout | ThreadX timeout, represents the maximum amount of time to wait to post to the audio queue. Options include TX_NO_WAIT (0x00000000), TX_WAIT_FOREVER (0xFFFFFFFF), and timeout values from 0x00000001 through 0xFFFFFFFE in ThreadX tick counts. |
| ssp_err_t(* sf_audio_playback_api_t::stop) (sf_audio_playback_ctrl_t *const p_ctrl) |
Stop audio playback. Causes SF_AUDIO_PLAYBACK_Start() halt playback and return.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for audio driver. |
| ssp_err_t(* sf_audio_playback_api_t::versionGet) (ssp_version_t *const p_version) |
Store version information in provided pointer.
| [in] | p_version | Pointer to device control block initialized in Open call for UART driver. |
| ssp_err_t(* sf_audio_playback_api_t::volumeSet) (sf_audio_playback_ctrl_t *const p_ctrl, uint8_t const volume) |
Set software volume control. Software volume control is applied globally to all streams on the hardware.
| [in] | p_ctrl | Pointer to device control block initialized in Open call for audio driver. |
| [in] | volume | Volume level requested. Valid range is from 0 (muted, which will stop playback) to 255 (maximum volume, default on open). |