]> granicus.if.org Git - esp-idf/commitdiff
driver: Remove features deprecated pre-IDF V4.0
authorAngus Gratton <angus@espressif.com>
Wed, 21 Aug 2019 02:31:44 +0000 (12:31 +1000)
committerAngus Gratton <gus@projectgus.com>
Thu, 12 Sep 2019 23:44:07 +0000 (09:44 +1000)
components/driver/i2s.c
components/driver/include/driver/adc.h
components/driver/include/driver/dac.h
components/driver/include/driver/i2s.h
components/driver/include/driver/ledc.h
components/driver/include/driver/touch_pad.h
components/driver/rtc_module.c
components/driver/test/test_ledc.c
examples/mesh/internal_communication/main/mesh_light.c
examples/mesh/manual_networking/main/mesh_light.c

index 10a38b15baafc9e8e5b3b8abf4bfd0c4d1dc5c5b..2d2046e1b92d55bcb59ed1c9a5fa843a97a5b787 100644 (file)
@@ -1180,18 +1180,6 @@ esp_err_t i2s_driver_uninstall(i2s_port_t i2s_num)
     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)
 {
     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;
 }
 
-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)
 {
     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);
     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;
-    }
-}
index df166b1c8d99d5c8d8bb76929712547343695b92..520970d79f23d4d4a4c20113c2de540586dcb050 100644 (file)
@@ -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);
 
-/** @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
  */
index 5ed96e201f2c7e5bfc60afe090eae879ab8d4873..d153230bdec85b43bc06f52f6e398f8e5e31b554 100644 (file)
@@ -42,25 +42,6 @@ typedef enum {
  */
 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.
  *
index c00be6632f9484408c61edadf2bd45549844125b..37d8278d631308a50da6ff9c3b9820c2d7b7813b 100644 (file)
@@ -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);
 
-/**
- * @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.
  *
@@ -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);
 
-/**
- * @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
  *
@@ -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);
 
-/**
- * @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.
  *
index 4d5593abb76670a24336c7d16189f0e22340456a..845f44286ba8252846d83a40a20e7a894a42f194 100644 (file)
@@ -126,10 +126,7 @@ typedef struct {
  */
 typedef struct {
     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 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_bit_t duty_resolution;  /*!< LEDC channel duty resolution */
     ledc_timer_t  timer_num;               /*!< The timer source of channel (0 - 3) */
     uint32_t freq_hz;                      /*!< LEDC timer frequency (Hz) */
     ledc_clk_cfg_t clk_cfg;                /*!< Configure LEDC source clock.
index 53d5b373896e2c463b82687dcf9665a277ea7d8f..8731115b4b0e3dc2e7d1462488c604eda0e59c97 100644 (file)
@@ -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);
 
-/**
- * @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.
  *          The handler will be attached to the same CPU core that this function is running on.
index d5954c9e6d2b6f35250a9f4329107323fd7e90b7..2162b015b688b714fbd6693e62aaba1c69ba84f1 100644 (file)
@@ -429,12 +429,6 @@ inline static touch_pad_t touch_pad_num_wrap(touch_pad_t 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)
 {
     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;
 }
 
-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)
 {
     adc_power_on();
@@ -1849,35 +1838,6 @@ esp_err_t dac_output_voltage(dac_channel_t channel, uint8_t dac_value)
     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)
 {
     portENTER_CRITICAL(&rtc_spinlock);
index b676c4232adaceb2535099b3aad386ec0839cfcd..02fab583f73319ba26a2b0641f411de6a7d5275d 100644 (file)
@@ -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 = {
         .speed_mode = speed_mode,
-        .bit_num = timer_bit,
+        .duty_resolution = timer_bit,
         .timer_num = timer,
         .freq_hz = 5000,
         .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 = {
         .speed_mode = speed_mode,
-        .bit_num = timer_bit,
+        .duty_resolution = timer_bit,
         .timer_num = timer,
         .freq_hz = 5000,
         .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 = {
         .speed_mode = LEDC_HIGH_SPEED_MODE,
-        .bit_num = LEDC_TIMER_13_BIT,
+        .duty_resolution = LEDC_TIMER_13_BIT,
         .timer_num = LEDC_TIMER_0,
         .freq_hz = 5000,
         .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 = {
         .speed_mode = LEDC_HIGH_SPEED_MODE,
-        .bit_num = 13,
+        .duty_resolution = 13,
         .timer_num = LEDC_TIMER_0,
         .freq_hz = 5000,
         .clk_cfg = LEDC_AUTO_CLK,
index b1f4c6705c4e4ed5a0b3b425308b980c3d7b6948..360c14f43a3d79833cecddc4697a6bfd12c187a3 100644 (file)
@@ -39,7 +39,7 @@ esp_err_t mesh_light_init(void)
     s_light_inited = true;
 
     ledc_timer_config_t ledc_timer = {
-        .bit_num = LEDC_TIMER_13_BIT,
+        .duty_resolution = LEDC_TIMER_13_BIT,
         .freq_hz = 5000,
         .speed_mode = LEDC_HIGH_SPEED_MODE,
         .timer_num = LEDC_TIMER_0,
index e181be41bf710708650f3935c6c8ce8aa020ee9f..ebd620d63ceeb11828d64cbc08fbc0eef39c3ab0 100644 (file)
@@ -39,7 +39,7 @@ esp_err_t mesh_light_init(void)
     s_light_inited = true;
 
     ledc_timer_config_t ledc_timer = {
-        .bit_num = LEDC_TIMER_13_BIT,
+        .duty_resolution = LEDC_TIMER_13_BIT,
         .freq_hz = 5000,
         .speed_mode = LEDC_HIGH_SPEED_MODE,
         .timer_num = LEDC_TIMER_0,