Data Structures | |
struct | i2s_user_config_t |
I2S user configuration structure. More... | |
Enumerations | |
enum | i2s_transfer_type_t { I2S_USING_INTERRUPT = 0U, I2S_USING_DMA = 1U } |
Defines the transfer type. More... | |
enum | i2s_mode_t { I2S_MASTER = 0U, I2S_SLAVE = 1U } |
Master or slave. More... | |
Functions | |
status_t | I2S_Init (const i2s_instance_t *instance, const i2s_user_config_t *config) |
Initializes the I2S module. More... | |
status_t | I2S_Deinit (const i2s_instance_t *instance) |
De-initializes the I2S module. More... | |
status_t | I2S_GetBaudRate (const i2s_instance_t *instance, uint32_t *configuredBaudRate) |
Returns the i2s baud rate. More... | |
status_t | I2S_SetTxBuffer (const i2s_instance_t *instance, const uint8_t *txBuff, uint32_t txSize) |
Keep sending. More... | |
status_t | I2S_SetRxBuffer (const i2s_instance_t *instance, uint8_t *rxBuff, uint32_t rxSize) |
Keep receiving. More... | |
status_t | I2S_SendDataBlocking (const i2s_instance_t *instance, const uint8_t *txBuff, uint32_t txSize, uint32_t timeout) |
Perform a blocking I2S transmission. More... | |
status_t | I2S_SendData (const i2s_instance_t *instance, const uint8_t *txBuff, uint32_t txSize) |
Perform a non-blocking I2S transmission. More... | |
status_t | I2S_GetStatus (const i2s_instance_t *instance, uint32_t *countRemaining) |
Get the status of the current I2S transfer. More... | |
status_t | I2S_ReceiveDataBlocking (const i2s_instance_t *instance, uint8_t *rxBuff, uint32_t rxSize, uint32_t timeout) |
Perform a blocking I2S reception. More... | |
status_t | I2S_ReceiveData (const i2s_instance_t *instance, uint8_t *rxBuff, uint32_t rxSize) |
Perform a non-blocking I2S reception. More... | |
status_t | I2S_Abort (const i2s_instance_t *instance) |
Terminates a non-blocking transfer early. More... | |
enum i2s_mode_t |
enum i2s_transfer_type_t |
status_t I2S_Abort | ( | const i2s_instance_t * | instance | ) |
status_t I2S_Deinit | ( | const i2s_instance_t * | instance | ) |
status_t I2S_GetBaudRate | ( | const i2s_instance_t * | instance, |
uint32_t * | configuredBaudRate | ||
) |
status_t I2S_GetStatus | ( | const i2s_instance_t * | instance, |
uint32_t * | countRemaining | ||
) |
Get the status of the current I2S transfer.
instance | Instance number |
countRemaining | Pointer to value that is populated with the number of words that have been sent in the active transfer |
STATUS_SUCCESS | The transmit has completed successfully. |
STATUS_BUSY | The transmit is still in progress. will be filled with the number of words that have been transferred so far. |
STATUS_I2S_ABORTED | The transmit was aborted. |
STATUS_TIMEOUT | A timeout was reached. |
STATUS_ERROR | An error occurred. |
status_t I2S_Init | ( | const i2s_instance_t * | instance, |
const i2s_user_config_t * | config | ||
) |
Initializes the I2S module.
This function initializes and enables the requested I2S module. Note that when use I2S over SAI, tx and rx line are separated with SAI0, with other SAI instance tx and rx share one line.
[in] | instance | Instance number |
[in] | config | The configuration structure |
status_t I2S_ReceiveData | ( | const i2s_instance_t * | instance, |
uint8_t * | rxBuff, | ||
uint32_t | rxSize | ||
) |
Perform a non-blocking I2S reception.
This function receives a block of data and returns immediately. The rest of the transmission is handled by the interrupt service routine (if the driver is initialized in interrupt mode).
[in] | instance | Instance number |
[in] | rxBuff | pointer to the data to be transferred |
[in] | rxSize | length in words of the data to be transferred |
status_t I2S_ReceiveDataBlocking | ( | const i2s_instance_t * | instance, |
uint8_t * | rxBuff, | ||
uint32_t | rxSize, | ||
uint32_t | timeout | ||
) |
Perform a blocking I2S reception.
This function receives a block of data and only returns when the transmission is complete.
[in] | instance | Instance number |
rxBuff | pointer to the receive buffer | |
rxSize | length in words of the data to be received | |
timeout | timeout for the transfer in milliseconds |
status_t I2S_SendData | ( | const i2s_instance_t * | instance, |
const uint8_t * | txBuff, | ||
uint32_t | txSize | ||
) |
Perform a non-blocking I2S transmission.
This function sends a block of data and returns immediately. The rest of the transmission is handled by the interrupt service routine (if the driver is initialized in interrupt mode).
[in] | instance | Instance number |
[in] | txBuff | pointer to the data to be transferred |
[in] | txSize | length in words of the data to be transferred |
status_t I2S_SendDataBlocking | ( | const i2s_instance_t * | instance, |
const uint8_t * | txBuff, | ||
uint32_t | txSize, | ||
uint32_t | timeout | ||
) |
Perform a blocking I2S transmission.
This function sends a block of data and only returns when the transmission is complete.
[in] | instance | Instance number |
[in] | txBuff | pointer to the data to be transferred |
[in] | txSize | length in words of the data to be transferred |
[in] | timeout | timeout value in milliseconds |
status_t I2S_SetRxBuffer | ( | const i2s_instance_t * | instance, |
uint8_t * | rxBuff, | ||
uint32_t | rxSize | ||
) |
Keep receiving.
This function must be called in callback function when RX_FULl event is reported to ensure rx operation working continuously.
[in] | instance | Instance number |
[in] | rxBuff | pointer to the data to be transferred |
[in] | rxSize | length in words of the data to be transferred |
status_t I2S_SetTxBuffer | ( | const i2s_instance_t * | instance, |
const uint8_t * | txBuff, | ||
uint32_t | txSize | ||
) |
Keep sending.
This function must be called in callback function when TX_EMPTY event is reported to ensure tx operation working continuously.
[in] | instance | Instance number |
[in] | txBuff | pointer to the data to be transferred |
[in] | txSize | length in words of the data to be transferred |