The core functions for using an RTOS I2S driver instance after it has been initialized and started. These functions may be used by both the host and any client tiles that RPC has been enabled for.
◆ rtos_i2s_rx()
size_t rtos_i2s_rx |
( |
rtos_i2s_t * |
ctx, |
|
|
int32_t * |
i2s_sample_buf, |
|
|
size_t |
frame_count, |
|
|
unsigned |
timeout |
|
) |
| |
|
inline |
Receives sample frames from the I2S interface.
This function will block until new frames are available.
- Parameters
-
ctx | A pointer to the I2S driver instance to use. |
i2s_sample_buf | A buffer to copy the received sample frames into. |
frame_count | The number of frames to receive from the buffer. This must be less than or equal to the size of the input buffer specified to rtos_i2s_start(). |
timeout | The amount of time to wait before the requested number of frames becomes available. |
- Returns
- The number of frames actually received into
i2s_sample_buf
.
◆ rtos_i2s_tx()
size_t rtos_i2s_tx |
( |
rtos_i2s_t * |
ctx, |
|
|
int32_t * |
i2s_sample_buf, |
|
|
size_t |
frame_count, |
|
|
unsigned |
timeout |
|
) |
| |
|
inline |
Transmits sample frames out to the I2S interface.
The samples are stored into a buffer and are not necessarily sent out to the I2S interface before this function returns.
- Parameters
-
ctx | A pointer to the I2S driver instance to use. |
i2s_sample_buf | A buffer containing the sample frames to transmit out to the I2S interface. |
frame_count | The number of frames to transmit out from the buffer. This must be less than or equal to the size of the output buffer specified to rtos_i2s_start(). |
timeout | The amount of time to wait before there is enough space in the send buffer to accept the frames to be transmitted. |
- Returns
- The number of frames actually stored into the buffer.