Peripherals
DAC
DAC driver has been redesigned (see DAC API Reference), which aims to unify the interface and extend the usage of DAC peripheral. Although it is recommended to use the new driver APIs, the legacy driver is still available in the previous include path driver/dac.h. However, by default, including driver/dac.h will bring a build warning like The legacy DAC driver is deprecated, please use 'driver/dac_oneshot.h', 'driver/dac_cosine.h' or 'driver/dac_continuous.h' instead. The warning can be suppressed by the Kconfig option CONFIG_DAC_SUPPRESS_DEPRECATE_WARN.
The major breaking changes in concept and usage are listed as follows:
Breaking Changes in Concepts
dac_channel_twhich was used to identify the hardware channel are removed from user space. The channel index now starts from0, so please use DAC_CHAN_0 and DAC_CHAN_1 instead. And in the new driver, DAC channels can be selected by usingdac_channel_mask_t. And these channels can be allocated in a same channel group which is represented bydac_channels_handle_t.dac_cw_scale_tis replaced bydac_cosine_atten_tto decouple the legacy driver and the new driver.dac_cw_phase_tis replaced bydac_cosine_phase_t. The enumerate value is now the phase angle directly.dac_cw_config_tis replaced bydac_cosine_config_t, but theen_chfield is removed because it should be specified while allocating the channel group.
Breaking Changes in Usage
dac_pad_get_io_numis removed.dac_output_voltageis replaced bydac_oneshot_output_voltage().dac_output_enableis removed. For oneshot mode, it will be enabled after the channel is allocated.dac_output_disableis removed. For oneshot mode, it will be disabled before the channel is deleted.dac_cw_generator_enableis replaced bydac_cosine_start().dac_cw_generator_disableis replaced bydac_cosine_stop().dac_cw_generator_configis replaced bydac_cosine_new_channel().
dac_i2s_enableis replaced bydac_continuous_enable(), but it needs to allocate the continuous DAC channel first bydac_continuous_new_channels().dac_i2s_disableis replaced bydac_continuous_disable().
GPSPI
Following items are deprecated. Since ESP-IDF v5.1, GPSPI clock source is configurable.
spi_get_actual_clockis deprecated, you should usespi_device_get_actual_freq()instead.
LEDC
soc_periph_ledc_clk_src_legacy_t::LEDC_USE_RTC8M_CLKis deprecated. Please useLEDC_USE_RC_FAST_CLKinstead.