On ESP32 module,
following code fails
- esp_err_t status = adc_vref_to_gpio(ADC_UNIT_2, ADC2_CHANNEL_9);
- if (status == ESP_OK) {
- printf("v_ref routed to GPIO\n");
- } else {
- printf("failed to route v_ref\n");
- }
adc_vref_to_gpio (ADC_UNIT_2, ADC2_CHANNEL_9) function with deprecated function
adc2_vref_to_gpio (GPIO_NUM_26) then code works OK.
(We can see steady Vref value on the pin, using external voltmeter)
That seems parameter being passed to "adc_vref_to_gpio " function seems wrong.
Appreciate any guidance to use adc_vref_to_gpio function correctly.
(Will like to avoid deprecated "adc2_vref_to_gpio" function)
I am on esp-idf-v4.4.1 version.
Best Regards,
Vinay