Function esp_idf_hal::sys::i2s_write_expand
source ยท pub unsafe extern "C" fn i2s_write_expand(
i2s_num: u32,
src: *const c_void,
size: usize,
src_bits: usize,
aim_bits: usize,
bytes_written: *mut usize,
ticks_to_wait: u32,
) -> i32
Expand description
@brief Write data to I2S DMA transmit buffer while expanding the number of bits per sample. For example, expanding 16-bit PCM to 32-bit PCM.
@param i2s_num I2S port number
@param src Source address to write from
@param size Size of data in bytes
@param src_bits Source audio bit
@param aim_bits Bit wanted, no more than 32, and must be greater than src_bits
@param[out] bytes_written Number of bytes written, if timeout, the result will be less than the size passed in.
@param ticks_to_wait TX buffer wait timeout in RTOS ticks. If this many ticks pass without space becoming available in the DMA transmit buffer, then the function will return (note that if the data is written to the DMA buffer in pieces, the overall operation may still take longer than this timeout.) Pass portMAX_DELAY for no timeout.
Format of the data in source buffer is determined by the I2S configuration (see i2s_config_t).
@return - ESP_OK Success - ESP_ERR_INVALID_ARG Parameter error