pub unsafe extern "C" fn i2s_channel_register_event_callback(
    handle: i2s_chan_handle_t,
    callbacks: *const i2s_event_callbacks_t,
    user_data: *mut c_void
) -> esp_err_t
Expand description

@brief Set event callbacks for I2S channel

@note Only allowed to be called when the channel state is REGISTERED / READY, (i.e., before channel starts) @note User can deregister a previously registered callback by calling this function and setting the callback member in the callbacks structure to NULL. @note When CONFIG_I2S_ISR_IRAM_SAFE is enabled, the callback itself and functions called by it should be placed in IRAM. The variables used in the function should be in the SRAM as well. The user_data should also reside in SRAM or internal RAM as well.

@param[in] handle I2S channel handler @param[in] callbacks Group of callback functions @param[in] user_data User data, which will be passed to callback functions directly @return - ESP_OK Set event callbacks successfully - ESP_ERR_INVALID_ARG Set event callbacks failed because of invalid argument - ESP_ERR_INVALID_STATE Set event callbacks failed because the current channel state is not REGISTERED or READY