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;
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;
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;
- }
-}
*/
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
*/
*/
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.
*
*/
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.
*
*/
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
*
*/
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.
*
*/
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.
*/
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.
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);
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();
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);
};
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,
};
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,
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,
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,
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,
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,