Function esp_idf_sys::i2s_read

source ยท
pub unsafe extern "C" fn i2s_read(
    i2s_num: i2s_port_t,
    dest: *mut c_void,
    size: usize,
    bytes_read: *mut usize,
    ticks_to_wait: TickType_t,
) -> esp_err_t
Expand description

@brief Read data from I2S DMA receive buffer

@param i2s_num I2S port number

@param dest Destination address to read into

@param size Size of data in bytes

@param[out] bytes_read Number of bytes read, if timeout, bytes read will be less than the size passed in.

@param ticks_to_wait RX buffer wait timeout in RTOS ticks. If this many ticks pass without bytes becoming available in the DMA receive buffer, then the function will return (note that if data is read from the DMA buffer in pieces, the overall operation may still take longer than this timeout.) Pass portMAX_DELAY for no timeout.

@note If the built-in ADC mode is enabled, we should call i2s_adc_enable and i2s_adc_disable around the whole reading process, to prevent the data getting corrupted.

@return - ESP_OK Success - ESP_ERR_INVALID_ARG Parameter error