i2s_channel_register_event_callback() function
Set event callbacks for I2S channel
Arguments
handle
I2S channel handler
callbacks
Group of callback functions
user_data
User data, which will be passed to callback functions directly
Return value
- 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
Notes
Only allowed to be called when the channel state is REGISTERED / READY, (i.e., before channel starts) User can deregister a previously registered callback by calling this function and setting the callback member in the `callbacks` structure to NULL. 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.
i2s_channel_register_event_callback() calls 4 functions:
![]()
i2s_channel_register_event_callback()
i2s_channel_register_event_callback() reads 10 variables and writes 1 variable:
![]()
i2s_channel_register_event_callback()