lexus2k / lcdgfx

Driver for LCD displays running on Arduino/Avr/ESP32/Linux (including Rasperry) platforms
MIT License
389 stars 55 forks source link

HSPI_HOST and VSPI_HOST deprecated for ESP32-S3 in ESP-IDF #95

Closed vintzvintz closed 1 year ago

vintzvintz commented 1 year ago

Context

Hobby project with plain ESP-IDF, not Arduino Core, on a EPS32-S3 devkit board. Using platformio/vscode on linux Added a "components" subdir in projet root and cloned lcdgfx repo into it. I2C SSD1306 oled display, so SPI support is not needed in my case.

Build fails on file esp32_spi.cpp with a bunch of errors like error: 'VSPI_HOST' was not declared in this scope ( see build logs below)

Analysis

HSPI_HOST and VSPI_HOST are deprecated and not defined anymore in latest versions of IDF and/or on newer ESP32 hardwares, as described at the end of spi_types.h IDF header file.

Workaround

I try and failed to completely disable SPI support by commenting out some lines in src/lcd_hal/UserSettings.h. It looks like at least 1 SPI implementation is required, and i do not have Arduino Wire in my project.

As a workaround, I added aliases in src/lcd_hal/esp/esp32_spi.cpp just after original #includes.

ifdef CONFIG_IDF_TARGET_ESP32S3

#define SPI_HOST    SPI1_HOST
#define HSPI_HOST   SPI2_HOST
#define VSPI_HOST   SPI3_HOST

endif

Conclusion I hope @lexus2k or someone more skilled/experienced than me would provide a cleaner fix for these deprecated VSPI_HOST and HSPI_HOST symbols on latest ESP32 family members (after ESP32 S2)

Please complete the following information:

Additional context Processing esp32-s3-devkitc-1 (platform: espressif32; board: esp32-s3-devkitc-1; framework: espidf)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s3-devkitc-1.html PLATFORM: Espressif 32 (5.2.0) > Espressif ESP32-S3-DevKitC-1-N8 (8 MB QD, No PSRAM) HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash DEBUG: Current (esp-builtin) On-board (esp-builtin) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa) PACKAGES:

lexus2k commented 1 year ago

Hello @vintzvintz

Do you have any fix to share?

lexus2k commented 1 year ago

It should be fixed with the recent commits. Feel free to reopen it if the issue still exists