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...
 

Detailed Description

Audio playback API structure. Audio playback implementations use the following API.

Field Documentation

◆ close

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.

Implemented as
Parameters
[in]p_ctrlPointer to device control block initialized in Open call for audio driver.

◆ open

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.

Implemented as
Parameters
[in,out]p_ctrlPointer to a device structure allocated by user. The device control structure is initialized in this function.
[in]p_cfgPointer to configuration structure. All elements of the structure must be set by user.

◆ pause

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.

Implemented as
Precondition
Call SF_AUDIO_PLAYBACK_Start() before using this function. Calling SF_AUDIO_PLAYBACK_Pause() before SF_AUDIO_PLAYBACK_Start() has no effect and does not return an error code.
Parameters
[in]p_ctrlPointer to device control block initialized in Open call for audio driver.

◆ resume

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.

Implemented as
Precondition
Call SF_AUDIO_PLAYBACK_Pause() before using this function. Calling SF_AUDIO_PLAYBACK_Resume() before SF_AUDIO_PLAYBACK_Pause() has no effect and does not return an error code.
Parameters
[in]p_ctrlPointer to device control block initialized in Open call for audio driver.

◆ start

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.

Implemented as
Precondition
Call SF_MESSAGE_Open to configure the messaging framework control block and queues with the parameters specified in sf_audio_playback_cfg_t::p_message and sf_audio_playback_cfg_t::p_queue.
Parameters
[in,out]p_ctrlPointer to device control block initialized in Open call for audio driver.
[in]p_dataPointer to data, description, timeout values, and synchronization options.
[in]timeoutThreadX 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.

◆ stop

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.

Implemented as
Precondition
Call SF_AUDIO_PLAYBACK_Start() before using this function. Calling SF_AUDIO_PLAYBACK_Stop() before SF_AUDIO_PLAYBACK_Start() has no effect and does not return an error code.
Parameters
[in]p_ctrlPointer to device control block initialized in Open call for audio driver.

◆ versionGet

ssp_err_t(* sf_audio_playback_api_t::versionGet) (ssp_version_t *const p_version)

Store version information in provided pointer.

Implemented as
Parameters
[in]p_versionPointer to device control block initialized in Open call for UART driver.

◆ volumeSet

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.

Implemented as
Warning
Software volume control reduces resolution and may require extra memory and processing bandwidth.
Parameters
[in]p_ctrlPointer to device control block initialized in Open call for audio driver.
[in]volumeVolume level requested. Valid range is from 0 (muted, which will stop playback) to 255 (maximum volume, default on open).

The documentation for this struct was generated from the following file: