Function esp_idf_sys::i2s_channel_init_tdm_mode

source ยท
pub unsafe extern "C" fn i2s_channel_init_tdm_mode(
    handle: i2s_chan_handle_t,
    tdm_cfg: *const i2s_tdm_config_t,
) -> esp_err_t
Expand description

@brief Initialize i2s channel to TDM mode @note Only allowed to be called when the channel state is REGISTERED, (i.e., channel has been allocated, but not initialized) and the state will be updated to READY if initialization success, otherwise the state will return to REGISTERED.

@param[in] handle I2S channel handler @param[in] tdm_cfg Configurations for TDM mode, including clock, slot and gpio The clock configuration can be generated by the helper macro I2S_TDM_CLK_DEFAULT_CONFIG The slot configuration can be generated by the helper macro I2S_TDM_PHILIPS_SLOT_DEFAULT_CONFIG, I2S_TDM_PCM_SHORT_SLOT_DEFAULT_CONFIG, I2S_TDM_PCM_LONG_SLOT_DEFAULT_CONFIG or I2S_TDM_MSB_SLOT_DEFAULT_CONFIG

@return - ESP_OK Initialize successfully - ESP_ERR_NO_MEM No memory for storing the channel information - ESP_ERR_INVALID_ARG NULL pointer or invalid configuration - ESP_ERR_INVALID_STATE This channel is not registered