Data transfers functions. More...
Functions | |
hal_status_t | hal_i2s_transmit (i2s_handle_t *p_i2s, uint16_t *p_data, uint32_t length, uint32_t timeout) |
Transmit an amount of data in blocking mode. More... | |
hal_status_t | hal_i2s_receive (i2s_handle_t *p_i2s, uint16_t *p_data, uint32_t length, uint32_t timeout) |
Receive an amount of data in blocking mode. More... | |
hal_status_t | hal_i2s_transmit_receive (i2s_handle_t *p_i2s, uint16_t *p_tx_data, uint16_t *p_rx_data, uint32_t length, uint32_t timeout) |
Transmit and Receive an amount of data in blocking mode. More... | |
hal_status_t | hal_i2s_transmit_it (i2s_handle_t *p_i2s, uint16_t *p_data, uint32_t length) |
Transmit an amount of data in non-blocking mode with Interrupt. More... | |
hal_status_t | hal_i2s_receive_it (i2s_handle_t *p_i2s, uint16_t *p_data, uint32_t length) |
Receive an amount of data in non-blocking mode with Interrupt. More... | |
hal_status_t | hal_i2s_transmit_receive_it (i2s_handle_t *p_i2s, uint16_t *p_tx_data, uint16_t *p_rx_data, uint32_t length) |
Transmit and Receive an amount of data in non-blocking mode with Interrupt. More... | |
hal_status_t | hal_i2s_transmit_dma (i2s_handle_t *p_i2s, uint16_t *p_data, uint32_t length) |
Transmit an amount of data in non-blocking mode with DMA. More... | |
hal_status_t | hal_i2s_receive_dma (i2s_handle_t *p_i2s, uint16_t *p_data, uint32_t length) |
Receive an amount of data in non-blocking mode with DMA. More... | |
hal_status_t | hal_i2s_transmit_receive_dma (i2s_handle_t *p_i2s, uint16_t *p_tx_data, uint16_t *p_rx_data, uint32_t length) |
Transmit and Receive an amount of data in non-blocking mode with DMA. More... | |
hal_status_t | hal_i2s_transmit_dma_sg_llp (i2s_handle_t *p_i2s, uint16_t *p_data, uint32_t length, dma_sg_llp_config_t *p_sg_llp_config) |
Transmit an amount of data in non-blocking mode with DMA. More... | |
hal_status_t | hal_i2s_receive_dma_sg_llp (i2s_handle_t *p_i2s, uint16_t *p_data, uint32_t length, dma_sg_llp_config_t *p_sg_llp_config) |
Receive an amount of data in non-blocking mode with DMA. More... | |
hal_status_t | hal_i2s_transmit_receive_dma_sg_llp (i2s_handle_t *p_i2s, uint16_t *p_tx_data, uint16_t *p_rx_data, uint32_t length, dma_sg_llp_config_t *p_sg_llp_config) |
Transmit and Receive an amount of data in non-blocking mode with DMA. More... | |
hal_status_t | hal_i2s_start_clock (i2s_handle_t *p_i2s) |
Start the I2S master clock. More... | |
hal_status_t | hal_i2s_stop_clock (i2s_handle_t *p_i2s) |
Stop the I2S master clock. More... | |
hal_status_t | hal_i2s_abort (i2s_handle_t *p_i2s) |
Abort ongoing transfer (blocking mode). More... | |
Data transfers functions.
============================================================================== ##### IO operation functions ##### =============================================================================== [..] This subsection provides a set of functions allowing to manage the I2S data transfers. [..] The I2S supports master and slave mode: (#) There are two modes of transfer: (++) Blocking mode: The communication is performed in polling mode. The HAL status of all data processing is returned by the same function after finishing transfer. (++) No-Blocking mode: The communication is performed using Interrupts or DMA, These APIs return the HAL status. The end of the data processing will be indicated through the dedicated I2S IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. The hal_i2s_tx_cplt_callback(), hal_i2s_rx_cplt_callback() and hal_i2s_tx_rx_cplt_callback() user callbacks will be executed respectively at the end of the transmit or Receive process The hal_i2s_error_callback() user callback will be executed when a communication error is detected. (#) APIs provided for these 2 transfer modes (Blocking mode or Non blocking mode using either Interrupt or DMA) exist for 1-Line (simplex) and 2-Line (full duplex) modes.
hal_status_t hal_i2s_abort | ( | i2s_handle_t * | p_i2s | ) |
Abort ongoing transfer (blocking mode).
[in] | p_i2s | I2S handle. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_receive | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_data, | ||
uint32_t | length, | ||
uint32_t | timeout | ||
) |
Receive an amount of data in blocking mode.
[in] | p_i2s | Pointer to an I2S handle which contains the configuration information for the specified I2S module. |
[out] | p_data | Pointer to data buffer |
[in] | length | Amount of data to be received in halfword, data of a channel. For example, when 32 bytes of data need to be sent in each of the left and right channels, length = 16. |
[in] | timeout | Timeout duration |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_receive_dma | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_data, | ||
uint32_t | length | ||
) |
Receive an amount of data in non-blocking mode with DMA.
[in] | p_i2s | Pointer to an I2S handle which contains the configuration information for the specified I2S module. |
[out] | p_data | Pointer to data buffer |
[in] | length | Amount of data to be sent in halfword, data of a channel, ranging between 1 and 4095. For example, when 32 bytes of data need to be sent in each of the left and right channels, length = 16. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_receive_dma_sg_llp | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_data, | ||
uint32_t | length, | ||
dma_sg_llp_config_t * | p_sg_llp_config | ||
) |
Receive an amount of data in non-blocking mode with DMA.
[in] | p_i2s | Pointer to an I2S handle which contains the configuration information for the specified I2S module. |
[out] | p_data | Pointer to data buffer |
[in] | length | Amount of data to be sent in halfword, data of a channel, ranging between 1 and 4095. For example, when 32 bytes of data need to be sent in each of the left and right channels, length = 16. |
[in] | p_sg_llp_config | Pointer to the config of source and destination's SG and LLP. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_receive_it | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_data, | ||
uint32_t | length | ||
) |
Receive an amount of data in non-blocking mode with Interrupt.
[in] | p_i2s | Pointer to an I2S handle which contains the configuration information for the specified I2S module. |
[out] | p_data | Pointer to data buffer |
[in] | length | Amount of data to be sent in halfword, data of a channel. For example, when 32 bytes of data need to be sent in each of the left and right channels, length = 16. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_start_clock | ( | i2s_handle_t * | p_i2s | ) |
Start the I2S master clock.
[in] | p_i2s | Pointer to an I2S handle which contains the configuration information for the specified I2S module. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_stop_clock | ( | i2s_handle_t * | p_i2s | ) |
Stop the I2S master clock.
[in] | p_i2s | Pointer to an I2S handle which contains the configuration information for the specified I2S module. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_transmit | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_data, | ||
uint32_t | length, | ||
uint32_t | timeout | ||
) |
Transmit an amount of data in blocking mode.
[in] | p_i2s | Pointer to an I2S handle which contains the configuration information for the specified I2S module. |
[in] | p_data | Pointer to data buffer |
[in] | length | Amount of data to be sent in halfword, data of a channel. For example, when 32 bytes of data need to be sent in each of the left and right channels, length = 16. |
[in] | timeout | Timeout duration |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_transmit_dma | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_data, | ||
uint32_t | length | ||
) |
Transmit an amount of data in non-blocking mode with DMA.
[in] | p_i2s | Pointer to an I2S handle which contains the configuration information for the specified I2S module. |
[in] | p_data | Pointer to data buffer |
[in] | length | Amount of data to be sent in halfword, data of a channel, ranging between 1 and 4095. For example, when 32 bytes of data need to be sent in each of the left and right channels, length = 16. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_transmit_dma_sg_llp | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_data, | ||
uint32_t | length, | ||
dma_sg_llp_config_t * | p_sg_llp_config | ||
) |
Transmit an amount of data in non-blocking mode with DMA.
[in] | p_i2s | Pointer to an I2S handle which contains the configuration information for the specified I2S module. |
[in] | p_data | Pointer to data buffer |
[in] | length | Amount of data to be sent in halfword, data of a channel, ranging between 1 and 4095. For example, when 32 bytes of data need to be sent in each of the left and right channels, length = 16. |
[in] | p_sg_llp_config | Pointer to the config of source and destination's SG and LLP. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_transmit_it | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_data, | ||
uint32_t | length | ||
) |
Transmit an amount of data in non-blocking mode with Interrupt.
[in] | p_i2s | Pointer to an I2S handle which contains the configuration information for the specified I2S module. |
[in] | p_data | Pointer to data buffer |
[in] | length | Amount of data to be sent in halfword, data of a channel. For example, when 32 bytes of data need to be sent in each of the left and right channels, length = 16. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_transmit_receive | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_tx_data, | ||
uint16_t * | p_rx_data, | ||
uint32_t | length, | ||
uint32_t | timeout | ||
) |
Transmit and Receive an amount of data in blocking mode.
[in] | p_i2s | Pointer to a I2S handle which contains the configuration information for the specified I2S module. |
[in] | p_tx_data | Pointer to transmission data buffer |
[out] | p_rx_data | Pointer to reception data buffer |
[in] | length | Amount of data to be sent and received in bytes |
[in] | timeout | Timeout duration |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_transmit_receive_dma | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_tx_data, | ||
uint16_t * | p_rx_data, | ||
uint32_t | length | ||
) |
Transmit and Receive an amount of data in non-blocking mode with DMA.
[in] | p_i2s | Pointer to a I2S handle which contains the configuration information for the specified I2S module. |
[in] | p_tx_data | Pointer to transmission data buffer |
[out] | p_rx_data | Pointer to reception data buffer |
[in] | length | Amount of data to be sent in bytes, ranging between 0 and 4095. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_transmit_receive_dma_sg_llp | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_tx_data, | ||
uint16_t * | p_rx_data, | ||
uint32_t | length, | ||
dma_sg_llp_config_t * | p_sg_llp_config | ||
) |
Transmit and Receive an amount of data in non-blocking mode with DMA.
[in] | p_i2s | Pointer to a I2S handle which contains the configuration information for the specified I2S module. |
[in] | p_tx_data | Pointer to transmission data buffer |
[out] | p_rx_data | Pointer to reception data buffer |
[in] | length | Amount of data to be sent in bytes, ranging between 0 and 4095. |
[in] | p_sg_llp_config | Pointer to the config of source and destination's SG and LLP. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_i2s_transmit_receive_it | ( | i2s_handle_t * | p_i2s, |
uint16_t * | p_tx_data, | ||
uint16_t * | p_rx_data, | ||
uint32_t | length | ||
) |
Transmit and Receive an amount of data in non-blocking mode with Interrupt.
[in] | p_i2s | Pointer to a I2S handle which contains the configuration information for the specified SPI module. |
[in] | p_tx_data | Pointer to transmission data buffer |
[out] | p_rx_data | Pointer to reception data buffer |
[in] | length | Amount of data to be sent and received in bytes |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |