mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-11-04 06:11:06 +00:00 
			
		
		
		
	driver: Remove features deprecated pre-IDF V4.0
This commit is contained in:
		
				
					committed by
					
						
						Angus Gratton
					
				
			
			
				
	
			
			
			
						parent
						
							f44d99b509
						
					
				
				
					commit
					f406d020d8
				
			@@ -1180,18 +1180,6 @@ esp_err_t i2s_driver_uninstall(i2s_port_t i2s_num)
 | 
				
			|||||||
    return ESP_OK;
 | 
					    return ESP_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int i2s_write_bytes(i2s_port_t i2s_num, const void *src, size_t size, TickType_t ticks_to_wait)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    size_t bytes_written = 0;
 | 
					 | 
				
			||||||
    int res = 0;
 | 
					 | 
				
			||||||
    res = i2s_write(i2s_num, src, size, &bytes_written, ticks_to_wait);
 | 
					 | 
				
			||||||
    if (res != ESP_OK) {
 | 
					 | 
				
			||||||
        return ESP_FAIL;
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
        return bytes_written;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
esp_err_t i2s_write(i2s_port_t i2s_num, const void *src, size_t size, size_t *bytes_written, TickType_t ticks_to_wait)
 | 
					esp_err_t i2s_write(i2s_port_t i2s_num, const void *src, size_t size, size_t *bytes_written, TickType_t ticks_to_wait)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    char *data_ptr, *src_byte;
 | 
					    char *data_ptr, *src_byte;
 | 
				
			||||||
@@ -1317,18 +1305,6 @@ esp_err_t i2s_write_expand(i2s_port_t i2s_num, const void *src, size_t size, siz
 | 
				
			|||||||
    return ESP_OK;
 | 
					    return ESP_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int i2s_read_bytes(i2s_port_t i2s_num, void *dest, size_t size, TickType_t ticks_to_wait)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    size_t bytes_read = 0;
 | 
					 | 
				
			||||||
    int res = 0;
 | 
					 | 
				
			||||||
    res = i2s_read(i2s_num, dest, size, &bytes_read, ticks_to_wait);
 | 
					 | 
				
			||||||
    if (res != ESP_OK) {
 | 
					 | 
				
			||||||
        return ESP_FAIL;
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
        return bytes_read;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
esp_err_t i2s_read(i2s_port_t i2s_num, void *dest, size_t size, size_t *bytes_read, TickType_t ticks_to_wait)
 | 
					esp_err_t i2s_read(i2s_port_t i2s_num, void *dest, size_t size, size_t *bytes_read, TickType_t ticks_to_wait)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    char *data_ptr, *dest_byte;
 | 
					    char *data_ptr, *dest_byte;
 | 
				
			||||||
@@ -1367,29 +1343,3 @@ esp_err_t i2s_read(i2s_port_t i2s_num, void *dest, size_t size, size_t *bytes_re
 | 
				
			|||||||
    xSemaphoreGive(p_i2s_obj[i2s_num]->rx->mux);
 | 
					    xSemaphoreGive(p_i2s_obj[i2s_num]->rx->mux);
 | 
				
			||||||
    return ESP_OK;
 | 
					    return ESP_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
int i2s_push_sample(i2s_port_t i2s_num, const void *sample, TickType_t ticks_to_wait)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    size_t bytes_push = 0;
 | 
					 | 
				
			||||||
    int res = 0;
 | 
					 | 
				
			||||||
    I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_FAIL);
 | 
					 | 
				
			||||||
    res = i2s_write(i2s_num, sample, p_i2s_obj[i2s_num]->bytes_per_sample, &bytes_push, ticks_to_wait);
 | 
					 | 
				
			||||||
    if (res != ESP_OK) {
 | 
					 | 
				
			||||||
        return ESP_FAIL;
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
        return bytes_push;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int i2s_pop_sample(i2s_port_t i2s_num, void *sample, TickType_t ticks_to_wait)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    size_t bytes_pop = 0;
 | 
					 | 
				
			||||||
    int res = 0;
 | 
					 | 
				
			||||||
    I2S_CHECK((i2s_num < I2S_NUM_MAX), "i2s_num error", ESP_FAIL);
 | 
					 | 
				
			||||||
    res = i2s_read(i2s_num, sample, p_i2s_obj[i2s_num]->bytes_per_sample, &bytes_pop, ticks_to_wait);
 | 
					 | 
				
			||||||
    if (res != ESP_OK) {
 | 
					 | 
				
			||||||
        return ESP_FAIL;
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
        return bytes_pop;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -212,20 +212,6 @@ esp_err_t adc1_config_channel_atten(adc1_channel_t channel, adc_atten_t atten);
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
int adc1_get_raw(adc1_channel_t channel);
 | 
					int adc1_get_raw(adc1_channel_t channel);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** @cond */    //Doxygen command to hide deprecated function from API Reference
 | 
					 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * @note When the power switch of SARADC1, SARADC2, HALL sensor and AMP sensor is turned on,
 | 
					 | 
				
			||||||
 *       the input of GPIO36 and GPIO39 will be pulled down for about 80ns.
 | 
					 | 
				
			||||||
 *       When enabling power for any of these peripherals, ignore input from GPIO36 and GPIO39.
 | 
					 | 
				
			||||||
 *       Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue.
 | 
					 | 
				
			||||||
 *       
 | 
					 | 
				
			||||||
 * @deprecated This function returns an ADC1 reading but is deprecated due to
 | 
					 | 
				
			||||||
 * a misleading name and has been changed to directly call the new function.
 | 
					 | 
				
			||||||
 * Use the new function adc1_get_raw() instead
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
int adc1_get_voltage(adc1_channel_t channel) __attribute__((deprecated));
 | 
					 | 
				
			||||||
/** @endcond */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @brief Enable ADC power
 | 
					 * @brief Enable ADC power
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -42,25 +42,6 @@ typedef enum {
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
esp_err_t dac_pad_get_io_num(dac_channel_t channel, gpio_num_t *gpio_num);
 | 
					esp_err_t dac_pad_get_io_num(dac_channel_t channel, gpio_num_t *gpio_num);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** @cond */
 | 
					 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
  * @brief  Set DAC output voltage.
 | 
					 | 
				
			||||||
  *
 | 
					 | 
				
			||||||
  * @note Function has been deprecated, please use dac_output_voltage instead.
 | 
					 | 
				
			||||||
  *       This name will be removed in a future release.
 | 
					 | 
				
			||||||
  *       The difference is that before calling dac_output_voltage, we need to initialize the dac pad by dac_output_enable
 | 
					 | 
				
			||||||
  *
 | 
					 | 
				
			||||||
  *
 | 
					 | 
				
			||||||
  * @param channel DAC channel
 | 
					 | 
				
			||||||
  * @param dac_value DAC output value
 | 
					 | 
				
			||||||
  *
 | 
					 | 
				
			||||||
  * @return
 | 
					 | 
				
			||||||
  *     - ESP_OK success
 | 
					 | 
				
			||||||
  *     - ESP_ERR_INVALID_ARG Parameter error
 | 
					 | 
				
			||||||
  */
 | 
					 | 
				
			||||||
esp_err_t dac_out_voltage(dac_channel_t channel, uint8_t dac_value) __attribute__ ((deprecated));
 | 
					 | 
				
			||||||
/** @endcond */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @brief Set DAC output voltage.
 | 
					 * @brief Set DAC output voltage.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -286,18 +286,6 @@ esp_err_t i2s_driver_install(i2s_port_t i2s_num, const i2s_config_t *i2s_config,
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
esp_err_t i2s_driver_uninstall(i2s_port_t i2s_num);
 | 
					esp_err_t i2s_driver_uninstall(i2s_port_t i2s_num);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * @brief Write data to I2S DMA transmit buffer.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * This function is deprecated. Use 'i2s_write' instead.
 | 
					 | 
				
			||||||
 * This definition will be removed in a future release.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @return
 | 
					 | 
				
			||||||
 *     - The amount of bytes written, if timeout, the result will be less than the size passed in.
 | 
					 | 
				
			||||||
 *     - ESP_FAIL  Parameter error
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
int i2s_write_bytes(i2s_port_t i2s_num, const void *src, size_t size, TickType_t ticks_to_wait) __attribute__ ((deprecated));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @brief Write data to I2S DMA transmit buffer.
 | 
					 * @brief Write data to I2S DMA transmit buffer.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
@@ -353,18 +341,6 @@ esp_err_t i2s_write(i2s_port_t i2s_num, const void *src, size_t size, size_t *by
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
esp_err_t i2s_write_expand(i2s_port_t i2s_num, const void *src, size_t size, size_t src_bits, size_t aim_bits, size_t *bytes_written, TickType_t ticks_to_wait);
 | 
					esp_err_t i2s_write_expand(i2s_port_t i2s_num, const void *src, size_t size, size_t src_bits, size_t aim_bits, size_t *bytes_written, TickType_t ticks_to_wait);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * @brief Read data from I2S DMA receive buffer
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * This function is deprecated. Use 'i2s_read' instead.
 | 
					 | 
				
			||||||
 * This definition will be removed in a future release.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @return
 | 
					 | 
				
			||||||
 *     - The amount of bytes read, if timeout, bytes read will be less than the size passed in
 | 
					 | 
				
			||||||
 *     - ESP_FAIL  Parameter error
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
int i2s_read_bytes(i2s_port_t i2s_num, void *dest, size_t size, TickType_t ticks_to_wait) __attribute__ ((deprecated));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @brief Read data from I2S DMA receive buffer
 | 
					 * @brief Read data from I2S DMA receive buffer
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
@@ -387,42 +363,6 @@ int i2s_read_bytes(i2s_port_t i2s_num, void *dest, size_t size, TickType_t ticks
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
esp_err_t i2s_read(i2s_port_t i2s_num, void *dest, size_t size, size_t *bytes_read, TickType_t ticks_to_wait);
 | 
					esp_err_t i2s_read(i2s_port_t i2s_num, void *dest, size_t size, size_t *bytes_read, TickType_t ticks_to_wait);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * @brief Write a single sample to the I2S DMA TX buffer.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * This function is deprecated. Use 'i2s_write' instead.
 | 
					 | 
				
			||||||
 * This definition will be removed in a future release.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @param i2s_num         I2S_NUM_0, I2S_NUM_1
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @param sample          Buffer to read data. Size of buffer (in bytes) = bits_per_sample / 8.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @param ticks_to_wait   Timeout in RTOS ticks. If a sample is not available in the DMA buffer within this period, no data is read and function returns zero.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @return
 | 
					 | 
				
			||||||
 *     - Number of bytes successfully pushed to DMA buffer, will be either zero or the size of configured sample buffer (in bytes).
 | 
					 | 
				
			||||||
 *     - ESP_FAIL Parameter error
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
int i2s_push_sample(i2s_port_t i2s_num, const void *sample, TickType_t ticks_to_wait) __attribute__ ((deprecated));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * @brief Read a single sample from the I2S DMA RX buffer.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * This function is deprecated. Use 'i2s_read' instead.
 | 
					 | 
				
			||||||
 * This definition will be removed in a future release.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @param i2s_num         I2S_NUM_0, I2S_NUM_1
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @param sample          Buffer to write data. Size of buffer (in bytes) = bits_per_sample / 8.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @param ticks_to_wait   Timeout in RTOS ticks. If a sample is not available in the DMA buffer within this period, no data is read and function returns zero.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @return
 | 
					 | 
				
			||||||
 *     - Number of bytes successfully read from DMA buffer, will be either zero or the size of configured sample buffer (in bytes).
 | 
					 | 
				
			||||||
 *     - ESP_FAIL Parameter error
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
int i2s_pop_sample(i2s_port_t i2s_num, void *sample, TickType_t ticks_to_wait) __attribute__ ((deprecated));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @brief Set sample rate used for I2S RX and TX.
 | 
					 * @brief Set sample rate used for I2S RX and TX.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -126,10 +126,7 @@ typedef struct {
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
typedef struct {
 | 
					typedef struct {
 | 
				
			||||||
    ledc_mode_t speed_mode;                /*!< LEDC speed speed_mode, high-speed mode or low-speed mode */
 | 
					    ledc_mode_t speed_mode;                /*!< LEDC speed speed_mode, high-speed mode or low-speed mode */
 | 
				
			||||||
    union {
 | 
					    ledc_timer_bit_t duty_resolution;  /*!< LEDC channel duty resolution */
 | 
				
			||||||
        ledc_timer_bit_t duty_resolution;  /*!< LEDC channel duty resolution */
 | 
					 | 
				
			||||||
        ledc_timer_bit_t bit_num __attribute__((deprecated)); /*!< Deprecated in ESP-IDF 3.0. This is an alias to 'duty_resolution' for backward compatibility with ESP-IDF 2.1 */
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
    ledc_timer_t  timer_num;               /*!< The timer source of channel (0 - 3) */
 | 
					    ledc_timer_t  timer_num;               /*!< The timer source of channel (0 - 3) */
 | 
				
			||||||
    uint32_t freq_hz;                      /*!< LEDC timer frequency (Hz) */
 | 
					    uint32_t freq_hz;                      /*!< LEDC timer frequency (Hz) */
 | 
				
			||||||
    ledc_clk_cfg_t clk_cfg;                /*!< Configure LEDC source clock.
 | 
					    ledc_clk_cfg_t clk_cfg;                /*!< Configure LEDC source clock.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -221,21 +221,6 @@ typedef void (* filter_cb_t)(uint16_t *raw_value, uint16_t *filtered_value);
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
esp_err_t touch_pad_set_filter_read_cb(filter_cb_t read_cb);
 | 
					esp_err_t touch_pad_set_filter_read_cb(filter_cb_t read_cb);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * @brief   Register touch-pad ISR,
 | 
					 | 
				
			||||||
 * @note Deprecated function, users should replace this with touch_pad_isr_register,
 | 
					 | 
				
			||||||
 *       because RTC modules share a same interrupt index.
 | 
					 | 
				
			||||||
 * @param fn  Pointer to ISR handler
 | 
					 | 
				
			||||||
 * @param arg  Parameter for ISR
 | 
					 | 
				
			||||||
 * @param unused Reserved, not used
 | 
					 | 
				
			||||||
 * @param handle_unused Reserved, not used
 | 
					 | 
				
			||||||
 * @return
 | 
					 | 
				
			||||||
 *     - ESP_OK Success ;
 | 
					 | 
				
			||||||
 *     - ESP_ERR_INVALID_ARG GPIO error
 | 
					 | 
				
			||||||
 *     - ESP_ERR_NO_MEM No memory
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
esp_err_t touch_pad_isr_handler_register(void(*fn)(void *), void *arg, int unused, intr_handle_t *handle_unused) __attribute__ ((deprecated));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @brief   Register touch-pad ISR.
 | 
					 * @brief   Register touch-pad ISR.
 | 
				
			||||||
 *          The handler will be attached to the same CPU core that this function is running on.
 | 
					 *          The handler will be attached to the same CPU core that this function is running on.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -429,12 +429,6 @@ inline static touch_pad_t touch_pad_num_wrap(touch_pad_t touch_num)
 | 
				
			|||||||
    return touch_num;
 | 
					    return touch_num;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
esp_err_t touch_pad_isr_handler_register(void (*fn)(void *), void *arg, int no_use, intr_handle_t *handle_no_use)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    RTC_MODULE_CHECK(fn, "Touch_Pad ISR null", ESP_ERR_INVALID_ARG);
 | 
					 | 
				
			||||||
    return rtc_isr_register(fn, arg, RTC_CNTL_TOUCH_INT_ST_M);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
esp_err_t touch_pad_isr_register(intr_handler_t fn, void* arg)
 | 
					esp_err_t touch_pad_isr_register(intr_handler_t fn, void* arg)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    RTC_MODULE_CHECK(fn, "Touch_Pad ISR null", ESP_ERR_INVALID_ARG);
 | 
					    RTC_MODULE_CHECK(fn, "Touch_Pad ISR null", ESP_ERR_INVALID_ARG);
 | 
				
			||||||
@@ -1548,11 +1542,6 @@ int adc1_get_raw(adc1_channel_t channel)
 | 
				
			|||||||
    return adc_value;
 | 
					    return adc_value;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int adc1_get_voltage(adc1_channel_t channel)    //Deprecated. Use adc1_get_raw(void) instead
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    return adc1_get_raw(channel);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void adc1_ulp_enable(void)
 | 
					void adc1_ulp_enable(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    adc_power_on();
 | 
					    adc_power_on();
 | 
				
			||||||
@@ -1849,35 +1838,6 @@ esp_err_t dac_output_voltage(dac_channel_t channel, uint8_t dac_value)
 | 
				
			|||||||
    return ESP_OK;
 | 
					    return ESP_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
esp_err_t dac_out_voltage(dac_channel_t channel, uint8_t dac_value)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    RTC_MODULE_CHECK((channel >= DAC_CHANNEL_1) && (channel < DAC_CHANNEL_MAX), DAC_ERR_STR_CHANNEL_ERROR, ESP_ERR_INVALID_ARG);
 | 
					 | 
				
			||||||
    portENTER_CRITICAL(&rtc_spinlock);
 | 
					 | 
				
			||||||
    //Disable Tone
 | 
					 | 
				
			||||||
    CLEAR_PERI_REG_MASK(SENS_SAR_DAC_CTRL1_REG, SENS_SW_TONE_EN);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //Disable Channel Tone
 | 
					 | 
				
			||||||
    if (channel == DAC_CHANNEL_1) {
 | 
					 | 
				
			||||||
        CLEAR_PERI_REG_MASK(SENS_SAR_DAC_CTRL2_REG, SENS_DAC_CW_EN1_M);
 | 
					 | 
				
			||||||
    } else if (channel == DAC_CHANNEL_2) {
 | 
					 | 
				
			||||||
        CLEAR_PERI_REG_MASK(SENS_SAR_DAC_CTRL2_REG, SENS_DAC_CW_EN2_M);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    //Set the Dac value
 | 
					 | 
				
			||||||
    if (channel == DAC_CHANNEL_1) {
 | 
					 | 
				
			||||||
        SET_PERI_REG_BITS(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_DAC, dac_value, RTC_IO_PDAC1_DAC_S);   //dac_output
 | 
					 | 
				
			||||||
    } else if (channel == DAC_CHANNEL_2) {
 | 
					 | 
				
			||||||
        SET_PERI_REG_BITS(RTC_IO_PAD_DAC2_REG, RTC_IO_PDAC2_DAC, dac_value, RTC_IO_PDAC2_DAC_S);   //dac_output
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    portEXIT_CRITICAL(&rtc_spinlock);
 | 
					 | 
				
			||||||
    //dac pad init
 | 
					 | 
				
			||||||
    dac_rtc_pad_init(channel);
 | 
					 | 
				
			||||||
    dac_output_enable(channel);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return ESP_OK;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
esp_err_t dac_i2s_enable(void)
 | 
					esp_err_t dac_i2s_enable(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    portENTER_CRITICAL(&rtc_spinlock);
 | 
					    portENTER_CRITICAL(&rtc_spinlock);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -83,7 +83,7 @@ static void timer_frequency_test(ledc_channel_t channel, ledc_timer_bit_t timer_
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
    ledc_timer_config_t ledc_time_config = {
 | 
					    ledc_timer_config_t ledc_time_config = {
 | 
				
			||||||
        .speed_mode = speed_mode,
 | 
					        .speed_mode = speed_mode,
 | 
				
			||||||
        .bit_num = timer_bit,
 | 
					        .duty_resolution = timer_bit,
 | 
				
			||||||
        .timer_num = timer,
 | 
					        .timer_num = timer,
 | 
				
			||||||
        .freq_hz = 5000,
 | 
					        .freq_hz = 5000,
 | 
				
			||||||
        .clk_cfg = LEDC_AUTO_CLK,
 | 
					        .clk_cfg = LEDC_AUTO_CLK,
 | 
				
			||||||
@@ -124,7 +124,7 @@ static void timer_duty_test(ledc_channel_t channel, ledc_timer_bit_t timer_bit,
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
    ledc_timer_config_t ledc_time_config = {
 | 
					    ledc_timer_config_t ledc_time_config = {
 | 
				
			||||||
        .speed_mode = speed_mode,
 | 
					        .speed_mode = speed_mode,
 | 
				
			||||||
        .bit_num = timer_bit,
 | 
					        .duty_resolution = timer_bit,
 | 
				
			||||||
        .timer_num = timer,
 | 
					        .timer_num = timer,
 | 
				
			||||||
        .freq_hz = 5000,
 | 
					        .freq_hz = 5000,
 | 
				
			||||||
        .clk_cfg = LEDC_AUTO_CLK,
 | 
					        .clk_cfg = LEDC_AUTO_CLK,
 | 
				
			||||||
@@ -228,7 +228,7 @@ TEST_CASE("LEDC normal channel and timer config", "[ledc][test_env=UT_T1_LEDC]")
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    ledc_timer_config_t ledc_time_config = {
 | 
					    ledc_timer_config_t ledc_time_config = {
 | 
				
			||||||
        .speed_mode = LEDC_HIGH_SPEED_MODE,
 | 
					        .speed_mode = LEDC_HIGH_SPEED_MODE,
 | 
				
			||||||
        .bit_num = LEDC_TIMER_13_BIT,
 | 
					        .duty_resolution = LEDC_TIMER_13_BIT,
 | 
				
			||||||
        .timer_num = LEDC_TIMER_0,
 | 
					        .timer_num = LEDC_TIMER_0,
 | 
				
			||||||
        .freq_hz = 5000,
 | 
					        .freq_hz = 5000,
 | 
				
			||||||
        .clk_cfg = LEDC_AUTO_CLK,
 | 
					        .clk_cfg = LEDC_AUTO_CLK,
 | 
				
			||||||
@@ -298,7 +298,7 @@ TEST_CASE("LEDC timer set", "[ledc][test_env=UT_T1_LEDC]")
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    ledc_timer_config_t ledc_time_config = {
 | 
					    ledc_timer_config_t ledc_time_config = {
 | 
				
			||||||
        .speed_mode = LEDC_HIGH_SPEED_MODE,
 | 
					        .speed_mode = LEDC_HIGH_SPEED_MODE,
 | 
				
			||||||
        .bit_num = 13,
 | 
					        .duty_resolution = 13,
 | 
				
			||||||
        .timer_num = LEDC_TIMER_0,
 | 
					        .timer_num = LEDC_TIMER_0,
 | 
				
			||||||
        .freq_hz = 5000,
 | 
					        .freq_hz = 5000,
 | 
				
			||||||
        .clk_cfg = LEDC_AUTO_CLK,
 | 
					        .clk_cfg = LEDC_AUTO_CLK,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,7 +39,7 @@ esp_err_t mesh_light_init(void)
 | 
				
			|||||||
    s_light_inited = true;
 | 
					    s_light_inited = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ledc_timer_config_t ledc_timer = {
 | 
					    ledc_timer_config_t ledc_timer = {
 | 
				
			||||||
        .bit_num = LEDC_TIMER_13_BIT,
 | 
					        .duty_resolution = LEDC_TIMER_13_BIT,
 | 
				
			||||||
        .freq_hz = 5000,
 | 
					        .freq_hz = 5000,
 | 
				
			||||||
        .speed_mode = LEDC_HIGH_SPEED_MODE,
 | 
					        .speed_mode = LEDC_HIGH_SPEED_MODE,
 | 
				
			||||||
        .timer_num = LEDC_TIMER_0,
 | 
					        .timer_num = LEDC_TIMER_0,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,7 +39,7 @@ esp_err_t mesh_light_init(void)
 | 
				
			|||||||
    s_light_inited = true;
 | 
					    s_light_inited = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ledc_timer_config_t ledc_timer = {
 | 
					    ledc_timer_config_t ledc_timer = {
 | 
				
			||||||
        .bit_num = LEDC_TIMER_13_BIT,
 | 
					        .duty_resolution = LEDC_TIMER_13_BIT,
 | 
				
			||||||
        .freq_hz = 5000,
 | 
					        .freq_hz = 5000,
 | 
				
			||||||
        .speed_mode = LEDC_HIGH_SPEED_MODE,
 | 
					        .speed_mode = LEDC_HIGH_SPEED_MODE,
 | 
				
			||||||
        .timer_num = LEDC_TIMER_0,
 | 
					        .timer_num = LEDC_TIMER_0,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user