mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-29 06:06:40 +00:00
Add support for ESP32-S2 #250
This commit is contained in:
parent
e8e78df7d9
commit
44355f24b9
@ -144,17 +144,25 @@ static lgfx::Bus_SPI* init_spi_bus(Preferences* prefs)
|
|||||||
case 1:
|
case 1:
|
||||||
// SPI_HOST (SPI1_HOST) is not supported by the SPI Master and SPI Slave driver on ESP32-S2 and later
|
// SPI_HOST (SPI1_HOST) is not supported by the SPI Master and SPI Slave driver on ESP32-S2 and later
|
||||||
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
||||||
cfg.spi_host = SPI1_HOST;
|
cfg.spi_host = SPI_HOST;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case 2: // HSPI on ESP32 and HSPI on ESP32-S2
|
case 2: // HSPI on ESP32 and FSPI on ESP32-S2
|
||||||
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
||||||
cfg.spi_host = SPI2_HOST;
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||||
|
cfg.spi_host = HSPI_HOST;
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||||
|
cfg.spi_host = FSPI_HOST;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
default: // VSPI on ESP32 and FSPI on ESP32-S2
|
default: // VSPI on ESP32 and HSPI on ESP32-S2
|
||||||
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
||||||
cfg.spi_host = SPI3_HOST;
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||||
|
cfg.spi_host = VSPI_HOST;
|
||||||
|
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||||
|
cfg.spi_host = HSPI_HOST;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
bus->config(cfg); // The set value is reflected on the bus.
|
bus->config(cfg); // The set value is reflected on the bus.
|
||||||
bus->init();
|
bus->init();
|
||||||
@ -190,7 +198,7 @@ static void init_panel(lgfx::Panel_Device* panel, Preferences* prefs)
|
|||||||
cfg.invert =
|
cfg.invert =
|
||||||
prefs->getBool("invert", INVERT_COLORS != 0); // true if the light and darkness of the panel is reversed
|
prefs->getBool("invert", INVERT_COLORS != 0); // true if the light and darkness of the panel is reversed
|
||||||
#else
|
#else
|
||||||
cfg.invert = prefs->getBool("invert", false); // true if the light and darkness of the panel is reversed
|
cfg.invert = prefs->getBool("invert", false); // true if the light and darkness of the panel is reversed
|
||||||
#endif
|
#endif
|
||||||
#ifdef TFT_RGB_ORDER
|
#ifdef TFT_RGB_ORDER
|
||||||
cfg.rgb_order = prefs->getBool("rgb_order", true); // true if the red and blue of the panel are swapped
|
cfg.rgb_order = prefs->getBool("rgb_order", true); // true if the red and blue of the panel are swapped
|
||||||
@ -336,8 +344,8 @@ void LovyanGfx::show_info()
|
|||||||
{
|
{
|
||||||
LOG_VERBOSE(TAG_TFT, F("Interface : Serial"));
|
LOG_VERBOSE(TAG_TFT, F("Interface : Serial"));
|
||||||
auto panel = tft.getPanel();
|
auto panel = tft.getPanel();
|
||||||
auto bus = (lgfx::Bus_SPI*)panel->getBus();
|
auto bus = (lgfx::Bus_SPI*)panel->getBus();
|
||||||
auto cfg = bus->config(); // Get the structure for bus configuration.
|
auto cfg = bus->config(); // Get the structure for bus configuration.
|
||||||
tftPinInfo(F("MOSI"), cfg.pin_mosi);
|
tftPinInfo(F("MOSI"), cfg.pin_mosi);
|
||||||
tftPinInfo(F("MISO"), cfg.pin_miso);
|
tftPinInfo(F("MISO"), cfg.pin_miso);
|
||||||
tftPinInfo(F("SCLK"), cfg.pin_sclk);
|
tftPinInfo(F("SCLK"), cfg.pin_sclk);
|
||||||
|
@ -62,7 +62,7 @@ lib_ignore =
|
|||||||
;LittleFS_esp32 ; for v2
|
;LittleFS_esp32 ; for v2
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
;LittleFS_esp32 ; for v1
|
lorol/LittleFS_esp32@^1.0.6 ; for v1
|
||||||
bodmer/TFT_eSPI@2.4.32
|
bodmer/TFT_eSPI@2.4.32
|
||||||
;ESP Async WebServer
|
;ESP Async WebServer
|
||||||
git+https://github.com/fvanroie/ConsoleInput.git#dev
|
git+https://github.com/fvanroie/ConsoleInput.git#dev
|
||||||
|
Loading…
x
Reference in New Issue
Block a user