Synergy Software Package User's Manual

I2S implementation of Audio Recording Interface. More...

Data Structures

struct  sf_audio_record_i2s_instance_ctrl_t
 

Macros

#define SF_AUDIO_RECORD_I2S_CODE_VERSION_MAJOR   (2U)
 
#define SF_AUDIO_RECORD_I2S_OPEN   (0x49325352)
 

Functions

ssp_err_t SF_AUDIO_RECORD_I2S_Open (sf_audio_record_ctrl_t *const p_api_ctrl, sf_audio_record_cfg_t const *const p_cfg)
 Configures the Audio record I2S framework and I2S HAL driver The SF_AUDIO_RECORD_I2S_Open function creates a mutex for the I2S Unit used, then calls the driver open function. The mutex is deleted following the driver layer open function fails. More...
 
ssp_err_t SF_AUDIO_RECORD_I2S_Start (sf_audio_record_ctrl_t *const p_api_ctrl)
 Gets mutex, starts recording data into the buffer. More...
 
ssp_err_t SF_AUDIO_RECORD_I2S_Stop (sf_audio_record_ctrl_t *const p_api_ctrl)
 Stops the audio recording and releases mutex. More...
 
ssp_err_t SF_AUDIO_RECORD_I2S_InfoGet (sf_audio_record_ctrl_t *const p_api_ctrl, sf_audio_record_info_t *p_info)
 Provide information about the channel supported by audio recording framework(stereo) More...
 
ssp_err_t SF_AUDIO_RECORD_I2S_Close (sf_audio_record_ctrl_t *const p_api_ctrl)
 Closes I2S driver, releases and deletes the mutex. More...
 
ssp_err_t SF_AUDIO_RECORD_I2S_VersionGet (ssp_version_t *const p_version)
 Gets version and stores it in provided pointer p_version. More...
 

Detailed Description

I2S implementation of Audio Recording Interface.

The Audio Recording Framework implementation uses the I2S interface for audio recording.

Macro Definition Documentation

◆ SF_AUDIO_RECORD_I2S_CODE_VERSION_MAJOR

#define SF_AUDIO_RECORD_I2S_CODE_VERSION_MAJOR   (2U)

Version of code that implements the API defined in this file

◆ SF_AUDIO_RECORD_I2S_OPEN

#define SF_AUDIO_RECORD_I2S_OPEN   (0x49325352)

Macro definitions "I2SR" in ASCII

Function Documentation

◆ SF_AUDIO_RECORD_I2S_Close()

ssp_err_t SF_AUDIO_RECORD_I2S_Close ( sf_audio_record_ctrl_t *const  p_api_ctrl)

Closes I2S driver, releases and deletes the mutex.

Implements
Return values
SSP_SUCCESSSuccessful close.
SSP_ERR_ASSERTIONp_ctrl is NULL.
SSP_ERR_NOT_OPENControl block p_ctrl is not initialized.
Returns
See Common Error Codes and lower level driver function for other possible return codes or causes. This function calls

Call the underlying I2S close

Post the mutex

If all the HAL layers closed successfully, then delete the mutex and mark module as un-initialized

Clear information from control block so other functions know this instance is closed

◆ SF_AUDIO_RECORD_I2S_InfoGet()

ssp_err_t SF_AUDIO_RECORD_I2S_InfoGet ( sf_audio_record_ctrl_t *const  p_api_ctrl,
sf_audio_record_info_t *  p_info 
)

Provide information about the channel supported by audio recording framework(stereo)

Implements
Return values
SSP_SUCCESSInfoGet returns successfully.
SSP_ERR_ASSERTIONp_ctrl or p_info is null.
SSP_ERR_NOT_OPENControl block p_ctrl is not initialized.
Returns
See Common Error Codes for other possible return codes or causes.

◆ SF_AUDIO_RECORD_I2S_Open()

ssp_err_t SF_AUDIO_RECORD_I2S_Open ( sf_audio_record_ctrl_t *const  p_api_ctrl,
sf_audio_record_cfg_t const *const  p_cfg 
)

Configures the Audio record I2S framework and I2S HAL driver The SF_AUDIO_RECORD_I2S_Open function creates a mutex for the I2S Unit used, then calls the driver open function. The mutex is deleted following the driver layer open function fails.

Implements
Return values
SSP_SUCCESSConfiguration of lower level drivers completed successfully.
SSP_ERR_ASSERTIONp_ctrl or p_cfg parameter is null:
SSP_ERR_INTERNALAn internal ThreadX error has occurred. This is typically a failure to create/use a mutex.
Returns
See Common Error Codes and lower level driver function for other possible return codes. This function calls:

Open I2S module

Create a mutex to protect access to the control structure and the lower level hardware.

Initialize the configuration parameters

If any of the HAL layer initializations failed, then delete the mutex and exit the function with the error code

Delete the mutex

Mark control block open so other tasks know it is valid

◆ SF_AUDIO_RECORD_I2S_Start()

ssp_err_t SF_AUDIO_RECORD_I2S_Start ( sf_audio_record_ctrl_t *const  p_api_ctrl)

Gets mutex, starts recording data into the buffer.

Implements
Return values
SSP_SUCCESSI2S record started successfully.
SSP_ERR_ASSERTIONp_ctrl is NULL.
SSP_ERR_NOT_OPENDriver control block not valid.
SSP_ERR_IN_USEThe module is currently busy performing another operation
Returns
See Common Error Codes and lower level driver function for other possible return codes. This function calls:

Get mutex, start i2s

Call the underlying I2S driver read

If any of the HAL layer initializations failed, then delete the mutex and exit the function with the error code

Return the mutex

◆ SF_AUDIO_RECORD_I2S_Stop()

ssp_err_t SF_AUDIO_RECORD_I2S_Stop ( sf_audio_record_ctrl_t *const  p_api_ctrl)

Stops the audio recording and releases mutex.

Implements
Return values
SSP_SUCCESSI2S Record stopped successfully.
SSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
SSP_ERR_NOT_OPENControl block p_ctrl is not initialized.
SSP_ERR_INTERNALAn internal ThreadX error has occurred. This is typically a failure to create/use a mutex.
Returns
See Common Error Codes for other possible return codes or causes. This function calls: i2s_api_t::stop

Return the mutex

If there was a mutex error, return it

◆ SF_AUDIO_RECORD_I2S_VersionGet()

ssp_err_t SF_AUDIO_RECORD_I2S_VersionGet ( ssp_version_t *const  p_version)

Gets version and stores it in provided pointer p_version.

Implements
Return values
SSP_SUCCESSVersionGet returned successfully.
SSP_ERR_ASSERTIONParameter p_version was null.

Copy the version information.