esp-iot-solution icon indicating copy to clipboard operation
esp-iot-solution copied to clipboard

Migrate ADC legacy driver to New driver using bus component (AEGHB-228)

Open nopnop2002 opened this issue 2 years ago • 3 comments

I'm using adc1_get_raw() at the same time as this driver. https://github.com/espressif/esp-iot-solution/tree/master/components/bus

I want to migrate adc1_get_raw() to adc_oneshot_read().

But this is using driver/i2s.h here so it can't be migrated.

https://github.com/espressif/esp-iot-solution/blob/master/components/bus/include/i2s_lcd_driver.h#L17

[908/915] Building C object esp-idf/tft_library/CMakeFiles/__idf_tft_library.dir/i2s_lcd_esp32_driver.c.objIn file included from /home/nop/esp-idf/components/driver/deprecated/driver/i2s.h:23,
                 from ../components/tft_library/i2s_lcd_driver.h:17,
                 from ../components/tft_library/i2s_lcd_esp32_driver.c:35:
/home/nop/esp-idf/components/driver/deprecated/driver/adc.h:19:2: warning: #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively" [-Wcpp]
   19 | #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively"
      |  ^~~~~~~

Legacy driver and adc_oneshot_read() cannot be used at the same time.

E (364) ADC: CONFLICT! driver_ng is not allowed to be used with the legacy driver

nopnop2002 avatar Jun 03 '23 06:06 nopnop2002

Hi @nopnop2002 IDF 5.0 dropped some APIs, which caused this problem. If you are using IDF 5.0 for a new project and want to use the I2S interface to drive the screen, we suggest you use the new esp_lcd component instead

leeebo avatar Jun 06 '23 02:06 leeebo

If you just want to use I2C/SPI in the bus component, you can just move i2s_lcd_esp32s2_driver.c i2s_lcd_esp32_driver.c out from the CMakeLists.

leeebo avatar Jun 06 '23 02:06 leeebo

we suggest you use the new esp_lcd component instead

Thank you for your comment.

I'll look into the esp_lcd component over the weekend.

nopnop2002 avatar Jun 06 '23 06:06 nopnop2002