#include "hpm_common.h"
#include "hpm_i2s_common.h"
#include "hpm_gptmr_drv.h"
#include "hpm_spi_drv.h"
#include "hpm_clock_drv.h"
#include "hpm_dma_mgr.h"
Go to the source code of this file.
|
| void | hpm_i2s_master_over_spi_transfer_complete_callback (hpm_i2s_over_spi_t *i2s) |
| | Transfer complete callback for i2s master over spi. More...
|
| |
| hpm_stat_t | hpm_i2s_master_over_spi_init (hpm_i2s_over_spi_t *i2s) |
| | Initialization for i2s master over spi. More...
|
| |
| bool | hpm_i2s_master_over_spi_tx_is_busy (hpm_i2s_over_spi_t *i2s) |
| | Check if i2s master over spiis busy. More...
|
| |
| hpm_stat_t | hpm_i2s_master_over_spi_tx_buffer_nonblocking (hpm_i2s_over_spi_t *i2s, uint8_t protocol, uint32_t lrck_hz, uint8_t audio_depth, uint8_t *data, uint32_t size) |
| |
| hpm_stat_t | hpm_i2s_master_over_spi_tx_buffer (hpm_i2s_over_spi_t *i2s, uint8_t protocol, uint32_t lrck_hz, uint8_t audio_depth, uint8_t *data, uint32_t size) |
| | Transmit for i2s master over spi. More...
|
| |
| hpm_stat_t | hpm_i2s_master_over_spi_tx_stop (hpm_i2s_over_spi_t *i2s) |
| | Stop Transmission for i2s master over spi. More...
|
| |
| hpm_stat_t | hpm_i2s_master_over_spi_rx_config (hpm_i2s_over_spi_t *i2s, uint8_t protocol, uint32_t lrck_hz, uint32_t audio_depth, uint8_t *buffer0, uint8_t *buffer1, uint32_t size) |
| | Receiving configuration for i2s master over spi. More...
|
| |
| hpm_stat_t | hpm_i2s_master_over_spi_rx_start (hpm_i2s_over_spi_t *i2s, i2s_rx_data_tc callback) |
| | Start receiving for i2s master over spi. More...
|
| |
| hpm_stat_t | hpm_i2s_master_over_spi_rx_stop (hpm_i2s_over_spi_t *i2s) |
| | Stop receiving for i2s master over spi. More...
|
| |
◆ hpm_i2s_over_spi_t
◆ i2s_rx_data_tc
| typedef void(* i2s_rx_data_tc) (uint32_t cb_data_ptr) |
◆ hpm_i2s_master_over_spi_init()
Initialization for i2s master over spi.
- Parameters
-
| [in] | i2s | i2s over spi context |
- Return values
-
| status_success | if no error occurred |
◆ hpm_i2s_master_over_spi_rx_config()
| hpm_stat_t hpm_i2s_master_over_spi_rx_config |
( |
hpm_i2s_over_spi_t * |
i2s, |
|
|
uint8_t |
protocol, |
|
|
uint32_t |
lrck_hz, |
|
|
uint32_t |
audio_depth, |
|
|
uint8_t * |
buffer0, |
|
|
uint8_t * |
buffer1, |
|
|
uint32_t |
size |
|
) |
| |
Receiving configuration for i2s master over spi.
- Parameters
-
| [in] | i2s | i2s over spi context |
| [in] | protocol | i2s protocol, only support I2S_PROTOCOL_MSB_JUSTIFIED I2S_PROTOCOL_LSB_JUSTIFIED |
| [in] | lrck_hz | switch left and right channels frequency, unit: hz |
| [in] | audio_depth | audio depth only support 16bits and 32bits |
| [in] | buffer0 | buffer0 pointer |
| [in] | buffer1 | buffer1 pointer |
| [in] | size | receive size |
- Return values
-
| status_success | if no error occurred |
◆ hpm_i2s_master_over_spi_rx_start()
Start receiving for i2s master over spi.
- Parameters
-
| [in] | i2s | i2s over spi context |
| [in] | callback | callback after each buffer is received |
- Return values
-
| status_success | if no error occurred |
◆ hpm_i2s_master_over_spi_rx_stop()
Stop receiving for i2s master over spi.
- Parameters
-
| [in] | i2s | i2s over spi context |
- Return values
-
| status_success | if no error occurred |
◆ hpm_i2s_master_over_spi_transfer_complete_callback()
Transfer complete callback for i2s master over spi.
- Parameters
-
| [in] | i2s | i2s over spi context |
◆ hpm_i2s_master_over_spi_tx_buffer()
| hpm_stat_t hpm_i2s_master_over_spi_tx_buffer |
( |
hpm_i2s_over_spi_t * |
i2s, |
|
|
uint8_t |
protocol, |
|
|
uint32_t |
lrck_hz, |
|
|
uint8_t |
audio_depth, |
|
|
uint8_t * |
data, |
|
|
uint32_t |
size |
|
) |
| |
Transmit for i2s master over spi.
- Parameters
-
| [in] | i2s | i2s over spi context |
| [in] | protocol | i2s protocol, only support I2S_PROTOCOL_MSB_JUSTIFIED I2S_PROTOCOL_LSB_JUSTIFIED |
| [in] | lrck_hz | switch left and right channels frequency, unit: hz |
| [in] | audio_depth | audio depth only support 16bits and 32bits |
| [in] | data | data pointer |
| [in] | size | transmit size |
- Return values
-
| status_success | if no error occurred |
◆ hpm_i2s_master_over_spi_tx_buffer_nonblocking()
| hpm_stat_t hpm_i2s_master_over_spi_tx_buffer_nonblocking |
( |
hpm_i2s_over_spi_t * |
i2s, |
|
|
uint8_t |
protocol, |
|
|
uint32_t |
lrck_hz, |
|
|
uint8_t |
audio_depth, |
|
|
uint8_t * |
data, |
|
|
uint32_t |
size |
|
) |
| |
Transmit for i2s master over spi in a non-blocking.
This function initializes and starts a transmission operation to send audio data to an I2S Over SPI master mode device via the SPI interface without blocking the current execution flow until the transfer is complete.
- Parameters
-
| i2s | i2s over spi context |
| protocol | i2s protocol, only support I2S_PROTOCOL_MSB_JUSTIFIED I2S_PROTOCOL_LSB_JUSTIFIED |
| lrck_hz | switch left and right channels frequency, unit: hz |
| audio_depth | audio depth only support 16bits and 32bits |
| data | Pointer to the audio data to be transmitted. |
| size | Total size of the audio data to be transmitted in bytes. |
- Returns
- status_success if no error occurred
◆ hpm_i2s_master_over_spi_tx_is_busy()
Check if i2s master over spiis busy.
This function determines whether the I2S-over-SPI master device is currently busy transmitting data. It is typically used during I2S communication to ensure that the device is not processing data, thus avoiding data conflicts or overwriting.
- Parameters
-
- Returns
- Returns a bool value indicating the transmission status of the I2S-over-SPI master device. Returns true if the device is busy, and false if the device is idle.
◆ hpm_i2s_master_over_spi_tx_stop()
Stop Transmission for i2s master over spi.
- Parameters
-
| [in] | i2s | i2s over spi context |
- Return values
-
| status_success | if no error occurred |