![]() |
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... | |
I2S implementation of Audio Recording Interface.
The Audio Recording Framework implementation uses the I2S interface for audio recording.
| #define SF_AUDIO_RECORD_I2S_CODE_VERSION_MAJOR (2U) |
Version of code that implements the API defined in this file
| #define SF_AUDIO_RECORD_I2S_OPEN (0x49325352) |
Macro definitions "I2SR" in ASCII
| 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.
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | p_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | Control block p_ctrl is not initialized. |
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
| 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)
| SSP_SUCCESS | InfoGet returns successfully. |
| SSP_ERR_ASSERTION | p_ctrl or p_info is null. |
| SSP_ERR_NOT_OPEN | Control block p_ctrl is not initialized. |
| 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.
| SSP_SUCCESS | Configuration of lower level drivers completed successfully. |
| SSP_ERR_ASSERTION | p_ctrl or p_cfg parameter is null: |
| SSP_ERR_INTERNAL | An internal ThreadX error has occurred. This is typically a failure to create/use a mutex. |
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
| 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.
| SSP_SUCCESS | I2S record started successfully. |
| SSP_ERR_ASSERTION | p_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | Driver control block not valid. |
| SSP_ERR_IN_USE | The module is currently busy performing another operation |
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
| ssp_err_t SF_AUDIO_RECORD_I2S_Stop | ( | sf_audio_record_ctrl_t *const | p_api_ctrl | ) |
Stops the audio recording and releases mutex.
| SSP_SUCCESS | I2S Record stopped successfully. |
| SSP_ERR_ASSERTION | The parameter p_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | Control block p_ctrl is not initialized. |
| SSP_ERR_INTERNAL | An internal ThreadX error has occurred. This is typically a failure to create/use a mutex. |
Return the mutex
If there was a mutex error, return it
| ssp_err_t SF_AUDIO_RECORD_I2S_VersionGet | ( | ssp_version_t *const | p_version | ) |
Gets version and stores it in provided pointer p_version.
| SSP_SUCCESS | VersionGet returned successfully. |
| SSP_ERR_ASSERTION | Parameter p_version was null. |
Copy the version information.