Synergy Software Package User's Manual

RTOS-integrated I2S implementation of Audio Playback Interface. More...

Data Structures

struct  sf_audio_playback_hw_i2s_instance_ctrl_t
 
struct  sf_audio_playback_hw_i2s_cfg_t
 

Functions

ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_Open (sf_audio_playback_hw_ctrl_t *const p_api_ctrl, sf_audio_playback_hw_cfg_t const *const p_cfg)
 Open the I2S audio driver, including the I2S HAL driver and helper timer and transfer HAL drivers. More...
 
ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_Start (sf_audio_playback_hw_ctrl_t *const p_ctrl)
 Start the I2S and timer HAL drivers. More...
 
ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_Stop (sf_audio_playback_hw_ctrl_t *const p_api_ctrl)
 Stop the I2S and timer HAL drivers. More...
 
ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_Play (sf_audio_playback_hw_ctrl_t *const p_api_ctrl, int16_t const *const p_buffer, uint32_t length)
 Play a single audio buffer by input samples to the I2S at the sampling frequency configured by the timer. More...
 
ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_DataTypeGet (sf_audio_playback_hw_ctrl_t *const p_ctrl, sf_audio_playback_data_type_t *const p_data_type)
 Provides the expected data type in the pointer p_data_type. More...
 
ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_Close (sf_audio_playback_hw_ctrl_t *const p_api_ctrl)
 Close open audio driver. More...
 
ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_VersionGet (ssp_version_t *const p_version)
 Stores the version of the firmware and API in provided pointer p_version. More...
 

Detailed Description

RTOS-integrated I2S implementation of Audio Playback Interface.

The Audio Playback Framework I2S implementation uses the I2S interface for audio playback.

Name of module used by error logger macro

Function Documentation

◆ SF_AUDIO_PLAYBACK_HW_I2S_Close()

ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_Close ( sf_audio_playback_hw_ctrl_t *const  p_api_ctrl)

Close open audio driver.

Return values
SSP_SUCCESSSuccessful close.
SSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
Returns
See Common Error Codes and lower level driver function for other possible return codes. This function calls:
Note
This function is reentrant for different channels. It is not reentrant for the same channel.

Close I2S driver.

◆ SF_AUDIO_PLAYBACK_HW_I2S_DataTypeGet()

ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_DataTypeGet ( sf_audio_playback_hw_ctrl_t *const  p_ctrl,
sf_audio_playback_data_type_t *const  p_data_type 
)

Provides the expected data type in the pointer p_data_type.

Return values
SSP_SUCCESSData type stored in p_data_type.
SSP_ERR_ASSERTIONThe parameter p_ctrl or p_data_type is NULL.
Note
This function is reentrant if the lower level driver functions are reentrant.

Store data type. The audio framework supports only 16-bit signed data.

◆ SF_AUDIO_PLAYBACK_HW_I2S_Open()

ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_Open ( sf_audio_playback_hw_ctrl_t *const  p_api_ctrl,
sf_audio_playback_hw_cfg_t const *const  p_cfg 
)

Open the I2S audio driver, including the I2S HAL driver and helper timer and transfer HAL drivers.

Return values
SSP_SUCCESSConfiguration of lower level drivers completed successfully.
SSP_ERR_ASSERTIONOne of the following parameter is null: p_ctrl or p_cfg or p_cfg_extend->p_lower_lvl_i2s or p_cfg_extend->p_lower_lvl_i2s->p_api.
Returns
See Common Error Codes and lower level driver function for other possible return codes. This function calls:
Note
This function is reentrant if the lower level driver functions are reentrant.

Open I2S module

Store driver data.

◆ SF_AUDIO_PLAYBACK_HW_I2S_Play()

ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_Play ( sf_audio_playback_hw_ctrl_t *const  p_api_ctrl,
int16_t const *const  p_buffer,
uint32_t  length 
)

Play a single audio buffer by input samples to the I2S at the sampling frequency configured by the timer.

Return values
SSP_SUCCESSBuffer playback began successfully.
SSP_ERR_ASSERTIONThe parameter p_ctrl or p_buffer is NULL or length is less than 0x10000U.
Returns
See Common Error Codes and lower level driver function for other possible return codes. This function calls:
Note
This function is reentrant if the lower level driver functions are reentrant.

Reset transfer.

◆ SF_AUDIO_PLAYBACK_HW_I2S_Start()

ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_Start ( sf_audio_playback_hw_ctrl_t *const  p_ctrl)

Start the I2S and timer HAL drivers.

Return values
SSP_SUCCESSAudio playback hardware started successfully.
Note
This function is reentrant if the lower level driver functions are reentrant.

This API is not used - I2S is started when write is called from SF_AUDIO_PLAYBACK_HW_I2S_Play.

◆ SF_AUDIO_PLAYBACK_HW_I2S_Stop()

ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_Stop ( sf_audio_playback_hw_ctrl_t *const  p_api_ctrl)

Stop the I2S and timer HAL drivers.

Return values
SSP_SUCCESSAudio playback hardware stopped successfully.
SSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
Returns
See Common Error Codes and lower level driver function for other possible return codes. This function calls:
Note
This function is reentrant if the lower level driver functions are reentrant.

Stop I2S.

◆ SF_AUDIO_PLAYBACK_HW_I2S_VersionGet()

ssp_err_t SF_AUDIO_PLAYBACK_HW_I2S_VersionGet ( ssp_version_t *const  p_version)

Stores the version of the firmware and API in provided pointer p_version.

Return values
SSP_ERR_ASSERTIONThe parameter p_version is NULL.
SSP_SUCCESSModule version successfully stored in p_version.
Note
This function is reentrant.