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)
 

Detailed Description

I2S functions implemented at the HAL layer will follow this API.

Field Documentation

◆ close

ssp_err_t(* i2s_api_t::close) (i2s_ctrl_t *const p_ctrl)

Allows driver to be reconfigured and may reduce power consumption.

Implemented as
Parameters
[in]p_ctrlControl block set in i2s_api_t::open call for this instance.

◆ infoGet

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.

Implemented as
Parameters
[in]p_ctrlControl block set in i2s_api_t::open call for this instance.
[out]p_infoCollection of information for this instance.

◆ mute

ssp_err_t(* i2s_api_t::mute) (i2s_ctrl_t *const p_ctrl, i2s_mute_t const mute_enable)

Enable or disable mute.

Implemented as
Parameters
[in]p_ctrlControl block set in i2s_api_t::open call for this instance.
[in]mute_enableWhether to enable or disable mute.

◆ open

ssp_err_t(* i2s_api_t::open) (i2s_ctrl_t *const p_ctrl, i2s_cfg_t const *const p_cfg)

Initial configuration.

Implemented as
Precondition
Peripheral clocks and any required output pins should be configured prior to calling this function.
Note
To reconfigure after calling this function, call i2s_api_t::close first.
Parameters
[in]p_ctrlPointer to control block. Must be declared by user. Elements set here.
[in]p_cfgPointer to configuration structure. All elements of this structure must be set by user.

◆ read

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.

Implemented as
Parameters
[in]p_ctrlControl block set in i2s_api_t::open call for this instance.
[in]p_destBuffer to store PCM samples. Must be 4 byte aligned.
[in]bytesNumber 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.

◆ stop

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.

Implemented as
Parameters
[in]p_ctrlControl block set in i2s_api_t::open call for this instance.
[in]dirDirection of communication to stop.

◆ versionGet

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

Get version and store it in provided pointer p_version.

Implemented as
Parameters
[out]p_versionCode and API version used.

◆ write

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.

Implemented as
Parameters
[in]p_ctrlControl block set in i2s_api_t::open call for this instance.
[in]p_srcBuffer of PCM samples. Must be 4 byte aligned.
[in]bytesNumber 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.

◆ writeRead

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.

Implemented as
Parameters
[in]p_ctrlControl block set in i2s_api_t::open call for this instance.
[in]p_srcBuffer of PCM samples. Must be 4 byte aligned.
[in]p_destBuffer to store PCM samples. Must be 4 byte aligned.
[in]bytesNumber 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.

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