Peripheral State and Errors functions

I2S control functions. More...

Functions

hal_i2s_state_t hal_i2s_get_state (i2s_handle_t *p_i2s)
 Return the I2S handle state. More...
 
uint32_t hal_i2s_get_error (i2s_handle_t *p_i2s)
 Return the I2S error code. More...
 
hal_status_t hal_i2s_set_tx_fifo_threshold (i2s_handle_t *p_i2s, uint32_t threshold)
 Set the TX FIFO threshold. More...
 
hal_status_t hal_i2s_set_rx_fifo_threshold (i2s_handle_t *p_i2s, uint32_t threshold)
 Set the RX FIFO threshold. More...
 
uint32_t hal_i2s_get_tx_fifo_threshold (i2s_handle_t *p_i2s)
 Get the TX FIFO threshold. More...
 
uint32_t hal_i2s_get_rx_fifo_threshold (i2s_handle_t *p_i2s)
 Get the RX FIFO threshold. More...
 
hal_status_t hal_i2s_suspend_reg (i2s_handle_t *p_i2s)
 Suspend some registers related to I2S configuration before sleep. More...
 
hal_status_t hal_i2s_resume_reg (i2s_handle_t *p_i2s)
 Restore some registers related to I2S configuration after sleep. This function must be used in conjunction with the hal_i2s_suspend_reg(). More...
 

Detailed Description

I2S control functions.

 ===============================================================================
                      ##### Peripheral State and Errors functions #####
 ===============================================================================
    [..]
    This subsection provides a set of functions allowing to control the I2S.
     (+) hal_i2s_get_state() API can be helpful to check in run-time the state of the I2S peripheral
     (+) hal_i2s_get_error() check in run-time Errors occurring during communication
     (+) hal_i2s_set_timeout() set the timeout during internal process
     (+) hal_i2s_set_tx_fifo_threshold() set the TX FIFO Threshold
     (+) hal_i2s_set_rx_fifo_threshold() set the RX FIFO Threshold
     (+) hal_i2s_get_tx_fifo_threshold() get the TX FIFO Threshold
     (+) hal_i2s_get_rx_fifo_threshold() get the RX FIFO Threshold

Function Documentation

◆ hal_i2s_get_error()

uint32_t hal_i2s_get_error ( i2s_handle_t p_i2s)

Return the I2S error code.

Parameters
[in]p_i2sPointer to an I2S handle which contains the configuration information for the specified I2S module.
Returns
I2S error code in bitmap format

◆ hal_i2s_get_rx_fifo_threshold()

uint32_t hal_i2s_get_rx_fifo_threshold ( i2s_handle_t p_i2s)

Get the RX FIFO threshold.

Parameters
[in]p_i2sPointer to an I2S handle which contains the configuration information for the specified I2S module.
Returns
RX FIFO threshold

◆ hal_i2s_get_state()

hal_i2s_state_t hal_i2s_get_state ( i2s_handle_t p_i2s)

Return the I2S handle state.

Parameters
[in]p_i2sPointer to an I2S handle which contains the configuration information for the specified I2S module.
Return values
HAL_I2S_STATE_RESETPeripheral not initialized.
HAL_I2S_STATE_READYPeripheral initialized and ready for use.
HAL_I2S_STATE_BUSYAn internal process is ongoing.
HAL_I2S_STATE_BUSY_TXData Transmii2son process is ongoing.
HAL_I2S_STATE_BUSY_RXData Reception process is ongoing.
HAL_I2S_STATE_ABORTPeripheral with abort request ongoing.
HAL_I2S_STATE_ERRORPeripheral in error.

◆ hal_i2s_get_tx_fifo_threshold()

uint32_t hal_i2s_get_tx_fifo_threshold ( i2s_handle_t p_i2s)

Get the TX FIFO threshold.

Parameters
[in]p_i2sPointer to an I2S handle which contains the configuration information for the specified I2S module.
Returns
TX FIFO threshold

◆ hal_i2s_resume_reg()

hal_status_t hal_i2s_resume_reg ( i2s_handle_t p_i2s)

Restore some registers related to I2S configuration after sleep. This function must be used in conjunction with the hal_i2s_suspend_reg().

Parameters
[in]p_i2sPointer to a I2S handle which contains the configuration information for the specified I2S module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_i2s_set_rx_fifo_threshold()

hal_status_t hal_i2s_set_rx_fifo_threshold ( i2s_handle_t p_i2s,
uint32_t  threshold 
)

Set the RX FIFO threshold.

Parameters
[in]p_i2sPointer to an I2S handle which contains the configuration information for the specified I2S module.
[in]thresholdRX FIFO threshold value ranging bwtween 0x0U ~ 0x7U.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_i2s_set_tx_fifo_threshold()

hal_status_t hal_i2s_set_tx_fifo_threshold ( i2s_handle_t p_i2s,
uint32_t  threshold 
)

Set the TX FIFO threshold.

Parameters
[in]p_i2sPointer to an I2S handle which contains the configuration information for the specified I2S module.
[in]thresholdTX FIFO threshold value ranging bwtween 0x0U ~ 0x7U.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_i2s_suspend_reg()

hal_status_t hal_i2s_suspend_reg ( i2s_handle_t p_i2s)

Suspend some registers related to I2S configuration before sleep.

Parameters
[in]p_i2sPointer to a I2S handle which contains the configuration information for the specified I2S module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.