mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 05:36:37 +00:00
Add Elecrow ESP-Terminal SPI and RGB
This commit is contained in:
parent
8c8a7eb717
commit
a790679466
6
.github/workflows/build.yaml
vendored
6
.github/workflows/build.yaml
vendored
@ -32,10 +32,10 @@ jobs:
|
|||||||
out: d1-r32-espduino32
|
out: d1-r32-espduino32
|
||||||
- env: d1-r32-unoshield_ili9486_adc
|
- env: d1-r32-unoshield_ili9486_adc
|
||||||
out: d1-r32-espduino32
|
out: d1-r32-espduino32
|
||||||
- out: waveshare
|
|
||||||
env: "esp32-one_ili9486 -e esp32-one_st7796"
|
|
||||||
- out: dustinwatts
|
- out: dustinwatts
|
||||||
env: "freetouchdeck_4MB -e freetouchdeck_8MB -e esp32-touchdown"
|
env: "freetouchdeck_4MB -e freetouchdeck_8MB -e esp32-touchdown"
|
||||||
|
- out: elecrow
|
||||||
|
env: "esp-terminal-rgb_16MB -e esp-terminal-spi_16MB"
|
||||||
- out: globalsecurity
|
- out: globalsecurity
|
||||||
env: gs-t3e_16MB
|
env: gs-t3e_16MB
|
||||||
- out: lanbon
|
- out: lanbon
|
||||||
@ -52,6 +52,8 @@ jobs:
|
|||||||
env: "panlee-zw3d95ce01s-ar-4848_16MB -e panlee-zw3d95ce01s-ur-4848_16MB"
|
env: "panlee-zw3d95ce01s-ar-4848_16MB -e panlee-zw3d95ce01s-ur-4848_16MB"
|
||||||
- out: sunton
|
- out: sunton
|
||||||
env: "esp32-2432s028r_4MB -e esp32-3248s035c_4MB -e esp32-3248s035r_4MB -e sunton-4827s043c_16MB -e sunton-8048s043c_16MB -e sunton-8048s050c_16MB -e sunton-8048s070c_16MB"
|
env: "esp32-2432s028r_4MB -e esp32-3248s035c_4MB -e esp32-3248s035r_4MB -e sunton-4827s043c_16MB -e sunton-8048s043c_16MB -e sunton-8048s050c_16MB -e sunton-8048s070c_16MB"
|
||||||
|
- out: waveshare
|
||||||
|
env: "esp32-one_ili9486 -e esp32-one_st7796"
|
||||||
- out: wireless-tag
|
- out: wireless-tag
|
||||||
env: "wt32-sc01_4MB -e wt32-sc01_16MB -e wt-86-32-3zw1 -e wt32-sc01-plus_8MB -e wt32-sc01-plus_16MB"
|
env: "wt32-sc01_4MB -e wt32-sc01_16MB -e wt-86-32-3zw1 -e wt32-sc01-plus_8MB -e wt32-sc01-plus_16MB"
|
||||||
- out: yeacreate
|
- out: yeacreate
|
||||||
|
@ -57,7 +57,7 @@ static uint32_t _read_panel_id(lgfx::Bus_SPI* bus, int32_t pin_cs, uint32_t cmd
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ESP32S2) || defined(ESP32S3)
|
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||||
static lgfx::Bus_Parallel16* init_parallel_16_bus(Preferences* prefs, int8_t data_pins[], uint8_t num)
|
static lgfx::Bus_Parallel16* init_parallel_16_bus(Preferences* prefs, int8_t data_pins[], uint8_t num)
|
||||||
{
|
{
|
||||||
lgfx::Bus_Parallel16* bus = new lgfx::v1::Bus_Parallel16();
|
lgfx::Bus_Parallel16* bus = new lgfx::v1::Bus_Parallel16();
|
||||||
@ -85,7 +85,7 @@ static lgfx::Bus_Parallel16* init_parallel_16_bus(Preferences* prefs, int8_t dat
|
|||||||
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
||||||
return bus;
|
return bus;
|
||||||
}
|
}
|
||||||
#endif // ESP32S2
|
#endif // ESP32S2/S3
|
||||||
|
|
||||||
static lgfx::Bus_Parallel8* init_parallel_8_bus(Preferences* prefs, int8_t data_pins[], uint8_t num)
|
static lgfx::Bus_Parallel8* init_parallel_8_bus(Preferences* prefs, int8_t data_pins[], uint8_t num)
|
||||||
{
|
{
|
||||||
@ -223,9 +223,17 @@ static void configure_panel(lgfx::Panel_Device* panel, Preferences* prefs)
|
|||||||
#else
|
#else
|
||||||
cfg.rgb_order = prefs->getBool("rgb_order", false); // true if the red and blue of the panel are swapped
|
cfg.rgb_order = prefs->getBool("rgb_order", false); // true if the red and blue of the panel are swapped
|
||||||
#endif
|
#endif
|
||||||
cfg.dlen_16bit = prefs->getBool("dlen_16bit", false); // true for panels that send data length in 16-bit units
|
|
||||||
cfg.bus_shared = prefs->getBool("bus_shared", true); // true if the bus is shared with the SD card
|
bool dlen_16bit = false;
|
||||||
// (bus control is performed with drawJpgFile etc.)
|
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||||
|
if(panel->getBus()) {
|
||||||
|
lgfx::v1::bus_type_t bus_type = panel->getBus()->busType();
|
||||||
|
if(bus_type == lgfx::v1::bus_parallel16) dlen_16bit = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
cfg.dlen_16bit = prefs->getBool("dlen_16bit", dlen_16bit); // true for panels that send data length in 16-bit units
|
||||||
|
cfg.bus_shared = prefs->getBool("bus_shared", true); // true if the bus is shared with the SD card
|
||||||
|
// (bus control is performed with drawJpgFile etc.)
|
||||||
panel->config(cfg);
|
panel->config(cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +248,7 @@ lgfx::IBus* _init_bus(Preferences* preferences)
|
|||||||
for(uint8_t i = 0; i < 16; i++) {
|
for(uint8_t i = 0; i < 16; i++) {
|
||||||
snprintf(key, sizeof(key), "d%d", i + 1);
|
snprintf(key, sizeof(key), "d%d", i + 1);
|
||||||
data_pins[i] = preferences->getInt(key, data_pins[i]);
|
data_pins[i] = preferences->getInt(key, data_pins[i]);
|
||||||
LOG_DEBUG(TAG_TFT, F("D%d: %d"), i + 1, data_pins[i]);
|
LOG_DEBUG(TAG_TFT, F("D%d: %d"), i, data_pins[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
||||||
@ -252,13 +260,13 @@ lgfx::IBus* _init_bus(Preferences* preferences)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__);
|
||||||
#if defined(ESP32S2)
|
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||||
if(is_16bit) {
|
if(is_16bit) {
|
||||||
is_8bit = false;
|
is_8bit = false;
|
||||||
LOG_VERBOSE(TAG_TFT, F("16-bit TFT bus"));
|
LOG_VERBOSE(TAG_TFT, F("16-bit TFT bus"));
|
||||||
return init_parallel_16_bus(preferences, data_pins, 16);
|
return init_parallel_16_bus(preferences, data_pins, 16);
|
||||||
} else
|
} else
|
||||||
#endif // ESP32S2
|
#endif // ESP32S2/S3
|
||||||
if(is_8bit) {
|
if(is_8bit) {
|
||||||
is_16bit = false;
|
is_16bit = false;
|
||||||
LOG_VERBOSE(TAG_TFT, F("8-bit TFT bus"));
|
LOG_VERBOSE(TAG_TFT, F("8-bit TFT bus"));
|
||||||
@ -1012,7 +1020,7 @@ void LovyanGfx::show_info()
|
|||||||
tftPinInfo(F("TFT_D7"), cfg.pin_d7);
|
tftPinInfo(F("TFT_D7"), cfg.pin_d7);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ESP32S2) || defined(ESP32S3)
|
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||||
if(bus_type == lgfx::v1::bus_parallel16) {
|
if(bus_type == lgfx::v1::bus_parallel16) {
|
||||||
LOG_VERBOSE(TAG_TFT, F("Interface : Parallel 16bit"));
|
LOG_VERBOSE(TAG_TFT, F("Interface : Parallel 16bit"));
|
||||||
auto bus = (lgfx::v1::Bus_Parallel16*)panel->getBus();
|
auto bus = (lgfx::v1::Bus_Parallel16*)panel->getBus();
|
||||||
@ -1144,7 +1152,7 @@ bool LovyanGfx::is_driver_pin(uint8_t pin)
|
|||||||
pin == cfg.pin_d7)
|
pin == cfg.pin_d7)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
#if defined(ESP32S2) || defined(ESP32S3)
|
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||||
} else if(bus_type == lgfx::v1::bus_parallel16) {
|
} else if(bus_type == lgfx::v1::bus_parallel16) {
|
||||||
auto bus = (lgfx::v1::Bus_Parallel16*)panel->getBus();
|
auto bus = (lgfx::v1::Bus_Parallel16*)panel->getBus();
|
||||||
auto cfg = bus->config(); // Get the structure for bus configuration.
|
auto cfg = bus->config(); // Get the structure for bus configuration.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user