![]() |
Synergy Software Package User's Manual
|
#include <r_i2s_api.h>
Data Fields | |
| ssp_err_t(* | open )(i2s_ctrl_t *const p_ctrl, i2s_cfg_t const *const p_cfg) |
| ssp_err_t(* | stop )(i2s_ctrl_t *const p_ctrl, i2s_dir_t const dir) |
| ssp_err_t(* | mute )(i2s_ctrl_t *const p_ctrl, i2s_mute_t const mute_enable) |
| ssp_err_t(* | write )(i2s_ctrl_t *const p_ctrl, uint8_t const *const p_src, uint16_t const bytes) |
| ssp_err_t(* | read )(i2s_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint16_t const bytes) |
| ssp_err_t(* | writeRead )(i2s_ctrl_t *const p_ctrl, uint8_t const *const p_src, uint8_t *const p_dest, uint16_t const bytes) |
| ssp_err_t(* | infoGet )(i2s_ctrl_t *const p_ctrl, i2s_info_t *const p_info) |
| ssp_err_t(* | close )(i2s_ctrl_t *const p_ctrl) |
| ssp_err_t(* | versionGet )(ssp_version_t *const p_version) |
I2S functions implemented at the HAL layer will follow this API.
| ssp_err_t(* i2s_api_t::close) (i2s_ctrl_t *const p_ctrl) |
Allows driver to be reconfigured and may reduce power consumption.
| [in] | p_ctrl | Control block set in i2s_api_t::open call for this instance. |
| ssp_err_t(* i2s_api_t::infoGet) (i2s_ctrl_t *const p_ctrl, i2s_info_t *const p_info) |
Get instance specific information and store it in provided pointer p_info.
| [in] | p_ctrl | Control block set in i2s_api_t::open call for this instance. |
| [out] | p_info | Collection of information for this instance. |
| ssp_err_t(* i2s_api_t::mute) (i2s_ctrl_t *const p_ctrl, i2s_mute_t const mute_enable) |
Enable or disable mute.
| [in] | p_ctrl | Control block set in i2s_api_t::open call for this instance. |
| [in] | mute_enable | Whether to enable or disable mute. |
| ssp_err_t(* i2s_api_t::open) (i2s_ctrl_t *const p_ctrl, i2s_cfg_t const *const p_cfg) |
Initial configuration.
| [in] | p_ctrl | Pointer to control block. Must be declared by user. Elements set here. |
| [in] | p_cfg | Pointer to configuration structure. All elements of this structure must be set by user. |
| ssp_err_t(* i2s_api_t::read) (i2s_ctrl_t *const p_ctrl, uint8_t *const p_dest, uint16_t const bytes) |
Read I2S data. Reception is complete when callback is called with I2S_EVENT_RX_EMPTY.
| [in] | p_ctrl | Control block set in i2s_api_t::open call for this instance. |
| [in] | p_dest | Buffer to store PCM samples. Must be 4 byte aligned. |
| [in] | bytes | Number of bytes in the buffer. Recommended requesting a multiple of 8 bytes. If not a multiple of 8, receive will stop at the multiple of 8 below requested bytes. |
| ssp_err_t(* i2s_api_t::stop) (i2s_ctrl_t *const p_ctrl, i2s_dir_t const dir) |
Stop communication. Transmission is stopped when callback is called with I2S_EVENT_IDLE. Reception is stopped when callback is called with I2S_EVENT_RX_EMPTY.
| [in] | p_ctrl | Control block set in i2s_api_t::open call for this instance. |
| [in] | dir | Direction of communication to stop. |
| ssp_err_t(* i2s_api_t::versionGet) (ssp_version_t *const p_version) |
Get version and store it in provided pointer p_version.
| [out] | p_version | Code and API version used. |
| ssp_err_t(* i2s_api_t::write) (i2s_ctrl_t *const p_ctrl, uint8_t const *const p_src, uint16_t const bytes) |
Write I2S data. All transmit data is queued when callback is called with I2S_EVENT_TX_EMPTY. Transmission is complete when callback is called with I2S_EVENT_IDLE.
| [in] | p_ctrl | Control block set in i2s_api_t::open call for this instance. |
| [in] | p_src | Buffer of PCM samples. Must be 4 byte aligned. |
| [in] | bytes | Number of bytes in the buffer. Recommended requesting a multiple of 8 bytes. If not a multiple of 8, padding 0s will be added to transmission to make it a multiple of 8. |
| ssp_err_t(* i2s_api_t::writeRead) (i2s_ctrl_t *const p_ctrl, uint8_t const *const p_src, uint8_t *const p_dest, uint16_t const bytes) |
Simultaneously write and read I2S data. Transmission and reception are complete when callback is called with I2S_EVENT_IDLE.
| [in] | p_ctrl | Control block set in i2s_api_t::open call for this instance. |
| [in] | p_src | Buffer of PCM samples. Must be 4 byte aligned. |
| [in] | p_dest | Buffer to store PCM samples. Must be 4 byte aligned. |
| [in] | bytes | Number of bytes in the buffers. Recommended requesting a multiple of 8 bytes. If not a multiple of 8, padding 0s will be added to transmission to make it a multiple of 8, and receive will stop at the multiple of 8 below requested bytes. |