![]() |
Synergy Software Package User's Manual
|
Driver for the Serial Sound Interface (SSI). More...
Data Structures | |
| struct | ssi_instance_ctrl_t |
| struct | i2s_on_ssi_cfg_t |
Enumerations | |
| enum | ssi_audio_clock_t { SSI_AUDIO_CLOCK_EXTERNAL = 0, SSI_AUDIO_CLOCK_GTIOC1A = 1 } |
Functions | |
| ssp_err_t | R_SSI_Open (i2s_ctrl_t *const p_api_ctrl, i2s_cfg_t const *const p_cfg) |
| Opens the SSI. Implements i2s_api_t::open. More... | |
| ssp_err_t | R_SSI_Stop (i2s_ctrl_t *const p_api_ctrl, i2s_dir_t const dir) |
| Stops SSI. Implements i2s_api_t::stop. More... | |
| ssp_err_t | R_SSI_Close (i2s_ctrl_t *const p_api_ctrl) |
| Closes SSI. Implements i2s_api_t::close. More... | |
| ssp_err_t | R_SSI_Write (i2s_ctrl_t *const p_api_ctrl, uint8_t const *const p_src, uint16_t const bytes) |
| Writes data buffer to SSI. Implements i2s_api_t::write. More... | |
| ssp_err_t | R_SSI_Read (i2s_ctrl_t *const p_api_ctrl, uint8_t *const p_dest, uint16_t const bytes) |
| Reads data into provided buffer. Implements i2s_api_t::read. More... | |
| ssp_err_t | R_SSI_WriteRead (i2s_ctrl_t *const p_api_ctrl, uint8_t const *const p_src, uint8_t *const p_dest, uint16_t const bytes) |
| Writes from source buffer and reads data into destination buffer. Implements i2s_api_t::writeRead. More... | |
| ssp_err_t | R_SSI_Mute (i2s_ctrl_t *const p_api_ctrl, i2s_mute_t const mute_enable) |
| Mutes SSI. Implements i2s_api_t::mute. More... | |
| ssp_err_t | R_SSI_InfoGet (i2s_ctrl_t *const p_api_ctrl, i2s_info_t *const p_info) |
| Get I2S information and store it in provided pointer p_info. Implements i2s_api_t::infoGet. More... | |
| ssp_err_t | R_SSI_VersionGet (ssp_version_t *const p_version) |
| Sets driver version based on compile time macros. More... | |
Driver for the Serial Sound Interface (SSI).
Extends I2S Interface.
| enum ssi_audio_clock_t |
| ssp_err_t R_SSI_Close | ( | i2s_ctrl_t *const | p_api_ctrl | ) |
Closes SSI. Implements i2s_api_t::close.
This function powers down the SSI and closes the lower level timer and transfer drivers if they are used.
| SSP_SUCCESS | Device closed successfully. |
| SSP_ERR_ASSERTION | The pointer to p_ctrl null. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Stop feeding clock to SSI peripheral to deactivate it.
If a timer instance is provided, close the timer instance.
If a transfer instance is provided for write, close the transfer instance.
If a transfer instance is provided for read, close the transfer instance.
Release HW lock.
| ssp_err_t R_SSI_InfoGet | ( | i2s_ctrl_t *const | p_api_ctrl, |
| i2s_info_t *const | p_info | ||
| ) |
Get I2S information and store it in provided pointer p_info. Implements i2s_api_t::infoGet.
| SSP_SUCCESS | Information stored successfully. |
| SSP_ERR_ASSERTION | The p_ctrl or p_info parameter was null. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Get the SSI hardware status information.
If SSI hardware status is idle, set status to stopped. Otherwise, set status to in use.
Get the sampling frequency information.
| ssp_err_t R_SSI_Mute | ( | i2s_ctrl_t *const | p_api_ctrl, |
| i2s_mute_t const | mute_enable | ||
| ) |
Mutes SSI. Implements i2s_api_t::mute.
Data is still written while mute is enabled, but the transmit line outputs zeros.
| SSP_SUCCESS | Transmission is muted. |
| SSP_ERR_ASSERTION | The pointer to p_ctrl was null. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Enables the mute if MUTE_ON is set. Otherwise, disables the mute.
| ssp_err_t R_SSI_Open | ( | i2s_ctrl_t *const | p_api_ctrl, |
| i2s_cfg_t const *const | p_cfg | ||
| ) |
Opens the SSI. Implements i2s_api_t::open.
This function calculates the clock divisor based on the input audio clock frequency and the requested sampling frequency. It sets this clock divisor and the configurations specified in i2s_cfg_t. It also opens the timer and transfer interfaces if they are provided.
| SSP_SUCCESS | Ready for I2S communication. |
| SSP_ERR_ASSERTION | The pointer to p_ctrl or p_cfg is null. |
| SSP_ERR_IN_USE | The requested channel has already been opened or hardware has been locked. |
Configure dependent timer and transfer drivers.
Configure interrupts.
Mark driver as open by initializing it to "SSI" in its ASCII equivalent.
| ssp_err_t R_SSI_Read | ( | i2s_ctrl_t *const | p_api_ctrl, |
| uint8_t *const | p_dest, | ||
| uint16_t const | bytes | ||
| ) |
Reads data into provided buffer. Implements i2s_api_t::read.
This function resets the transfer if the transfer interface is used, or reads the length of data available in the FIFO then stores the remaining read buffer in the control block to be filled in the ISR.
Read() cannot be called if another write(), read() or writeRead() operation is in progress. Read can be called when the SSI is idle, or after the I2S_EVENT_RX_FULL event.
| SSP_SUCCESS | Read initiated successfully. |
| SSP_ERR_ASSERTION | The pointer to p_ctrl or p_dest was null, or bytes requested was 0. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
If a transfer instance is provided for read, reset the transfer. Otherwise unload the receive FIFO.
Make sure reception is enabled.
| ssp_err_t R_SSI_Stop | ( | i2s_ctrl_t *const | p_api_ctrl, |
| i2s_dir_t const | dir | ||
| ) |
Stops SSI. Implements i2s_api_t::stop.
This function disables the transfer if the transfer interface is used, or sends a stop signal to stop writing data in the ISR if interrupt driven mode is used.
| SSP_SUCCESS | I2S communication stop request issued. |
| SSP_ERR_ASSERTION | The pointer to p_ctrl null. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Stop is complete after an I2S_EVENT_IDLE interrupt.
| ssp_err_t R_SSI_VersionGet | ( | ssp_version_t *const | p_version | ) |
Sets driver version based on compile time macros.
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | The parameter p_version is NULL. |
| ssp_err_t R_SSI_Write | ( | i2s_ctrl_t *const | p_api_ctrl, |
| uint8_t const *const | p_src, | ||
| uint16_t const | bytes | ||
| ) |
Writes data buffer to SSI. Implements i2s_api_t::write.
This function resets the transfer if the transfer interface is used, or writes the length of data that fits in the FIFO then stores the remaining write buffer in the control block to be written in the ISR.
Write() cannot be called if another write(), read() or writeRead() operation is in progress. Write can be called when the SSI is idle, or after the I2S_EVENT_TX_EMPTY event.
| SSP_SUCCESS | Write initiated successfully. |
| SSP_ERR_ASSERTION | The pointer to p_ctrl or p_src was null, or bytes requested was 0. |
| SSP_ERR_IN_USE | Another transfer is in progress, data was not written. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
| SSP_ERR_UNDERFLOW | The transmit FIFO underflowed before it was reloaded. |
If a transfer instance is provided for write, reset the transfer. Otherwise load the transmit FIFO.
Make sure transmission is enabled.
| ssp_err_t R_SSI_WriteRead | ( | i2s_ctrl_t *const | p_api_ctrl, |
| uint8_t const *const | p_src, | ||
| uint8_t *const | p_dest, | ||
| uint16_t const | bytes | ||
| ) |
Writes from source buffer and reads data into destination buffer. Implements i2s_api_t::writeRead.
This function calls R_SSI_Write and R_SSI_Read.
writeRead() cannot be called if another write(), read() or writeRead() operation is in progress. writeRead() can be called when the SSI is idle, or after the I2S_EVENT_RX_FULL event.
| SSP_SUCCESS | Write and read initiated successfully. |
| SSP_ERR_ASSERTION | The pointer to p_ctrl, p_src, or p_dest was null, or bytes requested was 0. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
| SSP_ERR_UNDERFLOW | The transmit FIFO underflowed before it was reloaded. |
If a transfer instance is provided for read, reset the transfer.
If a transfer instance is provided for write, reset the transfer.
Make sure transmission is enabled.