From 774b01fdcda8abcbba95890ecb6847bf469ff68f Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 11 Oct 2025 15:54:43 +0200 Subject: [PATCH 001/136] Bump version v15.1.0.1 --- CHANGELOG.md | 21 ++++++---- FIRMWARE.md | 2 +- README.md | 2 +- RELEASENOTES.md | 66 +++++-------------------------- tasmota/include/tasmota_version.h | 2 +- 5 files changed, 26 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dedd311fe..de15733a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,24 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development -## [15.0.1.5] +## [15.1.0.1] ### Added - ### Breaking Changed +### Changed + +### Fixed + +### Removed + + +## [Released] + +## [15.1.0] 20251011 +- Release Stella + +## [15.0.1.5] 20251011 ### Changed - ESP8266 platform update from 2025.09.00 to 2025.10.00 (#23971) - ESP32 Platform from 2025.09.30 to 2025.10.30, Framework (Arduino Core) from v3.1.3.250808 to v3.1.4 and IDF from v5.3.3.250801 to v5.3.4.250826 (#23971) @@ -18,9 +30,6 @@ All notable changes to this project will be documented in this file. - Berry fixed 'be_top is non zero' warning when calling C mapped functions (#23989) - Berry fixed 'be_top is non zero' when `Br` command fails (#23990) -### Removed - - ## [15.0.1.4] 20251002 ### Added - ESP32 Extension Manager, replacing loading of Partition Wizard (#23955) @@ -104,8 +113,6 @@ All notable changes to this project will be documented in this file. - Berry Hue regression from #23429 (#23623) - AHT30 sensor start with null values after deep sleep (#23624) -## [Released] - ## [15.0.1] 20250614 - Release Sharon diff --git a/FIRMWARE.md b/FIRMWARE.md index 194cd2f61..69b425b6c 100644 --- a/FIRMWARE.md +++ b/FIRMWARE.md @@ -18,7 +18,7 @@ See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/CHANGELOG ## Development -[![Dev Version](https://img.shields.io/badge/development%20version-v15.0.x.x-blue.svg)](https://github.com/arendst/Tasmota) +[![Dev Version](https://img.shields.io/badge/development%20version-v15.1.x.x-blue.svg)](https://github.com/arendst/Tasmota) [![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/) [![Tasmota CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+CI%22) [![Tasmota ESP32 CI](https://github.com/arendst/Tasmota/workflows/Tasmota%20ESP32%20CI/badge.svg)](https://github.com/arendst/Tasmota/actions?query=workflow%3A%22Tasmota+ESP32+CI%22) diff --git a/README.md b/README.md index f44e2ae0a..b4efc2dd2 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Firmware binaries can be downloaded from http://ota.tasmota.com/tasmota/release/ ## Development -[![Dev Version](https://img.shields.io/badge/development%20version-v15.0.x.x-blue.svg)](https://github.com/arendst/Tasmota) +[![Dev Version](https://img.shields.io/badge/development%20version-v15.1.x.x-blue.svg)](https://github.com/arendst/Tasmota) [![Download Dev](https://img.shields.io/badge/download-development-yellow.svg)](http://ota.tasmota.com/tasmota/) [![Tasmota CI](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml/badge.svg)](https://github.com/arendst/Tasmota/actions/workflows/build_all_the_things.yml) [![Build_development](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml/badge.svg)](https://github.com/arendst/Tasmota/actions/workflows/Tasmota_build_devel.yml) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 76d5cf372..4f12d275c 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -36,9 +36,9 @@ While fallback or downgrading is common practice it was never supported due to S This release will be supported from ESP8266/Arduino library Core version **2.7.8** due to reported security and stability issues on previous Core version. This will also support gzipped binaries. -This release will be supported from ESP32/Arduino library Core version **v3.1.3.250504**. +This release will be supported from ESP32/Arduino library Core version **v3.1.4**. -Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.3.250504 have been removed. +Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.4 have been removed. ## Initial configuration tools @@ -71,12 +71,12 @@ Latest released binaries can be downloaded from - http://ota.tasmota.com/tasmota/release Historical binaries can be downloaded from -- http://ota.tasmota.com/tasmota/release-15.0.1 +- http://ota.tasmota.com/tasmota/release-15.1.0 The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz`` -### ESP32, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-S2 and ESP32-S3 based -The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.3.250504**. +### ESP32, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-S2, ESP32-S3 and ESP32-P4 based +The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.4**. - **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY** - **tasmota32solo1.bin** = The Tasmota version with most drivers including additional sensors and KNX for single core ESP32 and 4M+ flash. @@ -85,7 +85,9 @@ The following binary downloads have been compiled with ESP32/Arduino library cor - **tasmota32s3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S3 with USB HWCDC and fallback to serial and 4M+ flash. - **tasmota32c2.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C2 with serial and 4M+ flash. - **tasmota32c3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C3 with USB HWCDC and fallback to serial and 4M+ flash. +- **tasmota32c5.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C5 with USB HWCDC and fallback to serial and 4M+ flash. - **tasmota32c6.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C6 with USB HWCDC and fallback to serial and 4M+ flash. +- **tasmota32p4.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-P4 with USB HWCDC and fallback to serial and 4M+ flash. - **tasmota32-AD.bin** to **tasmota32-VN.bin** = The Tasmota version in different languages for 4M+ flash. - **tasmota32-bluetooth.bin** = The Bluetooth version adds BLE support for 4M+ flash. - **tasmota32-display.bin** = The Display version without Energy Monitoring but adds display support for 4M+ flash. @@ -100,7 +102,7 @@ Latest released binaries can be downloaded from - https://ota.tasmota.com/tasmota32/release Historical binaries can be downloaded from -- https://ota.tasmota.com/tasmota32/release-15.0.1 +- https://ota.tasmota.com/tasmota32/release-15.1.0 The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasmota.com/tasmota32/release/tasmota32.bin`` @@ -110,63 +112,13 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm [Complete list](BUILDS.md) of available feature and sensors. -## Changelog v15.0.1.5 +## Changelog v15.1.0.1 ### Added -- Commands `LoRaWanDecoder "` and `LoRaWanName "` to clear name [#23394](https://github.com/arendst/Tasmota/issues/23394) -- Command `I2sPause` [#23646](https://github.com/arendst/Tasmota/issues/23646) -- Support for RV3028 RTC [#23672](https://github.com/arendst/Tasmota/issues/23672) -- Support for RX8030 RTC [#23855](https://github.com/arendst/Tasmota/issues/23855) -- Extend state JSON message with functional hostname and ipaddress which could be WiFi or Ethernet -- Internal function 'WSContentSendRaw_P' [#23641](https://github.com/arendst/Tasmota/issues/23641) -- Universal display driver for ZJY169S0800TG01 ST7789 280x240 [#23638](https://github.com/arendst/Tasmota/issues/23638) -- NeoPool add Redox tank alarm [#19811](https://github.com/arendst/Tasmota/issues/19811) -- I2S additions [#23543](https://github.com/arendst/Tasmota/issues/23543) -- ESP32 ROM SHA Hardware Acceleration to BearSSL [#23819](https://github.com/arendst/Tasmota/issues/23819) -- ESP32 Extension Manager, replacing loading of Partition Wizard [#23955](https://github.com/arendst/Tasmota/issues/23955) -- Support for ESP32-P4 [#23663](https://github.com/arendst/Tasmota/issues/23663) -- Support for ESP32-C5 [#23804](https://github.com/arendst/Tasmota/issues/23804) -- ESP32-P4 command `HostedOta` [#23675](https://github.com/arendst/Tasmota/issues/23675) -- Berry f-strings now support ':' in expression [#23618](https://github.com/arendst/Tasmota/issues/23618) -- Berry preview of animation framework [#23816](https://github.com/arendst/Tasmota/issues/23816) -- Berry `call()` now works for classes [#23744](https://github.com/arendst/Tasmota/issues/23744) -- Berry multiplication between string and int [#23850](https://github.com/arendst/Tasmota/issues/23850) -- Berry animation framework web ui to compile DSL [#23962](https://github.com/arendst/Tasmota/issues/23962) ### Breaking Changed -- Berry `animate` framework is DEPRECATED, will be replace by `animation` framework [#23854](https://github.com/arendst/Tasmota/issues/23854) ### Changed -- ESP8266 platform update from 2025.05.00 to 2025.10.00 [#23971](https://github.com/arendst/Tasmota/issues/23971) -- ESP32 Platform from 2025.05.30 to 2025.10.30, Framework (Arduino Core) from v3.1.3.250504 to v3.1.4 and IDF from v5.3.3.250501 to v5.3.4.250826 [#23971](https://github.com/arendst/Tasmota/issues/23971) -- Epdiy library from v1.0.0 to v2.0.0 -- OpenTherm library from v0.9.0 to v1.1.5 [#23704](https://github.com/arendst/Tasmota/issues/23704) -- JPEGDEC library from v1.5.0 to v1.8.3 [#23883](https://github.com/arendst/Tasmota/issues/23883) -- Library names [#23560](https://github.com/arendst/Tasmota/issues/23560) -- Web UI styles and HTML syntax [#23847](https://github.com/arendst/Tasmota/issues/23847) -- Make GUI Timer parameters mobile phone friendly [#23959](https://github.com/arendst/Tasmota/issues/23959) -- CSS uses named colors variables [#23597](https://github.com/arendst/Tasmota/issues/23597) -- VEML6070 and AHT2x device detection [#23581](https://github.com/arendst/Tasmota/issues/23581) -- Domoticz supports persistent settings for all relays, keys and switches when filesystem `#define USE_UFILESYS` is enabled -- ESP32 LoRaWan decoding won't duplicate non-decoded message if `SO147 0` -- Use HAL instead of ROM for SHA HW acceleration as used by TLS [#23902](https://github.com/arendst/Tasmota/issues/23902) -- BLE updates for esp-nimble-cpp v2.x [#23553](https://github.com/arendst/Tasmota/issues/23553) -- Berry raise webserver hooks from 16 to 32 [#23748](https://github.com/arendst/Tasmota/issues/23748) -- Berry add argument to `werbserver.content_send_style` [#23953](https://github.com/arendst/Tasmota/issues/23953) ### Fixed -- Syslog RFC5424 compliance [#23509](https://github.com/arendst/Tasmota/issues/23509) -- Unable to use default serial GPIOs by TasmotaSerial regression from v14.5.0 with IDF 5.3.2.250120 [#23775](https://github.com/arendst/Tasmota/issues/23775) -- AHT30 sensor start with null values after deep sleep [#23624](https://github.com/arendst/Tasmota/issues/23624) -- NeoPool reset to default settings [#23734](https://github.com/arendst/Tasmota/issues/23734) -- Berry vulnerability in JSON parsing for unicode [#23603](https://github.com/arendst/Tasmota/issues/23603) -- Berry security issues in `int64` and improve documentation [#23605](https://github.com/arendst/Tasmota/issues/23605) -- Berry security issues in `berry_mapping` and improve documentation [#23606](https://github.com/arendst/Tasmota/issues/23606) -- Berry Hue regression from #23429 [#23623](https://github.com/arendst/Tasmota/issues/23623) -- Berry calling `setmember` with a function [#23825](https://github.com/arendst/Tasmota/issues/23825) -- Berry fixed 'be_top is non zero' warning when calling C mapped functions [#23989](https://github.com/arendst/Tasmota/issues/23989) -- Berry fixed 'be_top is non zero' when `Br` command fails [#23990](https://github.com/arendst/Tasmota/issues/23990) -- LVGL restore `lv_chart.set_range` removed in LVGL 9.3.0 in favor of `lv_chart.set_axis_range` [#23567](https://github.com/arendst/Tasmota/issues/23567) ### Removed -- `user-scalable=no` from HTTP HEADER [#23798](https://github.com/arendst/Tasmota/issues/23798) - diff --git a/tasmota/include/tasmota_version.h b/tasmota/include/tasmota_version.h index e74859147..03bed4b3f 100644 --- a/tasmota/include/tasmota_version.h +++ b/tasmota/include/tasmota_version.h @@ -22,6 +22,6 @@ #define TASMOTA_SHA_SHORT // Filled by Github sed -const uint32_t TASMOTA_VERSION = 0x0F000105; // 15.0.1.5 +const uint32_t TASMOTA_VERSION = 0x0F010001; // 15.1.0.1 #endif // _TASMOTA_VERSION_H_ From f6a488a84cf2faf264615b900ded9b224e94b7c0 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sat, 11 Oct 2025 19:15:41 +0200 Subject: [PATCH 002/136] TLS fix ECDSA and add 'SetOption165 1' to enable ECDSA in addition to RSA (#24000) --- CHANGELOG.md | 1 + .../src/WiFiClientSecureLightBearSSL.cpp | 7 +++++-- .../src/WiFiClientSecureLightBearSSL.h | 6 ++++++ tasmota/include/tasmota_types.h | 2 +- tasmota/my_user_config.h | 5 +++-- tasmota/tasmota_support/settings.ino | 1 + .../tasmota_xdrv_driver/xdrv_02_9_mqtt.ino | 21 +++++++++++++++++++ 7 files changed, 38 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de15733a2..304eed2b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file. ### Fixed - Berry fixed 'be_top is non zero' warning when calling C mapped functions (#23989) - Berry fixed 'be_top is non zero' when `Br` command fails (#23990) +- TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA ## [15.0.1.4] 20251002 ### Added diff --git a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp index c11acaec2..227e078d6 100755 --- a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp +++ b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp @@ -930,8 +930,8 @@ extern "C" { br_ssl_engine_set_ghash(&cc->eng, &br_ghash_ctmul32); // we support only P256 EC curve for AWS IoT, no EC curve for Letsencrypt unless forced - br_ssl_engine_set_ec(&cc->eng, &br_ec_p256_m15); // TODO -#ifndef ESP8266 + br_ssl_engine_set_ec(&cc->eng, &br_ec_p256_m15); +#ifdef ESP32 br_ssl_engine_set_ecdsa(&cc->eng, &br_ecdsa_i15_vrfy_asn1); #endif } @@ -986,6 +986,9 @@ bool WiFiClientSecure_light::_connectSSL(const char* hostName) { br_x509_minimal_init(x509_minimal, &br_sha256_vtable, _ta_P, _ta_size); br_x509_minimal_set_rsa(x509_minimal, br_ssl_engine_get_rsavrfy(_eng)); br_x509_minimal_set_hash(x509_minimal, br_sha256_ID, &br_sha256_vtable); +#ifdef ESP32 + br_x509_minimal_set_ecdsa(x509_minimal, &br_ec_all_m15, &br_ecdsa_i15_vrfy_asn1); +#endif // ESP32 br_ssl_engine_set_x509(_eng, &x509_minimal->vtable); uint32_t now = UtcTime(); uint32_t cfg_time = CfgTime(); diff --git a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h index 3cbbcc67e..dab8ca4f7 100755 --- a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h +++ b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h @@ -120,6 +120,9 @@ class WiFiClientSecure_light : public WiFiClient { return br_ssl_engine_last_error(_eng); } } + int32_t getLastCipherSuite(void) { + return _eng->session.cipher_suite; + } inline void setLastError(int32_t err) { _last_error = err; } @@ -131,6 +134,9 @@ class WiFiClientSecure_light : public WiFiClient { } void setInsecure(); + void setECDSA(bool ecdsa) { + _rsa_only = !ecdsa; + }; void setDomainName(const char * domain) { _domain = domain; diff --git a/tasmota/include/tasmota_types.h b/tasmota/include/tasmota_types.h index 2ebbfe618..b2ba441cb 100644 --- a/tasmota/include/tasmota_types.h +++ b/tasmota/include/tasmota_types.h @@ -199,7 +199,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t no_export_energy_today : 1; // bit 16 (v14.3.0.7) - SetOption162 - (Energy) Do not add export energy to energy today (1) uint32_t gui_device_name : 1; // bit 17 (v14.4.1.1) - SetOption163 - GUI_NOSHOW_DEVICENAME - (GUI) Disable display of GUI device name (1) uint32_t wizmote_enabled : 1; // bit 18 (v14.4.1.4) - SetOption164 - (WizMote) Enable WiZ Smart Remote support (1) - uint32_t spare19 : 1; // bit 19 + uint32_t tls_use_ecdsa : 1; // bit 19 (v15.0.1.0) - SetOption165 - (TLS) Enable ECDSA validation in addition to RSA uint32_t spare20 : 1; // bit 20 uint32_t spare21 : 1; // bit 21 uint32_t spare22 : 1; // bit 22 diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index b5a40701e..bfd3828e4 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -173,8 +173,9 @@ #define MQTT_INDEX_SEPARATOR false // [SetOption64] Enable "_" instead of "-" as sensor index separator #define MQTT_TUYA_RECEIVED false // [SetOption66] Enable TuyaMcuReceived messages over Mqtt #define MQTT_ONLY_JSON_OUTPUT false // [SetOption90] Disable non-json messages -#define MQTT_TLS_ENABLED false // [SetOption103] Enable TLS mode (requires TLS version) -#define MQTT_TLS_FINGERPRINT false // [SetOption132] Force TLS fingerprint validation instead of CA (requires TLS version) +#define MQTT_TLS_ENABLED false // [SetOption103] Enable TLS mode +#define MQTT_TLS_FINGERPRINT false // [SetOption132] Force TLS fingerprint validation instead of CA +#define MQTT_TLS_ECDSA false // [SetOption165] Enable TLS ECDSA validation in addition to RSA, false by default but automatically set to 'true' in case of a cipher error '296' // -- HTTP ---------------------------------------- #define WEB_SERVER 2 // [WebServer] Web server (0 = Off, 1 = Start as User, 2 = Start as Admin) diff --git a/tasmota/tasmota_support/settings.ino b/tasmota/tasmota_support/settings.ino index f9a70e259..268e546a0 100644 --- a/tasmota/tasmota_support/settings.ino +++ b/tasmota/tasmota_support/settings.ino @@ -1448,6 +1448,7 @@ void SettingsDefaultSet2(void) { // Matter flag6.matter_enabled |= MATTER_ENABLED; + flag6.tls_use_ecdsa |= MQTT_TLS_ECDSA; Settings->flag = flag; Settings->flag2 = flag2; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino b/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino index 6c92168a6..584751fcc 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino @@ -262,6 +262,7 @@ void MqttInit(void) { if (!Settings->flag5.tls_use_fingerprint) { tlsClient->setTrustAnchor(Tasmota_TA, nitems(Tasmota_TA)); } + tlsClient->setECDSA(Settings->flag6.tls_use_ecdsa); MqttClient.setClient(*tlsClient); } else { @@ -1391,6 +1392,14 @@ void MqttReconnect(void) { 120 : 376 : BR_ALERT_NO_APPLICATION_PROTOCOL */ AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_MQTT "TLS connection error: %d"), tlsClient->getLastError()); + if (tlsClient->getLastError() == 296) { + // in this special case of cipher mismatch, we force enable ECDSA + // this would be the case for newer letsencrypt certificates now defaulting + // to EC certificates requiring ECDSA instead of RSA + Settings->flag6.tls_use_ecdsa = true; + tlsClient->setECDSA(Settings->flag6.tls_use_ecdsa); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_MQTT "TLS now enabling ECDSA 'SetOption165 1'"), tlsClient->getLastError()); + } } #endif /* @@ -1408,6 +1417,18 @@ void MqttReconnect(void) { */ MqttDisconnected(MqttClient.state()); } +#ifdef USE_MQTT_TLS + if (Mqtt.mqtt_tls) { + int32_t cipher_suite = tlsClient->getLastCipherSuite(); + if (BR_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 == cipher_suite) { + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_MQTT "TLS cipher suite: %s"), PSTR("ECDHE_RSA_AES_128_GCM_SHA256")); + } else if (BR_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 == cipher_suite) { + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_MQTT "TLS cipher suite: %s"), PSTR("ECDHE_ECDSA_AES_128_GCM_SHA256")); + } else if (0 != cipher_suite) { + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_MQTT "TLS cipher suite: 0x%04X"), cipher_suite); + } + } +#endif // USE_MQTT_TLS } void MqttCheck(void) { From 2d894c49e016f7c0522d97208d4ccef797143536 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 12 Oct 2025 11:17:09 +0200 Subject: [PATCH 003/136] Update change logs --- CHANGELOG.md | 2 +- RELEASENOTES.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 304eed2b0..0e69fe647 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. ### Changed ### Fixed +- TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA (#24000) ### Removed @@ -29,7 +30,6 @@ All notable changes to this project will be documented in this file. ### Fixed - Berry fixed 'be_top is non zero' warning when calling C mapped functions (#23989) - Berry fixed 'be_top is non zero' when `Br` command fails (#23990) -- TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA ## [15.0.1.4] 20251002 ### Added diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 4f12d275c..0b86279a6 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -120,5 +120,6 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ### Changed ### Fixed +- TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA [#24000](https://github.com/arendst/Tasmota/issues/24000) ### Removed From 04e0655618bad3b4bbda4007175e68108daea23f Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 12 Oct 2025 14:35:41 +0200 Subject: [PATCH 004/136] Fix Extension Manager exception when `OtaUrl` is not defined or invalid --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + .../src/embedded/extension_manager.be | 9 +- .../solidify/solidified_extension_manager.h | 251 +++++++++--------- 4 files changed, 140 insertions(+), 122 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e69fe647..973da8024 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file. ### Fixed - TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA (#24000) +- Extension Manager exception when `OtaUrl` is not defined or invalid ### Removed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0b86279a6..a6662377f 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -121,5 +121,6 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ### Fixed - TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA [#24000](https://github.com/arendst/Tasmota/issues/24000) +- Extension Manager exception when `OtaUrl` is not defined or invalid ### Removed diff --git a/lib/libesp32/berry_tasmota/src/embedded/extension_manager.be b/lib/libesp32/berry_tasmota/src/embedded/extension_manager.be index 7ef429b30..176c248f6 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/extension_manager.be +++ b/lib/libesp32/berry_tasmota/src/embedded/extension_manager.be @@ -649,9 +649,14 @@ class Extension_manager var version = f"0x{tasmota.version():08X}" if !self.ext_repo + self.ext_repo = self.EXT_REPO # Default var ota_url = tasmota.cmd("OtaUrl", true)['OtaUrl'] - var url_parts = string.split(ota_url, "/") - self.ext_repo = f"{url_parts[0]}//{url_parts[2]}/extensions/" # http://otaserver/extensions/ + if size(ota_url) > 0 + var url_parts = string.split(ota_url, "/") + if url_parts.size() > 2 + self.ext_repo = f"{url_parts[0]}//{url_parts[2]}/extensions/" # http://otaserver/extensions/ + end + end end var url = f"{self.ext_repo}{self.EXT_REPO_MANIFEST}?a={arch}&v={version}" log(f"EXT: fetching extensions manifest '{url}'", 3) diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_extension_manager.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_extension_manager.h index 9a495ff98..8fd1eb5ff 100644 --- a/lib/libesp32/berry_tasmota/src/solidify/solidified_extension_manager.h +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_extension_manager.h @@ -4,7 +4,7 @@ \********************************************************************/ #include "be_constobj.h" extern const bclass be_class_Extension_manager; -// compact class 'Extension_manager' ktab size: 182, total: 319 (saved 1096 bytes) +// compact class 'Extension_manager' ktab size: 182, total: 320 (saved 1104 bytes) static const bvalue be_ktab_class_Extension_manager[182] = { /* K0 */ be_nested_str(webserver), /* K1 */ be_nested_str(check_privileged_access), @@ -1317,8 +1317,8 @@ be_local_closure(class_Extension_manager_load_manifest, /* name */ &be_ktab_class_Extension_manager, /* shared constants */ &be_const_str_load_manifest, &be_const_str_solidified, - ( &(const binstruction[129]) { /* code */ - 0xA8020071, // 0000 EXBLK 0 #0073 + ( &(const binstruction[140]) { /* code */ + 0xA802007C, // 0000 EXBLK 0 #007E 0xA4062C00, // 0001 IMPORT R1 K22 0xB80A4A00, // 0002 GETNGBL R2 K37 0x8C08058A, // 0003 GETMET R2 R2 K138 @@ -1330,123 +1330,134 @@ be_local_closure(class_Extension_manager_load_manifest, /* name */ 0x7C140200, // 0009 CALL R5 1 0x7C0C0400, // 000A CALL R3 2 0x88100123, // 000B GETMBR R4 R0 K35 - 0x7412000F, // 000C JMPT R4 #001D - 0xB8124A00, // 000D GETNGBL R4 K37 - 0x8C10098C, // 000E GETMET R4 R4 K140 - 0x5818008D, // 000F LDCONST R6 K141 - 0x501C0200, // 0010 LDBOOL R7 1 0 - 0x7C100600, // 0011 CALL R4 3 - 0x9410098D, // 0012 GETIDX R4 R4 K141 - 0x8C14035C, // 0013 GETMET R5 R1 K92 - 0x5C1C0800, // 0014 MOVE R7 R4 - 0x5820001C, // 0015 LDCONST R8 K28 - 0x7C140600, // 0016 CALL R5 3 - 0x60180018, // 0017 GETGBL R6 G24 - 0x581C008E, // 0018 LDCONST R7 K142 - 0x94200B17, // 0019 GETIDX R8 R5 K23 - 0x94240B44, // 001A GETIDX R9 R5 K68 - 0x7C180600, // 001B CALL R6 3 - 0x90024606, // 001C SETMBR R0 K35 R6 - 0x60100018, // 001D GETGBL R4 G24 - 0x5814008F, // 001E LDCONST R5 K143 - 0x88180123, // 001F GETMBR R6 R0 K35 - 0x881C0190, // 0020 GETMBR R7 R0 K144 - 0x5C200400, // 0021 MOVE R8 R2 - 0x5C240600, // 0022 MOVE R9 R3 - 0x7C100A00, // 0023 CALL R4 5 - 0xB8165200, // 0024 GETNGBL R5 K41 - 0x60180018, // 0025 GETGBL R6 G24 - 0x581C0091, // 0026 LDCONST R7 K145 - 0x5C200800, // 0027 MOVE R8 R4 - 0x7C180400, // 0028 CALL R6 2 - 0x581C002B, // 0029 LDCONST R7 K43 - 0x7C140400, // 002A CALL R5 2 - 0xB8168000, // 002B GETNGBL R5 K64 - 0x7C140000, // 002C CALL R5 0 - 0x8C180B41, // 002D GETMET R6 R5 K65 - 0x5C200800, // 002E MOVE R8 R4 - 0x7C180400, // 002F CALL R6 2 - 0x8C180B42, // 0030 GETMET R6 R5 K66 - 0x7C180200, // 0031 CALL R6 1 - 0x541E00C7, // 0032 LDINT R7 200 - 0x201C0C07, // 0033 NE R7 R6 R7 - 0x781E0035, // 0034 JMPF R7 #006B - 0x881C015B, // 0035 GETMBR R7 R0 K91 - 0x88200123, // 0036 GETMBR R8 R0 K35 - 0x201C0E08, // 0037 NE R7 R7 R8 - 0x781E0022, // 0038 JMPF R7 #005C - 0x8C1C0B92, // 0039 GETMET R7 R5 K146 - 0x7C1C0200, // 003A CALL R7 1 - 0x141C0F17, // 003B LT R7 R7 K23 - 0x781E0005, // 003C JMPF R7 #0043 - 0x8C1C0B93, // 003D GETMET R7 R5 K147 - 0x7C1C0200, // 003E CALL R7 1 - 0xB81E8000, // 003F GETNGBL R7 K64 - 0x7C1C0000, // 0040 CALL R7 0 - 0x5C140E00, // 0041 MOVE R5 R7 - 0x70020001, // 0042 JMP #0045 - 0x8C1C0B46, // 0043 GETMET R7 R5 K70 - 0x7C1C0200, // 0044 CALL R7 1 - 0x881C015B, // 0045 GETMBR R7 R0 K91 - 0x90024607, // 0046 SETMBR R0 K35 R7 - 0x601C0018, // 0047 GETGBL R7 G24 - 0x5820008F, // 0048 LDCONST R8 K143 - 0x88240123, // 0049 GETMBR R9 R0 K35 - 0x88280190, // 004A GETMBR R10 R0 K144 - 0x5C2C0400, // 004B MOVE R11 R2 - 0x5C300600, // 004C MOVE R12 R3 - 0x7C1C0A00, // 004D CALL R7 5 - 0x5C100E00, // 004E MOVE R4 R7 - 0xB81E5200, // 004F GETNGBL R7 K41 - 0x60200018, // 0050 GETGBL R8 G24 - 0x58240091, // 0051 LDCONST R9 K145 - 0x5C280800, // 0052 MOVE R10 R4 - 0x7C200400, // 0053 CALL R8 2 - 0x5824002B, // 0054 LDCONST R9 K43 - 0x7C1C0400, // 0055 CALL R7 2 - 0x8C1C0B41, // 0056 GETMET R7 R5 K65 - 0x5C240800, // 0057 MOVE R9 R4 - 0x7C1C0400, // 0058 CALL R7 2 - 0x8C1C0B42, // 0059 GETMET R7 R5 K66 - 0x7C1C0200, // 005A CALL R7 1 - 0x5C180E00, // 005B MOVE R6 R7 - 0x541E00C7, // 005C LDINT R7 200 - 0x201C0C07, // 005D NE R7 R6 R7 - 0x781E000B, // 005E JMPF R7 #006B - 0xB81E5200, // 005F GETNGBL R7 K41 - 0x60200018, // 0060 GETGBL R8 G24 - 0x58240094, // 0061 LDCONST R9 K148 - 0x5C280C00, // 0062 MOVE R10 R6 - 0x7C200400, // 0063 CALL R8 2 - 0x58240044, // 0064 LDCONST R9 K68 - 0x7C1C0400, // 0065 CALL R7 2 - 0x601C0018, // 0066 GETGBL R7 G24 - 0x58200095, // 0067 LDCONST R8 K149 - 0x5C240C00, // 0068 MOVE R9 R6 - 0x7C1C0400, // 0069 CALL R7 2 - 0xB0072C07, // 006A RAISE 1 K150 R7 - 0x8C1C0B97, // 006B GETMET R7 R5 K151 - 0x7C1C0200, // 006C CALL R7 1 - 0x8C200B46, // 006D GETMET R8 R5 K70 - 0x7C200200, // 006E CALL R8 1 - 0xA8040001, // 006F EXBLK 1 1 - 0x80040E00, // 0070 RET 1 R7 - 0xA8040001, // 0071 EXBLK 1 1 - 0x7002000C, // 0072 JMP #0080 - 0xAC040002, // 0073 CATCH R1 0 2 - 0x70020009, // 0074 JMP #007F - 0xB80E5200, // 0075 GETNGBL R3 K41 - 0x60100018, // 0076 GETGBL R4 G24 - 0x58140049, // 0077 LDCONST R5 K73 - 0x5C180200, // 0078 MOVE R6 R1 - 0x5C1C0400, // 0079 MOVE R7 R2 - 0x7C100600, // 007A CALL R4 3 - 0x58140044, // 007B LDCONST R5 K68 - 0x7C0C0400, // 007C CALL R3 2 - 0xB0040202, // 007D RAISE 1 R1 R2 - 0x70020000, // 007E JMP #0080 - 0xB0080000, // 007F RAISE 2 R0 R0 - 0x80000000, // 0080 RET 0 + 0x7412001A, // 000C JMPT R4 #0028 + 0x8810015B, // 000D GETMBR R4 R0 K91 + 0x90024604, // 000E SETMBR R0 K35 R4 + 0xB8124A00, // 000F GETNGBL R4 K37 + 0x8C10098C, // 0010 GETMET R4 R4 K140 + 0x5818008D, // 0011 LDCONST R6 K141 + 0x501C0200, // 0012 LDBOOL R7 1 0 + 0x7C100600, // 0013 CALL R4 3 + 0x9410098D, // 0014 GETIDX R4 R4 K141 + 0x6014000C, // 0015 GETGBL R5 G12 + 0x5C180800, // 0016 MOVE R6 R4 + 0x7C140200, // 0017 CALL R5 1 + 0x24140B17, // 0018 GT R5 R5 K23 + 0x7816000D, // 0019 JMPF R5 #0028 + 0x8C14035C, // 001A GETMET R5 R1 K92 + 0x5C1C0800, // 001B MOVE R7 R4 + 0x5820001C, // 001C LDCONST R8 K28 + 0x7C140600, // 001D CALL R5 3 + 0x8C180B5D, // 001E GETMET R6 R5 K93 + 0x7C180200, // 001F CALL R6 1 + 0x24180D44, // 0020 GT R6 R6 K68 + 0x781A0005, // 0021 JMPF R6 #0028 + 0x60180018, // 0022 GETGBL R6 G24 + 0x581C008E, // 0023 LDCONST R7 K142 + 0x94200B17, // 0024 GETIDX R8 R5 K23 + 0x94240B44, // 0025 GETIDX R9 R5 K68 + 0x7C180600, // 0026 CALL R6 3 + 0x90024606, // 0027 SETMBR R0 K35 R6 + 0x60100018, // 0028 GETGBL R4 G24 + 0x5814008F, // 0029 LDCONST R5 K143 + 0x88180123, // 002A GETMBR R6 R0 K35 + 0x881C0190, // 002B GETMBR R7 R0 K144 + 0x5C200400, // 002C MOVE R8 R2 + 0x5C240600, // 002D MOVE R9 R3 + 0x7C100A00, // 002E CALL R4 5 + 0xB8165200, // 002F GETNGBL R5 K41 + 0x60180018, // 0030 GETGBL R6 G24 + 0x581C0091, // 0031 LDCONST R7 K145 + 0x5C200800, // 0032 MOVE R8 R4 + 0x7C180400, // 0033 CALL R6 2 + 0x581C002B, // 0034 LDCONST R7 K43 + 0x7C140400, // 0035 CALL R5 2 + 0xB8168000, // 0036 GETNGBL R5 K64 + 0x7C140000, // 0037 CALL R5 0 + 0x8C180B41, // 0038 GETMET R6 R5 K65 + 0x5C200800, // 0039 MOVE R8 R4 + 0x7C180400, // 003A CALL R6 2 + 0x8C180B42, // 003B GETMET R6 R5 K66 + 0x7C180200, // 003C CALL R6 1 + 0x541E00C7, // 003D LDINT R7 200 + 0x201C0C07, // 003E NE R7 R6 R7 + 0x781E0035, // 003F JMPF R7 #0076 + 0x881C015B, // 0040 GETMBR R7 R0 K91 + 0x88200123, // 0041 GETMBR R8 R0 K35 + 0x201C0E08, // 0042 NE R7 R7 R8 + 0x781E0022, // 0043 JMPF R7 #0067 + 0x8C1C0B92, // 0044 GETMET R7 R5 K146 + 0x7C1C0200, // 0045 CALL R7 1 + 0x141C0F17, // 0046 LT R7 R7 K23 + 0x781E0005, // 0047 JMPF R7 #004E + 0x8C1C0B93, // 0048 GETMET R7 R5 K147 + 0x7C1C0200, // 0049 CALL R7 1 + 0xB81E8000, // 004A GETNGBL R7 K64 + 0x7C1C0000, // 004B CALL R7 0 + 0x5C140E00, // 004C MOVE R5 R7 + 0x70020001, // 004D JMP #0050 + 0x8C1C0B46, // 004E GETMET R7 R5 K70 + 0x7C1C0200, // 004F CALL R7 1 + 0x881C015B, // 0050 GETMBR R7 R0 K91 + 0x90024607, // 0051 SETMBR R0 K35 R7 + 0x601C0018, // 0052 GETGBL R7 G24 + 0x5820008F, // 0053 LDCONST R8 K143 + 0x88240123, // 0054 GETMBR R9 R0 K35 + 0x88280190, // 0055 GETMBR R10 R0 K144 + 0x5C2C0400, // 0056 MOVE R11 R2 + 0x5C300600, // 0057 MOVE R12 R3 + 0x7C1C0A00, // 0058 CALL R7 5 + 0x5C100E00, // 0059 MOVE R4 R7 + 0xB81E5200, // 005A GETNGBL R7 K41 + 0x60200018, // 005B GETGBL R8 G24 + 0x58240091, // 005C LDCONST R9 K145 + 0x5C280800, // 005D MOVE R10 R4 + 0x7C200400, // 005E CALL R8 2 + 0x5824002B, // 005F LDCONST R9 K43 + 0x7C1C0400, // 0060 CALL R7 2 + 0x8C1C0B41, // 0061 GETMET R7 R5 K65 + 0x5C240800, // 0062 MOVE R9 R4 + 0x7C1C0400, // 0063 CALL R7 2 + 0x8C1C0B42, // 0064 GETMET R7 R5 K66 + 0x7C1C0200, // 0065 CALL R7 1 + 0x5C180E00, // 0066 MOVE R6 R7 + 0x541E00C7, // 0067 LDINT R7 200 + 0x201C0C07, // 0068 NE R7 R6 R7 + 0x781E000B, // 0069 JMPF R7 #0076 + 0xB81E5200, // 006A GETNGBL R7 K41 + 0x60200018, // 006B GETGBL R8 G24 + 0x58240094, // 006C LDCONST R9 K148 + 0x5C280C00, // 006D MOVE R10 R6 + 0x7C200400, // 006E CALL R8 2 + 0x58240044, // 006F LDCONST R9 K68 + 0x7C1C0400, // 0070 CALL R7 2 + 0x601C0018, // 0071 GETGBL R7 G24 + 0x58200095, // 0072 LDCONST R8 K149 + 0x5C240C00, // 0073 MOVE R9 R6 + 0x7C1C0400, // 0074 CALL R7 2 + 0xB0072C07, // 0075 RAISE 1 K150 R7 + 0x8C1C0B97, // 0076 GETMET R7 R5 K151 + 0x7C1C0200, // 0077 CALL R7 1 + 0x8C200B46, // 0078 GETMET R8 R5 K70 + 0x7C200200, // 0079 CALL R8 1 + 0xA8040001, // 007A EXBLK 1 1 + 0x80040E00, // 007B RET 1 R7 + 0xA8040001, // 007C EXBLK 1 1 + 0x7002000C, // 007D JMP #008B + 0xAC040002, // 007E CATCH R1 0 2 + 0x70020009, // 007F JMP #008A + 0xB80E5200, // 0080 GETNGBL R3 K41 + 0x60100018, // 0081 GETGBL R4 G24 + 0x58140049, // 0082 LDCONST R5 K73 + 0x5C180200, // 0083 MOVE R6 R1 + 0x5C1C0400, // 0084 MOVE R7 R2 + 0x7C100600, // 0085 CALL R4 3 + 0x58140044, // 0086 LDCONST R5 K68 + 0x7C0C0400, // 0087 CALL R3 2 + 0xB0040202, // 0088 RAISE 1 R1 R2 + 0x70020000, // 0089 JMP #008B + 0xB0080000, // 008A RAISE 2 R0 R0 + 0x80000000, // 008B RET 0 }) ) ); From b770518b7286cf6c4a0645cb49c1d8bb65b5781a Mon Sep 17 00:00:00 2001 From: vrilcode <31141078+vrilcode@users.noreply.github.com> Date: Sun, 12 Oct 2025 15:26:26 +0200 Subject: [PATCH 005/136] Update i2c_driver.be (#24003) Added a read_bit function as there is also a write_bit function. --- lib/libesp32/berry_tasmota/src/embedded/i2c_driver.be | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/libesp32/berry_tasmota/src/embedded/i2c_driver.be b/lib/libesp32/berry_tasmota/src/embedded/i2c_driver.be index 540dcc169..0b62135d6 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/i2c_driver.be +++ b/lib/libesp32/berry_tasmota/src/embedded/i2c_driver.be @@ -118,10 +118,17 @@ class I2C_Driver var buf = self.wire.read_bytes(self.addr, reg, 4) return (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3] end + + # Reads a specific bit from a register + # read_bit(reg:int, bit:int) -> bool + def read_bit(reg, bit) + if bit < 0 || bit > 7 return end + return bool(self.read8(reg) & 1 << bit) + end end #- Example d = I2C_Driver("MPU", 0x68, 58) --# \ No newline at end of file +-# From 23a89c12247f2164929da63726a728a09bc47686 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sun, 12 Oct 2025 13:27:58 +0000 Subject: [PATCH 006/136] Solidified Code updated --- .../src/solidify/solidified_i2c_driver.h | 570 ++++++++++-------- 1 file changed, 304 insertions(+), 266 deletions(-) diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_driver.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_driver.h index cc8fcf12b..9562f4fd4 100644 --- a/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_driver.h +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_i2c_driver.h @@ -3,33 +3,103 @@ * Generated code, don't edit * \********************************************************************/ #include "be_constobj.h" -// compact class 'I2C_Driver' ktab size: 20, total: 71 (saved 408 bytes) +// compact class 'I2C_Driver' ktab size: 20, total: 74 (saved 432 bytes) static const bvalue be_ktab_class_I2C_Driver[20] = { /* K0 */ be_nested_str(wire), /* K1 */ be_nested_str(read_bytes), /* K2 */ be_nested_str(addr), - /* K3 */ be_const_int(0), - /* K4 */ be_const_int(1), - /* K5 */ be_const_int(2), + /* K3 */ be_const_int(2), + /* K4 */ be_const_int(0), + /* K5 */ be_const_int(1), /* K6 */ be_const_int(3), - /* K7 */ be_nested_str(tasmota), - /* K8 */ be_nested_str(i2c_enabled), - /* K9 */ be_nested_str(wire_scan), - /* K10 */ be_nested_str(function), - /* K11 */ be_nested_str(name), - /* K12 */ be_nested_str(I2C_X3A), - /* K13 */ be_nested_str(detected_X20on_X20bus), - /* K14 */ be_nested_str(bus), - /* K15 */ be_nested_str(write8), - /* K16 */ be_nested_str(read8), - /* K17 */ be_nested_str(write16), - /* K18 */ be_nested_str(read), - /* K19 */ be_nested_str(write), + /* K7 */ be_nested_str(read), + /* K8 */ be_nested_str(read8), + /* K9 */ be_nested_str(write8), + /* K10 */ be_nested_str(write16), + /* K11 */ be_nested_str(write), + /* K12 */ be_nested_str(tasmota), + /* K13 */ be_nested_str(i2c_enabled), + /* K14 */ be_nested_str(wire_scan), + /* K15 */ be_nested_str(function), + /* K16 */ be_nested_str(name), + /* K17 */ be_nested_str(I2C_X3A), + /* K18 */ be_nested_str(detected_X20on_X20bus), + /* K19 */ be_nested_str(bus), }; extern const bclass be_class_I2C_Driver; +/******************************************************************** +** Solidified function: read16 +********************************************************************/ +be_local_closure(class_I2C_Driver_read16, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_I2C_Driver, /* shared constants */ + &be_const_str_read16, + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x940C0504, // 0006 GETIDX R3 R2 K4 + 0x54120007, // 0007 LDINT R4 8 + 0x380C0604, // 0008 SHL R3 R3 R4 + 0x94100505, // 0009 GETIDX R4 R2 K5 + 0x000C0604, // 000A ADD R3 R3 R4 + 0x80040600, // 000B RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read13 +********************************************************************/ +be_local_closure(class_I2C_Driver_read13, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_I2C_Driver, /* shared constants */ + &be_const_str_read13, + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x940C0504, // 0006 GETIDX R3 R2 K4 + 0x54120004, // 0007 LDINT R4 5 + 0x380C0604, // 0008 SHL R3 R3 R4 + 0x94100505, // 0009 GETIDX R4 R2 K5 + 0x000C0604, // 000A ADD R3 R3 R4 + 0x80040600, // 000B RET 1 R3 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: read32 ********************************************************************/ @@ -53,14 +123,14 @@ be_local_closure(class_I2C_Driver_read32, /* name */ 0x5C140200, // 0003 MOVE R5 R1 0x541A0003, // 0004 LDINT R6 4 0x7C080800, // 0005 CALL R2 4 - 0x940C0503, // 0006 GETIDX R3 R2 K3 + 0x940C0504, // 0006 GETIDX R3 R2 K4 0x54120017, // 0007 LDINT R4 24 0x380C0604, // 0008 SHL R3 R3 R4 - 0x94100504, // 0009 GETIDX R4 R2 K4 + 0x94100505, // 0009 GETIDX R4 R2 K5 0x5416000F, // 000A LDINT R5 16 0x38100805, // 000B SHL R4 R4 R5 0x000C0604, // 000C ADD R3 R3 R4 - 0x94100505, // 000D GETIDX R4 R2 K5 + 0x94100503, // 000D GETIDX R4 R2 K3 0x54160007, // 000E LDINT R5 8 0x38100805, // 000F SHL R4 R4 R5 0x000C0604, // 0010 ADD R3 R3 R4 @@ -74,76 +144,9 @@ be_local_closure(class_I2C_Driver_read32, /* name */ /******************************************************************** -** Solidified function: init +** Solidified function: read8 ********************************************************************/ -be_local_closure(class_I2C_Driver_init, /* name */ - be_nested_proto( - 9, /* nstack */ - 4, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_I2C_Driver, /* shared constants */ - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[44]) { /* code */ - 0x4C100000, // 0000 LDNIL R4 - 0x20100604, // 0001 NE R4 R3 R4 - 0x78120005, // 0002 JMPF R4 #0009 - 0xB8120E00, // 0003 GETNGBL R4 K7 - 0x8C100908, // 0004 GETMET R4 R4 K8 - 0x5C180600, // 0005 MOVE R6 R3 - 0x7C100400, // 0006 CALL R4 2 - 0x74120000, // 0007 JMPT R4 #0009 - 0x80000800, // 0008 RET 0 - 0x90020402, // 0009 SETMBR R0 K2 R2 - 0xB8120E00, // 000A GETNGBL R4 K7 - 0x8C100909, // 000B GETMET R4 R4 K9 - 0x88180102, // 000C GETMBR R6 R0 K2 - 0x7C100400, // 000D CALL R4 2 - 0x90020004, // 000E SETMBR R0 K0 R4 - 0x88100100, // 000F GETMBR R4 R0 K0 - 0x78120019, // 0010 JMPF R4 #002B - 0x60100004, // 0011 GETGBL R4 G4 - 0x5C140200, // 0012 MOVE R5 R1 - 0x7C100200, // 0013 CALL R4 1 - 0x1C10090A, // 0014 EQ R4 R4 K10 - 0x78120004, // 0015 JMPF R4 #001B - 0x5C100200, // 0016 MOVE R4 R1 - 0x5C140000, // 0017 MOVE R5 R0 - 0x7C100200, // 0018 CALL R4 1 - 0x90021604, // 0019 SETMBR R0 K11 R4 - 0x70020000, // 001A JMP #001C - 0x90021601, // 001B SETMBR R0 K11 R1 - 0x8810010B, // 001C GETMBR R4 R0 K11 - 0x4C140000, // 001D LDNIL R5 - 0x1C100805, // 001E EQ R4 R4 R5 - 0x78120001, // 001F JMPF R4 #0022 - 0x4C100000, // 0020 LDNIL R4 - 0x90020004, // 0021 SETMBR R0 K0 R4 - 0x88100100, // 0022 GETMBR R4 R0 K0 - 0x78120006, // 0023 JMPF R4 #002B - 0x60100001, // 0024 GETGBL R4 G1 - 0x5814000C, // 0025 LDCONST R5 K12 - 0x8818010B, // 0026 GETMBR R6 R0 K11 - 0x581C000D, // 0027 LDCONST R7 K13 - 0x88200100, // 0028 GETMBR R8 R0 K0 - 0x8820110E, // 0029 GETMBR R8 R8 K14 - 0x7C100800, // 002A CALL R4 4 - 0x80000000, // 002B RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read24 -********************************************************************/ -be_local_closure(class_I2C_Driver_read24, /* name */ +be_local_closure(class_I2C_Driver_read8, /* name */ be_nested_proto( 7, /* nstack */ 2, /* argc */ @@ -154,25 +157,88 @@ be_local_closure(class_I2C_Driver_read24, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_I2C_Driver, /* shared constants */ - &be_const_str_read24, + &be_const_str_read8, &be_const_str_solidified, - ( &(const binstruction[16]) { /* code */ + ( &(const binstruction[ 7]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080507, // 0001 GETMET R2 R2 K7 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180005, // 0004 LDCONST R6 K5 + 0x7C080800, // 0005 CALL R2 4 + 0x80040400, // 0006 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read12 +********************************************************************/ +be_local_closure(class_I2C_Driver_read12, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_I2C_Driver, /* shared constants */ + &be_const_str_read12, + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 0x88100102, // 0002 GETMBR R4 R0 K2 0x5C140200, // 0003 MOVE R5 R1 - 0x58180006, // 0004 LDCONST R6 K6 + 0x58180003, // 0004 LDCONST R6 K3 0x7C080800, // 0005 CALL R2 4 - 0x940C0503, // 0006 GETIDX R3 R2 K3 - 0x5412000F, // 0007 LDINT R4 16 + 0x940C0504, // 0006 GETIDX R3 R2 K4 + 0x54120003, // 0007 LDINT R4 4 0x380C0604, // 0008 SHL R3 R3 R4 - 0x94100504, // 0009 GETIDX R4 R2 K4 - 0x54160007, // 000A LDINT R5 8 - 0x38100805, // 000B SHL R4 R4 R5 - 0x000C0604, // 000C ADD R3 R3 R4 - 0x94100505, // 000D GETIDX R4 R2 K5 - 0x000C0604, // 000E ADD R3 R3 R4 - 0x80040600, // 000F RET 1 R3 + 0x94100505, // 0009 GETIDX R4 R2 K5 + 0x000C0604, // 000A ADD R3 R3 R4 + 0x80040600, // 000B RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: read_bit +********************************************************************/ +be_local_closure(class_I2C_Driver_read_bit, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_I2C_Driver, /* shared constants */ + &be_const_str_read_bit, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x140C0504, // 0000 LT R3 R2 K4 + 0x740E0002, // 0001 JMPT R3 #0005 + 0x540E0006, // 0002 LDINT R3 7 + 0x240C0403, // 0003 GT R3 R2 R3 + 0x780E0000, // 0004 JMPF R3 #0006 + 0x80000600, // 0005 RET 0 + 0x600C0017, // 0006 GETGBL R3 G23 + 0x8C100108, // 0007 GETMET R4 R0 K8 + 0x5C180200, // 0008 MOVE R6 R1 + 0x7C100400, // 0009 CALL R4 2 + 0x38160A02, // 000A SHL R5 K5 R2 + 0x2C100805, // 000B AND R4 R4 R5 + 0x7C0C0200, // 000C CALL R3 1 + 0x80040600, // 000D RET 1 R3 }) ) ); @@ -196,25 +262,25 @@ be_local_closure(class_I2C_Driver_write_bit, /* name */ &be_const_str_write_bit, &be_const_str_solidified, ( &(const binstruction[26]) { /* code */ - 0x14100503, // 0000 LT R4 R2 K3 + 0x14100504, // 0000 LT R4 R2 K4 0x74120002, // 0001 JMPT R4 #0005 0x54120006, // 0002 LDINT R4 7 0x24100404, // 0003 GT R4 R2 R4 0x78120000, // 0004 JMPF R4 #0006 0x80000800, // 0005 RET 0 - 0x38120802, // 0006 SHL R4 K4 R2 + 0x38120A02, // 0006 SHL R4 K5 R2 0x780E0007, // 0007 JMPF R3 #0010 - 0x8C14010F, // 0008 GETMET R5 R0 K15 + 0x8C140109, // 0008 GETMET R5 R0 K9 0x5C1C0200, // 0009 MOVE R7 R1 - 0x8C200110, // 000A GETMET R8 R0 K16 + 0x8C200108, // 000A GETMET R8 R0 K8 0x5C280200, // 000B MOVE R10 R1 0x7C200400, // 000C CALL R8 2 0x30201004, // 000D OR R8 R8 R4 0x7C140600, // 000E CALL R5 3 0x70020008, // 000F JMP #0019 - 0x8C14010F, // 0010 GETMET R5 R0 K15 + 0x8C140109, // 0010 GETMET R5 R0 K9 0x5C1C0200, // 0011 MOVE R7 R1 - 0x8C200110, // 0012 GETMET R8 R0 K16 + 0x8C200108, // 0012 GETMET R8 R0 K8 0x5C280200, // 0013 MOVE R10 R1 0x7C200400, // 0014 CALL R8 2 0x542600FE, // 0015 LDINT R9 255 @@ -228,6 +294,41 @@ be_local_closure(class_I2C_Driver_write_bit, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: read16LE +********************************************************************/ +be_local_closure(class_I2C_Driver_read16LE, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_I2C_Driver, /* shared constants */ + &be_const_str_read16LE, + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 K0 + 0x8C080501, // 0001 GETMET R2 R2 K1 + 0x88100102, // 0002 GETMBR R4 R0 K2 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x940C0505, // 0006 GETIDX R3 R2 K5 + 0x54120007, // 0007 LDINT R4 8 + 0x380C0604, // 0008 SHL R3 R3 R4 + 0x94100504, // 0009 GETIDX R4 R2 K4 + 0x000C0604, // 000A ADD R3 R3 R4 + 0x80040600, // 000B RET 1 R3 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: write16LE ********************************************************************/ @@ -255,7 +356,7 @@ be_local_closure(class_I2C_Driver_write16LE, /* name */ 0x3C100805, // 0007 SHR R4 R4 R5 0x300C0604, // 0008 OR R3 R3 R4 0x5C080600, // 0009 MOVE R2 R3 - 0x8C0C0111, // 000A GETMET R3 R0 K17 + 0x8C0C010A, // 000A GETMET R3 R0 K10 0x5C140200, // 000B MOVE R5 R1 0x5C180400, // 000C MOVE R6 R2 0x7C0C0600, // 000D CALL R3 3 @@ -267,12 +368,12 @@ be_local_closure(class_I2C_Driver_write16LE, /* name */ /******************************************************************** -** Solidified function: read8 +** Solidified function: write8 ********************************************************************/ -be_local_closure(class_I2C_Driver_read8, /* name */ +be_local_closure(class_I2C_Driver_write8, /* name */ be_nested_proto( - 7, /* nstack */ - 2, /* argc */ + 9, /* nstack */ + 3, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -280,16 +381,17 @@ be_local_closure(class_I2C_Driver_read8, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_I2C_Driver, /* shared constants */ - &be_const_str_read8, + &be_const_str_write8, &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C080512, // 0001 GETMET R2 R2 K18 - 0x88100102, // 0002 GETMBR R4 R0 K2 - 0x5C140200, // 0003 MOVE R5 R1 - 0x58180004, // 0004 LDCONST R6 K4 - 0x7C080800, // 0005 CALL R2 4 - 0x80040400, // 0006 RET 1 R2 + ( &(const binstruction[ 8]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 K0 + 0x8C0C070B, // 0001 GETMET R3 R3 K11 + 0x88140102, // 0002 GETMBR R5 R0 K2 + 0x5C180200, // 0003 MOVE R6 R1 + 0x5C1C0400, // 0004 MOVE R7 R2 + 0x58200005, // 0005 LDCONST R8 K5 + 0x7C0C0A00, // 0006 CALL R3 5 + 0x80040600, // 0007 RET 1 R3 }) ) ); @@ -317,47 +419,12 @@ be_local_closure(class_I2C_Driver_read14, /* name */ 0x8C080501, // 0001 GETMET R2 R2 K1 0x88100102, // 0002 GETMBR R4 R0 K2 0x5C140200, // 0003 MOVE R5 R1 - 0x58180005, // 0004 LDCONST R6 K5 - 0x7C080800, // 0005 CALL R2 4 - 0x940C0503, // 0006 GETIDX R3 R2 K3 - 0x54120005, // 0007 LDINT R4 6 - 0x380C0604, // 0008 SHL R3 R3 R4 - 0x94100504, // 0009 GETIDX R4 R2 K4 - 0x000C0604, // 000A ADD R3 R3 R4 - 0x80040600, // 000B RET 1 R3 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read16LE -********************************************************************/ -be_local_closure(class_I2C_Driver_read16LE, /* name */ - be_nested_proto( - 7, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_I2C_Driver, /* shared constants */ - &be_const_str_read16LE, - &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C080501, // 0001 GETMET R2 R2 K1 - 0x88100102, // 0002 GETMBR R4 R0 K2 - 0x5C140200, // 0003 MOVE R5 R1 - 0x58180005, // 0004 LDCONST R6 K5 + 0x58180003, // 0004 LDCONST R6 K3 0x7C080800, // 0005 CALL R2 4 0x940C0504, // 0006 GETIDX R3 R2 K4 - 0x54120007, // 0007 LDINT R4 8 + 0x54120005, // 0007 LDINT R4 6 0x380C0604, // 0008 SHL R3 R3 R4 - 0x94100503, // 0009 GETIDX R4 R2 K3 + 0x94100505, // 0009 GETIDX R4 R2 K5 0x000C0604, // 000A ADD R3 R3 R4 0x80040600, // 000B RET 1 R3 }) @@ -367,9 +434,9 @@ be_local_closure(class_I2C_Driver_read16LE, /* name */ /******************************************************************** -** Solidified function: read12 +** Solidified function: read24 ********************************************************************/ -be_local_closure(class_I2C_Driver_read12, /* name */ +be_local_closure(class_I2C_Driver_read24, /* name */ be_nested_proto( 7, /* nstack */ 2, /* argc */ @@ -380,21 +447,25 @@ be_local_closure(class_I2C_Driver_read12, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_I2C_Driver, /* shared constants */ - &be_const_str_read12, + &be_const_str_read24, &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ + ( &(const binstruction[16]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 0x88100102, // 0002 GETMBR R4 R0 K2 0x5C140200, // 0003 MOVE R5 R1 - 0x58180005, // 0004 LDCONST R6 K5 + 0x58180006, // 0004 LDCONST R6 K6 0x7C080800, // 0005 CALL R2 4 - 0x940C0503, // 0006 GETIDX R3 R2 K3 - 0x54120003, // 0007 LDINT R4 4 + 0x940C0504, // 0006 GETIDX R3 R2 K4 + 0x5412000F, // 0007 LDINT R4 16 0x380C0604, // 0008 SHL R3 R3 R4 - 0x94100504, // 0009 GETIDX R4 R2 K4 - 0x000C0604, // 000A ADD R3 R3 R4 - 0x80040600, // 000B RET 1 R3 + 0x94100505, // 0009 GETIDX R4 R2 K5 + 0x54160007, // 000A LDINT R5 8 + 0x38100805, // 000B SHL R4 R4 R5 + 0x000C0604, // 000C ADD R3 R3 R4 + 0x94100503, // 000D GETIDX R4 R2 K3 + 0x000C0604, // 000E ADD R3 R3 R4 + 0x80040600, // 000F RET 1 R3 }) ) ); @@ -402,12 +473,12 @@ be_local_closure(class_I2C_Driver_read12, /* name */ /******************************************************************** -** Solidified function: write8 +** Solidified function: init ********************************************************************/ -be_local_closure(class_I2C_Driver_write8, /* name */ +be_local_closure(class_I2C_Driver_init, /* name */ be_nested_proto( 9, /* nstack */ - 3, /* argc */ + 4, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -415,87 +486,53 @@ be_local_closure(class_I2C_Driver_write8, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_I2C_Driver, /* shared constants */ - &be_const_str_write8, + &be_const_str_init, &be_const_str_solidified, - ( &(const binstruction[ 8]) { /* code */ - 0x880C0100, // 0000 GETMBR R3 R0 K0 - 0x8C0C0713, // 0001 GETMET R3 R3 K19 - 0x88140102, // 0002 GETMBR R5 R0 K2 - 0x5C180200, // 0003 MOVE R6 R1 - 0x5C1C0400, // 0004 MOVE R7 R2 - 0x58200004, // 0005 LDCONST R8 K4 - 0x7C0C0A00, // 0006 CALL R3 5 - 0x80040600, // 0007 RET 1 R3 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read13 -********************************************************************/ -be_local_closure(class_I2C_Driver_read13, /* name */ - be_nested_proto( - 7, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_I2C_Driver, /* shared constants */ - &be_const_str_read13, - &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C080501, // 0001 GETMET R2 R2 K1 - 0x88100102, // 0002 GETMBR R4 R0 K2 - 0x5C140200, // 0003 MOVE R5 R1 - 0x58180005, // 0004 LDCONST R6 K5 - 0x7C080800, // 0005 CALL R2 4 - 0x940C0503, // 0006 GETIDX R3 R2 K3 - 0x54120004, // 0007 LDINT R4 5 - 0x380C0604, // 0008 SHL R3 R3 R4 - 0x94100504, // 0009 GETIDX R4 R2 K4 - 0x000C0604, // 000A ADD R3 R3 R4 - 0x80040600, // 000B RET 1 R3 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read16 -********************************************************************/ -be_local_closure(class_I2C_Driver_read16, /* name */ - be_nested_proto( - 7, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_I2C_Driver, /* shared constants */ - &be_const_str_read16, - &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C080501, // 0001 GETMET R2 R2 K1 - 0x88100102, // 0002 GETMBR R4 R0 K2 - 0x5C140200, // 0003 MOVE R5 R1 - 0x58180005, // 0004 LDCONST R6 K5 - 0x7C080800, // 0005 CALL R2 4 - 0x940C0503, // 0006 GETIDX R3 R2 K3 - 0x54120007, // 0007 LDINT R4 8 - 0x380C0604, // 0008 SHL R3 R3 R4 - 0x94100504, // 0009 GETIDX R4 R2 K4 - 0x000C0604, // 000A ADD R3 R3 R4 - 0x80040600, // 000B RET 1 R3 + ( &(const binstruction[44]) { /* code */ + 0x4C100000, // 0000 LDNIL R4 + 0x20100604, // 0001 NE R4 R3 R4 + 0x78120005, // 0002 JMPF R4 #0009 + 0xB8121800, // 0003 GETNGBL R4 K12 + 0x8C10090D, // 0004 GETMET R4 R4 K13 + 0x5C180600, // 0005 MOVE R6 R3 + 0x7C100400, // 0006 CALL R4 2 + 0x74120000, // 0007 JMPT R4 #0009 + 0x80000800, // 0008 RET 0 + 0x90020402, // 0009 SETMBR R0 K2 R2 + 0xB8121800, // 000A GETNGBL R4 K12 + 0x8C10090E, // 000B GETMET R4 R4 K14 + 0x88180102, // 000C GETMBR R6 R0 K2 + 0x7C100400, // 000D CALL R4 2 + 0x90020004, // 000E SETMBR R0 K0 R4 + 0x88100100, // 000F GETMBR R4 R0 K0 + 0x78120019, // 0010 JMPF R4 #002B + 0x60100004, // 0011 GETGBL R4 G4 + 0x5C140200, // 0012 MOVE R5 R1 + 0x7C100200, // 0013 CALL R4 1 + 0x1C10090F, // 0014 EQ R4 R4 K15 + 0x78120004, // 0015 JMPF R4 #001B + 0x5C100200, // 0016 MOVE R4 R1 + 0x5C140000, // 0017 MOVE R5 R0 + 0x7C100200, // 0018 CALL R4 1 + 0x90022004, // 0019 SETMBR R0 K16 R4 + 0x70020000, // 001A JMP #001C + 0x90022001, // 001B SETMBR R0 K16 R1 + 0x88100110, // 001C GETMBR R4 R0 K16 + 0x4C140000, // 001D LDNIL R5 + 0x1C100805, // 001E EQ R4 R4 R5 + 0x78120001, // 001F JMPF R4 #0022 + 0x4C100000, // 0020 LDNIL R4 + 0x90020004, // 0021 SETMBR R0 K0 R4 + 0x88100100, // 0022 GETMBR R4 R0 K0 + 0x78120006, // 0023 JMPF R4 #002B + 0x60100001, // 0024 GETGBL R4 G1 + 0x58140011, // 0025 LDCONST R5 K17 + 0x88180110, // 0026 GETMBR R6 R0 K16 + 0x581C0012, // 0027 LDCONST R7 K18 + 0x88200100, // 0028 GETMBR R8 R0 K0 + 0x88201113, // 0029 GETMBR R8 R8 K19 + 0x7C100800, // 002A CALL R4 4 + 0x80000000, // 002B RET 0 }) ) ); @@ -520,11 +557,11 @@ be_local_closure(class_I2C_Driver_write16, /* name */ &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ 0x880C0100, // 0000 GETMBR R3 R0 K0 - 0x8C0C0713, // 0001 GETMET R3 R3 K19 + 0x8C0C070B, // 0001 GETMET R3 R3 K11 0x88140102, // 0002 GETMBR R5 R0 K2 0x5C180200, // 0003 MOVE R6 R1 0x5C1C0400, // 0004 MOVE R7 R2 - 0x58200005, // 0005 LDCONST R8 K5 + 0x58200003, // 0005 LDCONST R8 K3 0x7C0C0A00, // 0006 CALL R3 5 0x80040600, // 0007 RET 1 R3 }) @@ -539,24 +576,25 @@ be_local_closure(class_I2C_Driver_write16, /* name */ be_local_class(I2C_Driver, 3, NULL, - be_nested_map(16, + be_nested_map(17, ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(write16, 11), be_const_closure(class_I2C_Driver_write16_closure) }, + { be_const_key(read13, 8), be_const_closure(class_I2C_Driver_read13_closure) }, { be_const_key(read32, -1), be_const_closure(class_I2C_Driver_read32_closure) }, - { be_const_key(write16, 15), be_const_closure(class_I2C_Driver_write16_closure) }, - { be_const_key(addr, -1), be_const_var(1) }, - { be_const_key(init, 1), be_const_closure(class_I2C_Driver_init_closure) }, + { be_const_key(read8, 4), be_const_closure(class_I2C_Driver_read8_closure) }, { be_const_key(write_bit, -1), be_const_closure(class_I2C_Driver_write_bit_closure) }, - { be_const_key(read14, -1), be_const_closure(class_I2C_Driver_read14_closure) }, - { be_const_key(name, -1), be_const_var(2) }, - { be_const_key(read8, -1), be_const_closure(class_I2C_Driver_read8_closure) }, - { be_const_key(write16LE, 11), be_const_closure(class_I2C_Driver_write16LE_closure) }, - { be_const_key(read16LE, -1), be_const_closure(class_I2C_Driver_read16LE_closure) }, + { be_const_key(read16, 16), be_const_closure(class_I2C_Driver_read16_closure) }, { be_const_key(read12, -1), be_const_closure(class_I2C_Driver_read12_closure) }, - { be_const_key(wire, 5), be_const_var(0) }, + { be_const_key(read_bit, -1), be_const_closure(class_I2C_Driver_read_bit_closure) }, { be_const_key(write8, -1), be_const_closure(class_I2C_Driver_write8_closure) }, - { be_const_key(read13, -1), be_const_closure(class_I2C_Driver_read13_closure) }, - { be_const_key(read16, -1), be_const_closure(class_I2C_Driver_read16_closure) }, + { be_const_key(read16LE, -1), be_const_closure(class_I2C_Driver_read16LE_closure) }, + { be_const_key(write16LE, -1), be_const_closure(class_I2C_Driver_write16LE_closure) }, + { be_const_key(wire, -1), be_const_var(0) }, + { be_const_key(addr, 0), be_const_var(1) }, + { be_const_key(read14, -1), be_const_closure(class_I2C_Driver_read14_closure) }, { be_const_key(read24, -1), be_const_closure(class_I2C_Driver_read24_closure) }, + { be_const_key(init, -1), be_const_closure(class_I2C_Driver_init_closure) }, + { be_const_key(name, -1), be_const_var(2) }, })), (bstring*) &be_const_str_I2C_Driver ); From 0eec031d49f93877b1cd5b69eea9832c242c32d3 Mon Sep 17 00:00:00 2001 From: Christian Baars Date: Sun, 12 Oct 2025 17:15:02 +0200 Subject: [PATCH 007/136] split udisplay.cpp into multiple files (#24007) --- lib/lib_display/UDisplay/uDisplay.cpp | 2980 +---------------- lib/lib_display/UDisplay/uDisplay.h | 364 +- lib/lib_display/UDisplay/uDisplayColors.cpp | 31 + lib/lib_display/UDisplay/uDisplay_config.h | 56 + lib/lib_display/UDisplay/uDisplay_control.cpp | 146 + lib/lib_display/UDisplay/uDisplay_dma.cpp | 133 + lib/lib_display/UDisplay/uDisplay_epd.cpp | 362 ++ lib/lib_display/UDisplay/uDisplay_esp32s3.cpp | 158 + .../UDisplay/uDisplay_graphics.cpp | 565 ++++ .../UDisplay/uDisplay_parallel.cpp | 142 + lib/lib_display/UDisplay/uDisplay_spi.cpp | 154 + lib/lib_display/UDisplay/uDisplay_spi.h | 71 + .../UDisplay/uDisplay_spi_comm.cpp | 158 + lib/lib_display/UDisplay/uDisplay_timing.cpp | 60 + lib/lib_display/UDisplay/uDisplay_touch.cpp | 568 ++++ lib/lib_display/UDisplay/uDisplay_utils.cpp | 111 + 16 files changed, 2923 insertions(+), 3136 deletions(-) mode change 100755 => 100644 lib/lib_display/UDisplay/uDisplay.cpp mode change 100755 => 100644 lib/lib_display/UDisplay/uDisplay.h create mode 100644 lib/lib_display/UDisplay/uDisplayColors.cpp create mode 100644 lib/lib_display/UDisplay/uDisplay_config.h create mode 100644 lib/lib_display/UDisplay/uDisplay_control.cpp create mode 100644 lib/lib_display/UDisplay/uDisplay_dma.cpp create mode 100644 lib/lib_display/UDisplay/uDisplay_epd.cpp create mode 100644 lib/lib_display/UDisplay/uDisplay_esp32s3.cpp create mode 100644 lib/lib_display/UDisplay/uDisplay_graphics.cpp create mode 100644 lib/lib_display/UDisplay/uDisplay_parallel.cpp create mode 100644 lib/lib_display/UDisplay/uDisplay_spi.cpp create mode 100644 lib/lib_display/UDisplay/uDisplay_spi.h create mode 100644 lib/lib_display/UDisplay/uDisplay_spi_comm.cpp create mode 100644 lib/lib_display/UDisplay/uDisplay_timing.cpp create mode 100644 lib/lib_display/UDisplay/uDisplay_touch.cpp create mode 100644 lib/lib_display/UDisplay/uDisplay_utils.cpp diff --git a/lib/lib_display/UDisplay/uDisplay.cpp b/lib/lib_display/UDisplay/uDisplay.cpp old mode 100755 new mode 100644 index 0619d796b..142eecfcd --- a/lib/lib_display/UDisplay/uDisplay.cpp +++ b/lib/lib_display/UDisplay/uDisplay.cpp @@ -19,55 +19,24 @@ #include #include "uDisplay.h" +#include "uDisplay_config.h" +#include "uDisplay_spi.h" #ifdef ESP32 #include "esp8266toEsp32.h" #endif - -#ifdef USE_ESP32_S3 -#include "esp_cache.h" -#endif // USE_ESP32_S3 - #include "tasmota_options.h" -extern int Cache_WriteBack_Addr(uint32_t addr, uint32_t size); - - //#define UDSP_DEBUG #ifndef UDSP_LBSIZE #define UDSP_LBSIZE 256 #endif -#define renderer_swap(a, b) { int16_t t = a; a = b; b = t; } - -enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE}; -extern void AddLog(uint32_t loglevel, PGM_P formatP, ...); - -const uint16_t udisp_colors[]={UDISP_BLACK,UDISP_WHITE,UDISP_RED,UDISP_GREEN,UDISP_BLUE,UDISP_CYAN,UDISP_MAGENTA,\ - UDISP_YELLOW,UDISP_NAVY,UDISP_DARKGREEN,UDISP_DARKCYAN,UDISP_MAROON,UDISP_PURPLE,UDISP_OLIVE,\ -UDISP_LIGHTGREY,UDISP_DARKGREY,UDISP_ORANGE,UDISP_GREENYELLOW,UDISP_PINK}; - -uint16_t uDisplay::GetColorFromIndex(uint8_t index) { - if (index >= sizeof(udisp_colors) / 2) index = 0; - return udisp_colors[index]; -} - -uint16_t uDisplay::fgcol(void) { - return fg_col; -} -uint16_t uDisplay::bgcol(void) { - return bg_col; -} - -int8_t uDisplay::color_type(void) { - return col_type; -} - uDisplay::~uDisplay(void) { #ifdef UDSP_DEBUG - Serial.printf("dealloc\n"); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: dealloc"); #endif if (frame_buffer) { free(frame_buffer); @@ -176,7 +145,7 @@ uDisplay::uDisplay(char *lp) : Renderer(800, 600) { if (*lp1 == '#') break; if (*lp1 == '\n') lp1++; while (*lp1 == ' ') lp1++; - //Serial.printf(">> %s\n",lp1); + //AddLog(LOG_LEVEL_DEBUG, ">> %s\n",lp1); if (*lp1 != ';') { // check ids: if (*lp1 == ':') { @@ -221,10 +190,7 @@ uDisplay::uDisplay(char *lp) : Renderer(800, 600) { reset_pin(50, 200); } #ifdef UDSP_DEBUG - Serial.printf("SSPI_MOSI : %d\n", spi_mosi); - Serial.printf("SSPI_SCLK : %d\n", spi_clk); - Serial.printf("SSPI_CS : %d\n", spi_cs); - Serial.printf("DSP RESET : %d\n", reset); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: SSPI_MOSI:%d SSPI_SCLK:%d SSPI_CS:%d DSP_RESET:%d", spi_mosi, spi_clk, spi_cs, reset); #endif } } else if (*lp1 == 'I') { @@ -236,8 +202,7 @@ uDisplay::uDisplay(char *lp) : Renderer(800, 600) { wire_n = next_val(&lp1); i2caddr = next_hex(&lp1); #ifdef UDSP_DEBUG - Serial.printf("I2C_INIT bus : %d\n", wire_n); - Serial.printf("I2C_INIT addr : %02x\n", i2caddr); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: I2C_INIT bus:%d addr:%02x", wire_n, i2caddr); #endif if (wire_n == 1) { wire = &Wire; @@ -405,12 +370,12 @@ uDisplay::uDisplay(char *lp) : Renderer(800, 600) { wire->write(dsp_cmds[1]); wire->endTransmission(); #ifdef UDSP_DEBUG - Serial.printf("reg = %02x, val = %02x\n", dsp_cmds[0], dsp_cmds[1]); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: reg=%02x val=%02x", dsp_cmds[0], dsp_cmds[1]); #endif } else { delay(dsp_cmds[0]); #ifdef UDSP_DEBUG - Serial.printf("delay = %d ms\n", dsp_cmds[0]); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: delay=%d ms", dsp_cmds[0]); #endif } } @@ -718,151 +683,77 @@ void UfsCheckSDCardInit(void); } #ifdef UDSP_DEBUG - Serial.printf("Device : %s\n", dname); - Serial.printf("xs : %d\n", gxs); - Serial.printf("ys : %d\n", gys); - Serial.printf("bpp: %d\n", bpp); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: Device:%s xs:%d ys:%d bpp:%d", dname, gxs, gys, bpp); if (interface == _UDSP_SPI) { - Serial.printf("Nr. : %d\n", spi_nr); - Serial.printf("CS : %d\n", spi_cs); - Serial.printf("CLK : %d\n", spi_clk); - Serial.printf("MOSI: %d\n", spi_mosi); - Serial.printf("DC : %d\n", spi_dc); - Serial.printf("TS_CS: %d\n", ut_spi_cs); - Serial.printf("TS_RST: %d\n", ut_reset); - Serial.printf("TS_IRQ: %d\n", ut_irq); - Serial.printf("BPAN: %d\n", bpanel); - Serial.printf("RES : %d\n", reset); - Serial.printf("MISO: %d\n", spi_miso); - Serial.printf("SPED: %d\n", spi_speed*1000000); - Serial.printf("Pixels: %d\n", col_mode); - Serial.printf("SaMode: %d\n", sa_mode); - Serial.printf("DMA-Mode: %d\n", lvgl_param.use_dma); - - Serial.printf("opts: %02x,%02x,%02x\n", saw_3, dim_op, startline); - - Serial.printf("SetAddr : %x,%x,%x\n", saw_1, saw_2, saw_3); - - Serial.printf("Rot 0: %x,%x - %d - %d\n", madctrl, rot[0], x_addr_offs[0], y_addr_offs[0]); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: Nr:%d CS:%d CLK:%d MOSI:%d DC:%d TS_CS:%d TS_RST:%d TS_IRQ:%d", + spi_nr, spi_cs, spi_clk, spi_mosi, spi_dc, ut_spi_cs, ut_reset, ut_irq); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: BPAN:%d RES:%d MISO:%d SPED:%d Pixels:%d SaMode:%d DMA-Mode:%d opts:%02x,%02x,%02x SetAddr:%x,%x,%x", + bpanel, reset, spi_miso, spi_speed*1000000, col_mode, sa_mode, lvgl_param.use_dma, saw_3, dim_op, startline, saw_1, saw_2, saw_3); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: Rot 0: %x,%x - %d - %d", madctrl, rot[0], x_addr_offs[0], y_addr_offs[0]); if (ep_mode == 1) { - Serial.printf("LUT_Partial : %d - %d - %x - %d - %d\n", lut_siz_partial, lutpsize, lut_cmd[0], epcoffs_part, epc_part_cnt); - Serial.printf("LUT_Full : %d - %d - %x - %d - %d\n", lut_siz_full, lutfsize, lut_cmd[0], epcoffs_full, epc_full_cnt); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: LUT_Partial:%d-%d-%x-%d-%d LUT_Full:%d-%d-%x-%d-%d", + lut_siz_partial, lutpsize, lut_cmd[0], epcoffs_part, epc_part_cnt, + lut_siz_full, lutfsize, lut_cmd[0], epcoffs_full, epc_full_cnt); } if (ep_mode == 2) { - Serial.printf("LUT_SIZE 1: %d\n", lut_cnt[0]); - Serial.printf("LUT_SIZE 2: %d\n", lut_cnt[1]); - Serial.printf("LUT_SIZE 3: %d\n", lut_cnt[2]); - Serial.printf("LUT_SIZE 4: %d\n", lut_cnt[3]); - Serial.printf("LUT_SIZE 5: %d\n", lut_cnt[4]); - Serial.printf("LUT_CMDS %02x-%02x-%02x-%02x-%02x\n", lut_cmd[0], lut_cmd[1], lut_cmd[2], lut_cmd[3], lut_cmd[4]); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: LUT_SIZE 1:%d 2:%d 3:%d 4:%d 5:%d", + lut_cnt[0], lut_cnt[1], lut_cnt[2], lut_cnt[3], lut_cnt[4]); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: LUT_CMDS %02x-%02x-%02x-%02x-%02x", + lut_cmd[0], lut_cmd[1], lut_cmd[2], lut_cmd[3], lut_cmd[4]); } } if (interface == _UDSP_I2C) { - Serial.printf("Addr : %02x\n", i2caddr); - Serial.printf("SCL : %d\n", i2c_scl); - Serial.printf("SDA : %d\n", i2c_sda); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: Addr:%02x SCL:%d SDA:%d", i2caddr, i2c_scl, i2c_sda); - Serial.printf("SPA : %x\n", saw_1); - Serial.printf("pa_sta: %x\n", i2c_page_start); - Serial.printf("pa_end: %x\n", i2c_page_end); - Serial.printf("SCA : %x\n", saw_2); - Serial.printf("ca_sta: %x\n", i2c_col_start); - Serial.printf("pa_end: %x\n", i2c_col_end); - Serial.printf("WRA : %x\n", saw_3); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: SPA:%x pa_sta:%x pa_end:%x SCA:%x ca_sta:%x ca_end:%x WRA:%x", + saw_1, i2c_page_start, i2c_page_end, saw_2, i2c_col_start, i2c_col_end, saw_3); } if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { #ifdef USE_ESP32_S3 - Serial.printf("par mode: %d\n", interface); - Serial.printf("par res: %d\n", reset); - Serial.printf("par cs : %d\n", par_cs); - Serial.printf("par rs : %d\n", par_rs); - Serial.printf("par wr : %d\n", par_wr); - Serial.printf("par rd : %d\n", par_rd); - Serial.printf("par bp : %d\n", bpanel); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: par mode:%d res:%d cs:%d rs:%d wr:%d rd:%d bp:%d", + interface, reset, par_cs, par_rs, par_wr, par_rd, bpanel); for (uint32_t cnt = 0; cnt < 8; cnt ++) { - Serial.printf("par d%d: %d\n", cnt, par_dbl[cnt]); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: par d%d:%d", cnt, par_dbl[cnt]); } if (interface == _UDSP_PAR16) { for (uint32_t cnt = 0; cnt < 8; cnt ++) { - Serial.printf("par d%d: %d\n", cnt + 8, par_dbh[cnt]); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: par d%d:%d", cnt + 8, par_dbh[cnt]); } } - Serial.printf("par freq : %d\n", spi_speed); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: par freq:%d", spi_speed); #endif // USE_ESP32_S3 } if (interface == _UDSP_RGB) { #ifdef USE_ESP32_S3 - Serial.printf("rgb de: %d\n", de); - Serial.printf("rgb vsync: %d\n", vsync); - Serial.printf("rgb hsync : %d\n", hsync); - Serial.printf("rgb pclk : %d\n", pclk); - Serial.printf("rgb bp : %d\n", bpanel); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: rgb de:%d vsync:%d hsync:%d pclk:%d bp:%d", de, vsync, hsync, pclk, bpanel); for (uint32_t cnt = 0; cnt < 8; cnt ++) { - Serial.printf("rgb d%d: %d\n", cnt, par_dbl[cnt]); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: rgb d%d:%d", cnt, par_dbl[cnt]); } for (uint32_t cnt = 0; cnt < 8; cnt ++) { - Serial.printf("rgb d%d: %d\n", cnt + 8, par_dbh[cnt]); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: rgb d%d:%d", cnt + 8, par_dbh[cnt]); } - Serial.printf("rgb freq : %d\n", spi_speed); - - Serial.printf("rgb hsync_polarity: %d\n", hsync_polarity); - Serial.printf("rgb hsync_front_porch: %d\n", hsync_front_porch); - Serial.printf("rgb hsync_pulse_width : %d\n", hsync_pulse_width); - Serial.printf("rgb hsync_back_porch : %d\n", hsync_back_porch); - Serial.printf("rgb vsync_polarity : %d\n", vsync_polarity); - Serial.printf("rgb vsync_front_porch : %d\n", vsync_front_porch); - Serial.printf("rgb vsync_pulse_width : %d\n", vsync_pulse_width); - Serial.printf("rgb vsync_back_porch : %d\n", vsync_back_porch); - Serial.printf("rgb pclk_active_neg : %d\n", pclk_active_neg); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: rgb freq:%d hsync_pol:%d hsync_fp:%d hsync_pw:%d hsync_bp:%d vsync_pol:%d vsync_fp:%d vsync_pw:%d vsync_bp:%d pclk_neg:%d", + spi_speed, hsync_polarity, hsync_front_porch, hsync_pulse_width, hsync_back_porch, + vsync_polarity, vsync_front_porch, vsync_pulse_width, vsync_back_porch, pclk_active_neg); #endif // USE_ESP32_S3 } #endif #ifdef UDSP_DEBUG - Serial.printf("Dsp class init complete\n"); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: Dsp class init complete"); #endif } -void uDisplay::delay_arg(uint32_t args) { - uint32_t delay_ms = 0; - switch (args & 0xE0) { - case 0x80: delay_ms = 150; break; - case 0xA0: delay_ms = 10; break; - case 0xE0: delay_ms = 500; break; - } - if (delay_ms > 0) { - delay(delay_ms); -#ifdef UDSP_DEBUG - Serial.printf("delay %d ms\n", delay_ms); -#endif - } -} - -// epaper pseudo opcodes -#define EP_RESET 0x60 -#define EP_LUT_FULL 0x61 -#define EP_LUT_PARTIAL 0x62 -#define EP_WAITIDLE 0x63 -#define EP_SET_MEM_AREA 0x64 -#define EP_SET_MEM_PTR 0x65 -#define EP_SEND_DATA 0x66 -#define EP_CLR_FRAME 0x67 -#define EP_SEND_FRAME 0x68 -#define EP_BREAK_RR_EQU 0x69 -#define EP_BREAK_RR_NEQ 0x6a - -extern int32_t ESP_ResetInfoReason(); - // special init for GC displays void uDisplay::send_spi_icmds(uint16_t cmd_size) { uint16_t index = 0; @@ -870,7 +761,7 @@ uint16_t cmd_offset = 0; #ifdef UDSP_DEBUG - Serial.printf("start send icmd table\n"); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: start send icmd table"); #endif while (1) { uint8_t iob; @@ -881,27 +772,24 @@ uint16_t cmd_offset = 0; uint8_t args = dsp_cmds[cmd_offset++]; index++; #ifdef UDSP_DEBUG - Serial.printf("cmd, args %02x, %d ", iob, args & 0x7f); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: cmd, args %02x, %d", iob, args & 0x7f); #endif for (uint32_t cnt = 0; cnt < (args & 0x7f); cnt++) { iob = dsp_cmds[cmd_offset++]; index++; #ifdef UDSP_DEBUG - Serial.printf("%02x ", iob); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: %02x", iob); #endif ulcd_data8(iob); } SPI_CS_HIGH -#ifdef UDSP_DEBUG - Serial.printf("\n"); -#endif if (args & 0x80) { // delay after the command delay_arg(args); } if (index >= cmd_size) break; } #ifdef UDSP_DEBUG - Serial.printf("end send icmd table\n"); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: end send icmd table"); #endif return; } @@ -910,7 +798,7 @@ uint16_t cmd_offset = 0; void uDisplay::send_spi_cmds(uint16_t cmd_offset, uint16_t cmd_size) { uint16_t index = 0; #ifdef UDSP_DEBUG - Serial.printf("start send cmd table\n"); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: start send cmd table"); #endif while (1) { uint8_t iob; @@ -922,7 +810,7 @@ uint16_t index = 0; uint8_t args = dsp_cmds[cmd_offset++]; index++; #ifdef UDSP_DEBUG - Serial.printf("cmd, args %02x, %d ", iob, args & 0x1f); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: cmd, args %02x, %d", iob, args & 0x1f); #endif switch (iob) { case EP_RESET: @@ -986,9 +874,8 @@ uint16_t index = 0; } #ifdef UDSP_DEBUG if (args & 1) { - Serial.printf("%02x ", iob ); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: %02x", iob); } - Serial.printf("\n"); #endif if (args & 0x80) { // delay after the command delay_arg(args); @@ -1009,13 +896,13 @@ uint16_t index = 0; uint8_t args = dsp_cmds[cmd_offset++]; index++; #ifdef UDSP_DEBUG - Serial.printf("cmd, args %02x, %d ", iob, args & 0x1f); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: cmd, args %02x, %d", iob, args & 0x1f); #endif for (uint32_t cnt = 0; cnt < (args & 0x1f); cnt++) { iob = dsp_cmds[cmd_offset++]; index++; #ifdef UDSP_DEBUG - Serial.printf("%02x ", iob ); + AddLog(LOG_LEVEL_DEBUG, "%02x ", iob ); #endif if (!allcmd_mode) { ulcd_data8(iob); @@ -1024,9 +911,6 @@ uint16_t index = 0; } } SPI_CS_HIGH -#ifdef UDSP_DEBUG - Serial.printf("\n"); -#endif if (args & 0x80) { // delay after the command delay_arg(args); } @@ -1036,23 +920,21 @@ uint16_t index = 0; exit: #ifdef UDSP_DEBUG - Serial.printf("end send cmd table\n"); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: end send cmd table"); #endif return; } Renderer *uDisplay::Init(void) { - extern bool UsePSRAM(void); - if (!interface) { // no valid configuration, abort #ifdef UDSP_DEBUG - Serial.printf("Dsp Init no valid configuration\n"); + AddLog(LOG_LEVEL_INFO, "UDisplay: Dsp Init no valid configuration"); #endif return NULL; } #ifdef UDSP_DEBUG - Serial.printf("Dsp Init 1 start \n"); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: Dsp Init 1 start"); #endif // for any bpp below native 16 bits, we allocate a local framebuffer to copy into @@ -1085,12 +967,12 @@ Renderer *uDisplay::Init(void) { } */ #ifdef UDSP_DEBUG - Serial.printf("I2C cmds: %d\n", dsp_ncmds); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: I2C cmds:%d", dsp_ncmds); #endif for (uint32_t cnt = 0; cnt < dsp_ncmds; cnt++) { i2c_command(dsp_cmds[cnt]); #ifdef UDSP_DEBUG - Serial.printf("cmd = %x\n", dsp_cmds[cnt]); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: cmd=%x", dsp_cmds[cnt]); #endif } @@ -1156,7 +1038,7 @@ Renderer *uDisplay::Init(void) { busy_pin = spi_miso; pinMode(spi_miso, INPUT_PULLUP); #ifdef UDSP_DEBUG - Serial.printf("Dsp busy pin: %d\n", busy_pin); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: Dsp busy pin:%d", busy_pin); #endif } } @@ -1183,7 +1065,7 @@ Renderer *uDisplay::Init(void) { #ifdef USE_ESP32_S3 if (!UsePSRAM()) { // RGB is not supported on S3 without PSRAM #ifdef UDSP_DEBUG - Serial.printf("Dsp RGB requires PSRAM, abort\n"); + AddLog(LOG_LEVEL_INFO, "UDisplay: Dsp RGB requires PSRAM, abort"); #endif return NULL; } @@ -1355,19 +1237,16 @@ Renderer *uDisplay::Init(void) { uint8_t args = dsp_cmds[index++]; #ifdef UDSP_DEBUG - Serial.printf("cmd, args %02x, %d ", iob, args&0x1f); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: cmd, args %02x, %d", iob, args & 0x1f); #endif for (uint32_t cnt = 0; cnt < (args & 0x1f); cnt++) { iob = dsp_cmds[index++]; #ifdef UDSP_DEBUG - Serial.printf("%02x ", iob ); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: %02x", iob); #endif pb_writeData(iob, 8); } cs_control(1); - #ifdef UDSP_DEBUG - Serial.printf("\n"); - #endif if (args & 0x80) { // delay after the command uint32_t delay_ms = 0; switch (args & 0xE0) { @@ -1378,7 +1257,7 @@ Renderer *uDisplay::Init(void) { if (delay_ms > 0) { delay(delay_ms); #ifdef UDSP_DEBUG - Serial.printf("delay %d ms\n", delay_ms); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: delay %d ms", delay_ms); #endif } @@ -1400,7 +1279,7 @@ Renderer *uDisplay::Init(void) { } #ifdef UDSP_DEBUG - Serial.printf("Dsp Init 1 complete \n"); + AddLog(LOG_LEVEL_DEBUG, "UDisplay: Dsp Init 1 complete"); #endif return this; } @@ -1411,7 +1290,7 @@ void uDisplay::DisplayInit(int8_t p, int8_t size, int8_t rot, int8_t font) { if (p == DISPLAY_INIT_PARTIAL) { if (lutpsize) { #ifdef UDSP_DEBUG - Serial.printf("init partial epaper mode\n"); + AddLog(LOG_LEVEL_DEBUG, "init partial epaper mode"); #endif SetLut(lut_partial); Updateframe_EPD(); @@ -1420,7 +1299,7 @@ void uDisplay::DisplayInit(int8_t p, int8_t size, int8_t rot, int8_t font) { return; } else if (p == DISPLAY_INIT_FULL) { #ifdef UDSP_DEBUG - Serial.printf("init full epaper mode\n"); + AddLog(LOG_LEVEL_DEBUG, "init full epaper mode"); #endif if (lutfsize) { SetLut(lut_full); @@ -1448,185 +1327,13 @@ void uDisplay::DisplayInit(int8_t p, int8_t size, int8_t rot, int8_t font) { } #ifdef UDSP_DEBUG - Serial.printf("Dsp Init 2 complete \n"); + AddLog(LOG_LEVEL_DEBUG, "Dsp Init 2 complete"); #endif } } -void uDisplay::reset_pin(int32_t msl, int32_t msh) { - if (reset > 0) { - digitalWrite(reset, LOW); - delay(msl); - digitalWrite(reset, HIGH); - delay(msh); - } -} - -#define UDSP_BUSY_TIMEOUT 3000 -// epaper sync or delay -void uDisplay::delay_sync(int32_t ms) { - uint8_t busy_level = HIGH; - if (lvgl_param.busy_invert) { - busy_level = LOW; - } - uint32_t time = millis(); - if (busy_pin > 0) { - - while (digitalRead(busy_pin) == busy_level) { - delay(1); - if ((millis() - time) > UDSP_BUSY_TIMEOUT) { - break; - } - } - } else { - delay(ms); - } -} - - -void uDisplay::ulcd_command(uint8_t val) { - - if (interface == _UDSP_SPI) { - if (spi_dc < 0) { - if (spi_nr > 2) { - if (spi_nr == 3) { - write9(val, 0); - } else { - write9_slow(val, 0); - } - } else { - hw_write9(val, 0); - } - } else { - SPI_DC_LOW - if (spi_nr > 2) { - if (spi_nr == 3) { - write8(val); - } else { - write8_slow(val); - } - } else { - uspi->write(val); - } - SPI_DC_HIGH - } - return; - } - -#ifdef USE_ESP32_S3 - if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { - pb_writeCommand(val, 8); - } -#endif // USE_ESP32_S3 -} - -void uDisplay::ulcd_data8(uint8_t val) { - - if (interface == _UDSP_SPI) { - if (spi_dc < 0) { - if (spi_nr > 2) { - if (spi_nr == 3) { - write9(val, 1); - } else { - write9_slow(val, 1); - } - } else { - hw_write9(val, 1); - } - } else { - if (spi_nr > 2) { - if (spi_nr == 3) { - write8(val); - } else { - write8_slow(val); - } - } else { - uspi->write(val); - } - } - return; - } - -#ifdef USE_ESP32_S3 - if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { - pb_writeData(val, 8); - } -#endif // USE_ESP32_S3 -} - -void uDisplay::ulcd_data16(uint16_t val) { - - if (interface == _UDSP_SPI) { - if (spi_dc < 0) { - if (spi_nr > 2) { - write9(val >> 8, 1); - write9(val, 1); - } else { - hw_write9(val >> 8, 1); - hw_write9(val, 1); - } - } else { - if (spi_nr > 2) { - write16(val); - } else { - uspi->write16(val); - } - } - return; - } - -#ifdef USE_ESP32_S3 - if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { - pb_writeData(val, 16); - } -#endif // USE_ESP32_S3 -} - -void uDisplay::ulcd_data32(uint32_t val) { - - if (interface == _UDSP_SPI) { - if (spi_dc < 0) { - if (spi_nr > 2) { - write9(val >> 24, 1); - write9(val >> 16, 1); - write9(val >> 8, 1); - write9(val, 1); - } else { - hw_write9(val >> 24, 1); - hw_write9(val >> 16, 1); - hw_write9(val >> 8, 1); - hw_write9(val, 1); - } - } else { - if (spi_nr > 2) { - write32(val); - } else { - uspi->write32(val); - } - } - return; - } - -#ifdef USE_ESP32_S3 - if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { - pb_writeData(val, 32); - } -#endif // USE_ESP32_S3 -} - -void uDisplay::ulcd_command_one(uint8_t val) { - - if (interface == _UDSP_SPI) { - SPI_BEGIN_TRANSACTION - SPI_CS_LOW - ulcd_command(val); - SPI_CS_HIGH - SPI_END_TRANSACTION - } -} - void uDisplay::i2c_command(uint8_t val) { - //Serial.printf("%02x\n",val ); + //AddLog(LOG_LEVEL_DEBUG, "%02x\n",val ); wire->beginTransmission(i2caddr); wire->write(0); wire->write(val); @@ -1725,7 +1432,7 @@ void uDisplay::Updateframe(void) { //uint8_t xs = 132 >> 3; uint8_t m_row = saw_2; uint8_t m_col = i2c_col_start; - // Serial.printf("m_row=%d m_col=%d xs=%d ys=%d\n", m_row, m_col, xs, ys); + // AddLog(LOG_LEVEL_DEBUG, "m_row=%d m_col=%d xs=%d ys=%d\n", m_row, m_col, xs, ys); uint16_t p = 0; @@ -1749,2568 +1456,3 @@ void uDisplay::Updateframe(void) { } } - -void uDisplay::drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) { - - - if (ep_mode) { - drawFastVLine_EPD(x, y, h, color); - return; - } - - if (framebuffer) { - Renderer::drawFastVLine(x, y, h, color); - return; - } - - // Rudimentary clipping - if ((x >= _width) || (y >= _height)) return; - if ((y + h - 1) >= _height) h = _height - y; - - - if (interface == _UDSP_RGB) { - #ifdef USE_ESP32_S3 - if (cur_rot > 0) { - while (h--) { - drawPixel_RGB(x , y , color); - y++; - } - } else { - uint16_t *fb = rgb_fb; - fb += (int32_t)y * _width; - fb += x; - while (h--) { - *fb = color; - Cache_WriteBack_Addr((uint32_t)fb, 2); - fb+=_width; - y++; - } - } - #endif - return; - } - - SPI_BEGIN_TRANSACTION - - SPI_CS_LOW - - setAddrWindow_int(x, y, 1, h); - - if (col_mode == 18) { - uint8_t r = (color & 0xF800) >> 11; - uint8_t g = (color & 0x07E0) >> 5; - uint8_t b = color & 0x001F; - r = (r * 255) / 31; - g = (g * 255) / 63; - b = (b * 255) / 31; - - while (h--) { - ulcd_data8(r); - ulcd_data8(g); - ulcd_data8(b); - } - } else { - while (h--) { - WriteColor(color); - } - } - - SPI_CS_HIGH - - SPI_END_TRANSACTION -} - -void uDisplay::drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) { - - - if (ep_mode) { - drawFastHLine_EPD(x, y, w, color); - return; - } - - if (framebuffer) { - Renderer::drawFastHLine(x, y, w, color); - return; - } - - // Rudimentary clipping - if((x >= _width) || (y >= _height)) return; - if((x + w - 1) >= _width) w = _width - x; - - - if (interface == _UDSP_RGB) { -#ifdef USE_ESP32_S3 - if (cur_rot > 0) { - while (w--) { - drawPixel_RGB(x , y , color); - x++; - } - } else { - uint16_t *fb = rgb_fb; - fb += (int32_t)y * _width; - fb += x; - while (w--) { - *fb = color; - Cache_WriteBack_Addr((uint32_t)fb, 2); - fb++; - x++; - } - } - #endif - return; - } - - - SPI_BEGIN_TRANSACTION - - SPI_CS_LOW - - setAddrWindow_int(x, y, w, 1); - - if (col_mode == 18) { - uint8_t r = (color & 0xF800) >> 11; - uint8_t g = (color & 0x07E0) >> 5; - uint8_t b = color & 0x001F; - r = (r * 255) / 31; - g = (g * 255) / 63; - b = (b * 255) / 31; - - while (w--) { - ulcd_data8(r); - ulcd_data8(g); - ulcd_data8(b); - } - } else { - while (w--) { - WriteColor(color); - } - } - - SPI_CS_HIGH - - SPI_END_TRANSACTION -} - -//#define CD_XS gxs -//#define CD_YS gys -#define CD_XS width() -#define CD_YS height() - -void uDisplay::fillScreen(uint16_t color) { - fillRect(0, 0, CD_XS, CD_YS, color); -} - -// fill a rectangle -void uDisplay::fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) { - - if (interface == _UDSP_RGB) { - for (uint32_t yp = y; yp < y + h; yp++) { - drawFastHLine(x, yp, w, color); - } - return; - } - - - if (ep_mode) { - fillRect_EPD(x, y, w, h, color); - return; - } - - if (framebuffer) { - Renderer::fillRect(x, y, w, h, color); - return; - } - - if((x >= CD_XS) || (y >= CD_YS)) return; - if((x + w - 1) >= CD_XS) w = CD_XS - x; - if((y + h - 1) >= CD_YS) h = CD_YS - y; - - - SPI_BEGIN_TRANSACTION - SPI_CS_LOW - - setAddrWindow_int(x, y, w, h); - - if (col_mode == 18) { - uint8_t r = (color & 0xF800) >> 11; - uint8_t g = (color & 0x07E0) >> 5; - uint8_t b = color & 0x001F; - r = (r * 255) / 31; - g = (g * 255) / 63; - b = (b * 255) / 31; - - for (y = h; y > 0; y--) { - for (x = w; x > 0; x--) { - ulcd_data8(r); - ulcd_data8(g); - ulcd_data8(b); - } - } - - } else { - for (y = h; y > 0; y--) { - for (x = w; x > 0; x--) { - WriteColor(color); - } - } - } - SPI_CS_HIGH - SPI_END_TRANSACTION -} - -/* - -// pack RGB into uint32 -uint32_t pack_rgb(uint32_t r, uint32_t g, uint32_t b) { - uint32_t data; - data=r<<23; - data|=g<<14; - data|=b<<5; - data|=0b10000000010000000010000000000000; - return ulswap(data); -} - -// init 27 bit mode -uint32_t data=pack_rgb(r,g,b); -REG_SET_BIT(SPI_USER_REG(3), SPI_USR_MOSI); -REG_WRITE(SPI_MOSI_DLEN_REG(3), 27 - 1); -uint32_t *dp=(uint32_t*)SPI_W0_REG(3); -digitalWrite( _cs, LOW); -for(y=h; y>0; y--) { - for(x=w; x>0; x--) { - while (REG_GET_FIELD(SPI_CMD_REG(3), SPI_USR)); - *dp=data; - REG_SET_BIT(SPI_CMD_REG(3), SPI_USR); - } -} -*/ - -#ifdef USE_UNIVERSAL_TOUCH - -uint8_t ut_irq_flg; - -void IRAM_ATTR ut_touch_irq(void) { - ut_irq_flg = 1; -} - -// universal touch driver -bool uDisplay::utouch_Init(char **name) { - *name = ut_name; - if (ut_init_code) { - if (ut_reset >= 0) { - pinMode(ut_reset, OUTPUT); - digitalWrite(ut_reset, HIGH); - delay(10); - digitalWrite(ut_reset, LOW); - delay(5); - digitalWrite(ut_reset, HIGH); - delay(10); - } - if (ut_irq >= 0) { - pinMode(ut_irq, INPUT ); - attachInterrupt(ut_irq, ut_touch_irq, FALLING); - } - -extern SPIClass *SpiBegin(uint32 bus); - - if (ut_spi_nr == spi_nr) { - // same as display - ut_spi = uspi; - } else { -#ifdef ESP32 - ut_spi = SpiBegin(ut_spi_nr); -#endif - } - return ut_execute(ut_init_code); - } - return false; -} - -uint16_t uDisplay::touched(void) { - if (ut_irq >= 0) { - if (!ut_irq_flg) { - return false; - } - ut_irq_flg = 0; - } - if (ut_touch_code) { - return ut_execute(ut_touch_code); - } - return 0; -} - -int16_t uDisplay::getPoint_x(void) { - if (ut_getx_code) { - return ut_execute(ut_getx_code); - } - return 0; -} - -int16_t uDisplay::getPoint_y(void) { - if (ut_gety_code) { - return ut_execute(ut_gety_code); - } - return 0; -} -#endif // USE_UNIVERSAL_TOUCH - - -void uDisplay::Splash(void) { - - if (splash_font < 0) return; - - if (ep_mode) { - Updateframe(); - delay_sync(lut3time * 10); - } - setTextFont(splash_font); - setTextSize(splash_size); - DrawStringAt(splash_xp, splash_yp, dname, fg_col, 0); - Updateframe(); - -#ifdef UDSP_DEBUG - Serial.printf("draw splash\n"); -#endif -} - -void uDisplay::setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) { - - if (bpp != 16 || interface == _UDSP_RGB) { - // just save params or update frame - if (!x0 && !y0 && !x1 && !y1) { - if (!ep_mode) { - Updateframe(); - } - } else { - seta_xp1 = x0; - seta_xp2 = x1; - seta_yp1 = y0; - seta_yp2 = y1; - // Serial.printf("xp1=%d xp2=%d yp1=%d yp2=%d\n", seta_xp1, seta_xp2, seta_yp1, seta_yp2); - } - return; - } - - if (interface == _UDSP_RGB) { - return; - } - - if (!x0 && !y0 && !x1 && !y1) { - SPI_CS_HIGH - SPI_END_TRANSACTION - } else { - SPI_BEGIN_TRANSACTION - SPI_CS_LOW - setAddrWindow_int(x0, y0, x1 - x0, y1 - y0 ); - } -} - -#define udisp_swap(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) ///< No-temp-var swap operation - -void uDisplay::setAddrWindow_int(uint16_t x, uint16_t y, uint16_t w, uint16_t h) { - - if (interface == _UDSP_RGB) { - return; - } - - x += x_addr_offs[cur_rot]; - y += y_addr_offs[cur_rot]; - - if (sa_mode != 8) { - uint32_t xa = ((uint32_t)x << 16) | (x + w - 1); - uint32_t ya = ((uint32_t)y << 16) | (y + h - 1); - - ulcd_command(saw_1); - ulcd_data32(xa); - - ulcd_command(saw_2); - ulcd_data32(ya); - - if (saw_3 != 0xff) { - ulcd_command(saw_3); // write to RAM - } - } else { - uint16_t x2 = x + w - 1, - y2 = y + h - 1; - - if (cur_rot & 1) { // Vertical address increment mode - udisp_swap(x,y); - udisp_swap(x2,y2); - } - ulcd_command(saw_1); - if (allcmd_mode) { - ulcd_data8(x); - ulcd_data8(x2); - } else { - ulcd_command(x); - ulcd_command(x2); - } - ulcd_command(saw_2); - if (allcmd_mode) { - ulcd_data8(y); - ulcd_data8(y2); - } else { - ulcd_command(y); - ulcd_command(y2); - } - if (saw_3 != 0xff) { - ulcd_command(saw_3); // write to RAM - } - } -} - -#define RGB16_TO_MONO 0x8410 -#define RGB16_SWAP_TO_MONO 0x1084 -// #define CNV_B1_OR ((0x10<<11) | (0x20<<5) | 0x10) -// static inline uint8_t ulv_color_to1(uint16_t color) { -// if (color & CNV_B1_OR) { -// return 1; -// } -// else { -// return 0; -// } -/* -// this needs optimization - if (((color>>11) & 0x10) || ((color>>5) & 0x20) || (color & 0x10)) { - return 1; - } - else { - return 0; - }*/ -// } - -// convert to mono, these are framebuffer based -void uDisplay::pushColorsMono(uint16_t *data, uint16_t len, bool rgb16_swap) { - // pixel is white if at least one of the 3 components is above 50% - // this is tested with a simple mask, swapped if needed - uint16_t rgb16_to_mono_mask = rgb16_swap ? RGB16_SWAP_TO_MONO : RGB16_TO_MONO; - - for (uint32_t y = seta_yp1; y < seta_yp2; y++) { - seta_yp1++; - if (lvgl_param.invert_bw) { - for (uint32_t x = seta_xp1; x < seta_xp2; x++) { - uint16_t color = *data++; - if (bpp == 1) color = (color & rgb16_to_mono_mask) ? 0 : 1; - drawPixel(x, y, color); // todo - inline the method to save speed - len--; - if (!len) return; // failsafe - exist if len (pixel number) is exhausted - } - } else { - for (uint32_t x = seta_xp1; x < seta_xp2; x++) { - uint16_t color = *data++; - if (bpp == 1) color = (color & rgb16_to_mono_mask) ? 1 : 0; - drawPixel(x, y, color); // todo - inline the method to save speed - len--; - if (!len) return; // failsafe - exist if len (pixel number) is exhausted - } - } - } -} - -// swap high low byte -static inline void lvgl_color_swap(uint16_t *data, uint16_t len) { for (uint32_t i = 0; i < len; i++) (data[i] = data[i] << 8 | data[i] >> 8); } - -void uDisplay::pushColors(uint16_t *data, uint16_t len, boolean not_swapped) { - - if (lvgl_param.swap_color) { - not_swapped = !not_swapped; - } - - //Serial.printf("push %x - %d - %d - %d\n", (uint32_t)data, len, not_swapped, lvgl_param.data); - - // Isolating _UDSP_RGB to increase code sharing - // - // Use ESP-IDF LCD driver to push colors and rely on the following assumptions: - // * bytes swapping is already handled in the driver configuration (see uDisplay::Init()), - // * pushColors() is only called with not_swapped equals true, - // * cache flushing is done by the LCD driver. - if (interface == _UDSP_RGB) { -#ifdef USE_ESP32_S3 - if (!not_swapped) { - // internal error -> write error message but continue (with possibly wrong colors) - AddLog(LOG_LEVEL_ERROR, PSTR("DSP: Unexpected byte-swapping requested in pushColors()")); - } - - // check that bytes count matches the size of area, and remove from inner loop - if ((seta_yp2 - seta_yp1) * (seta_xp2 - seta_xp2) > len) { return; } - - esp_lcd_panel_draw_bitmap(_panel_handle, seta_xp1, seta_yp1, seta_xp2, seta_yp2, (void *)data); -#endif - return; - } - - - if (not_swapped == false) { - // called from LVGL bytes are swapped - if (bpp != 16) { - // lvgl_color_swap(data, len); -- no need to swap anymore, we have inverted the mask - pushColorsMono(data, len, true); - return; - } - - if ( (col_mode != 18) && (spi_dc >= 0) && (spi_nr <= 2) ) { - // special version 8 bit spi I or II -#ifdef ESP8266 - lvgl_color_swap(data, len); - while (len--) { - uspi->write(*data++); - } -#else - if (lvgl_param.use_dma) { - pushPixelsDMA(data, len ); - } else { - uspi->writeBytes((uint8_t*)data, len * 2); - } -#endif - } else { - -#ifdef ESP32 - if ( (col_mode == 18) && (spi_dc >= 0) && (spi_nr <= 2) ) { - uint8_t *line = (uint8_t*)malloc(len * 3); - uint8_t *lp = line; - if (line) { - uint16_t color; - for (uint32_t cnt = 0; cnt < len; cnt++) { - color = *data++; - color = (color << 8) | (color >> 8); - uint8_t r = (color & 0xF800) >> 11; - uint8_t g = (color & 0x07E0) >> 5; - uint8_t b = color & 0x001F; - r = (r * 255) / 31; - g = (g * 255) / 63; - b = (b * 255) / 31; - *lp++ = r; - *lp++ = g; - *lp++ = b; - } - - if (lvgl_param.use_dma) { - pushPixels3DMA(line, len ); - } else { - uspi->writeBytes(line, len * 3); - } - free(line); - } - - } else { - // 9 bit and others - if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { - #ifdef USE_ESP32_S3 - pb_pushPixels(data, len, true, false); - #endif // USE_ESP32_S3 - } else { - lvgl_color_swap(data, len); - while (len--) { - WriteColor(*data++); - } - } - } -#endif // ESP32 - -#ifdef ESP8266 - lvgl_color_swap(data, len); - while (len--) { - WriteColor(*data++); - } -#endif - } - } else { - // called from displaytext, no byte swap, currently no dma here - - if (bpp != 16) { - pushColorsMono(data, len); - return; - } - if ( (col_mode != 18) && (spi_dc >= 0) && (spi_nr <= 2) ) { - // special version 8 bit spi I or II - #ifdef ESP8266 - while (len--) { - //uspi->write(*data++); - WriteColor(*data++); - } - #else - uspi->writePixels(data, len * 2); - #endif - } else { - // 9 bit and others - if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { -#ifdef USE_ESP32_S3 - pb_pushPixels(data, len, false, false); -#endif // USE_ESP32_S3 - } else { - while (len--) { - WriteColor(*data++); - } - } - } - } -} - -void uDisplay::WriteColor(uint16_t color) { - - if (col_mode == 18) { - uint8_t r = (color & 0xF800) >> 11; - uint8_t g = (color & 0x07E0) >> 5; - uint8_t b = color & 0x001F; - - r = (r * 255) / 31; - g = (g * 255) / 63; - b = (b * 255) / 31; - - ulcd_data8(r); - ulcd_data8(g); - ulcd_data8(b); - } else { - ulcd_data16(color); - } -} - -#ifdef USE_ESP32_S3 -void uDisplay::drawPixel_RGB(int16_t x, int16_t y, uint16_t color) { -int16_t w = _width, h = _height; - - if ((x < 0) || (x >= w) || (y < 0) || (y >= h)) { - return; - } - - // check rotation, move pixel around if necessary - switch (cur_rot) { - case 1: - renderer_swap(w, h); - renderer_swap(x, y); - x = w - x - 1; - break; - case 2: - x = w - x - 1; - y = h - y - 1; - break; - case 3: - renderer_swap(w, h); - renderer_swap(x, y); - y = h - y - 1; - break; - } - - uint16_t *fb = rgb_fb; - fb += (int32_t)y * w; - fb += x; - *fb = color; - Cache_WriteBack_Addr((uint32_t)fb, 2); - -} -#endif // USE_ESP32_S3 - -void uDisplay::drawPixel(int16_t x, int16_t y, uint16_t color) { - -#ifdef USE_ESP32_S3 - if (interface == _UDSP_RGB) { - drawPixel_RGB(x, y, color); - return; - } -#endif - - if (ep_mode) { - drawPixel_EPD(x, y, color); - return; - } - - if (framebuffer) { - Renderer::drawPixel(x, y, color); - return; - } - - if ((x < 0) || (x >= _width) || (y < 0) || (y >= _height)) return; - - - SPI_BEGIN_TRANSACTION - - SPI_CS_LOW - - setAddrWindow_int(x, y, 1, 1); - - WriteColor(color); - - SPI_CS_HIGH - - SPI_END_TRANSACTION -} - -void uDisplay::setRotation(uint8_t rotation) { - cur_rot = rotation; - - if (framebuffer) { - Renderer::setRotation(cur_rot); - return; - } - - if (interface == _UDSP_SPI || interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { - - if (ep_mode) { - Renderer::setRotation(cur_rot); - return; - } - SPI_BEGIN_TRANSACTION - SPI_CS_LOW - ulcd_command(madctrl); - - if (!allcmd_mode) { - ulcd_data8(rot[cur_rot]); - } else { - ulcd_command(rot[cur_rot]); - } - - if ((sa_mode == 8) && !allcmd_mode) { - ulcd_command(startline); - ulcd_data8((cur_rot < 2) ? height() : 0); - } - - SPI_CS_HIGH - SPI_END_TRANSACTION - } - switch (rotation) { - case 0: - _width = gxs; - _height = gys; - break; - case 1: - _width = gys; - _height = gxs; - break; - case 2: - _width = gxs; - _height = gys; - break; - case 3: - _width = gys; - _height = gxs; - break; - } - -#ifdef USE_ESP32_S3 - if (interface == _UDSP_RGB) { - // utilize the ESP-IDF LCD driver's support for display rotation: - // mirror x axis for rotation 1 and 2, mirror y axis for rotation 2 and 3 - esp_lcd_panel_mirror(_panel_handle, rotation == 1 || rotation == 2, rotation & 2); - // swap x/y for rotation 1 and 3 - esp_lcd_panel_swap_xy(_panel_handle, rotation & 1); - } -#endif // USE_ESP32_S3 -} - -void udisp_bpwr(uint8_t on); - -void uDisplay::DisplayOnff(int8_t on) { - - if (ep_mode) { - return; - } - - if (pwr_cbp) { - pwr_cbp(on); - } - -#define AW_PWMRES 1024 - - if (interface == _UDSP_I2C) { - if (on) { - i2c_command(dsp_on); - } else { - i2c_command(dsp_off); - } - } else { - if (on) { - if (dsp_on != 0xff) ulcd_command_one(dsp_on); - if (bpanel >= 0) { -#ifdef ESP32 - if (!bpmode) { - analogWrite(bpanel, dimmer10_gamma); - } else { - analogWrite(bpanel, AW_PWMRES - dimmer10_gamma); - } -#else - if (!bpmode) { - digitalWrite(bpanel, HIGH); - } else { - digitalWrite(bpanel, LOW); - } -#endif - } - - } else { - if (dsp_off != 0xff) ulcd_command_one(dsp_off); - if (bpanel >= 0) { -#ifdef ESP32 - if (!bpmode) { - analogWrite(bpanel, 0); - } else { - analogWrite(bpanel, AW_PWMRES - 1); - } -#else - if (!bpmode) { - digitalWrite(bpanel, LOW); - } else { - digitalWrite(bpanel, HIGH); - } -#endif - } - } - } -} - -void uDisplay::invertDisplay(boolean i) { - - if (ep_mode) { - return; - } - - if (interface == _UDSP_SPI || interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { - if (i) { - ulcd_command_one(inv_on); - } else { - ulcd_command_one(inv_off); - } - } - if (interface == _UDSP_I2C) { - if (i) { - i2c_command(inv_on); - } else { - i2c_command(inv_off); - } - } -} - -void udisp_dimm(uint8_t dim); - -// input value is 0..15 -// void uDisplay::dim(uint8_t dim) { -// dim8(((uint32_t)dim * 255) / 15); -// } - -// dim is 0..255 -void uDisplay::dim10(uint8_t dim, uint16_t dim_gamma) { // dimmer with 8 bits resolution, 0..255. Gamma correction must be done by caller - dimmer8 = dim; - dimmer10_gamma = dim_gamma; - if (ep_mode) { - return; - } - -#ifdef ESP32 // TODO should we also add a ESP8266 version for bpanel? - if (bpanel >= 0) { // is the BaclPanel GPIO configured - if (!bpmode) { - analogWrite(bpanel, dimmer10_gamma); - } else { - analogWrite(bpanel, AW_PWMRES - dimmer10_gamma); - } - - // ledcWrite(ESP32_PWM_CHANNEL, dimmer8_gamma); - } else if (dim_cbp) { - dim_cbp(dim); - } -#endif - if (interface == _UDSP_SPI) { - if (dim_op != 0xff) { // send SPI command if dim configured - SPI_BEGIN_TRANSACTION - SPI_CS_LOW - ulcd_command(dim_op); - ulcd_data8(dimmer8); - SPI_CS_HIGH - SPI_END_TRANSACTION - } - } -} - -// the cases are PSEUDO_OPCODES from MODULE_DESCRIPTOR -// and may be expanded with more opcodes -void uDisplay::TS_RotConvert(int16_t *x, int16_t *y) { - int16_t temp; - - if (rot_t[cur_rot] & 0x80) { - temp = *y; - *y = *x; - *x = temp; - } - - if (rotmap_xmin >= 0) { - *y = map(*y, rotmap_ymin, rotmap_ymax, 0, gys); - *x = map(*x, rotmap_xmin, rotmap_xmax, 0, gxs); - *x = constrain(*x, 0, gxs); - *y = constrain(*y, 0, gys); - } -// *x = constrain(*x, 0, gxs); -// *y = constrain(*y, 0, gys); - - //Serial.printf("rot 1 %d - %d\n",*x,*y ); - - switch (rot_t[cur_rot] & 0xf) { - case 0: - break; - case 1: - temp = *y; - *y = height() - *x; - *x = temp; - break; - case 2: - *x = width() - *x; - *y = height() - *y; - break; - case 3: - temp = *y; - *y = *x; - *x = width() - temp; - break; - case 4: - *x = width() - *x; - break; - case 5: - *y = height() - *y; - break; - } - - //Serial.printf("rot 2 %d - %d\n",*x,*y ); -} - -uint8_t uDisplay::strlen_ln(char *str) { - for (uint32_t cnt = 0; cnt < 256; cnt++) { - if (!str[cnt] || str[cnt] == '\n' || str[cnt] == ' ') return cnt; - } - return 0; -} - -char *uDisplay::devname(void) { - return dname; -} - - - -#ifdef USE_UNIVERSAL_TOUCH - -float CharToFloat(const char *str); - -uint32_t uDisplay::ut_par(char **lp, uint32_t mode) { - char *cp = *lp; - while (*cp != ' ') { - if (!cp) break; - cp++; - } - cp++; - uint32_t result; - if (!mode) { - // hex - result = strtol(cp, &cp, 16); - } else if (mode == 1) { - // word - result = strtol(cp, &cp, 10); - } else { - // float as 32bit integer - float fval = CharToFloat(cp); - result = *(uint32_t*)&fval; - while (*cp) { - if (*cp == ' ' || *cp =='\n') { - break; - } - cp++; - } - } - *lp = cp; - return result; -} - -// translate pseudo opcodes to tokens -void uDisplay::ut_trans(char **sp, uint8_t **code) { - char *cp = *sp; - uint16_t wval; - uint8_t tmp_code[64]; - uint8_t *ut_code = tmp_code; - while (*cp) { - if (*cp == ':' || *cp == '#') { - break; - } - if (*cp == ';') { - // skip comment line - while (*cp) { - if (*cp == '\n') { - cp++; - break; - } - cp++; - } - } - if (!strncmp(cp, "RDWM", 4)) { - // read word many - *ut_code++ = UT_RDWM; - wval = ut_par(&cp, 0); - *ut_code++ = wval>>8; - *ut_code++ = wval; - wval = ut_par(&cp, 1); - if (wval > sizeof(ut_array)) { - wval = sizeof(ut_array); - } - *ut_code++ = wval; - } else if (!strncmp(cp, "RDW", 3)) { - // read word one - *ut_code++ = UT_RDW; - wval = ut_par(&cp, 0); - *ut_code++ = wval>>8; - *ut_code++ = wval; - } else if (!strncmp(cp, "RDM", 3)) { - // read many - *ut_code++ = UT_RDM; - *ut_code++ = ut_par(&cp, 0); - wval = ut_par(&cp, 1); - if (wval > sizeof(ut_array)) { - wval = sizeof(ut_array); - } - *ut_code++ = wval; - } else if (!strncmp(cp, "RD", 2)) { - // read one - *ut_code++ = UT_RD; - *ut_code++ = ut_par(&cp, 0); - } else if (!strncmp(cp, "CPR", 3)) { - // cmp and set - *ut_code++ = UT_CPR; - *ut_code++ = ut_par(&cp, 0); - } else if (!strncmp(cp, "CPM", 3)) { - // cmp multiple and set - *ut_code++ = UT_CPM; - uint8_t num = ut_par(&cp, 0); - *ut_code++ = num; - for (uint32_t cnt = 0; cnt < num; cnt++) { - *ut_code++ = ut_par(&cp, 0); - } - } else if (!strncmp(cp, "CP", 2)) { - // cmp and set - *ut_code++ = UT_CP; - *ut_code++ = ut_par(&cp, 0); - } else if (!strncmp(cp, "RTF", 3)) { - // return when false - *ut_code++ = UT_RTF; - } else if (!strncmp(cp, "RTT", 3)) { - // return when true - *ut_code++ = UT_RTT; - } else if (!strncmp(cp, "MVB", 3)) { - // move - *ut_code++ = UT_MVB; - *ut_code++ = ut_par(&cp, 1); - *ut_code++ = ut_par(&cp, 1); - } else if (!strncmp(cp, "MV", 2)) { - // move - *ut_code++ = UT_MV; - *ut_code++ = ut_par(&cp, 1); - *ut_code++ = ut_par(&cp, 1); - } else if (!strncmp(cp, "RT", 2)) { - // return status - *ut_code++ = UT_RT; - } else if (!strncmp(cp, "WRW", 3)) { - *ut_code++ = UT_WRW; - wval = ut_par(&cp, 0); - *ut_code++ = wval>>8; - *ut_code++ = wval; - wval = ut_par(&cp, 0); - *ut_code++ = wval; - } else if (!strncmp(cp, "WR", 2)) { - *ut_code++ = UT_WR; - wval = ut_par(&cp, 0); - *ut_code++ = wval; - wval = ut_par(&cp, 0); - *ut_code++ = wval; - } else if (!strncmp(cp, "AND", 3)) { - *ut_code++ = UT_AND; - wval = ut_par(&cp, 0); - *ut_code++ = wval >> 8; - *ut_code++ = wval; - } else if (!strncmp(cp, "SCL", 3)) { - *ut_code++ = UT_SCALE; - wval = ut_par(&cp, 1); - *ut_code++ = wval >> 8; - *ut_code++ = wval; - uint32_t lval = ut_par(&cp, 2); - *ut_code++ = lval >> 24; - *ut_code++ = lval >> 16; - *ut_code++ = lval >> 8; - *ut_code++ = lval; - } else if (!strncmp(cp, "LIM", 3)) { - *ut_code++ = UT_LIM; - wval = ut_par(&cp, 1); - *ut_code++ = wval >> 8; - *ut_code++ = wval; - } else if (!strncmp(cp, "GSRT", 4)) { - *ut_code++ = UT_GSRT; - wval = ut_par(&cp, 1); - *ut_code++ = wval >> 8; - *ut_code++ = wval; - } else if (!strncmp(cp, "XPT", 3)) { - *ut_code++ = UT_XPT; - wval = ut_par(&cp, 1); - *ut_code++ = wval >> 8; - *ut_code++ = wval; - } else if (!strncmp(cp, "DBG", 3)) { - *ut_code++ = UT_DBG; - wval = ut_par(&cp, 1); - *ut_code++ = wval; - } - cp++; - } - *ut_code++ = UT_END; - *sp = cp - 1; - uint16_t memsize = (uint32_t)ut_code - (uint32_t)tmp_code; - // allocate memory - //AddLog(LOG_LEVEL_INFO, PSTR("UT-code: %d bytes"),memsize); -#ifdef UDSP_DEBUG - Serial.printf("Utouch code size : %d\n", memsize); -#endif - uint8_t *mp = (uint8_t*)malloc(memsize + 2); - if (mp) { - memmove(mp, tmp_code, memsize); - *code = mp; - } -} - -uint8_t *uDisplay::ut_rd(uint8_t *iop, uint32_t len, uint32_t amode) { - if (ut_wire) { - // i2c mode - ut_wire->beginTransmission(ut_i2caddr); - ut_wire->write(*iop++); - if (amode == 2) { - ut_wire->write(*iop++); - } - ut_wire->endTransmission(false); - if (len > 1) { - len = *iop++; - } - ut_wire->requestFrom(ut_i2caddr, (size_t)len); - uint8_t index = 0; - while (ut_wire->available()) { - ut_array[index++] = ut_wire->read(); - } - } else { - // spi mode - if (amode == 1) { - uint16_t val = *iop++; - uint16_t len = *iop++; - if (ut_spi) { - digitalWrite(ut_spi_cs, LOW); - ut_spi->beginTransaction(ut_spiSettings); - ut_spi->transfer(val); - val = ut_spi->transfer16(0); - ut_spi->endTransaction(); - ut_array[len] = val << 8; - ut_array[len + 1] = val; - digitalWrite(ut_spi_cs, HIGH); - } - } - } - return iop; -} - -uint8_t *uDisplay::ut_wr(uint8_t *iop, uint32_t amode) { - if (ut_wire) { - // i2c mode - ut_wire->beginTransmission(ut_i2caddr); - ut_wire->write(*iop++); - if (amode == 2) { - ut_wire->write(*iop++); - } - ut_wire->write(*iop++); - ut_wire->endTransmission(true); - } else { - // spi mode - } - return iop; -} - - -int16_t uDisplay::besttwoavg( int16_t x , int16_t y , int16_t z ) { - int16_t da, db, dc; - int16_t reta = 0; - if ( x > y ) da = x - y; else da = y - x; - if ( x > z ) db = x - z; else db = z - x; - if ( z > y ) dc = z - y; else dc = y - z; - - if ( da <= db && da <= dc ) reta = (x + y) >> 1; - else if ( db <= da && db <= dc ) reta = (x + z) >> 1; - else reta = (y + z) >> 1; - - return (reta); -} - -uint16_t uDisplay::ut_XPT2046(uint16_t z_th) { - uint16_t result = 0; - if (ut_spi) { - int16_t data[6]; - ut_spi->beginTransaction(ut_spiSettings); - digitalWrite(ut_spi_cs, LOW); - ut_spi->transfer(0xB1 /* Z1 */); - int16_t z1 = ut_spi->transfer16(0xC1 /* Z2 */) >> 3; - int16_t z = z1 + 4095; - int16_t z2 = ut_spi->transfer16(0x91 /* X */) >> 3; - z -= z2; - if (z >= z_th) { - ut_spi->transfer16(0x91 /* X */); // dummy X measure, 1st is always noisy - data[0] = ut_spi->transfer16(0xD1 /* Y */) >> 3; - data[1] = ut_spi->transfer16(0x91 /* X */) >> 3; // make 3 x-y measurements - data[2] = ut_spi->transfer16(0xD1 /* Y */) >> 3; - data[3] = ut_spi->transfer16(0x91 /* X */) >> 3; - result = 1; - } - else { - data[0] = data[1] = data[2] = data[3] = 0; - } - data[4] = ut_spi->transfer16(0xD0 /* Y */) >> 3; // Last Y touch power down - data[5] = ut_spi->transfer16(0) >> 3; - digitalWrite(ut_spi_cs, HIGH); - ut_spi->endTransaction(); - - uint16_t x = besttwoavg( data[0], data[2], data[4] ); - uint16_t y = besttwoavg( data[1], data[3], data[5] ); - - ut_array[0] = x >> 8; - ut_array[1] = x; - ut_array[2] = y >> 8; - ut_array[3] = y; - } - return result; -} - -int16_t uDisplay::ut_execute(uint8_t *ut_code) { -int16_t result = 0; -uint8_t iob, len; -uint16_t wval; - - while (*ut_code != UT_END) { - iob = *ut_code++; - switch (iob) { - case UT_RD: - // read 1 byte - ut_code = ut_rd(ut_code, 1, 1); - break; - - case UT_RDM: - // read multiple bytes - ut_code = ut_rd(ut_code, 2, 1); - break; - - case UT_RDW: - // read 1 byte - ut_code = ut_rd(ut_code, 1, 2); - break; - - case UT_RDWM: - // read multiple bytes - ut_code = ut_rd(ut_code, 2, 2); - break; - - case UT_WR: - ut_code = ut_wr(ut_code, 1); - break; - - case UT_WRW: - ut_code = ut_wr(ut_code, 2); - break; - - case UT_CP: - // compare - iob = *ut_code++; - result = (iob == ut_array[0]); - break; - - case UT_CPM: - // compare multiple - len = *ut_code++; - result = 0; - for (uint32_t cnt = 0; cnt < len; cnt++) { - iob = *ut_code++; - result |= (iob == ut_array[0]); - } - break; - - case UT_CPR: - // compare - iob = *ut_code++; - result = (iob == result); - break; - - case UT_RTF: - // return when false - if (result == 0) { - return false; - } - break; - - case UT_RTT: - // return when true - if (result > 0) { - return false; - } - break; - - case UT_MVB: - // move byte from index to high or low result - wval = *ut_code++; - iob = *ut_code++; - if (wval == 0) { - result &= 0xff00; - result |= ut_array[iob]; - } else { - result &= 0x00ff; - result |= (ut_array[iob] << 8); - } - break; - - case UT_MV: - // move - // source - result = *ut_code++; - iob = *ut_code++; - if (iob == 1) { - result = ut_array[result]; - } else if (iob == 2) { - iob = result; - result = ut_array[iob] << 8; - result |= ut_array[iob + 1]; - } else { - iob = result; - result = ut_array[iob + 1] << 8; - result |= ut_array[iob]; - } - result &= 0xfff; - break; - - case UT_AND: - // and - wval = *ut_code++ << 8; - wval |= *ut_code++; - result &= wval; - break; - - case UT_SCALE: - { - wval = *ut_code++ << 8; - wval |= *ut_code++; - result -= wval; - uint32_t lval = (uint32_t)*ut_code++ << 24; - lval |= (uint32_t)*ut_code++ << 16; - lval |= (uint32_t)*ut_code++ << 8; - lval |= (uint32_t)*ut_code++; - float fval = *(float*)&lval; - fval *= (float)result; - result = fval; - } - break; - - case UT_LIM: - wval = *ut_code++ << 8; - wval |= *ut_code++; - if (result > wval) { - result = wval; - } - break; - - case UT_RT: - // result - return result; - break; - - case UT_GSRT: -#ifdef USE_ESP32_S3 - { uint32_t val = get_sr_touch(SIMPLERS_XP, SIMPLERS_XM, SIMPLERS_YP, SIMPLERS_YM); - if (val == 0) { - return false; - } - uint16_t xp = val >> 16; - uint16_t yp = val; - - wval = *ut_code++ << 8; - wval |= *ut_code++; - if (xp > wval && yp > wval) { - ut_array[0] = val >> 24; - ut_array[1] = val >> 16; - ut_array[2] = val >> 8; - ut_array[3] = val; - return true; - } - return false; - } -#endif // USE_ESP32_S3 - break; - - case UT_XPT: - wval = *ut_code++ << 8; - wval |= *ut_code++; - result = ut_XPT2046(wval); - break; - - case UT_DBG: - // debug show result - //Serial.printf("UTDBG: %d\n", result); - wval = *ut_code++; - AddLog(LOG_LEVEL_INFO, PSTR("UTDBG %d: %02x : %02x,%02x,%02x,%02x"), wval, result, ut_array[0], ut_array[1], ut_array[2], ut_array[3]); - break; - - case UT_END: - break; - } - } - return result; -} -#endif // USE_UNIVERSAL_TOUCH - -uint32_t uDisplay::str2c(char **sp, char *vp, uint32_t len) { - char *lp = *sp; - if (len) len--; - char *cp = strchr(lp, ','); - if (cp) { - while (1) { - if (*lp == ',') { - *vp = 0; - *sp = lp + 1; - return 0; - } - if (len) { - *vp++ = *lp++; - len--; - } else { - lp++; - } - } - } else { - uint16_t slen = strlen(lp); - if (slen) { - strlcpy(vp, *sp, len); - *sp = lp + slen; - return 0; - } - } - return 1; -} - -int32_t uDisplay::next_val(char **sp) { - char ibuff[16]; - if (!str2c(sp, ibuff, sizeof(ibuff))) { - return atoi(ibuff); - } - return 0xff; -} - -uint32_t uDisplay::next_hex(char **sp) { - char ibuff[16]; - if (!str2c(sp, ibuff, sizeof(ibuff))) { - return strtol(ibuff, 0, 16); - } - return 0xff; -} - -#ifdef ESP32 -#include "soc/spi_reg.h" -#include "soc/spi_struct.h" -#include "esp32-hal-spi.h" -#include "esp32-hal.h" -#include "soc/spi_struct.h" - -// since ardunio transferBits is completely disfunctional -// we use our own hardware driver for 9 bit spi -void uDisplay::hw_write9(uint8_t val, uint8_t dc) { - - if (spi_dc < -1) { - // RA8876 mode - if (!dc) { - uspi->write(RA8876_CMD_WRITE); - uspi->write(val); - } else { - uspi->write(RA8876_DATA_WRITE); - uspi->write(val); - } - } else { - uint32_t regvalue = val >> 1; - if (dc) regvalue |= 0x80; - else regvalue &= 0x7f; - if (val & 1) regvalue |= 0x8000; - - REG_SET_BIT(SPI_USER_REG(3), SPI_USR_MOSI); - REG_WRITE(SPI_MOSI_DLEN_REG(3), 9 - 1); - uint32_t *dp = (uint32_t*)SPI_W0_REG(3); - *dp = regvalue; - REG_SET_BIT(SPI_CMD_REG(3), SPI_USR); - while (REG_GET_FIELD(SPI_CMD_REG(3), SPI_USR)); - } -} - -#else -#include "spi_register.h" -void uDisplay::hw_write9(uint8_t val, uint8_t dc) { - - if (spi_dc < -1) { - // RA8876 mode - if (!dc) { - uspi->write(RA8876_CMD_WRITE); - uspi->write(val); - } else { - uspi->write(RA8876_DATA_WRITE); - uspi->write(val); - } - } else { - uint32_t regvalue; - uint8_t bytetemp; - if (!dc) { - bytetemp = (val>> 1) & 0x7f; - } else { - bytetemp = (val >> 1) | 0x80; - } - regvalue = ((8 & SPI_USR_COMMAND_BITLEN) << SPI_USR_COMMAND_BITLEN_S) | ((uint32)bytetemp); //configure transmission variable,9bit transmission length and first 8 command bit - if (val & 0x01) regvalue |= BIT15; //write the 9th bit - while (READ_PERI_REG(SPI_CMD(1)) & SPI_USR); //waiting for spi module available - WRITE_PERI_REG(SPI_USER2(1), regvalue); //write command and command length into spi reg - SET_PERI_REG_MASK(SPI_CMD(1), SPI_USR); //transmission start - } -} -#endif - -#define USECACHE ICACHE_RAM_ATTR - -// slow software spi needed for displays with max 10 Mhz clck - -void USECACHE uDisplay::write8(uint8_t val) { - for (uint8_t bit = 0x80; bit; bit >>= 1) { - GPIO_CLR(spi_clk); - if (val & bit) GPIO_SET(spi_mosi); - else GPIO_CLR(spi_mosi); - GPIO_SET(spi_clk); - } -} - -uint8_t uDisplay::writeReg16(uint8_t reg, uint16_t wval) { - hw_write9(reg, 0); - hw_write9(wval, 1); - hw_write9(reg + 1, 0); - hw_write9(wval >> 8, 1); - return 0; -} - -uint8_t uDisplay::readData(void) { - uspi->write(RA8876_DATA_READ); - uint8_t val = uspi->transfer(0); - return val; -} - -uint8_t uDisplay::readStatus(void) { - uspi->write(RA8876_STATUS_READ); - uint8_t val = uspi->transfer(0); - return val; -} - -void uDisplay::write8_slow(uint8_t val) { - for (uint8_t bit = 0x80; bit; bit >>= 1) { - GPIO_CLR_SLOW(spi_clk); - if (val & bit) GPIO_SET_SLOW(spi_mosi); - else GPIO_CLR_SLOW(spi_mosi); - GPIO_SET_SLOW(spi_clk); - } -} - -void USECACHE uDisplay::write9(uint8_t val, uint8_t dc) { - - GPIO_CLR(spi_clk); - if (dc) GPIO_SET(spi_mosi); - else GPIO_CLR(spi_mosi); - GPIO_SET(spi_clk); - - for (uint8_t bit = 0x80; bit; bit >>= 1) { - GPIO_CLR(spi_clk); - if (val & bit) GPIO_SET(spi_mosi); - else GPIO_CLR(spi_mosi); - GPIO_SET(spi_clk); - } -} - -void uDisplay::write9_slow(uint8_t val, uint8_t dc) { - - GPIO_CLR_SLOW(spi_clk); - if (dc) GPIO_SET_SLOW(spi_mosi); - else GPIO_CLR_SLOW(spi_mosi); - GPIO_SET_SLOW(spi_clk); - - for (uint8_t bit = 0x80; bit; bit >>= 1) { - GPIO_CLR_SLOW(spi_clk); - if (val & bit) GPIO_SET_SLOW(spi_mosi); - else GPIO_CLR_SLOW(spi_mosi); - GPIO_SET_SLOW(spi_clk); - } -} - -void USECACHE uDisplay::write16(uint16_t val) { - for (uint16_t bit = 0x8000; bit; bit >>= 1) { - GPIO_CLR(spi_clk); - if (val & bit) GPIO_SET(spi_mosi); - else GPIO_CLR(spi_mosi); - GPIO_SET(spi_clk); - } -} - -void USECACHE uDisplay::write32(uint32_t val) { - for (uint32_t bit = 0x80000000; bit; bit >>= 1) { - GPIO_CLR(spi_clk); - if (val & bit) GPIO_SET(spi_mosi); - else GPIO_CLR(spi_mosi); - GPIO_SET(spi_clk); - } -} - - -// epaper section - -// EPD2IN9 commands -#define DRIVER_OUTPUT_CONTROL 0x01 -#define BOOSTER_SOFT_START_CONTROL 0x0C -#define GATE_SCAN_START_POSITION 0x0F -#define DEEP_SLEEP_MODE 0x10 -#define DATA_ENTRY_MODE_SETTING 0x11 -#define SW_RESET 0x12 -#define TEMPERATURE_SENSOR_CONTROL 0x1A -#define MASTER_ACTIVATION 0x20 -#define DISPLAY_UPDATE_CONTROL_1 0x21 -#define DISPLAY_UPDATE_CONTROL_2 0x22 -#define WRITE_RAM 0x24 -#define WRITE_VCOM_REGISTER 0x2C -#define WRITE_LUT_REGISTER 0x32 -#define SET_DUMMY_LINE_PERIOD 0x3A -#define SET_GATE_TIME 0x3B -#define BORDER_WAVEFORM_CONTROL 0x3C -#define SET_RAM_X_ADDRESS_START_END_POSITION 0x44 -#define SET_RAM_Y_ADDRESS_START_END_POSITION 0x45 -#define SET_RAM_X_ADDRESS_COUNTER 0x4E -#define SET_RAM_Y_ADDRESS_COUNTER 0x4F -#define TERMINATE_FRAME_READ_WRITE 0xFF - - -void uDisplay::spi_data8_EPD(uint8_t val) { - SPI_BEGIN_TRANSACTION - SPI_CS_LOW - ulcd_data8(val); - SPI_CS_HIGH - SPI_END_TRANSACTION -} - -void uDisplay::spi_command_EPD(uint8_t val) { - SPI_BEGIN_TRANSACTION - SPI_CS_LOW - ulcd_command(val); - SPI_CS_HIGH - SPI_END_TRANSACTION -} - -void uDisplay::Init_EPD(int8_t p) { - if (p == DISPLAY_INIT_PARTIAL) { - if (lutpsize) { - SetLut(lut_partial); - } - } else { - if (lutfsize) { - SetLut(lut_full); - } - if (lut_cnt[0]) { - SetLuts(); - } - } - if (ep_mode == 1) { - ClearFrameMemory(0xFF); - Updateframe_EPD(); - } else if (ep_mode == 3) { - ClearFrameMemory(0xFF); - Updateframe_EPD(); - } else { - ClearFrame_42(); - } - if (p == DISPLAY_INIT_PARTIAL) { - delay_sync(lutptime * 10); - } else { - delay_sync(lutftime * 10); - } -} - -void uDisplay::ClearFrameMemory(unsigned char color) { - SetMemoryArea(0, 0, gxs - 1, gys - 1); - SetMemoryPointer(0, 0); - spi_command_EPD(WRITE_RAM); - /* send the color data */ - for (int i = 0; i < gxs / 8 * gys; i++) { - spi_data8_EPD(color); - } -} - -void uDisplay::SetLuts(void) { - uint8_t index, count; - for (index = 0; index < MAX_LUTS; index++) { - spi_command_EPD(lut_cmd[index]); - for (count = 0; count < lut_cnt[index]; count++) { - spi_data8_EPD(lut_array[index][count]); - } - } -} - -void uDisplay::DisplayFrame_42(void) { - - spi_command_EPD(saw_1); - for(int i = 0; i < gxs / 8 * gys; i++) { - spi_data8_EPD(0xFF); - } - delay(2); - - spi_command_EPD(saw_2); - for(int i = 0; i < gxs / 8 * gys; i++) { - spi_data8_EPD(framebuffer[i]^0xff); - } - delay(2); - - SetLuts(); - - spi_command_EPD(saw_3); - delay_sync(100); - -#ifdef UDSP_DEBUG - Serial.printf("EPD Diplayframe\n"); -#endif -} - - - - -void uDisplay::ClearFrame_42(void) { - spi_command_EPD(saw_1); - for (uint16_t j = 0; j < gys; j++) { - for (uint16_t i = 0; i < gxs; i++) { - spi_data8_EPD(0xFF); - } - } - - spi_command_EPD(saw_2); - for (uint16_t j = 0; j < gys; j++) { - for (uint16_t i = 0; i < gxs; i++) { - spi_data8_EPD(0xFF); - } - } - - spi_command_EPD(saw_3); - delay_sync(100); -#ifdef UDSP_DEBUG - Serial.printf("EPD Clearframe\n"); -#endif -} - -void uDisplay::SetLut(const unsigned char* lut) { - //spi_command_EPD(WRITE_LUT_REGISTER); - spi_command_EPD(lut_cmd[0]); - /* the length of look-up table is 30 bytes */ - for (int i = 0; i < lutfsize; i++) { - spi_data8_EPD(lut[i]); - } -} - -void uDisplay::Updateframe_EPD(void) { - if (ep_mode == 1 || ep_mode == 3) { - switch (ep_update_mode) { - case DISPLAY_INIT_PARTIAL: - if (epc_part_cnt) { - send_spi_cmds(epcoffs_part, epc_part_cnt); - } - break; - case DISPLAY_INIT_FULL: - if (epc_full_cnt) { - send_spi_cmds(epcoffs_full, epc_full_cnt); - } - break; - default: - SetFrameMemory(framebuffer, 0, 0, gxs, gys); - DisplayFrame_29(); - } - } else { - DisplayFrame_42(); - } -} - -void uDisplay::DisplayFrame_29(void) { - spi_command_EPD(DISPLAY_UPDATE_CONTROL_2); - spi_data8_EPD(0xC4); - spi_command_EPD(MASTER_ACTIVATION); - spi_data8_EPD(TERMINATE_FRAME_READ_WRITE); -} - -void uDisplay::SetMemoryArea(int x_start, int y_start, int x_end, int y_end) { - int x_start1 = (x_start >> 3) & 0xFF; - int x_end1 = (x_end >> 3) & 0xFF; - int y_start1 = y_start & 0xFF; - int y_start2 = (y_start >> 8) & 0xFF; - int y_end1 = y_end & 0xFF; - int y_end2 = (y_end >> 8) & 0xFF; - /* x point must be the multiple of 8 or the last 3 bits will be ignored */ - - if (ep_mode == 3) { - spi_command_EPD(SET_RAM_X_ADDRESS_START_END_POSITION); - spi_data8_EPD(x_start1); - spi_data8_EPD(x_end1); - spi_command_EPD(SET_RAM_Y_ADDRESS_START_END_POSITION); - spi_data8_EPD(y_end1); - spi_data8_EPD(y_end2); - spi_data8_EPD(y_start1); - spi_data8_EPD(y_start2); - } else { - spi_command_EPD(SET_RAM_X_ADDRESS_START_END_POSITION); - spi_data8_EPD(x_start1); - spi_data8_EPD(x_end1); - spi_command_EPD(SET_RAM_Y_ADDRESS_START_END_POSITION); - spi_data8_EPD(y_start1); - spi_data8_EPD(y_start2); - spi_data8_EPD(y_end1); - spi_data8_EPD(y_end2); - } -} - -void uDisplay::SetFrameMemory(const unsigned char* image_buffer) { - SetMemoryArea(0, 0, gxs - 1, gys - 1); - SetMemoryPointer(0, 0); - spi_command_EPD(WRITE_RAM); - /* send the image data */ - for (int i = 0; i < gxs / 8 * gys; i++) { - spi_data8_EPD(image_buffer[i] ^ 0xff); - } -} - -void uDisplay::SetMemoryPointer(int x, int y) { - int x1; - int y1; - int y2; - - if (ep_mode == 3) { - x1 = (x >> 3) & 0xFF; - y--; - y1 = y & 0xFF; - y2 = (y >> 8) & 0xFF; - } else { - x1 = (x >> 3) & 0xFF; - y1 = y & 0xFF; - y2 = (y >> 8) & 0xFF; - } - - spi_command_EPD(SET_RAM_X_ADDRESS_COUNTER); - /* x point must be the multiple of 8 or the last 3 bits will be ignored */ - spi_data8_EPD(x1); - spi_command_EPD(SET_RAM_Y_ADDRESS_COUNTER); - spi_data8_EPD(y1); - spi_data8_EPD(y2); -} - -#if 0 -void uDisplay::Send_EP_Data() { - for (int i = 0; i < gys / 8 * gys; i++) { - spi_data8_EPD(framebuffer[i]^0xff); - } -} -#else -void uDisplay::Send_EP_Data() { - uint16_t image_width = gxs & 0xFFF8; - uint16_t x = 0; - uint16_t y = 0; - uint16_t x_end = gxs - 1; - uint16_t y_end = gys - 1; - - for (uint16_t j = 0; j < y_end - y + 1; j++) { - for (uint16_t i = 0; i < (x_end - x + 1) / 8; i++) { - spi_data8_EPD(framebuffer[i + j * (image_width / 8)]^0xff); - } - } -} -#endif - -void uDisplay::SetFrameMemory( - const unsigned char* image_buffer, - uint16_t x, - uint16_t y, - uint16_t image_width, - uint16_t image_height -) { - uint16_t x_end; - uint16_t y_end; - - if ( - image_buffer == NULL || - x < 0 || image_width < 0 || - y < 0 || image_height < 0 - ) { - return; - } - - /* x point must be the multiple of 8 or the last 3 bits will be ignored */ - x &= 0xFFF8; - image_width &= 0xFFF8; - if (x + image_width >= gxs) { - x_end = gxs - 1; - } else { - x_end = x + image_width - 1; - } - if (y + image_height >= gys) { - y_end = gys - 1; - } else { - y_end = y + image_height - 1; - } - - if (!x && !y && image_width == gxs && image_height == gys) { - SetFrameMemory(image_buffer); - return; - } - - SetMemoryArea(x, y, x_end, y_end); - SetMemoryPointer(x, y); - spi_command_EPD(WRITE_RAM); - /* send the image data */ - for (uint16_t j = 0; j < y_end - y + 1; j++) { - for (uint16_t i = 0; i < (x_end - x + 1) / 8; i++) { - spi_data8_EPD(image_buffer[i + j * (image_width / 8)]^0xff); - } - } -} - -#define IF_INVERT_COLOR 1 - -/** - * @brief: this draws a pixel by absolute coordinates. - * this function won't be affected by the rotate parameter. - * we must use this for epaper because these displays have a strange and different bit pattern - */ -void uDisplay::DrawAbsolutePixel(int x, int y, int16_t color) { - - int16_t w = width(), h = height(); - if (cur_rot == 1 || cur_rot == 3) { - renderer_swap(w, h); - } - - if (x < 0 || x >= w || y < 0 || y >= h) { - return; - } - if (IF_INVERT_COLOR) { - if (color) { - framebuffer[(x + y * w) / 8] |= 0x80 >> (x % 8); - } else { - framebuffer[(x + y * w) / 8] &= ~(0x80 >> (x % 8)); - } - } else { - if (color) { - framebuffer[(x + y * w) / 8] &= ~(0x80 >> (x % 8)); - } else { - framebuffer[(x + y * w) / 8] |= 0x80 >> (x % 8); - } - } -} - -void uDisplay::drawPixel_EPD(int16_t x, int16_t y, uint16_t color) { - if (!framebuffer) return; - if ((x < 0) || (x >= width()) || (y < 0) || (y >= height())) - return; - - // check rotation, move pixel around if necessary - switch (cur_rot) { - case 1: - renderer_swap(x, y); - x = gxs - x - 1; - break; - case 2: - x = gxs - x - 1; - y = gys - y - 1; - break; - case 3: - renderer_swap(x, y); - y = gys - y - 1; - break; - } - - // x is which column - DrawAbsolutePixel(x, y, color); - -} - - -void uDisplay::fillRect_EPD(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) { - for (uint32_t yp = y; yp < y + h; yp++) { - for (uint32_t xp = x; xp < x + w; xp++) { - drawPixel_EPD(xp , yp , color); - } - } -} -void uDisplay::drawFastVLine_EPD(int16_t x, int16_t y, int16_t h, uint16_t color) { - while (h--) { - drawPixel_EPD(x , y , color); - y++; - } -} -void uDisplay::drawFastHLine_EPD(int16_t x, int16_t y, int16_t w, uint16_t color) { - while (w--) { - drawPixel_EPD(x , y , color); - x++; - } -} - - -void uDisplay::beginTransaction(SPISettings s) { -#ifdef ESP32 - if (lvgl_param.use_dma) { - dmaWait(); - } -#endif - uspi->beginTransaction(s); -} - -void uDisplay::endTransaction(void) { - uspi->endTransaction(); -} - - -// ESP 32 DMA section , derived from TFT_eSPI -#ifdef ESP32 - -/*************************************************************************************** -** Function name: initDMA -** Description: Initialise the DMA engine - returns true if init OK -***************************************************************************************/ -bool uDisplay::initDMA(int32_t ctrl_cs) -{ - if (DMA_Enabled) return false; - - esp_err_t ret; - spi_bus_config_t buscfg = { - .mosi_io_num = spi_mosi, - .miso_io_num = -1, - .sclk_io_num = spi_clk, - .quadwp_io_num = -1, - .quadhd_io_num = -1, - .max_transfer_sz = width() * height() * 2 + 8, // TFT screen size - .flags = 0, - .intr_flags = 0 - }; - - spi_device_interface_config_t devcfg = { - .command_bits = 0, - .address_bits = 0, - .dummy_bits = 0, - .mode = SPI_MODE3, - .duty_cycle_pos = 0, - .cs_ena_pretrans = 0, - .cs_ena_posttrans = 0, - .clock_speed_hz = spi_speed*1000000, - .input_delay_ns = 0, - .spics_io_num = ctrl_cs, - .flags = SPI_DEVICE_NO_DUMMY, //0, - .queue_size = 1, - .pre_cb = 0, //dc_callback, //Callback to handle D/C line - .post_cb = 0 - }; - ret = spi_bus_initialize(spi_host, &buscfg, 1); - ESP_ERROR_CHECK(ret); - ret = spi_bus_add_device(spi_host, &devcfg, &dmaHAL); - ESP_ERROR_CHECK(ret); - - DMA_Enabled = true; - spiBusyCheck = 0; - return true; -} - -/*************************************************************************************** -** Function name: deInitDMA -** Description: Disconnect the DMA engine from SPI -***************************************************************************************/ -void uDisplay::deInitDMA(void) { - if (!DMA_Enabled) return; - spi_bus_remove_device(dmaHAL); - spi_bus_free(spi_host); - DMA_Enabled = false; -} - -/*************************************************************************************** -** Function name: dmaBusy -** Description: Check if DMA is busy -***************************************************************************************/ -bool uDisplay::dmaBusy(void) { - if (!DMA_Enabled || !spiBusyCheck) return false; - - spi_transaction_t *rtrans; - esp_err_t ret; - uint8_t checks = spiBusyCheck; - for (int i = 0; i < checks; ++i) { - ret = spi_device_get_trans_result(dmaHAL, &rtrans, 0); - if (ret == ESP_OK) spiBusyCheck--; - } - - //Serial.print("spiBusyCheck=");Serial.println(spiBusyCheck); - if (spiBusyCheck == 0) return false; - return true; -} - - -/*************************************************************************************** -** Function name: dmaWait -** Description: Wait until DMA is over (blocking!) -***************************************************************************************/ -void uDisplay::dmaWait(void) { - if (!DMA_Enabled || !spiBusyCheck) return; - spi_transaction_t *rtrans; - esp_err_t ret; - for (int i = 0; i < spiBusyCheck; ++i) { - ret = spi_device_get_trans_result(dmaHAL, &rtrans, portMAX_DELAY); - assert(ret == ESP_OK); - } - spiBusyCheck = 0; -} - - -/*************************************************************************************** -** Function name: pushPixelsDMA -** Description: Push pixels to TFT (len must be less than 32767) -***************************************************************************************/ -// This will byte swap the original image if setSwapBytes(true) was called by sketch. -void uDisplay::pushPixelsDMA(uint16_t* image, uint32_t len) { - - if ((len == 0) || (!DMA_Enabled)) return; - - dmaWait(); - - esp_err_t ret; - - memset(&trans, 0, sizeof(spi_transaction_t)); - - trans.user = (void *)1; - trans.tx_buffer = image; //finally send the line data - trans.length = len * 16; //Data length, in bits - trans.flags = 0; //SPI_TRANS_USE_TXDATA flag - - ret = spi_device_queue_trans(dmaHAL, &trans, portMAX_DELAY); - assert(ret == ESP_OK); - - spiBusyCheck++; - if (!lvgl_param.async_dma) { - dmaWait(); - } -} - -/*************************************************************************************** -** Function name: pushPixelsDMA -** Description: Push pixels to TFT (len must be less than 32767) -***************************************************************************************/ -// This will byte swap the original image if setSwapBytes(true) was called by sketch. -void uDisplay::pushPixels3DMA(uint8_t* image, uint32_t len) { - - if ((len == 0) || (!DMA_Enabled)) return; - - dmaWait(); - - esp_err_t ret; - - memset(&trans, 0, sizeof(spi_transaction_t)); - - trans.user = (void *)1; - trans.tx_buffer = image; //finally send the line data - trans.length = len * 24; //Data length, in bits - trans.flags = 0; //SPI_TRANS_USE_TXDATA flag - - ret = spi_device_queue_trans(dmaHAL, &trans, portMAX_DELAY); - assert(ret == ESP_OK); - - spiBusyCheck++; - if (!lvgl_param.async_dma) { - dmaWait(); - } -} - -#ifdef USE_ESP32_S3 -void uDisplay::calcClockDiv(uint32_t* div_a, uint32_t* div_b, uint32_t* div_n, uint32_t* clkcnt, uint32_t baseClock, uint32_t targetFreq) { - uint32_t diff = INT32_MAX; - *div_n = 256; - *div_a = 63; - *div_b = 62; - *clkcnt = 64; - uint32_t start_cnt = std::min(64u, (baseClock / (targetFreq * 2) + 1)); - uint32_t end_cnt = std::max(2u, baseClock / 256u / targetFreq); - if (start_cnt <= 2) { end_cnt = 1; } - for (uint32_t cnt = start_cnt; diff && cnt >= end_cnt; --cnt) - { - float fdiv = (float)baseClock / cnt / targetFreq; - uint32_t n = std::max(2u, (uint32_t)fdiv); - fdiv -= n; - - for (uint32_t a = 63; diff && a > 0; --a) - { - uint32_t b = roundf(fdiv * a); - if (a == b && n == 256) { - break; - } - uint32_t freq = baseClock / ((n * cnt) + (float)(b * cnt) / (float)a); - uint32_t d = abs((int)targetFreq - (int)freq); - if (diff <= d) { continue; } - diff = d; - *clkcnt = cnt; - *div_n = n; - *div_b = b; - *div_a = a; - if (b == 0 || a == b) { - break; - } - } - } - if (*div_a == *div_b) - { - *div_b = 0; - *div_n += 1; - } - } - -void uDisplay::_alloc_dmadesc(size_t len) { - if (_dmadesc) heap_caps_free(_dmadesc); - _dmadesc_size = len; - _dmadesc = (lldesc_t*)heap_caps_malloc(sizeof(lldesc_t) * len, MALLOC_CAP_DMA); -} - -void uDisplay::_setup_dma_desc_links(const uint8_t *data, int32_t len) { - static constexpr size_t MAX_DMA_LEN = (4096-4); -/* - if (_dmadesc_size * MAX_DMA_LEN < len) { - _alloc_dmadesc(len / MAX_DMA_LEN + 1); - } - lldesc_t *dmadesc = _dmadesc; - - while (len > MAX_DMA_LEN) { - len -= MAX_DMA_LEN; - dmadesc->buffer = (uint8_t *)data; - data += MAX_DMA_LEN; - *(uint32_t*)dmadesc = MAX_DMA_LEN | MAX_DMA_LEN << 12 | 0x80000000; - dmadesc->next = dmadesc + 1; - dmadesc++; - } - *(uint32_t*)dmadesc = ((len + 3) & ( ~3 )) | len << 12 | 0xC0000000; - dmadesc->buffer = (uint8_t *)data; - dmadesc->next = nullptr; - */ - } - -#define WAIT_LCD_NOT_BUSY while (*reg_lcd_user & LCD_CAM_LCD_START) {} - - -void uDisplay::pb_beginTransaction(void) { - auto dev = _dev; - dev->lcd_clock.val = _clock_reg_value; - // int clk_div = std::min(63u, std::max(1u, 120*1000*1000 / (_cfg.freq_write+1))); - // dev->lcd_clock.lcd_clk_sel = 2; // clock_select: 1=XTAL CLOCK / 2=240MHz / 3=160MHz - // dev->lcd_clock.lcd_clkcnt_n = clk_div; - // dev->lcd_clock.lcd_clk_equ_sysclk = 0; - // dev->lcd_clock.lcd_ck_idle_edge = true; - // dev->lcd_clock.lcd_ck_out_edge = false; - - dev->lcd_misc.val = LCD_CAM_LCD_CD_IDLE_EDGE; - // dev->lcd_misc.lcd_cd_idle_edge = 1; - // dev->lcd_misc.lcd_cd_cmd_set = 0; - // dev->lcd_misc.lcd_cd_dummy_set = 0; - // dev->lcd_misc.lcd_cd_data_set = 0; - - dev->lcd_user.val = 0; - // dev->lcd_user.lcd_byte_order = false; - // dev->lcd_user.lcd_bit_order = false; - // dev->lcd_user.lcd_8bits_order = false; - - dev->lcd_user.val = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG; - - _cache_flip = _cache[0]; - } - -void uDisplay::pb_endTransaction(void) { - auto dev = _dev; - while (dev->lcd_user.val & LCD_CAM_LCD_START) {} -} - -void uDisplay::pb_wait(void) { - auto dev = _dev; - while (dev->lcd_user.val & LCD_CAM_LCD_START) {} -} - -bool uDisplay::pb_busy(void) { - auto dev = _dev; - return (dev->lcd_user.val & LCD_CAM_LCD_START); -} - -bool uDisplay::pb_writeCommand(uint32_t data, uint_fast8_t bit_length) { - auto dev = _dev; - auto reg_lcd_user = &(dev->lcd_user.val); - dev->lcd_misc.val = LCD_CAM_LCD_CD_IDLE_EDGE | LCD_CAM_LCD_CD_CMD_SET; - - if (interface == _UDSP_PAR8) { - // 8bit bus - auto bytes = bit_length >> 3; - do { - dev->lcd_cmd_val.lcd_cmd_value = data; - data >>= 8; - WAIT_LCD_NOT_BUSY - *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - } while (--bytes); - return true; - } else { - dev->lcd_cmd_val.val = data; - WAIT_LCD_NOT_BUSY - *reg_lcd_user = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - return true; - } -} - -void uDisplay::pb_writeData(uint32_t data, uint_fast8_t bit_length) { - auto dev = _dev; - auto reg_lcd_user = &(dev->lcd_user.val); - dev->lcd_misc.val = LCD_CAM_LCD_CD_IDLE_EDGE; - auto bytes = bit_length >> 3; - - if (interface == _UDSP_PAR8) { - uint8_t shift = (bytes - 1) * 8; - for (uint32_t cnt = 0; cnt < bytes; cnt++) { - dev->lcd_cmd_val.lcd_cmd_value = (data >> shift) & 0xff; - shift -= 8; - WAIT_LCD_NOT_BUSY - *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - } - return; - - } else { - if (bytes == 1 || bytes == 4) { - uint8_t shift = (bytes - 1) * 8; - for (uint32_t cnt = 0; cnt < bytes; cnt++) { - dev->lcd_cmd_val.lcd_cmd_value = (data >> shift) & 0xff; - shift -= 8; - WAIT_LCD_NOT_BUSY - *reg_lcd_user = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - } - return; - } - - dev->lcd_cmd_val.val = data; - WAIT_LCD_NOT_BUSY - *reg_lcd_user = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - return; - } -} - -void uDisplay::pb_pushPixels(uint16_t* data, uint32_t length, bool swap_bytes, bool use_dma) { - auto dev = _dev; - auto reg_lcd_user = &(dev->lcd_user.val); - dev->lcd_misc.val = LCD_CAM_LCD_CD_IDLE_EDGE; - - if (interface == _UDSP_PAR8) { - if (swap_bytes) { - for (uint32_t cnt = 0; cnt < length; cnt++) { - dev->lcd_cmd_val.lcd_cmd_value = *data; - while (*reg_lcd_user & LCD_CAM_LCD_START) {} - *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - dev->lcd_cmd_val.lcd_cmd_value = *data >> 8; - WAIT_LCD_NOT_BUSY - *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - data++; - } - } else { - for (uint32_t cnt = 0; cnt < length; cnt++) { - dev->lcd_cmd_val.lcd_cmd_value = *data >> 8; - while (*reg_lcd_user & LCD_CAM_LCD_START) {} - *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - dev->lcd_cmd_val.lcd_cmd_value = *data; - WAIT_LCD_NOT_BUSY - *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - data++; - } - } - } else { - if (swap_bytes) { - uint16_t iob; - for (uint32_t cnt = 0; cnt < length; cnt++) { - iob = *data++; - iob = (iob << 8) | (iob >> 8); - dev->lcd_cmd_val.lcd_cmd_value = iob; - WAIT_LCD_NOT_BUSY - *reg_lcd_user = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - } - } else { - for (uint32_t cnt = 0; cnt < length; cnt++) { - dev->lcd_cmd_val.lcd_cmd_value = *data++; - WAIT_LCD_NOT_BUSY - *reg_lcd_user = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - } - } - } -} - - -void uDisplay::pb_writeBytes(const uint8_t* data, uint32_t length, bool use_dma) { - -/* - uint32_t freq = spi_speed * 1000000; - uint32_t slow = (freq< 4000000) ? 2 : (freq < 8000000) ? 1 : 0; - - auto dev = _dev; - do { - auto reg_lcd_user = &(dev->lcd_user.val); - dev->lcd_misc.lcd_cd_cmd_set = 0; - dev->lcd_cmd_val.lcd_cmd_value = data[0] | data[1] << 16; - uint32_t cmd_val = data[2] | data[3] << 16; - while (*reg_lcd_user & LCD_CAM_LCD_START) {} - *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_CMD_2_CYCLE_EN | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; - - if (use_dma) { - if (slow) { ets_delay_us(slow); } - _setup_dma_desc_links(&data[4], length - 4); - gdma_start(_dma_chan, (intptr_t)(_dmadesc)); - length = 0; - } else { - size_t len = length; - if (len > CACHE_SIZE) { - len = (((len - 1) % CACHE_SIZE) + 4) & ~3u; - } - memcpy(_cache_flip, &data[4], (len-4+3)&~3); - _setup_dma_desc_links((const uint8_t*)_cache_flip, len-4); - gdma_start(_dma_chan, (intptr_t)(_dmadesc)); - length -= len; - data += len; - _cache_flip = _cache[(_cache_flip == _cache[0])]; - } - dev->lcd_cmd_val.lcd_cmd_value = cmd_val; - dev->lcd_misc.lcd_cd_data_set = 0; - *reg_lcd_user = LCD_CAM_LCD_ALWAYS_OUT_EN | LCD_CAM_LCD_DOUT | LCD_CAM_LCD_CMD | LCD_CAM_LCD_CMD_2_CYCLE_EN | LCD_CAM_LCD_UPDATE_REG; - while (*reg_lcd_user & LCD_CAM_LCD_START) {} - *reg_lcd_user = LCD_CAM_LCD_ALWAYS_OUT_EN | LCD_CAM_LCD_DOUT | LCD_CAM_LCD_CMD | LCD_CAM_LCD_CMD_2_CYCLE_EN | LCD_CAM_LCD_START; - } while (length); -*/ -} - - -void uDisplay::_send_align_data(void) { - _has_align_data = false; - auto dev = _dev; - dev->lcd_cmd_val.lcd_cmd_value = _align_data; - auto reg_lcd_user = &(dev->lcd_user.val); - while (*reg_lcd_user & LCD_CAM_LCD_START) {} - *reg_lcd_user = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; -} - - -void uDisplay::cs_control(bool level) { - auto pin = par_cs; - if (pin < 0) return; - if (level) { - gpio_hi(pin); - } - else { - gpio_lo(pin); - } -} - -void uDisplay::_pb_init_pin(bool read) { - if (read) { - if (interface == _UDSP_PAR8) { - for (size_t i = 0; i < 8; ++i) { - gpio_ll_output_disable(&GPIO, (gpio_num_t)par_dbl[i]); - } - } else { - for (size_t i = 0; i < 8; ++i) { - gpio_ll_output_disable(&GPIO, (gpio_num_t)par_dbl[i]); - } - for (size_t i = 0; i < 8; ++i) { - gpio_ll_output_disable(&GPIO, (gpio_num_t)par_dbh[i]); - } - } - } - else { - auto idx_base = LCD_DATA_OUT0_IDX; - if (interface == _UDSP_PAR8) { - for (size_t i = 0; i < 8; ++i) { - gpio_matrix_out(par_dbl[i], idx_base + i, 0, 0); - } - } else { - for (size_t i = 0; i < 8; ++i) { - gpio_matrix_out(par_dbl[i], idx_base + i, 0, 0); - } - for (size_t i = 0; i < 8; ++i) { - gpio_matrix_out(par_dbh[i], idx_base + 8 + i, 0, 0); - } - } - } -} - -/* read analog value from pin for simple digitizer -X+ = d1 -X- = CS -Y+ = RS -Y- = D0 - -define YP A2 // must be an analog pin, use "An" notation! -#define XM A3 // must be an analog pin, use "An" notation! -#define YM 8 // can be a digital pin -#define XP 9 // can be a digital pin - -*/ -uint32_t uDisplay::get_sr_touch(uint32_t _xp, uint32_t _xm, uint32_t _yp, uint32_t _ym) { - uint32_t aval = 0; - uint16_t xp,yp; - if (pb_busy()) return 0; - - _pb_init_pin(true); - gpio_matrix_out(par_rs, 0x100, 0, 0); - - pinMode(_ym, INPUT_PULLUP); // d0 - pinMode(_yp, INPUT_PULLUP); // rs - - pinMode(_xm, OUTPUT); // cs - pinMode(_xp, OUTPUT); // d1 - digitalWrite(_xm, HIGH); // cs - digitalWrite(_xp, LOW); // d1 - - xp = 4096 - analogRead(_ym); // d0 - - pinMode(_xm, INPUT_PULLUP); // cs - pinMode(_xp, INPUT_PULLUP); // d1 - - pinMode(_ym, OUTPUT); // d0 - pinMode(_yp, OUTPUT); // rs - digitalWrite(_ym, HIGH); // d0 - digitalWrite(_yp, LOW); // rs - - yp = 4096 - analogRead(_xp); // d1 - - aval = (xp << 16) | yp; - - pinMode(_yp, OUTPUT); // rs - pinMode(_xm, OUTPUT); // cs - pinMode(_ym, OUTPUT); // d0 - pinMode(_xp, OUTPUT); // d1 - digitalWrite(_yp, HIGH); // rs - digitalWrite(_xm, HIGH); // cs - - _pb_init_pin(false); - gpio_matrix_out(par_rs, LCD_DC_IDX, 0, 0); - - return aval; -} - - - - -#if 0 -void TFT_eSPI::startWrite(void) -{ - begin_tft_write(); - lockTransaction = true; // Lock transaction for all sequentially run sketch functions - inTransaction = true; -} - -/*************************************************************************************** -** Function name: endWrite -** Description: end transaction with CS high -***************************************************************************************/ -void TFT_eSPI::endWrite(void) -{ - lockTransaction = false; // Release sketch induced transaction lock - inTransaction = false; - DMA_BUSY_CHECK; // Safety check - user code should have checked this! - end_tft_write(); // Release SPI bus -} -#endif - - -#endif // USE_ESP32_S3 - -#endif // ESP32 diff --git a/lib/lib_display/UDisplay/uDisplay.h b/lib/lib_display/UDisplay/uDisplay.h old mode 100755 new mode 100644 index 37f4f1589..53d565c26 --- a/lib/lib_display/UDisplay/uDisplay.h +++ b/lib/lib_display/UDisplay/uDisplay.h @@ -10,20 +10,15 @@ #ifdef CONFIG_IDF_TARGET_ESP32S3 #define USE_ESP32_S3 #endif -#include "driver/spi_master.h" #include "soc/gpio_periph.h" #include +#include "driver/spi_master.h" #endif enum { UT_RD,UT_RDM,UT_CP,UT_RTF,UT_MV,UT_MVB,UT_RT,UT_RTT,UT_RDW,UT_RDWM,UT_WR,UT_WRW,UT_CPR,UT_AND,UT_SCALE,UT_LIM,UT_DBG,UT_GSRT,UT_XPT,UT_CPM,UT_END }; -#define RA8876_DATA_WRITE 0x80 -#define RA8876_DATA_READ 0xC0 -#define RA8876_CMD_WRITE 0x00 -#define RA8876_STATUS_READ 0x40 - #define UDSP_WRITE_16 0xf0 #define UDSP_READ_DATA 0xf1 #define UDSP_READ_STATUS 0xf2 @@ -41,13 +36,6 @@ enum { #include #include #include -static inline volatile uint32_t* get_gpio_hi_reg(int_fast8_t pin) { return (pin & 32) ? &GPIO.out1_w1ts.val : &GPIO.out_w1ts; } -//static inline volatile uint32_t* get_gpio_hi_reg(int_fast8_t pin) { return (volatile uint32_t*)((pin & 32) ? 0x60004014 : 0x60004008) ; } // workaround Eratta -static inline volatile uint32_t* get_gpio_lo_reg(int_fast8_t pin) { return (pin & 32) ? &GPIO.out1_w1tc.val : &GPIO.out_w1tc; } -//static inline volatile uint32_t* get_gpio_lo_reg(int_fast8_t pin) { return (volatile uint32_t*)((pin & 32) ? 0x60004018 : 0x6000400C) ; } -static inline bool gpio_in(int_fast8_t pin) { return ((pin & 32) ? GPIO.in1.data : GPIO.in) & (1 << (pin & 31)); } -static inline void gpio_hi(int_fast8_t pin) { if (pin >= 0) *get_gpio_hi_reg(pin) = 1 << (pin & 31); } // ESP_LOGI("LGFX", "gpio_hi: %d", pin); } -static inline void gpio_lo(int_fast8_t pin) { if (pin >= 0) *get_gpio_lo_reg(pin) = 1 << (pin & 31); } // ESP_LOGI("LGFX", "gpio_lo: %d", pin); } #include "esp_lcd_panel_interface.h" #include "esp_lcd_panel_rgb.h" #include "esp_pm.h" @@ -72,65 +60,6 @@ static inline void gpio_lo(int_fast8_t pin) { if (pin >= 0) *get_gpio_lo_reg(pin #define DISPLAY_INIT_PARTIAL 1 #define DISPLAY_INIT_FULL 2 -enum uColorType { uCOLOR_BW, uCOLOR_COLOR }; - -// Color definitions -#define UDISP_BLACK 0x0000 /* 0, 0, 0 */ -#define UDISP_NAVY 0x000F /* 0, 0, 128 */ -#define UDISP_DARKGREEN 0x03E0 /* 0, 128, 0 */ -#define UDISP_DARKCYAN 0x03EF /* 0, 128, 128 */ -#define UDISP_MAROON 0x7800 /* 128, 0, 0 */ -#define UDISP_PURPLE 0x780F /* 128, 0, 128 */ -#define UDISP_OLIVE 0x7BE0 /* 128, 128, 0 */ -#define UDISP_LIGHTGREY 0xC618 /* 192, 192, 192 */ -#define UDISP_DARKGREY 0x7BEF /* 128, 128, 128 */ -#define UDISP_BLUE 0x001F /* 0, 0, 255 */ -#define UDISP_GREEN 0x07E0 /* 0, 255, 0 */ -#define UDISP_CYAN 0x07FF /* 0, 255, 255 */ -#define UDISP_RED 0xF800 /* 255, 0, 0 */ -#define UDISP_MAGENTA 0xF81F /* 255, 0, 255 */ -#define UDISP_YELLOW 0xFFE0 /* 255, 255, 0 */ -#define UDISP_WHITE 0xFFFF /* 255, 255, 255 */ -#define UDISP_ORANGE 0xFD20 /* 255, 165, 0 */ -#define UDISP_GREENYELLOW 0xAFE5 /* 173, 255, 47 */ -#define UDISP_PINK 0xFc18 /* 255, 128, 192 */ - -#ifdef ESP8266 -#define PIN_OUT_SET 0x60000304 -#define PIN_OUT_CLEAR 0x60000308 -#define GPIO_SET(A) WRITE_PERI_REG( PIN_OUT_SET, 1 << A) -#define GPIO_CLR(A) WRITE_PERI_REG( PIN_OUT_CLEAR, 1 << A) -#define GPIO_CLR_SLOW(A) digitalWrite(A, LOW) -#define GPIO_SET_SLOW(A) digitalWrite(A, HIGH) -#else -#undef GPIO_SET -#undef GPIO_CLR -#undef GPIO_SET_SLOW -#undef GPIO_CLR_SLOW - -#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32P4 -#define GPIO_CLR(A) GPIO.out_w1tc.val = (1 << A) -#define GPIO_SET(A) GPIO.out_w1ts.val = (1 << A) -#else // plain ESP32 -#define GPIO_CLR(A) GPIO.out_w1tc = (1 << A) -#define GPIO_SET(A) GPIO.out_w1ts = (1 << A) -#endif - - - - -#define GPIO_CLR_SLOW(A) digitalWrite(A, LOW) -#define GPIO_SET_SLOW(A) digitalWrite(A, HIGH) - -#endif - -#define SPI_BEGIN_TRANSACTION if (spi_nr <= 2) beginTransaction(spiSettings); -#define SPI_END_TRANSACTION if (spi_nr <= 2) endTransaction(); - -#define SPI_CS_LOW if (spi_cs >= 0) GPIO_CLR_SLOW(spi_cs); -#define SPI_CS_HIGH if (spi_cs >= 0) GPIO_SET_SLOW(spi_cs); -#define SPI_DC_LOW if (spi_dc >= 0) GPIO_CLR_SLOW(spi_dc); -#define SPI_DC_HIGH if (spi_dc >= 0) GPIO_SET_SLOW(spi_dc); class uDisplay : public Renderer { public: @@ -164,153 +93,154 @@ class uDisplay : public Renderer { int16_t getPoint_y(); #endif // USE_UNIVERSAL_TOUCH - private: - void beginTransaction(SPISettings s); - void endTransaction(void); - void setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); - void drawPixel(int16_t x, int16_t y, uint16_t color); - void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color); - void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); - uint32_t str2c(char **sp, char *vp, uint32_t len); - void i2c_command(uint8_t val); - void ulcd_command_one(uint8_t val); - void ulcd_command(uint8_t val); - void ulcd_data8(uint8_t val); - void ulcd_data16(uint16_t val); - void ulcd_data32(uint32_t val); - void write8(uint8_t val); - void write8_slow(uint8_t val); - void write9(uint8_t val, uint8_t dc); - void write9_slow(uint8_t val, uint8_t dc); - void hw_write9(uint8_t val, uint8_t dc); - void write16(uint16_t val); - void write32(uint32_t val); - void spi_data9(uint8_t d, uint8_t dc); - uint8_t readData(void); - uint8_t readStatus(void); - uint8_t writeReg16(uint8_t reg, uint16_t wval); - void WriteColor(uint16_t color); - void SetLut(const unsigned char* lut); - void SetLuts(void); - void DisplayFrame_29(void); - void Updateframe_EPD(); - //void DisplayFrame_42(const unsigned char* frame_buffer); - void SetFrameMemory(const unsigned char* image_buffer); - void SetFrameMemory(const unsigned char* image_buffer, uint16_t x, uint16_t y, uint16_t image_width, uint16_t image_height); - void SetMemoryArea(int x_start, int y_start, int x_end, int y_end); - void SetMemoryPointer(int x, int y); - void DrawAbsolutePixel(int x, int y, int16_t color); - void drawPixel_EPD(int16_t x, int16_t y, uint16_t color); - void fillRect_EPD(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); - void drawFastVLine_EPD(int16_t x, int16_t y, int16_t h, uint16_t color); - void drawFastHLine_EPD(int16_t x, int16_t y, int16_t w, uint16_t color); - void Init_EPD(int8_t p); - void spi_command_EPD(uint8_t val); - void spi_data8_EPD(uint8_t val); - //void SetPartialWindow_42(uint8_t* frame_buffer, int16_t x, int16_t y, int16_t w, int16_t l, int16_t dtm); - void ClearFrameMemory(unsigned char color); - void ClearFrame_42(void); - void DisplayFrame_42(void); - uint8_t strlen_ln(char *str); - int32_t next_val(char **sp); - uint32_t next_hex(char **sp); - void setAddrWindow_int(uint16_t x, uint16_t y, uint16_t w, uint16_t h); - char dname[16]; - int8_t bpp; - uint8_t col_type; - uint8_t interface; - uint8_t i2caddr; - int8_t i2c_scl; - int8_t spec_init; - TwoWire *wire; - int8_t wire_n; - int8_t i2c_sda; - uint8_t i2c_col_start; - uint8_t i2c_col_end; - uint8_t i2c_page_start; - uint8_t i2c_page_end; - int8_t reset; - uint8_t dsp_cmds[256]; - uint8_t dsp_ncmds; - uint8_t dsp_on; - uint8_t dsp_off; - uint8_t allcmd_mode; - int8_t splash_font; - uint8_t splash_size; - uint16_t splash_xp; - uint16_t splash_yp; - uint16_t fg_col; - uint16_t bg_col; - uint16_t gxs; - uint16_t gys; - int8_t bpmode; - int8_t spi_cs; - int8_t spi_clk; - int8_t spi_mosi; - int8_t spi_dc; - int8_t bpanel; // backbanel GPIO, -1 if none - int8_t spi_miso; - uint8_t dimmer8; // 8 bits resolution, 0..255 - uint16_t dimmer10_gamma; // 10 bits resolution, 0..1023, gamma corrected - SPIClass *uspi; - uint8_t sspi; - SPISettings spiSettings; - uint8_t spi_speed; - uint8_t spi_nr = 1; - uint8_t madctrl; - uint8_t startline; - uint8_t rot[4]; - uint8_t rot_t[4]; - uint16_t x_addr_offs[4]; - uint16_t y_addr_offs[4]; - uint8_t saw_1; - uint8_t saw_2; - uint8_t saw_3; - uint8_t cur_rot; - uint8_t col_mode; - uint8_t inv_on; - uint8_t inv_off; - uint8_t sa_mode; - uint8_t dim_op; - uint8_t lutfsize; - uint8_t lutpsize; - int16_t lutftime; - int8_t busy_pin; - uint16_t lutptime; - uint16_t lut3time; - uint16_t lut_num; - uint8_t ep_mode; - uint8_t ep_update_mode; - uint8_t *lut_full; - uint8_t lut_siz_full; - uint8_t *lut_partial; - uint8_t lut_siz_partial; - uint8_t *frame_buffer; +private: + uint8_t *frame_buffer; + uint8_t *lut_full; + uint8_t *lut_partial; + uint8_t *lut_array[MAX_LUTS]; + uint8_t dsp_cmds[256]; + char dname[16]; + SPIClass *uspi; + TwoWire *wire; + SPISettings spiSettings; - uint8_t epcoffs_full; - uint8_t epc_full_cnt; - uint8_t epcoffs_part; - uint8_t epc_part_cnt; + uint16_t x_addr_offs[4]; + uint16_t y_addr_offs[4]; + uint16_t splash_xp; + uint16_t splash_yp; + uint16_t fg_col; + uint16_t bg_col; + uint16_t gxs; + uint16_t gys; + uint16_t dimmer10_gamma; + uint16_t seta_xp1; + uint16_t seta_xp2; + uint16_t seta_yp1; + uint16_t seta_yp2; + uint16_t lutptime; + uint16_t lut3time; + uint16_t lut_num; - uint8_t *lut_array[MAX_LUTS]; - uint8_t lut_cnt[MAX_LUTS]; - uint8_t lut_cmd[MAX_LUTS]; - uint8_t lut_siz[MAX_LUTS]; - uint16_t seta_xp1; - uint16_t seta_xp2; - uint16_t seta_yp1; - uint16_t seta_yp2; - int16_t rotmap_xmin; - int16_t rotmap_xmax; - int16_t rotmap_ymin; - int16_t rotmap_ymax; - void pushColorsMono(uint16_t *data, uint16_t len, bool rgb16_swap = false); - void delay_sync(int32_t time); - void reset_pin(int32_t delayl, int32_t delayh); - void delay_arg(uint32_t arg); - void Send_EP_Data(void); - void send_spi_cmds(uint16_t cmd_offset, uint16_t cmd_size); - void send_spi_icmds(uint16_t cmd_size); + uint8_t bpp; + uint8_t col_type; + uint8_t interface; + uint8_t i2caddr; + uint8_t i2c_col_start; + uint8_t i2c_col_end; + uint8_t i2c_page_start; + uint8_t i2c_page_end; + uint8_t dsp_ncmds; + uint8_t dsp_on; + uint8_t dsp_off; + uint8_t allcmd_mode; + uint8_t splash_size; + uint8_t dimmer8; + uint8_t spi_speed; + uint8_t spi_nr; + uint8_t rot[4]; + uint8_t rot_t[4]; + uint8_t madctrl; + uint8_t startline; + uint8_t saw_1; + uint8_t saw_2; + uint8_t saw_3; + uint8_t cur_rot; + uint8_t col_mode; + uint8_t inv_on; + uint8_t inv_off; + uint8_t sa_mode; + uint8_t dim_op; + uint8_t lutfsize; + uint8_t lutpsize; + uint8_t lut_siz_full; + uint8_t lut_siz_partial; + uint8_t epcoffs_full; + uint8_t epc_full_cnt; + uint8_t epcoffs_part; + uint8_t epc_part_cnt; + uint8_t lut_cnt[MAX_LUTS]; + uint8_t lut_cmd[MAX_LUTS]; + uint8_t lut_siz[MAX_LUTS]; + uint8_t ep_mode; + uint8_t ep_update_mode; + uint8_t sspi; + + int8_t spec_init; + int8_t wire_n; + int8_t i2c_scl; + int8_t i2c_sda; + int8_t reset; + int8_t splash_font; + int8_t bpmode; + int8_t spi_cs; + int8_t spi_clk; + int8_t spi_mosi; + int8_t spi_dc; + int8_t bpanel; + int8_t spi_miso; + int8_t busy_pin; + + int16_t lutftime; + int16_t rotmap_xmin; + int16_t rotmap_xmax; + int16_t rotmap_ymin; + int16_t rotmap_ymax; + + void beginTransaction(SPISettings s); + void endTransaction(void); + void setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); + void drawPixel(int16_t x, int16_t y, uint16_t color); + void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color); + void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); + uint32_t str2c(char **sp, char *vp, uint32_t len); + void i2c_command(uint8_t val); + void ulcd_command_one(uint8_t val); + void ulcd_command(uint8_t val); + void ulcd_data8(uint8_t val); + void ulcd_data16(uint16_t val); + void ulcd_data32(uint32_t val); + void write8(uint8_t val); + void write8_slow(uint8_t val); + void write9(uint8_t val, uint8_t dc); + void write9_slow(uint8_t val, uint8_t dc); + void hw_write9(uint8_t val, uint8_t dc); + void write16(uint16_t val); + void write32(uint32_t val); + void spi_data9(uint8_t d, uint8_t dc); + uint8_t readData(void); + uint8_t readStatus(void); + uint8_t writeReg16(uint8_t reg, uint16_t wval); + void WriteColor(uint16_t color); + void SetLut(const unsigned char* lut); + void SetLuts(void); + void DisplayFrame_29(void); + void Updateframe_EPD(); + void SetFrameMemory(const unsigned char* image_buffer); + void SetFrameMemory(const unsigned char* image_buffer, uint16_t x, uint16_t y, uint16_t image_width, uint16_t image_height); + void SetMemoryArea(int x_start, int y_start, int x_end, int y_end); + void SetMemoryPointer(int x, int y); + void DrawAbsolutePixel(int x, int y, int16_t color); + void drawPixel_EPD(int16_t x, int16_t y, uint16_t color); + void fillRect_EPD(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); + void drawFastVLine_EPD(int16_t x, int16_t y, int16_t h, uint16_t color); + void drawFastHLine_EPD(int16_t x, int16_t y, int16_t w, uint16_t color); + void Init_EPD(int8_t p); + void spi_command_EPD(uint8_t val); + void spi_data8_EPD(uint8_t val); + void ClearFrameMemory(unsigned char color); + void ClearFrame_42(void); + void DisplayFrame_42(void); + uint8_t strlen_ln(char *str); + int32_t next_val(char **sp); + uint32_t next_hex(char **sp); + void setAddrWindow_int(uint16_t x, uint16_t y, uint16_t w, uint16_t h); + void pushColorsMono(uint16_t *data, uint16_t len, bool rgb16_swap = false); + void delay_sync(int32_t time); + void reset_pin(int32_t delayl, int32_t delayh); + void delay_arg(uint32_t arg); + void Send_EP_Data(void); + void send_spi_cmds(uint16_t cmd_offset, uint16_t cmd_size); + void send_spi_icmds(uint16_t cmd_size); #ifdef USE_ESP32_S3 diff --git a/lib/lib_display/UDisplay/uDisplayColors.cpp b/lib/lib_display/UDisplay/uDisplayColors.cpp new file mode 100644 index 000000000..87c758f08 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplayColors.cpp @@ -0,0 +1,31 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" + +// Color palette definition +static constexpr uint16_t udisp_colors[] = { + UDISP_BLACK, UDISP_WHITE, UDISP_RED, UDISP_GREEN, UDISP_BLUE, UDISP_CYAN, + UDISP_MAGENTA, UDISP_YELLOW, UDISP_NAVY, UDISP_DARKGREEN, UDISP_DARKCYAN, + UDISP_MAROON, UDISP_PURPLE, UDISP_OLIVE, UDISP_LIGHTGREY, UDISP_DARKGREY, + UDISP_ORANGE, UDISP_GREENYELLOW, UDISP_PINK +}; + +uint16_t uDisplay::GetColorFromIndex(uint8_t index) { + const size_t color_count = sizeof(udisp_colors) / sizeof(udisp_colors[0]); + + if (index >= color_count) { + index = 0; + } + return udisp_colors[index]; +} + +uint16_t uDisplay::fgcol(void) { + return fg_col; +} + +uint16_t uDisplay::bgcol(void) { + return bg_col; +} + +int8_t uDisplay::color_type(void) { + return col_type; +} \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_config.h b/lib/lib_display/UDisplay/uDisplay_config.h new file mode 100644 index 000000000..5dd8f7d78 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_config.h @@ -0,0 +1,56 @@ +#ifndef UDISPLAY_CONFIG_H +#define UDISPLAY_CONFIG_H + +// Logging system interface +enum LoggingLevels { + LOG_LEVEL_NONE, + LOG_LEVEL_ERROR, + LOG_LEVEL_INFO, + LOG_LEVEL_DEBUG, + LOG_LEVEL_DEBUG_MORE +}; + +extern void AddLog(uint32_t loglevel, const char* formatP, ...); +extern int32_t ESP_ResetInfoReason(); +extern float CharToFloat(const char *str); +extern SPIClass *SpiBegin(uint32 bus); +extern int Cache_WriteBack_Addr(uint32_t addr, uint32_t size); +extern bool UsePSRAM(void); + +enum uColorType { uCOLOR_BW, uCOLOR_COLOR }; + +// Color definitions +constexpr uint16_t UDISP_BLACK = 0x0000; /* 0, 0, 0 */ +constexpr uint16_t UDISP_NAVY = 0x000F; /* 0, 0, 128 */ +constexpr uint16_t UDISP_DARKGREEN = 0x03E0; /* 0, 128, 0 */ +constexpr uint16_t UDISP_DARKCYAN = 0x03EF; /* 0, 128, 128 */ +constexpr uint16_t UDISP_MAROON = 0x7800; /* 128, 0, 0 */ +constexpr uint16_t UDISP_PURPLE = 0x780F; /* 128, 0, 128 */ +constexpr uint16_t UDISP_OLIVE = 0x7BE0; /* 128, 128, 0 */ +constexpr uint16_t UDISP_LIGHTGREY = 0xC618; /* 192, 192, 192 */ +constexpr uint16_t UDISP_DARKGREY = 0x7BEF; /* 128, 128, 128 */ +constexpr uint16_t UDISP_BLUE = 0x001F; /* 0, 0, 255 */ +constexpr uint16_t UDISP_GREEN = 0x07E0; /* 0, 255, 0 */ +constexpr uint16_t UDISP_CYAN = 0x07FF; /* 0, 255, 255 */ +constexpr uint16_t UDISP_RED = 0xF800; /* 255, 0, 0 */ +constexpr uint16_t UDISP_MAGENTA = 0xF81F; /* 255, 0, 255 */ +constexpr uint16_t UDISP_YELLOW = 0xFFE0; /* 255, 255, 0 */ +constexpr uint16_t UDISP_WHITE = 0xFFFF; /* 255, 255, 255 */ +constexpr uint16_t UDISP_ORANGE = 0xFD20; /* 255, 165, 0 */ +constexpr uint16_t UDISP_GREENYELLOW = 0xAFE5; /* 173, 255, 47 */ +constexpr uint16_t UDISP_PINK = 0xFC18; /* 255, 128, 192 */ + +// epaper pseudo opcodes +constexpr uint8_t EP_RESET = 0x60; +constexpr uint8_t EP_LUT_FULL = 0x61; +constexpr uint8_t EP_LUT_PARTIAL = 0x62; +constexpr uint8_t EP_WAITIDLE = 0x63; +constexpr uint8_t EP_SET_MEM_AREA = 0x64; +constexpr uint8_t EP_SET_MEM_PTR = 0x65; +constexpr uint8_t EP_SEND_DATA = 0x66; +constexpr uint8_t EP_CLR_FRAME = 0x67; +constexpr uint8_t EP_SEND_FRAME = 0x68; +constexpr uint8_t EP_BREAK_RR_EQU = 0x69; +constexpr uint8_t EP_BREAK_RR_NEQ = 0x6a; + +#endif \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_control.cpp b/lib/lib_display/UDisplay/uDisplay_control.cpp new file mode 100644 index 000000000..29c1d537b --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_control.cpp @@ -0,0 +1,146 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" +#include "uDisplay_spi.h" + +void udisp_bpwr(uint8_t on); + +void udisp_dimm(uint8_t dim); + +// input value is 0..15 +// void uDisplay::dim(uint8_t dim) { +// dim8(((uint32_t)dim * 255) / 15); +// } + +// ===== Power Management ===== + +void uDisplay::DisplayOnff(int8_t on) { + if (ep_mode) { + return; + } + + if (pwr_cbp) { + pwr_cbp(on); + } + +#define AW_PWMRES 1024 + + if (interface == _UDSP_I2C) { + if (on) { + i2c_command(dsp_on); + } else { + i2c_command(dsp_off); + } + } else { + if (on) { + if (dsp_on != 0xff) ulcd_command_one(dsp_on); + if (bpanel >= 0) { +#ifdef ESP32 + if (!bpmode) { + analogWrite(bpanel, dimmer10_gamma); + } else { + analogWrite(bpanel, AW_PWMRES - dimmer10_gamma); + } +#else + if (!bpmode) { + digitalWrite(bpanel, HIGH); + } else { + digitalWrite(bpanel, LOW); + } +#endif + } + } else { + if (dsp_off != 0xff) ulcd_command_one(dsp_off); + if (bpanel >= 0) { +#ifdef ESP32 + if (!bpmode) { + analogWrite(bpanel, 0); + } else { + analogWrite(bpanel, AW_PWMRES - 1); + } +#else + if (!bpmode) { + digitalWrite(bpanel, LOW); + } else { + digitalWrite(bpanel, HIGH); + } +#endif + } + } + } +} + +// ===== Brightness/Dimming Control ===== +// dim is 0..255 +void uDisplay::dim10(uint8_t dim, uint16_t dim_gamma) { + dimmer8 = dim; + dimmer10_gamma = dim_gamma; + + if (ep_mode) { + return; + } + +#ifdef ESP32 + if (bpanel >= 0) { + if (!bpmode) { + analogWrite(bpanel, dimmer10_gamma); + } else { + analogWrite(bpanel, AW_PWMRES - dimmer10_gamma); + } + } else if (dim_cbp) { + dim_cbp(dim); + } +#endif + + if (interface == _UDSP_SPI) { + if (dim_op != 0xff) { + SPI_BEGIN_TRANSACTION + SPI_CS_LOW + ulcd_command(dim_op); + ulcd_data8(dimmer8); + SPI_CS_HIGH + SPI_END_TRANSACTION + } + } +} + +// ===== Display Inversion ===== + +void uDisplay::invertDisplay(boolean i) { + if (ep_mode) { + return; + } + + if (interface == _UDSP_SPI || interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { + if (i) { + ulcd_command_one(inv_on); + } else { + ulcd_command_one(inv_off); + } + } + + if (interface == _UDSP_I2C) { + if (i) { + i2c_command(inv_on); + } else { + i2c_command(inv_off); + } + } +} + +// ===== Splash Screen ===== + +void uDisplay::Splash(void) { + if (splash_font < 0) return; + + if (ep_mode) { + Updateframe(); + delay_sync(lut3time * 10); + } + + setTextFont(splash_font); + setTextSize(splash_size); + DrawStringAt(splash_xp, splash_yp, dname, fg_col, 0); + Updateframe(); + + AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: draw splash")); +} \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_dma.cpp b/lib/lib_display/UDisplay/uDisplay_dma.cpp new file mode 100644 index 000000000..b8fa6eb63 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_dma.cpp @@ -0,0 +1,133 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" + +#ifdef ESP32 + +// ===== DMA Initialization and Control ===== +// ESP 32 DMA section , derived from TFT_eSPI + +bool uDisplay::initDMA(int32_t ctrl_cs) { + if (DMA_Enabled) return false; + + esp_err_t ret; + spi_bus_config_t buscfg = { + .mosi_io_num = spi_mosi, + .miso_io_num = -1, + .sclk_io_num = spi_clk, + .quadwp_io_num = -1, + .quadhd_io_num = -1, + .max_transfer_sz = width() * height() * 2 + 8, // TFT screen size + .flags = 0, + .intr_flags = 0 + }; + + spi_device_interface_config_t devcfg = { + .command_bits = 0, + .address_bits = 0, + .dummy_bits = 0, + .mode = SPI_MODE3, + .duty_cycle_pos = 0, + .cs_ena_pretrans = 0, + .cs_ena_posttrans = 0, + .clock_speed_hz = spi_speed*1000000, + .input_delay_ns = 0, + .spics_io_num = ctrl_cs, + .flags = SPI_DEVICE_NO_DUMMY, //0, + .queue_size = 1, + .pre_cb = 0, //dc_callback, //Callback to handle D/C line + .post_cb = 0 + }; + + ret = spi_bus_initialize(spi_host, &buscfg, 1); + ESP_ERROR_CHECK(ret); + ret = spi_bus_add_device(spi_host, &devcfg, &dmaHAL); + ESP_ERROR_CHECK(ret); + + DMA_Enabled = true; + spiBusyCheck = 0; + return true; +} + +void uDisplay::deInitDMA(void) { + if (!DMA_Enabled) return; + spi_bus_remove_device(dmaHAL); + spi_bus_free(spi_host); + DMA_Enabled = false; +} + +bool uDisplay::dmaBusy(void) { + if (!DMA_Enabled || !spiBusyCheck) return false; + + spi_transaction_t *rtrans; + esp_err_t ret; + uint8_t checks = spiBusyCheck; + for (int i = 0; i < checks; ++i) { + ret = spi_device_get_trans_result(dmaHAL, &rtrans, 0); + if (ret == ESP_OK) spiBusyCheck--; + } + + //Serial.print("spiBusyCheck=");Serial.println(spiBusyCheck); + if (spiBusyCheck == 0) return false; + return true; +} + +void uDisplay::dmaWait(void) { + if (!DMA_Enabled || !spiBusyCheck) return; + spi_transaction_t *rtrans; + esp_err_t ret; + for (int i = 0; i < spiBusyCheck; ++i) { + ret = spi_device_get_trans_result(dmaHAL, &rtrans, portMAX_DELAY); + assert(ret == ESP_OK); + } + spiBusyCheck = 0; +} + +// ===== DMA Data Transfer Functions ===== + +void uDisplay::pushPixelsDMA(uint16_t* image, uint32_t len) { + if ((len == 0) || (!DMA_Enabled)) return; + + dmaWait(); + + esp_err_t ret; + + memset(&trans, 0, sizeof(spi_transaction_t)); + + trans.user = (void *)1; + trans.tx_buffer = image; //finally send the line data + trans.length = len * 16; //Data length, in bits + trans.flags = 0; //SPI_TRANS_USE_TXDATA flag + + ret = spi_device_queue_trans(dmaHAL, &trans, portMAX_DELAY); + assert(ret == ESP_OK); + + spiBusyCheck++; + if (!lvgl_param.async_dma) { + dmaWait(); + } +} + +void uDisplay::pushPixels3DMA(uint8_t* image, uint32_t len) { + if ((len == 0) || (!DMA_Enabled)) return; + + dmaWait(); + + esp_err_t ret; + + memset(&trans, 0, sizeof(spi_transaction_t)); + + trans.user = (void *)1; + trans.tx_buffer = image; //finally send the line data + trans.length = len * 24; //Data length, in bits + trans.flags = 0; //SPI_TRANS_USE_TXDATA flag + + ret = spi_device_queue_trans(dmaHAL, &trans, portMAX_DELAY); + assert(ret == ESP_OK); + + spiBusyCheck++; + if (!lvgl_param.async_dma) { + dmaWait(); + } +} + +#endif // ESP32 \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_epd.cpp b/lib/lib_display/UDisplay/uDisplay_epd.cpp new file mode 100644 index 000000000..e16122934 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_epd.cpp @@ -0,0 +1,362 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" +#include "uDisplay_spi.h" + + +// ===== EPD Command Definitions ===== +static constexpr uint8_t DRIVER_OUTPUT_CONTROL = 0x01; +static constexpr uint8_t BOOSTER_SOFT_START_CONTROL = 0x0C; +static constexpr uint8_t GATE_SCAN_START_POSITION = 0x0F; +static constexpr uint8_t DEEP_SLEEP_MODE = 0x10; +static constexpr uint8_t DATA_ENTRY_MODE_SETTING = 0x11; +static constexpr uint8_t SW_RESET = 0x12; +static constexpr uint8_t TEMPERATURE_SENSOR_CONTROL = 0x1A; +static constexpr uint8_t MASTER_ACTIVATION = 0x20; +static constexpr uint8_t DISPLAY_UPDATE_CONTROL_1 = 0x21; +static constexpr uint8_t DISPLAY_UPDATE_CONTROL_2 = 0x22; +static constexpr uint8_t WRITE_RAM = 0x24; +static constexpr uint8_t WRITE_VCOM_REGISTER = 0x2C; +static constexpr uint8_t WRITE_LUT_REGISTER = 0x32; +static constexpr uint8_t SET_DUMMY_LINE_PERIOD = 0x3A; +static constexpr uint8_t SET_GATE_TIME = 0x3B; +static constexpr uint8_t BORDER_WAVEFORM_CONTROL = 0x3C; +static constexpr uint8_t SET_RAM_X_ADDRESS_START_END_POSITION = 0x44; +static constexpr uint8_t SET_RAM_Y_ADDRESS_START_END_POSITION = 0x45; +static constexpr uint8_t SET_RAM_X_ADDRESS_COUNTER = 0x4E; +static constexpr uint8_t SET_RAM_Y_ADDRESS_COUNTER = 0x4F; +static constexpr uint8_t TERMINATE_FRAME_READ_WRITE = 0xFF; + +// ===== EPD Initialization and Control ===== + +void uDisplay::Init_EPD(int8_t p) { + if (p == DISPLAY_INIT_PARTIAL) { + if (lutpsize) { + AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: init partial epaper mode")); + SetLut(lut_partial); + Updateframe_EPD(); + delay_sync(lutptime * 10); + } + return; + } else if (p == DISPLAY_INIT_FULL) { + AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: init full epaper mode")); + if (lutfsize) { + SetLut(lut_full); + Updateframe_EPD(); + } + if (ep_mode == 2) { + ClearFrame_42(); + DisplayFrame_42(); + } + delay_sync(lutftime * 10); + return; + } + + if (ep_mode == 2) Init_EPD(DISPLAY_INIT_FULL); +} + +void uDisplay::SetLut(const unsigned char* lut) { + spi_command_EPD(lut_cmd[0]); + for (int i = 0; i < lutfsize; i++) { + spi_data8_EPD(lut[i]); + } +} + +void uDisplay::SetLuts(void) { + uint8_t index, count; + for (index = 0; index < MAX_LUTS; index++) { + spi_command_EPD(lut_cmd[index]); + for (count = 0; count < lut_cnt[index]; count++) { + spi_data8_EPD(lut_array[index][count]); + } + } +} + +// ===== EPD Frame Memory Management ===== + +void uDisplay::ClearFrameMemory(unsigned char color) { + SetMemoryArea(0, 0, gxs - 1, gys - 1); + SetMemoryPointer(0, 0); + spi_command_EPD(WRITE_RAM); + for (int i = 0; i < gxs / 8 * gys; i++) { + spi_data8_EPD(color); + } +} + +void uDisplay::ClearFrame_42(void) { + spi_command_EPD(saw_1); + for (uint16_t j = 0; j < gys; j++) { + for (uint16_t i = 0; i < gxs; i++) { + spi_data8_EPD(0xFF); + } + } + + spi_command_EPD(saw_2); + for (uint16_t j = 0; j < gys; j++) { + for (uint16_t i = 0; i < gxs; i++) { + spi_data8_EPD(0xFF); + } + } + + spi_command_EPD(saw_3); + delay_sync(100); + AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: EPD Clearframe")); +} + +void uDisplay::DisplayFrame_42(void) { + spi_command_EPD(saw_1); + for(int i = 0; i < gxs / 8 * gys; i++) { + spi_data8_EPD(0xFF); + } + delay(2); + + spi_command_EPD(saw_2); + for(int i = 0; i < gxs / 8 * gys; i++) { + spi_data8_EPD(framebuffer[i]^0xff); + } + delay(2); + + SetLuts(); + + spi_command_EPD(saw_3); + delay_sync(100); + + AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: EPD Displayframe")); +} + +void uDisplay::DisplayFrame_29(void) { + spi_command_EPD(DISPLAY_UPDATE_CONTROL_2); + spi_data8_EPD(0xC4); + spi_command_EPD(MASTER_ACTIVATION); + spi_data8_EPD(TERMINATE_FRAME_READ_WRITE); +} + +// ===== EPD Memory Addressing ===== + +void uDisplay::SetMemoryArea(int x_start, int y_start, int x_end, int y_end) { + int x_start1 = (x_start >> 3) & 0xFF; + int x_end1 = (x_end >> 3) & 0xFF; + int y_start1 = y_start & 0xFF; + int y_start2 = (y_start >> 8) & 0xFF; + int y_end1 = y_end & 0xFF; + int y_end2 = (y_end >> 8) & 0xFF; + + if (ep_mode == 3) { + spi_command_EPD(SET_RAM_X_ADDRESS_START_END_POSITION); + spi_data8_EPD(x_start1); + spi_data8_EPD(x_end1); + spi_command_EPD(SET_RAM_Y_ADDRESS_START_END_POSITION); + spi_data8_EPD(y_end1); + spi_data8_EPD(y_end2); + spi_data8_EPD(y_start1); + spi_data8_EPD(y_start2); + } else { + spi_command_EPD(SET_RAM_X_ADDRESS_START_END_POSITION); + spi_data8_EPD(x_start1); + spi_data8_EPD(x_end1); + spi_command_EPD(SET_RAM_Y_ADDRESS_START_END_POSITION); + spi_data8_EPD(y_start1); + spi_data8_EPD(y_start2); + spi_data8_EPD(y_end1); + spi_data8_EPD(y_end2); + } +} + +void uDisplay::SetMemoryPointer(int x, int y) { + int x1; + int y1; + int y2; + + if (ep_mode == 3) { + x1 = (x >> 3) & 0xFF; + y--; + y1 = y & 0xFF; + y2 = (y >> 8) & 0xFF; + } else { + x1 = (x >> 3) & 0xFF; + y1 = y & 0xFF; + y2 = (y >> 8) & 0xFF; + } + + spi_command_EPD(SET_RAM_X_ADDRESS_COUNTER); + spi_data8_EPD(x1); + spi_command_EPD(SET_RAM_Y_ADDRESS_COUNTER); + spi_data8_EPD(y1); + spi_data8_EPD(y2); +} + +// ===== EPD Frame Updates ===== + +void uDisplay::Updateframe_EPD(void) { + if (ep_mode == 1 || ep_mode == 3) { + switch (ep_update_mode) { + case DISPLAY_INIT_PARTIAL: + if (epc_part_cnt) { + send_spi_cmds(epcoffs_part, epc_part_cnt); + } + break; + case DISPLAY_INIT_FULL: + if (epc_full_cnt) { + send_spi_cmds(epcoffs_full, epc_full_cnt); + } + break; + default: + SetFrameMemory(framebuffer, 0, 0, gxs, gys); + DisplayFrame_29(); + } + } else { + DisplayFrame_42(); + } +} + +void uDisplay::SetFrameMemory(const unsigned char* image_buffer) { + SetMemoryArea(0, 0, gxs - 1, gys - 1); + SetMemoryPointer(0, 0); + spi_command_EPD(WRITE_RAM); + for (int i = 0; i < gxs / 8 * gys; i++) { + spi_data8_EPD(image_buffer[i] ^ 0xff); + } +} + +void uDisplay::SetFrameMemory(const unsigned char* image_buffer, + uint16_t x, uint16_t y, uint16_t image_width, uint16_t image_height) { + + uint16_t x_end; + uint16_t y_end; + + if (image_buffer == NULL || x < 0 || image_width < 0 || y < 0 || image_height < 0) { + return; + } + + x &= 0xFFF8; + image_width &= 0xFFF8; + if (x + image_width >= gxs) { + x_end = gxs - 1; + } else { + x_end = x + image_width - 1; + } + if (y + image_height >= gys) { + y_end = gys - 1; + } else { + y_end = y + image_height - 1; + } + + if (!x && !y && image_width == gxs && image_height == gys) { + SetFrameMemory(image_buffer); + return; + } + + SetMemoryArea(x, y, x_end, y_end); + SetMemoryPointer(x, y); + spi_command_EPD(WRITE_RAM); + for (uint16_t j = 0; j < y_end - y + 1; j++) { + for (uint16_t i = 0; i < (x_end - x + 1) / 8; i++) { + spi_data8_EPD(image_buffer[i + j * (image_width / 8)] ^ 0xff); + } + } +} + +void uDisplay::Send_EP_Data() { + uint16_t image_width = gxs & 0xFFF8; + uint16_t x = 0; + uint16_t y = 0; + uint16_t x_end = gxs - 1; + uint16_t y_end = gys - 1; + + for (uint16_t j = 0; j < y_end - y + 1; j++) { + for (uint16_t i = 0; i < (x_end - x + 1) / 8; i++) { + spi_data8_EPD(framebuffer[i + j * (image_width / 8)] ^ 0xff); + } + } +} + +// ===== EPD Drawing Primitives ===== +#define IF_INVERT_COLOR 1 +#define renderer_swap(a, b) { int16_t t = a; a = b; b = t; } + +void uDisplay::DrawAbsolutePixel(int x, int y, int16_t color) { + int16_t w = width(), h = height(); + if (cur_rot == 1 || cur_rot == 3) { + renderer_swap(w, h); + } + + if (x < 0 || x >= w || y < 0 || y >= h) { + return; + } + + if (IF_INVERT_COLOR) { + if (color) { + framebuffer[(x + y * w) / 8] |= 0x80 >> (x % 8); + } else { + framebuffer[(x + y * w) / 8] &= ~(0x80 >> (x % 8)); + } + } else { + if (color) { + framebuffer[(x + y * w) / 8] &= ~(0x80 >> (x % 8)); + } else { + framebuffer[(x + y * w) / 8] |= 0x80 >> (x % 8); + } + } +} + +void uDisplay::drawPixel_EPD(int16_t x, int16_t y, uint16_t color) { + if (!framebuffer) return; + if ((x < 0) || (x >= width()) || (y < 0) || (y >= height())) + return; + + switch (cur_rot) { + case 1: + renderer_swap(x, y); + x = gxs - x - 1; + break; + case 2: + x = gxs - x - 1; + y = gys - y - 1; + break; + case 3: + renderer_swap(x, y); + y = gys - y - 1; + break; + } + + DrawAbsolutePixel(x, y, color); +} + +void uDisplay::fillRect_EPD(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) { + for (uint32_t yp = y; yp < y + h; yp++) { + for (uint32_t xp = x; xp < x + w; xp++) { + drawPixel_EPD(xp, yp, color); + } + } +} + +void uDisplay::drawFastVLine_EPD(int16_t x, int16_t y, int16_t h, uint16_t color) { + while (h--) { + drawPixel_EPD(x, y, color); + y++; + } +} + +void uDisplay::drawFastHLine_EPD(int16_t x, int16_t y, int16_t w, uint16_t color) { + while (w--) { + drawPixel_EPD(x, y, color); + x++; + } +} + +// ===== EPD SPI Helpers ===== + +void uDisplay::spi_command_EPD(uint8_t val) { + SPI_BEGIN_TRANSACTION + SPI_CS_LOW + ulcd_command(val); + SPI_CS_HIGH + SPI_END_TRANSACTION +} + +void uDisplay::spi_data8_EPD(uint8_t val) { + SPI_BEGIN_TRANSACTION + SPI_CS_LOW + ulcd_data8(val); + SPI_CS_HIGH + SPI_END_TRANSACTION +} \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_esp32s3.cpp b/lib/lib_display/UDisplay/uDisplay_esp32s3.cpp new file mode 100644 index 000000000..4e2409d47 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_esp32s3.cpp @@ -0,0 +1,158 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" + +#ifdef USE_ESP32_S3 +static inline volatile uint32_t* get_gpio_hi_reg(int_fast8_t pin) { return (pin & 32) ? &GPIO.out1_w1ts.val : &GPIO.out_w1ts; } +//static inline volatile uint32_t* get_gpio_hi_reg(int_fast8_t pin) { return (volatile uint32_t*)((pin & 32) ? 0x60004014 : 0x60004008) ; } // workaround Eratta +static inline volatile uint32_t* get_gpio_lo_reg(int_fast8_t pin) { return (pin & 32) ? &GPIO.out1_w1tc.val : &GPIO.out_w1tc; } +//static inline volatile uint32_t* get_gpio_lo_reg(int_fast8_t pin) { return (volatile uint32_t*)((pin & 32) ? 0x60004018 : 0x6000400C) ; } +static inline bool gpio_in(int_fast8_t pin) { return ((pin & 32) ? GPIO.in1.data : GPIO.in) & (1 << (pin & 31)); } +static inline void gpio_hi(int_fast8_t pin) { if (pin >= 0) *get_gpio_hi_reg(pin) = 1 << (pin & 31); } // ESP_LOGI("LGFX", "gpio_hi: %d", pin); } +static inline void gpio_lo(int_fast8_t pin) { if (pin >= 0) *get_gpio_lo_reg(pin) = 1 << (pin & 31); } // ESP_LOGI("LGFX", "gpio_lo: %d", pin); } + +// ===== ESP32-S3 Clock Calculation ===== + +void uDisplay::calcClockDiv(uint32_t* div_a, uint32_t* div_b, uint32_t* div_n, uint32_t* clkcnt, uint32_t baseClock, uint32_t targetFreq) { + uint32_t diff = INT32_MAX; + *div_n = 256; + *div_a = 63; + *div_b = 62; + *clkcnt = 64; + uint32_t start_cnt = std::min(64u, (baseClock / (targetFreq * 2) + 1)); + uint32_t end_cnt = std::max(2u, baseClock / 256u / targetFreq); + if (start_cnt <= 2) { end_cnt = 1; } + for (uint32_t cnt = start_cnt; diff && cnt >= end_cnt; --cnt) + { + float fdiv = (float)baseClock / cnt / targetFreq; + uint32_t n = std::max(2u, (uint32_t)fdiv); + fdiv -= n; + + for (uint32_t a = 63; diff && a > 0; --a) + { + uint32_t b = roundf(fdiv * a); + if (a == b && n == 256) { + break; + } + uint32_t freq = baseClock / ((n * cnt) + (float)(b * cnt) / (float)a); + uint32_t d = abs((int)targetFreq - (int)freq); + if (diff <= d) { continue; } + diff = d; + *clkcnt = cnt; + *div_n = n; + *div_b = b; + *div_a = a; + if (b == 0 || a == b) { + break; + } + } + } + if (*div_a == *div_b) + { + *div_b = 0; + *div_n += 1; + } +} + +// ===== ESP32-S3 DMA Descriptor Management ===== + +void uDisplay::_alloc_dmadesc(size_t len) { + if (_dmadesc) heap_caps_free(_dmadesc); + _dmadesc_size = len; + _dmadesc = (lldesc_t*)heap_caps_malloc(sizeof(lldesc_t) * len, MALLOC_CAP_DMA); +} + +void uDisplay::_setup_dma_desc_links(const uint8_t *data, int32_t len) { + static constexpr size_t MAX_DMA_LEN = (4096-4); +} + +// ===== ESP32-S3 Pin Control ===== + +void uDisplay::cs_control(bool level) { + auto pin = par_cs; + if (pin < 0) return; + if (level) { + gpio_hi(pin); + } + else { + gpio_lo(pin); + } +} + +void uDisplay::_pb_init_pin(bool read) { + if (read) { + if (interface == _UDSP_PAR8) { + for (size_t i = 0; i < 8; ++i) { + gpio_ll_output_disable(&GPIO, (gpio_num_t)par_dbl[i]); + } + } else { + for (size_t i = 0; i < 8; ++i) { + gpio_ll_output_disable(&GPIO, (gpio_num_t)par_dbl[i]); + } + for (size_t i = 0; i < 8; ++i) { + gpio_ll_output_disable(&GPIO, (gpio_num_t)par_dbh[i]); + } + } + } + else { + auto idx_base = LCD_DATA_OUT0_IDX; + if (interface == _UDSP_PAR8) { + for (size_t i = 0; i < 8; ++i) { + gpio_matrix_out(par_dbl[i], idx_base + i, 0, 0); + } + } else { + for (size_t i = 0; i < 8; ++i) { + gpio_matrix_out(par_dbl[i], idx_base + i, 0, 0); + } + for (size_t i = 0; i < 8; ++i) { + gpio_matrix_out(par_dbh[i], idx_base + 8 + i, 0, 0); + } + } + } +} + +// ===== ESP32-S3 Simple Resistive Touch ===== + +uint32_t uDisplay::get_sr_touch(uint32_t _xp, uint32_t _xm, uint32_t _yp, uint32_t _ym) { + uint32_t aval = 0; + uint16_t xp,yp; + if (pb_busy()) return 0; + + _pb_init_pin(true); + gpio_matrix_out(par_rs, 0x100, 0, 0); + + pinMode(_ym, INPUT_PULLUP); // d0 + pinMode(_yp, INPUT_PULLUP); // rs + + pinMode(_xm, OUTPUT); // cs + pinMode(_xp, OUTPUT); // d1 + digitalWrite(_xm, HIGH); // cs + digitalWrite(_xp, LOW); // d1 + + xp = 4096 - analogRead(_ym); // d0 + + pinMode(_xm, INPUT_PULLUP); // cs + pinMode(_xp, INPUT_PULLUP); // d1 + + pinMode(_ym, OUTPUT); // d0 + pinMode(_yp, OUTPUT); // rs + digitalWrite(_ym, HIGH); // d0 + digitalWrite(_yp, LOW); // rs + + yp = 4096 - analogRead(_xp); // d1 + + aval = (xp << 16) | yp; + + pinMode(_yp, OUTPUT); // rs + pinMode(_xm, OUTPUT); // cs + pinMode(_ym, OUTPUT); // d0 + pinMode(_xp, OUTPUT); // d1 + digitalWrite(_yp, HIGH); // rs + digitalWrite(_xm, HIGH); // cs + + _pb_init_pin(false); + gpio_matrix_out(par_rs, LCD_DC_IDX, 0, 0); + + return aval; +} + +#endif // USE_ESP32_S3 \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_graphics.cpp b/lib/lib_display/UDisplay/uDisplay_graphics.cpp new file mode 100644 index 000000000..256facc89 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_graphics.cpp @@ -0,0 +1,565 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" +#include "uDisplay_spi.h" + +// ===== Basic Drawing Primitives ===== + +static constexpr uint16_t RGB16_TO_MONO = 0x8410; +static constexpr uint16_t RGB16_SWAP_TO_MONO = 0x1084; +#define renderer_swap(a, b) { int16_t t = a; a = b; b = t; } + +void uDisplay::drawPixel(int16_t x, int16_t y, uint16_t color) { +#ifdef USE_ESP32_S3 + if (interface == _UDSP_RGB) { + drawPixel_RGB(x, y, color); + return; + } +#endif + + if (ep_mode) { + drawPixel_EPD(x, y, color); + return; + } + + if (framebuffer) { + Renderer::drawPixel(x, y, color); + return; + } + + if ((x < 0) || (x >= _width) || (y < 0) || (y >= _height)) return; + + SPI_BEGIN_TRANSACTION + SPI_CS_LOW + setAddrWindow_int(x, y, 1, 1); + WriteColor(color); + SPI_CS_HIGH + SPI_END_TRANSACTION +} + +void uDisplay::drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) { + if (ep_mode) { + drawFastHLine_EPD(x, y, w, color); + return; + } + + if (framebuffer) { + Renderer::drawFastHLine(x, y, w, color); + return; + } + + // Rudimentary clipping + if((x >= _width) || (y >= _height)) return; + if((x + w - 1) >= _width) w = _width - x; + +#ifdef USE_ESP32_S3 + if (interface == _UDSP_RGB) { + if (cur_rot > 0) { + while (w--) { + drawPixel_RGB(x , y , color); + x++; + } + } else { + uint16_t *fb = rgb_fb; + fb += (int32_t)y * _width; + fb += x; + while (w--) { + *fb = color; + Cache_WriteBack_Addr((uint32_t)fb, 2); + fb++; + x++; + } + } + return; + } +#endif + + SPI_BEGIN_TRANSACTION + SPI_CS_LOW + setAddrWindow_int(x, y, w, 1); + + if (col_mode == 18) { + uint8_t r = (color & 0xF800) >> 11; + uint8_t g = (color & 0x07E0) >> 5; + uint8_t b = color & 0x001F; + r = (r * 255) / 31; + g = (g * 255) / 63; + b = (b * 255) / 31; + + while (w--) { + ulcd_data8(r); + ulcd_data8(g); + ulcd_data8(b); + } + } else { + while (w--) { + WriteColor(color); + } + } + + SPI_CS_HIGH + SPI_END_TRANSACTION +} + +void uDisplay::drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) { + if (ep_mode) { + drawFastVLine_EPD(x, y, h, color); + return; + } + + if (framebuffer) { + Renderer::drawFastVLine(x, y, h, color); + return; + } + + // Rudimentary clipping + if ((x >= _width) || (y >= _height)) return; + if ((y + h - 1) >= _height) h = _height - y; + +#ifdef USE_ESP32_S3 + if (interface == _UDSP_RGB) { + if (cur_rot > 0) { + while (h--) { + drawPixel_RGB(x , y , color); + y++; + } + } else { + uint16_t *fb = rgb_fb; + fb += (int32_t)y * _width; + fb += x; + while (h--) { + *fb = color; + Cache_WriteBack_Addr((uint32_t)fb, 2); + fb+=_width; + y++; + } + } + return; + } +#endif + + SPI_BEGIN_TRANSACTION + SPI_CS_LOW + setAddrWindow_int(x, y, 1, h); + + if (col_mode == 18) { + uint8_t r = (color & 0xF800) >> 11; + uint8_t g = (color & 0x07E0) >> 5; + uint8_t b = color & 0x001F; + r = (r * 255) / 31; + g = (g * 255) / 63; + b = (b * 255) / 31; + + while (h--) { + ulcd_data8(r); + ulcd_data8(g); + ulcd_data8(b); + } + } else { + while (h--) { + WriteColor(color); + } + } + + SPI_CS_HIGH + SPI_END_TRANSACTION +} + +void uDisplay::fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) { +#ifdef USE_ESP32_S3 + if (interface == _UDSP_RGB) { + for (uint32_t yp = y; yp < y + h; yp++) { + drawFastHLine(x, yp, w, color); + } + return; + } +#endif + + if (ep_mode) { + fillRect_EPD(x, y, w, h, color); + return; + } + + if (framebuffer) { + Renderer::fillRect(x, y, w, h, color); + return; + } + + if((x >= _width) || (y >= _height)) return; + if((x + w - 1) >= _width) w = _width - x; + if((y + h - 1) >= _height) h = _height - y; + + SPI_BEGIN_TRANSACTION + SPI_CS_LOW + setAddrWindow_int(x, y, w, h); + + if (col_mode == 18) { + uint8_t r = (color & 0xF800) >> 11; + uint8_t g = (color & 0x07E0) >> 5; + uint8_t b = color & 0x001F; + r = (r * 255) / 31; + g = (g * 255) / 63; + b = (b * 255) / 31; + + for (y = h; y > 0; y--) { + for (x = w; x > 0; x--) { + ulcd_data8(r); + ulcd_data8(g); + ulcd_data8(b); + } + } + } else { + for (y = h; y > 0; y--) { + for (x = w; x > 0; x--) { + WriteColor(color); + } + } + } + + SPI_CS_HIGH + SPI_END_TRANSACTION +} + +void uDisplay::fillScreen(uint16_t color) { + fillRect(0, 0, width(), height(), color); +} + +static inline void lvgl_color_swap(uint16_t *data, uint16_t len) { for (uint32_t i = 0; i < len; i++) (data[i] = data[i] << 8 | data[i] >> 8); } + +void uDisplay::pushColors(uint16_t *data, uint16_t len, boolean not_swapped) { + + if (lvgl_param.swap_color) { + not_swapped = !not_swapped; + } + + //Serial.printf("push %x - %d - %d - %d\n", (uint32_t)data, len, not_swapped, lvgl_param.data); + + // Isolating _UDSP_RGB to increase code sharing + // + // Use ESP-IDF LCD driver to push colors and rely on the following assumptions: + // * bytes swapping is already handled in the driver configuration (see uDisplay::Init()), + // * pushColors() is only called with not_swapped equals true, + // * cache flushing is done by the LCD driver. + if (interface == _UDSP_RGB) { +#ifdef USE_ESP32_S3 + if (!not_swapped) { + // internal error -> write error message but continue (with possibly wrong colors) + AddLog(LOG_LEVEL_ERROR, PSTR("DSP: Unexpected byte-swapping requested in pushColors()")); + } + + // check that bytes count matches the size of area, and remove from inner loop + if ((seta_yp2 - seta_yp1) * (seta_xp2 - seta_xp2) > len) { return; } + + esp_lcd_panel_draw_bitmap(_panel_handle, seta_xp1, seta_yp1, seta_xp2, seta_yp2, (void *)data); +#endif + return; + } + + + if (not_swapped == false) { + // called from LVGL bytes are swapped + if (bpp != 16) { + // lvgl_color_swap(data, len); -- no need to swap anymore, we have inverted the mask + pushColorsMono(data, len, true); + return; + } + + if ( (col_mode != 18) && (spi_dc >= 0) && (spi_nr <= 2) ) { + // special version 8 bit spi I or II +#ifdef ESP8266 + lvgl_color_swap(data, len); + while (len--) { + uspi->write(*data++); + } +#else + if (lvgl_param.use_dma) { + pushPixelsDMA(data, len ); + } else { + uspi->writeBytes((uint8_t*)data, len * 2); + } +#endif + } else { + +#ifdef ESP32 + if ( (col_mode == 18) && (spi_dc >= 0) && (spi_nr <= 2) ) { + uint8_t *line = (uint8_t*)malloc(len * 3); + uint8_t *lp = line; + if (line) { + uint16_t color; + for (uint32_t cnt = 0; cnt < len; cnt++) { + color = *data++; + color = (color << 8) | (color >> 8); + uint8_t r = (color & 0xF800) >> 11; + uint8_t g = (color & 0x07E0) >> 5; + uint8_t b = color & 0x001F; + r = (r * 255) / 31; + g = (g * 255) / 63; + b = (b * 255) / 31; + *lp++ = r; + *lp++ = g; + *lp++ = b; + } + + if (lvgl_param.use_dma) { + pushPixels3DMA(line, len ); + } else { + uspi->writeBytes(line, len * 3); + } + free(line); + } + + } else { + // 9 bit and others + if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { + #ifdef USE_ESP32_S3 + pb_pushPixels(data, len, true, false); + #endif // USE_ESP32_S3 + } else { + lvgl_color_swap(data, len); + while (len--) { + WriteColor(*data++); + } + } + } +#endif // ESP32 + +#ifdef ESP8266 + lvgl_color_swap(data, len); + while (len--) { + WriteColor(*data++); + } +#endif + } + } else { + // called from displaytext, no byte swap, currently no dma here + + if (bpp != 16) { + pushColorsMono(data, len); + return; + } + if ( (col_mode != 18) && (spi_dc >= 0) && (spi_nr <= 2) ) { + // special version 8 bit spi I or II + #ifdef ESP8266 + while (len--) { + //uspi->write(*data++); + WriteColor(*data++); + } + #else + uspi->writePixels(data, len * 2); + #endif + } else { + // 9 bit and others + if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { +#ifdef USE_ESP32_S3 + pb_pushPixels(data, len, false, false); +#endif // USE_ESP32_S3 + } else { + while (len--) { + WriteColor(*data++); + } + } + } + } +} + +// convert to mono, these are framebuffer based +void uDisplay::pushColorsMono(uint16_t *data, uint16_t len, bool rgb16_swap) { + // pixel is white if at least one of the 3 components is above 50% + // this is tested with a simple mask, swapped if needed + uint16_t rgb16_to_mono_mask = rgb16_swap ? RGB16_SWAP_TO_MONO : RGB16_TO_MONO; + + for (uint32_t y = seta_yp1; y < seta_yp2; y++) { + seta_yp1++; + if (lvgl_param.invert_bw) { + for (uint32_t x = seta_xp1; x < seta_xp2; x++) { + uint16_t color = *data++; + if (bpp == 1) color = (color & rgb16_to_mono_mask) ? 0 : 1; + drawPixel(x, y, color); // todo - inline the method to save speed + len--; + if (!len) return; // failsafe - exist if len (pixel number) is exhausted + } + } else { + for (uint32_t x = seta_xp1; x < seta_xp2; x++) { + uint16_t color = *data++; + if (bpp == 1) color = (color & rgb16_to_mono_mask) ? 1 : 0; + drawPixel(x, y, color); // todo - inline the method to save speed + len--; + if (!len) return; // failsafe - exist if len (pixel number) is exhausted + } + } + } +} + +void uDisplay::setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) { + if (bpp != 16 || interface == _UDSP_RGB) { + // Just save params or update frame + if (!x0 && !y0 && !x1 && !y1) { + if (!ep_mode) { + Updateframe(); + } + } else { + seta_xp1 = x0; + seta_xp2 = x1; + seta_yp1 = y0; + seta_yp2 = y1; + } + return; + } + + if (interface == _UDSP_RGB) { + return; + } + + if (!x0 && !y0 && !x1 && !y1) { + SPI_CS_HIGH + SPI_END_TRANSACTION + } else { + SPI_BEGIN_TRANSACTION + SPI_CS_LOW + setAddrWindow_int(x0, y0, x1 - x0, y1 - y0); + } +} + +void uDisplay::setAddrWindow_int(uint16_t x, uint16_t y, uint16_t w, uint16_t h) { + if (interface == _UDSP_RGB) { + return; + } + + x += x_addr_offs[cur_rot]; + y += y_addr_offs[cur_rot]; + + if (sa_mode != 8) { + uint32_t xa = ((uint32_t)x << 16) | (x + w - 1); + uint32_t ya = ((uint32_t)y << 16) | (y + h - 1); + + ulcd_command(saw_1); + ulcd_data32(xa); + + ulcd_command(saw_2); + ulcd_data32(ya); + + if (saw_3 != 0xff) { + ulcd_command(saw_3); // write to RAM + } + } else { + uint16_t x2 = x + w - 1, + y2 = y + h - 1; + + if (cur_rot & 1) { // Vertical address increment mode + renderer_swap(x,y); + renderer_swap(x2,y2); + } + ulcd_command(saw_1); + if (allcmd_mode) { + ulcd_data8(x); + ulcd_data8(x2); + } else { + ulcd_command(x); + ulcd_command(x2); + } + ulcd_command(saw_2); + if (allcmd_mode) { + ulcd_data8(y); + ulcd_data8(y2); + } else { + ulcd_command(y); + ulcd_command(y2); + } + if (saw_3 != 0xff) { + ulcd_command(saw_3); // write to RAM + } + } +} + +void uDisplay::setRotation(uint8_t rotation) { + cur_rot = rotation; + + if (framebuffer) { + Renderer::setRotation(cur_rot); + return; + } + + if (interface == _UDSP_SPI || interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { + if (ep_mode) { + Renderer::setRotation(cur_rot); + return; + } + SPI_BEGIN_TRANSACTION + SPI_CS_LOW + ulcd_command(madctrl); + + if (!allcmd_mode) { + ulcd_data8(rot[cur_rot]); + } else { + ulcd_command(rot[cur_rot]); + } + + if ((sa_mode == 8) && !allcmd_mode) { + ulcd_command(startline); + ulcd_data8((cur_rot < 2) ? height() : 0); + } + + SPI_CS_HIGH + SPI_END_TRANSACTION + } + + switch (rotation) { + case 0: + _width = gxs; + _height = gys; + break; + case 1: + _width = gys; + _height = gxs; + break; + case 2: + _width = gxs; + _height = gys; + break; + case 3: + _width = gys; + _height = gxs; + break; + } + +#ifdef USE_ESP32_S3 + if (interface == _UDSP_RGB) { + // Utilize the ESP-IDF LCD driver's support for display rotation + esp_lcd_panel_mirror(_panel_handle, rotation == 1 || rotation == 2, rotation & 2); + esp_lcd_panel_swap_xy(_panel_handle, rotation & 1); + } +#endif +} + +#ifdef USE_ESP32_S3 +void uDisplay::drawPixel_RGB(int16_t x, int16_t y, uint16_t color) { + int16_t w = _width, h = _height; + + if ((x < 0) || (x >= w) || (y < 0) || (y >= h)) { + return; + } + + // check rotation, move pixel around if necessary + switch (cur_rot) { + case 1: + renderer_swap(w, h); + renderer_swap(x, y); + x = w - x - 1; + break; + case 2: + x = w - x - 1; + y = h - y - 1; + break; + case 3: + renderer_swap(w, h); + renderer_swap(x, y); + y = h - y - 1; + break; + } + + uint16_t *fb = rgb_fb; + fb += (int32_t)y * w; + fb += x; + *fb = color; + Cache_WriteBack_Addr((uint32_t)fb, 2); +} +#endif \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_parallel.cpp b/lib/lib_display/UDisplay/uDisplay_parallel.cpp new file mode 100644 index 000000000..d3f39f559 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_parallel.cpp @@ -0,0 +1,142 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" + +#ifdef USE_ESP32_S3 + +#ifdef ESP32 +#include "esp8266toEsp32.h" +#endif + +#define WAIT_LCD_NOT_BUSY while (*reg_lcd_user & LCD_CAM_LCD_START) {} + +// ===== Parallel Bus Control Functions ===== + +void uDisplay::pb_beginTransaction(void) { + auto dev = _dev; + dev->lcd_clock.val = _clock_reg_value; + dev->lcd_misc.val = LCD_CAM_LCD_CD_IDLE_EDGE; + dev->lcd_user.val = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG; + _cache_flip = _cache[0]; +} + +void uDisplay::pb_endTransaction(void) { + auto dev = _dev; + while (dev->lcd_user.val & LCD_CAM_LCD_START) {} +} + +void uDisplay::pb_wait(void) { + auto dev = _dev; + while (dev->lcd_user.val & LCD_CAM_LCD_START) {} +} + +bool uDisplay::pb_busy(void) { + auto dev = _dev; + return (dev->lcd_user.val & LCD_CAM_LCD_START); +} + +// ===== Parallel Bus Write Functions ===== + +bool uDisplay::pb_writeCommand(uint32_t data, uint_fast8_t bit_length) { + auto dev = _dev; + auto reg_lcd_user = &(dev->lcd_user.val); + dev->lcd_misc.val = LCD_CAM_LCD_CD_IDLE_EDGE | LCD_CAM_LCD_CD_CMD_SET; + + if (interface == _UDSP_PAR8) { + auto bytes = bit_length >> 3; + do { + dev->lcd_cmd_val.lcd_cmd_value = data; + data >>= 8; + WAIT_LCD_NOT_BUSY + *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; + } while (--bytes); + return true; + } else { + dev->lcd_cmd_val.val = data; + WAIT_LCD_NOT_BUSY + *reg_lcd_user = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; + return true; + } +} + +void uDisplay::pb_writeData(uint32_t data, uint_fast8_t bit_length) { + auto dev = _dev; + auto reg_lcd_user = &(dev->lcd_user.val); + dev->lcd_misc.val = LCD_CAM_LCD_CD_IDLE_EDGE; + auto bytes = bit_length >> 3; + + if (interface == _UDSP_PAR8) { + uint8_t shift = (bytes - 1) * 8; + for (uint32_t cnt = 0; cnt < bytes; cnt++) { + dev->lcd_cmd_val.lcd_cmd_value = (data >> shift) & 0xff; + shift -= 8; + WAIT_LCD_NOT_BUSY + *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; + } + return; + } else { + if (bytes == 1 || bytes == 4) { + uint8_t shift = (bytes - 1) * 8; + for (uint32_t cnt = 0; cnt < bytes; cnt++) { + dev->lcd_cmd_val.lcd_cmd_value = (data >> shift) & 0xff; + shift -= 8; + WAIT_LCD_NOT_BUSY + *reg_lcd_user = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; + } + return; + } + + dev->lcd_cmd_val.val = data; + WAIT_LCD_NOT_BUSY + *reg_lcd_user = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; + return; + } +} + +void uDisplay::pb_pushPixels(uint16_t* data, uint32_t length, bool swap_bytes, bool use_dma) { + auto dev = _dev; + auto reg_lcd_user = &(dev->lcd_user.val); + dev->lcd_misc.val = LCD_CAM_LCD_CD_IDLE_EDGE; + + if (interface == _UDSP_PAR8) { + if (swap_bytes) { + for (uint32_t cnt = 0; cnt < length; cnt++) { + dev->lcd_cmd_val.lcd_cmd_value = *data; + while (*reg_lcd_user & LCD_CAM_LCD_START) {} + *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; + dev->lcd_cmd_val.lcd_cmd_value = *data >> 8; + WAIT_LCD_NOT_BUSY + *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; + data++; + } + } else { + for (uint32_t cnt = 0; cnt < length; cnt++) { + dev->lcd_cmd_val.lcd_cmd_value = *data >> 8; + while (*reg_lcd_user & LCD_CAM_LCD_START) {} + *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; + dev->lcd_cmd_val.lcd_cmd_value = *data; + WAIT_LCD_NOT_BUSY + *reg_lcd_user = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; + data++; + } + } + } else { + if (swap_bytes) { + uint16_t iob; + for (uint32_t cnt = 0; cnt < length; cnt++) { + iob = *data++; + iob = (iob << 8) | (iob >> 8); + dev->lcd_cmd_val.lcd_cmd_value = iob; + WAIT_LCD_NOT_BUSY + *reg_lcd_user = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; + } + } else { + for (uint32_t cnt = 0; cnt < length; cnt++) { + dev->lcd_cmd_val.lcd_cmd_value = *data++; + WAIT_LCD_NOT_BUSY + *reg_lcd_user = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START; + } + } + } +} + +#endif \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_spi.cpp b/lib/lib_display/UDisplay/uDisplay_spi.cpp new file mode 100644 index 000000000..2a11abe94 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_spi.cpp @@ -0,0 +1,154 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" +#include "uDisplay_spi.h" +#ifndef ESP32 +#include "spi_register.h" +#endif + +// ===== Low-Level SPI Write Functions ===== +// ===== RA8876 Controller Commands ===== +static constexpr uint8_t RA8876_DATA_WRITE = 0x80; +static constexpr uint8_t RA8876_DATA_READ = 0xC0; +static constexpr uint8_t RA8876_CMD_WRITE = 0x00; +static constexpr uint8_t RA8876_STATUS_READ = 0x40; + +#ifdef ESP32 +void uDisplay::hw_write9(uint8_t val, uint8_t dc) { + if (spi_dc < -1) { + // RA8876 mode + if (!dc) { + uspi->write(RA8876_CMD_WRITE); + uspi->write(val); + } else { + uspi->write(RA8876_DATA_WRITE); + uspi->write(val); + } + } else { + uint32_t regvalue = val >> 1; + if (dc) regvalue |= 0x80; + else regvalue &= 0x7f; + if (val & 1) regvalue |= 0x8000; + + REG_SET_BIT(SPI_USER_REG(3), SPI_USR_MOSI); + REG_WRITE(SPI_MOSI_DLEN_REG(3), 9 - 1); + uint32_t *dp = (uint32_t*)SPI_W0_REG(3); + *dp = regvalue; + REG_SET_BIT(SPI_CMD_REG(3), SPI_USR); + while (REG_GET_FIELD(SPI_CMD_REG(3), SPI_USR)); + } +} +#else +void uDisplay::hw_write9(uint8_t val, uint8_t dc) { + if (spi_dc < -1) { + // RA8876 mode + if (!dc) { + uspi->write(RA8876_CMD_WRITE); + uspi->write(val); + } else { + uspi->write(RA8876_DATA_WRITE); + uspi->write(val); + } + } else { + uint32_t regvalue; + uint8_t bytetemp; + if (!dc) { + bytetemp = (val>> 1) & 0x7f; + } else { + bytetemp = (val >> 1) | 0x80; + } + regvalue = ((8 & SPI_USR_COMMAND_BITLEN) << SPI_USR_COMMAND_BITLEN_S) | ((uint32)bytetemp); + if (val & 0x01) regvalue |= BIT15; + while (READ_PERI_REG(SPI_CMD(1)) & SPI_USR); + WRITE_PERI_REG(SPI_USER2(1), regvalue); + SET_PERI_REG_MASK(SPI_CMD(1), SPI_USR); + } +} +#endif + +// ===== Software SPI (Slow) Functions ===== + +void uDisplay::write8(uint8_t val) { + for (uint8_t bit = 0x80; bit; bit >>= 1) { + GPIO_CLR(spi_clk); + if (val & bit) GPIO_SET(spi_mosi); + else GPIO_CLR(spi_mosi); + GPIO_SET(spi_clk); + } +} + +void uDisplay::write8_slow(uint8_t val) { + for (uint8_t bit = 0x80; bit; bit >>= 1) { + GPIO_CLR_SLOW(spi_clk); + if (val & bit) GPIO_SET_SLOW(spi_mosi); + else GPIO_CLR_SLOW(spi_mosi); + GPIO_SET_SLOW(spi_clk); + } +} + +void uDisplay::write9(uint8_t val, uint8_t dc) { + GPIO_CLR(spi_clk); + if (dc) GPIO_SET(spi_mosi); + else GPIO_CLR(spi_mosi); + GPIO_SET(spi_clk); + + for (uint8_t bit = 0x80; bit; bit >>= 1) { + GPIO_CLR(spi_clk); + if (val & bit) GPIO_SET(spi_mosi); + else GPIO_CLR(spi_mosi); + GPIO_SET(spi_clk); + } +} + +void uDisplay::write9_slow(uint8_t val, uint8_t dc) { + GPIO_CLR_SLOW(spi_clk); + if (dc) GPIO_SET_SLOW(spi_mosi); + else GPIO_CLR_SLOW(spi_mosi); + GPIO_SET_SLOW(spi_clk); + + for (uint8_t bit = 0x80; bit; bit >>= 1) { + GPIO_CLR_SLOW(spi_clk); + if (val & bit) GPIO_SET_SLOW(spi_mosi); + else GPIO_CLR_SLOW(spi_mosi); + GPIO_SET_SLOW(spi_clk); + } +} + +void uDisplay::write16(uint16_t val) { + for (uint16_t bit = 0x8000; bit; bit >>= 1) { + GPIO_CLR(spi_clk); + if (val & bit) GPIO_SET(spi_mosi); + else GPIO_CLR(spi_mosi); + GPIO_SET(spi_clk); + } +} + +void uDisplay::write32(uint32_t val) { + for (uint32_t bit = 0x80000000; bit; bit >>= 1) { + GPIO_CLR(spi_clk); + if (val & bit) GPIO_SET(spi_mosi); + else GPIO_CLR(spi_mosi); + GPIO_SET(spi_clk); + } +} + +// ===== RA8876 Specific Functions ===== + +uint8_t uDisplay::writeReg16(uint8_t reg, uint16_t wval) { + hw_write9(reg, 0); + hw_write9(wval, 1); + hw_write9(reg + 1, 0); + hw_write9(wval >> 8, 1); + return 0; +} + +uint8_t uDisplay::readData(void) { + uspi->write(RA8876_DATA_READ); + uint8_t val = uspi->transfer(0); + return val; +} + +uint8_t uDisplay::readStatus(void) { + uspi->write(RA8876_STATUS_READ); + uint8_t val = uspi->transfer(0); + return val; +} \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_spi.h b/lib/lib_display/UDisplay/uDisplay_spi.h new file mode 100644 index 000000000..113832a15 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_spi.h @@ -0,0 +1,71 @@ +#ifndef UDISPLAY_SPI_LOWLEVEL_H +#define UDISPLAY_SPI_LOWLEVEL_H + +#include "uDisplay_config.h" + +// ===== SPI Platform-Specific Includes ===== +#ifdef ESP32 +#include "soc/spi_reg.h" +#include "soc/spi_struct.h" +#include "esp32-hal-spi.h" +#include "esp32-hal.h" +#include "soc/spi_struct.h" +#endif + +// ===== GPIO Control Macros ===== + +#ifdef ESP8266 +#define PIN_OUT_SET 0x60000304 +#define PIN_OUT_CLEAR 0x60000308 +#define GPIO_SET(A) WRITE_PERI_REG( PIN_OUT_SET, 1 << A) +#define GPIO_CLR(A) WRITE_PERI_REG( PIN_OUT_CLEAR, 1 << A) +#define GPIO_CLR_SLOW(A) digitalWrite(A, LOW) +#define GPIO_SET_SLOW(A) digitalWrite(A, HIGH) +#else // ESP32 +#undef GPIO_SET +#undef GPIO_CLR +#undef GPIO_SET_SLOW +#undef GPIO_CLR_SLOW + +#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32P4 +#define GPIO_CLR(A) GPIO.out_w1tc.val = (1 << A) +#define GPIO_SET(A) GPIO.out_w1ts.val = (1 << A) +#else // plain ESP32 +#define GPIO_CLR(A) GPIO.out_w1tc = (1 << A) +#define GPIO_SET(A) GPIO.out_w1ts = (1 << A) +#endif + +#define GPIO_CLR_SLOW(A) digitalWrite(A, LOW) +#define GPIO_SET_SLOW(A) digitalWrite(A, HIGH) +#endif + +// ===== SPI Transaction Control Macros ===== +#define SPI_BEGIN_TRANSACTION if (spi_nr <= 2) beginTransaction(spiSettings); +#define SPI_END_TRANSACTION if (spi_nr <= 2) endTransaction(); + +#define SPI_CS_LOW if (spi_cs >= 0) GPIO_CLR_SLOW(spi_cs); +#define SPI_CS_HIGH if (spi_cs >= 0) GPIO_SET_SLOW(spi_cs); +#define SPI_DC_LOW if (spi_dc >= 0) GPIO_CLR_SLOW(spi_dc); +#define SPI_DC_HIGH if (spi_dc >= 0) GPIO_SET_SLOW(spi_dc); + +// ===== Function Declarations ===== +// These would typically be in the class declaration in uDisplay.h +// but we list them here for reference: + +/* +// Low-Level SPI Write Functions +void hw_write9(uint8_t val, uint8_t dc); +void write8(uint8_t val); +void write8_slow(uint8_t val); +void write9(uint8_t val, uint8_t dc); +void write9_slow(uint8_t val, uint8_t dc); +void write16(uint16_t val); +void write32(uint32_t val); + +// RA8876 Specific Functions +uint8_t writeReg16(uint8_t reg, uint16_t wval); +uint8_t readData(void); +uint8_t readStatus(void); +*/ + +#endif // UDISPLAY_SPI_LOWLEVEL_H \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_spi_comm.cpp b/lib/lib_display/UDisplay/uDisplay_spi_comm.cpp new file mode 100644 index 000000000..d04197bcf --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_spi_comm.cpp @@ -0,0 +1,158 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" +#include "uDisplay_spi.h" // Your SPI header + +// ===== High-Level SPI Communication Functions ===== + +void uDisplay::ulcd_command(uint8_t val) { + if (interface == _UDSP_SPI) { + if (spi_dc < 0) { + if (spi_nr > 2) { + if (spi_nr == 3) { + write9(val, 0); + } else { + write9_slow(val, 0); + } + } else { + hw_write9(val, 0); + } + } else { + SPI_DC_LOW + if (spi_nr > 2) { + if (spi_nr == 3) { + write8(val); + } else { + write8_slow(val); + } + } else { + uspi->write(val); + } + SPI_DC_HIGH + } + return; + } + +#ifdef USE_ESP32_S3 + if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { + pb_writeCommand(val, 8); + } +#endif +} + +void uDisplay::ulcd_data8(uint8_t val) { + if (interface == _UDSP_SPI) { + if (spi_dc < 0) { + if (spi_nr > 2) { + if (spi_nr == 3) { + write9(val, 1); + } else { + write9_slow(val, 1); + } + } else { + hw_write9(val, 1); + } + } else { + if (spi_nr > 2) { + if (spi_nr == 3) { + write8(val); + } else { + write8_slow(val); + } + } else { + uspi->write(val); + } + } + return; + } + +#ifdef USE_ESP32_S3 + if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { + pb_writeData(val, 8); + } +#endif +} + +void uDisplay::ulcd_data16(uint16_t val) { + if (interface == _UDSP_SPI) { + if (spi_dc < 0) { + if (spi_nr > 2) { + write9(val >> 8, 1); + write9(val, 1); + } else { + hw_write9(val >> 8, 1); + hw_write9(val, 1); + } + } else { + if (spi_nr > 2) { + write16(val); + } else { + uspi->write16(val); + } + } + return; + } + +#ifdef USE_ESP32_S3 + if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { + pb_writeData(val, 16); + } +#endif +} + +void uDisplay::ulcd_data32(uint32_t val) { + if (interface == _UDSP_SPI) { + if (spi_dc < 0) { + if (spi_nr > 2) { + write9(val >> 24, 1); + write9(val >> 16, 1); + write9(val >> 8, 1); + write9(val, 1); + } else { + hw_write9(val >> 24, 1); + hw_write9(val >> 16, 1); + hw_write9(val >> 8, 1); + hw_write9(val, 1); + } + } else { + if (spi_nr > 2) { + write32(val); + } else { + uspi->write32(val); + } + } + return; + } + +#ifdef USE_ESP32_S3 + if (interface == _UDSP_PAR8 || interface == _UDSP_PAR16) { + pb_writeData(val, 32); + } +#endif +} + +void uDisplay::ulcd_command_one(uint8_t val) { + if (interface == _UDSP_SPI) { + SPI_BEGIN_TRANSACTION + SPI_CS_LOW + ulcd_command(val); + SPI_CS_HIGH + SPI_END_TRANSACTION + } +} + +void uDisplay::WriteColor(uint16_t color) { + if (col_mode == 18) { + uint8_t r = (color & 0xF800) >> 11; + uint8_t g = (color & 0x07E0) >> 5; + uint8_t b = color & 0x001F; + r = (r * 255) / 31; + g = (g * 255) / 63; + b = (b * 255) / 31; + + ulcd_data8(r); + ulcd_data8(g); + ulcd_data8(b); + } else { + ulcd_data16(color); + } +} \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_timing.cpp b/lib/lib_display/UDisplay/uDisplay_timing.cpp new file mode 100644 index 000000000..f63170326 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_timing.cpp @@ -0,0 +1,60 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" + +// ===== Timing and Delay Functions ===== + +void uDisplay::delay_arg(uint32_t args) { + uint32_t delay_ms = 0; + switch (args & 0xE0) { + case 0x80: delay_ms = 150; break; + case 0xA0: delay_ms = 10; break; + case 0xE0: delay_ms = 500; break; + } + if (delay_ms > 0) { + delay(delay_ms); + AddLog(LOG_LEVEL_DEBUG, PSTR("DSP: delay %d ms"), delay_ms); + } +} + +void uDisplay::reset_pin(int32_t msl, int32_t msh) { + if (reset > 0) { + digitalWrite(reset, LOW); + delay(msl); + digitalWrite(reset, HIGH); + delay(msh); + } +} +#define UDSP_BUSY_TIMEOUT 3000 + +void uDisplay::delay_sync(int32_t ms) { + uint8_t busy_level = HIGH; + if (lvgl_param.busy_invert) { + busy_level = LOW; + } + uint32_t time = millis(); + if (busy_pin > 0) { + while (digitalRead(busy_pin) == busy_level) { + delay(1); + if ((millis() - time) > UDSP_BUSY_TIMEOUT) { + break; + } + } + } else { + delay(ms); + } +} + +// ===== SPI Transaction Control ===== + +void uDisplay::beginTransaction(SPISettings s) { +#ifdef ESP32 + if (lvgl_param.use_dma) { + dmaWait(); + } +#endif + uspi->beginTransaction(s); +} + +void uDisplay::endTransaction(void) { + uspi->endTransaction(); +} \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_touch.cpp b/lib/lib_display/UDisplay/uDisplay_touch.cpp new file mode 100644 index 000000000..6afa12637 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_touch.cpp @@ -0,0 +1,568 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" + +#ifdef USE_UNIVERSAL_TOUCH + +// ===== Touch IRQ Handler ===== + +uint8_t ut_irq_flg; + +void IRAM_ATTR ut_touch_irq(void) { + ut_irq_flg = 1; +} + +// ===== Touch Initialization ===== + +bool uDisplay::utouch_Init(char **name) { + *name = ut_name; + + if (ut_init_code) { + if (ut_reset >= 0) { + pinMode(ut_reset, OUTPUT); + digitalWrite(ut_reset, HIGH); + delay(10); + digitalWrite(ut_reset, LOW); + delay(5); + digitalWrite(ut_reset, HIGH); + delay(10); + } + + if (ut_irq >= 0) { + pinMode(ut_irq, INPUT); + attachInterrupt(ut_irq, ut_touch_irq, FALLING); + } + + if (ut_spi_nr == spi_nr) { + // same as display + ut_spi = uspi; + } else { +#ifdef ESP32 + ut_spi = SpiBegin(ut_spi_nr); +#endif + } + + return ut_execute(ut_init_code); + } + + return false; +} + +// ===== Touch Detection ===== + +uint16_t uDisplay::touched(void) { + if (ut_irq >= 0) { + if (!ut_irq_flg) { + return false; + } + ut_irq_flg = 0; + } + + if (ut_touch_code) { + return ut_execute(ut_touch_code); + } + + return 0; +} + +// ===== Touch Coordinate Reading ===== + +int16_t uDisplay::getPoint_x(void) { + if (ut_getx_code) { + return ut_execute(ut_getx_code); + } + return 0; +} + +int16_t uDisplay::getPoint_y(void) { + if (ut_gety_code) { + return ut_execute(ut_gety_code); + } + return 0; +} + +// ===== Touch Command Execution ===== + +// ===== Touch Code Translation ===== + +void uDisplay::ut_trans(char **sp, uint8_t **code) { + char *cp = *sp; + uint16_t wval; + uint8_t tmp_code[64]; + uint8_t *ut_code = tmp_code; + + while (*cp) { + if (*cp == ':' || *cp == '#') { + break; + } + if (*cp == ';') { + // skip comment line + while (*cp) { + if (*cp == '\n') { + cp++; + break; + } + cp++; + } + } + + if (!strncmp(cp, "RDWM", 4)) { + // read word many + *ut_code++ = UT_RDWM; + wval = ut_par(&cp, 0); + *ut_code++ = wval>>8; + *ut_code++ = wval; + wval = ut_par(&cp, 1); + if (wval > sizeof(ut_array)) { + wval = sizeof(ut_array); + } + *ut_code++ = wval; + } else if (!strncmp(cp, "RDW", 3)) { + // read word one + *ut_code++ = UT_RDW; + wval = ut_par(&cp, 0); + *ut_code++ = wval>>8; + *ut_code++ = wval; + } else if (!strncmp(cp, "RDM", 3)) { + // read many + *ut_code++ = UT_RDM; + *ut_code++ = ut_par(&cp, 0); + wval = ut_par(&cp, 1); + if (wval > sizeof(ut_array)) { + wval = sizeof(ut_array); + } + *ut_code++ = wval; + } else if (!strncmp(cp, "RD", 2)) { + // read one + *ut_code++ = UT_RD; + *ut_code++ = ut_par(&cp, 0); + } else if (!strncmp(cp, "CPR", 3)) { + // cmp and set + *ut_code++ = UT_CPR; + *ut_code++ = ut_par(&cp, 0); + } else if (!strncmp(cp, "CPM", 3)) { + // cmp multiple and set + *ut_code++ = UT_CPM; + uint8_t num = ut_par(&cp, 0); + *ut_code++ = num; + for (uint32_t cnt = 0; cnt < num; cnt++) { + *ut_code++ = ut_par(&cp, 0); + } + } else if (!strncmp(cp, "CP", 2)) { + // cmp and set + *ut_code++ = UT_CP; + *ut_code++ = ut_par(&cp, 0); + } else if (!strncmp(cp, "RTF", 3)) { + // return when false + *ut_code++ = UT_RTF; + } else if (!strncmp(cp, "RTT", 3)) { + // return when true + *ut_code++ = UT_RTT; + } else if (!strncmp(cp, "MVB", 3)) { + // move + *ut_code++ = UT_MVB; + *ut_code++ = ut_par(&cp, 1); + *ut_code++ = ut_par(&cp, 1); + } else if (!strncmp(cp, "MV", 2)) { + // move + *ut_code++ = UT_MV; + *ut_code++ = ut_par(&cp, 1); + *ut_code++ = ut_par(&cp, 1); + } else if (!strncmp(cp, "RT", 2)) { + // return status + *ut_code++ = UT_RT; + } else if (!strncmp(cp, "WRW", 3)) { + *ut_code++ = UT_WRW; + wval = ut_par(&cp, 0); + *ut_code++ = wval>>8; + *ut_code++ = wval; + wval = ut_par(&cp, 0); + *ut_code++ = wval; + } else if (!strncmp(cp, "WR", 2)) { + *ut_code++ = UT_WR; + wval = ut_par(&cp, 0); + *ut_code++ = wval; + wval = ut_par(&cp, 0); + *ut_code++ = wval; + } else if (!strncmp(cp, "AND", 3)) { + *ut_code++ = UT_AND; + wval = ut_par(&cp, 0); + *ut_code++ = wval >> 8; + *ut_code++ = wval; + } else if (!strncmp(cp, "SCL", 3)) { + *ut_code++ = UT_SCALE; + wval = ut_par(&cp, 1); + *ut_code++ = wval >> 8; + *ut_code++ = wval; + uint32_t lval = ut_par(&cp, 2); + *ut_code++ = lval >> 24; + *ut_code++ = lval >> 16; + *ut_code++ = lval >> 8; + *ut_code++ = lval; + } else if (!strncmp(cp, "LIM", 3)) { + *ut_code++ = UT_LIM; + wval = ut_par(&cp, 1); + *ut_code++ = wval >> 8; + *ut_code++ = wval; + } else if (!strncmp(cp, "GSRT", 4)) { + *ut_code++ = UT_GSRT; + wval = ut_par(&cp, 1); + *ut_code++ = wval >> 8; + *ut_code++ = wval; + } else if (!strncmp(cp, "XPT", 3)) { + *ut_code++ = UT_XPT; + wval = ut_par(&cp, 1); + *ut_code++ = wval >> 8; + *ut_code++ = wval; + } else if (!strncmp(cp, "DBG", 3)) { + *ut_code++ = UT_DBG; + wval = ut_par(&cp, 1); + *ut_code++ = wval; + } + cp++; + } + + *ut_code++ = UT_END; + *sp = cp - 1; + uint16_t memsize = (uint32_t)ut_code - (uint32_t)tmp_code; + + // allocate memory + uint8_t *mp = (uint8_t*)malloc(memsize + 2); + if (mp) { + memmove(mp, tmp_code, memsize); + *code = mp; + } +} + +// ===== Touch Parameter Parsing ===== + +uint32_t uDisplay::ut_par(char **lp, uint32_t mode) { + char *cp = *lp; + while (*cp != ' ') { + if (!cp) break; + cp++; + } + cp++; + uint32_t result; + + if (!mode) { + // hex + result = strtol(cp, &cp, 16); + } else if (mode == 1) { + // word + result = strtol(cp, &cp, 10); + } else { + // float as 32bit integer + float fval = CharToFloat(cp); + result = *(uint32_t*)&fval; + while (*cp) { + if (*cp == ' ' || *cp =='\n') { + break; + } + cp++; + } + } + + *lp = cp; + return result; +} + +int16_t uDisplay::ut_execute(uint8_t *ut_code) { + int16_t result = 0; + uint8_t iob, len; + uint16_t wval; + + while (*ut_code != UT_END) { + iob = *ut_code++; + switch (iob) { + case UT_RD: + // read 1 byte + ut_code = ut_rd(ut_code, 1, 1); + break; + + case UT_RDM: + // read multiple bytes + ut_code = ut_rd(ut_code, 2, 1); + break; + + case UT_RDW: + // read 1 byte + ut_code = ut_rd(ut_code, 1, 2); + break; + + case UT_RDWM: + // read multiple bytes + ut_code = ut_rd(ut_code, 2, 2); + break; + + case UT_WR: + ut_code = ut_wr(ut_code, 1); + break; + + case UT_WRW: + ut_code = ut_wr(ut_code, 2); + break; + + case UT_CP: + // compare + iob = *ut_code++; + result = (iob == ut_array[0]); + break; + + case UT_CPM: + // compare multiple + len = *ut_code++; + result = 0; + for (uint32_t cnt = 0; cnt < len; cnt++) { + iob = *ut_code++; + result |= (iob == ut_array[0]); + } + break; + + case UT_CPR: + // compare + iob = *ut_code++; + result = (iob == result); + break; + + case UT_RTF: + // return when false + if (result == 0) { + return false; + } + break; + + case UT_RTT: + // return when true + if (result > 0) { + return false; + } + break; + + case UT_MVB: + // move byte from index to high or low result + wval = *ut_code++; + iob = *ut_code++; + if (wval == 0) { + result &= 0xff00; + result |= ut_array[iob]; + } else { + result &= 0x00ff; + result |= (ut_array[iob] << 8); + } + break; + + case UT_MV: + // move + // source + result = *ut_code++; + iob = *ut_code++; + if (iob == 1) { + result = ut_array[result]; + } else if (iob == 2) { + iob = result; + result = ut_array[iob] << 8; + result |= ut_array[iob + 1]; + } else { + iob = result; + result = ut_array[iob + 1] << 8; + result |= ut_array[iob]; + } + result &= 0xfff; + break; + + case UT_AND: + // and + wval = *ut_code++ << 8; + wval |= *ut_code++; + result &= wval; + break; + + case UT_SCALE: + { + wval = *ut_code++ << 8; + wval |= *ut_code++; + result -= wval; + uint32_t lval = (uint32_t)*ut_code++ << 24; + lval |= (uint32_t)*ut_code++ << 16; + lval |= (uint32_t)*ut_code++ << 8; + lval |= (uint32_t)*ut_code++; + float fval = *(float*)&lval; + fval *= (float)result; + result = fval; + } + break; + + case UT_LIM: + wval = *ut_code++ << 8; + wval |= *ut_code++; + if (result > wval) { + result = wval; + } + break; + + case UT_RT: + // result + return result; + break; + + case UT_GSRT: +#ifdef USE_ESP32_S3 + { + uint32_t val = get_sr_touch(SIMPLERS_XP, SIMPLERS_XM, SIMPLERS_YP, SIMPLERS_YM); + if (val == 0) { + return false; + } + uint16_t xp = val >> 16; + uint16_t yp = val; + + wval = *ut_code++ << 8; + wval |= *ut_code++; + if (xp > wval && yp > wval) { + ut_array[0] = val >> 24; + ut_array[1] = val >> 16; + ut_array[2] = val >> 8; + ut_array[3] = val; + return true; + } + return false; + } +#endif // USE_ESP32_S3 + break; + + case UT_XPT: + wval = *ut_code++ << 8; + wval |= *ut_code++; + result = ut_XPT2046(wval); + break; + + case UT_DBG: + // debug show result + wval = *ut_code++; + AddLog(LOG_LEVEL_INFO, PSTR("UTDBG %d: %02x : %02x,%02x,%02x,%02x"), wval, result, ut_array[0], ut_array[1], ut_array[2], ut_array[3]); + break; + + case UT_END: + break; + } + } + + return result; +} + +// ===== Low-Level Touch Communication ===== +uint8_t *uDisplay::ut_rd(uint8_t *iop, uint32_t len, uint32_t amode) { + if (ut_wire) { + // i2c mode + ut_wire->beginTransmission(ut_i2caddr); + ut_wire->write(*iop++); + if (amode == 2) { + ut_wire->write(*iop++); + } + ut_wire->endTransmission(false); + if (len > 1) { + len = *iop++; + } + ut_wire->requestFrom(ut_i2caddr, (size_t)len); + uint8_t index = 0; + while (ut_wire->available()) { + ut_array[index++] = ut_wire->read(); + } + } else { + // spi mode + if (amode == 1) { + uint16_t val = *iop++; + uint16_t len = *iop++; + if (ut_spi) { + digitalWrite(ut_spi_cs, LOW); + ut_spi->beginTransaction(ut_spiSettings); + ut_spi->transfer(val); + val = ut_spi->transfer16(0); + ut_spi->endTransaction(); + ut_array[len] = val << 8; + ut_array[len + 1] = val; + digitalWrite(ut_spi_cs, HIGH); + } + } + } + + return iop; +} + +uint8_t *uDisplay::ut_wr(uint8_t *iop, uint32_t amode) { + if (ut_wire) { + // i2c mode + ut_wire->beginTransmission(ut_i2caddr); + ut_wire->write(*iop++); + if (amode == 2) { + ut_wire->write(*iop++); + } + ut_wire->write(*iop++); + ut_wire->endTransmission(true); + } else { + // spi mode + } + + return iop; +} + +// ===== XPT2046 Touch Controller ===== + +uint16_t uDisplay::ut_XPT2046(uint16_t z_th) { + uint16_t result = 0; + + if (ut_spi) { + int16_t data[6]; + ut_spi->beginTransaction(ut_spiSettings); + digitalWrite(ut_spi_cs, LOW); + ut_spi->transfer(0xB1 /* Z1 */); + int16_t z1 = ut_spi->transfer16(0xC1 /* Z2 */) >> 3; + int16_t z = z1 + 4095; + int16_t z2 = ut_spi->transfer16(0x91 /* X */) >> 3; + z -= z2; + + if (z >= z_th) { + ut_spi->transfer16(0x91 /* X */); // dummy X measure, 1st is always noisy + data[0] = ut_spi->transfer16(0xD1 /* Y */) >> 3; + data[1] = ut_spi->transfer16(0x91 /* X */) >> 3; // make 3 x-y measurements + data[2] = ut_spi->transfer16(0xD1 /* Y */) >> 3; + data[3] = ut_spi->transfer16(0x91 /* X */) >> 3; + result = 1; + } else { + data[0] = data[1] = data[2] = data[3] = 0; + } + + data[4] = ut_spi->transfer16(0xD0 /* Y */) >> 3; // Last Y touch power down + data[5] = ut_spi->transfer16(0) >> 3; + digitalWrite(ut_spi_cs, HIGH); + ut_spi->endTransaction(); + + uint16_t x = besttwoavg(data[0], data[2], data[4]); + uint16_t y = besttwoavg(data[1], data[3], data[5]); + + ut_array[0] = x >> 8; + ut_array[1] = x; + ut_array[2] = y >> 8; + ut_array[3] = y; + } + + return result; +} + +// ===== Touch Data Processing ===== + +int16_t uDisplay::besttwoavg(int16_t x, int16_t y, int16_t z) { + int16_t da, db, dc; + int16_t reta = 0; + + if (x > y) da = x - y; else da = y - x; + if (x > z) db = x - z; else db = z - x; + if (z > y) dc = z - y; else dc = y - z; + + if (da <= db && da <= dc) reta = (x + y) >> 1; + else if (db <= da && db <= dc) reta = (x + z) >> 1; + else reta = (y + z) >> 1; + + return (reta); +} + +#endif // USE_UNIVERSAL_TOUCH \ No newline at end of file diff --git a/lib/lib_display/UDisplay/uDisplay_utils.cpp b/lib/lib_display/UDisplay/uDisplay_utils.cpp new file mode 100644 index 000000000..fff89e886 --- /dev/null +++ b/lib/lib_display/UDisplay/uDisplay_utils.cpp @@ -0,0 +1,111 @@ +#include "uDisplay.h" +#include "uDisplay_config.h" + +// ===== String and Parsing Utilities ===== + +uint8_t uDisplay::strlen_ln(char *str) { + for (uint32_t cnt = 0; cnt < 256; cnt++) { + if (!str[cnt] || str[cnt] == '\n' || str[cnt] == ' ') return cnt; + } + return 0; +} + +char *uDisplay::devname(void) { + return dname; +} + +uint32_t uDisplay::str2c(char **sp, char *vp, uint32_t len) { + char *lp = *sp; + if (len) len--; + char *cp = strchr(lp, ','); + if (cp) { + while (1) { + if (*lp == ',') { + *vp = 0; + *sp = lp + 1; + return 0; + } + if (len) { + *vp++ = *lp++; + len--; + } else { + lp++; + } + } + } else { + uint16_t slen = strlen(lp); + if (slen) { + strlcpy(vp, *sp, len); + *sp = lp + slen; + return 0; + } + } + return 1; +} + +int32_t uDisplay::next_val(char **sp) { + char ibuff[16]; + if (!str2c(sp, ibuff, sizeof(ibuff))) { + return atoi(ibuff); + } + return 0xff; +} + +uint32_t uDisplay::next_hex(char **sp) { + char ibuff[16]; + if (!str2c(sp, ibuff, sizeof(ibuff))) { + return strtol(ibuff, 0, 16); + } + return 0xff; +} + +// ===== Touch Coordinate Conversion ===== +// the cases are PSEUDO_OPCODES from MODULE_DESCRIPTOR +// and may be expanded with more opcodes +void uDisplay::TS_RotConvert(int16_t *x, int16_t *y) { + int16_t temp; + + if (rot_t[cur_rot] & 0x80) { + temp = *y; + *y = *x; + *x = temp; + } + + if (rotmap_xmin >= 0) { + *y = map(*y, rotmap_ymin, rotmap_ymax, 0, gys); + *x = map(*x, rotmap_xmin, rotmap_xmax, 0, gxs); + *x = constrain(*x, 0, gxs); + *y = constrain(*y, 0, gys); + } + + switch (rot_t[cur_rot] & 0xf) { + case 0: + break; + case 1: + temp = *y; + *y = height() - *x; + *x = temp; + break; + case 2: + *x = width() - *x; + *y = height() - *y; + break; + case 3: + temp = *y; + *y = *x; + *x = width() - temp; + break; + case 4: + *x = width() - *x; + break; + case 5: + *y = height() - *y; + break; + } +} + +// ===== Color Conversion Helper ===== + +static inline void lvgl_color_swap(uint16_t *data, uint16_t len) { + for (uint32_t i = 0; i < len; i++) (data[i] = data[i] << 8 | data[i] >> 8); +} \ No newline at end of file From 0e88a227fd5e7f2ebbde8488c70493aaf9bab73c Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 13 Oct 2025 17:17:44 +0200 Subject: [PATCH 008/136] Update change logs --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 973da8024..8f88328ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. ### Breaking Changed ### Changed +- Refactored library UDisplay (#24007) ### Fixed - TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA (#24000) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index a6662377f..5c80c3f49 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -118,6 +118,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ### Breaking Changed ### Changed +- Refactored library UDisplay [#24007](https://github.com/arendst/Tasmota/issues/24007) ### Fixed - TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA [#24000](https://github.com/arendst/Tasmota/issues/24000) From b04557928c539cd30eb8bdb39b252659a5c9038d Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Mon, 13 Oct 2025 20:05:01 +0200 Subject: [PATCH 009/136] TLS enabled ECDSA by default for ESP8266 (#24009) --- CHANGELOG.md | 1 + lib/lib_ssl/tls_mini/src/StackThunk_light.cpp | 18 +++- lib/lib_ssl/tls_mini/src/StackThunk_light.h | 1 + .../src/WiFiClientSecureLightBearSSL.cpp | 26 ++--- tasmota/my_user_config.h | 1 + tasmota/tasmota_support/tasmota_ca.ino | 97 ++++++++++++++++++- .../tasmota_xdrv_driver/xdrv_02_9_mqtt.ino | 3 + 7 files changed, 127 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f88328ac..7635d2639 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ## [15.1.0.1] ### Added +- TLS enabled ECDSA by default for ESP8266 ### Breaking Changed diff --git a/lib/lib_ssl/tls_mini/src/StackThunk_light.cpp b/lib/lib_ssl/tls_mini/src/StackThunk_light.cpp index 00799d66c..ac4a3aa92 100644 --- a/lib/lib_ssl/tls_mini/src/StackThunk_light.cpp +++ b/lib/lib_ssl/tls_mini/src/StackThunk_light.cpp @@ -45,12 +45,16 @@ uint32_t stack_thunk_light_refcnt = 0; //#define _stackSize (5600/4) #if defined(USE_MQTT_CLIENT_CERT) || defined(USE_MQTT_AWS_IOT_LIGHT) || defined(USE_MQTT_AZURE_IOT) - #define _stackSize (5300/4) // using a light version of bearssl we can save 300 bytes + #define _stackSizeRSA (5300/4) // using a light version of bearssl we can save 500 bytes + #define _stackSizeECDSA (6300/4) // using a light version of bearssl we can save 300 bytes #else - #define _stackSize (4800/4) // no private key, we can reduce a little, max observed 4300 + #define _stackSizeRSA (4800/4) // no private key, we can reduce a little, max observed 4300 + #define _stackSizeECDSA (6800/4) // using a light version of bearssl we can save 300 bytes #endif #define _stackPaint 0xdeadbeef +size_t _stackSize = _stackSizeRSA; + void stack_thunk_yield() { if (can_yield()) { @@ -70,6 +74,16 @@ void stack_thunk_yield() } } +/* Set the size for stack depending on RSA or RSA/ECDSA */ +void stack_thunk_light_set_size(bool _rsa_only) +{ + if (_rsa_only) { + _stackSize = _stackSizeRSA; + } else { + _stackSize = _stackSizeECDSA; + } +} + /* Add a reference, and allocate the stack if necessary */ void stack_thunk_light_add_ref() { diff --git a/lib/lib_ssl/tls_mini/src/StackThunk_light.h b/lib/lib_ssl/tls_mini/src/StackThunk_light.h index ca6701422..98715fbb3 100644 --- a/lib/lib_ssl/tls_mini/src/StackThunk_light.h +++ b/lib/lib_ssl/tls_mini/src/StackThunk_light.h @@ -34,6 +34,7 @@ extern "C" { extern void stack_thunk_yield(); +extern void stack_thunk_light_set_size(bool _rsa_only); extern void stack_thunk_light_add_ref(); extern void stack_thunk_light_del_ref(); extern void stack_thunk_light_repaint(); diff --git a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp index 227e078d6..57568061b 100755 --- a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp +++ b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp @@ -884,14 +884,6 @@ extern "C" { ctx->fingerprint_all = fingerprint_all; } -#ifdef ESP8266 - // We limit to a single cipher to reduce footprint - // we reference it, don't put in PROGMEM - static const uint16_t suites[] = { - BR_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - }; -#else - // add more flexibility on ESP32 static const uint16_t suites[] = { BR_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, BR_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, @@ -899,7 +891,6 @@ extern "C" { static const uint16_t suites_RSA_ONLY[] = { BR_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, }; -#endif // Default initializion for our SSL clients static void br_ssl_client_base_init(br_ssl_client_context *cc, bool _rsa_only) { @@ -908,14 +899,14 @@ extern "C" { br_ssl_engine_add_flags(&cc->eng, BR_OPT_NO_RENEGOTIATION); br_ssl_engine_set_versions(&cc->eng, BR_TLS12, BR_TLS12); -#ifdef ESP8266 - br_ssl_engine_set_suites(&cc->eng, suites, (sizeof suites) / (sizeof suites[0])); -#else +#if defined(ESP32) || (defined(ESP8266) && defined(USE_MQTT_TLS_ECDSA)) if (_rsa_only) { br_ssl_engine_set_suites(&cc->eng, suites_RSA_ONLY, (sizeof suites_RSA_ONLY) / (sizeof suites_RSA_ONLY[0])); } else { br_ssl_engine_set_suites(&cc->eng, suites, (sizeof suites) / (sizeof suites[0])); } +#else + br_ssl_engine_set_suites(&cc->eng, suites_RSA_ONLY, (sizeof suites_RSA_ONLY) / (sizeof suites_RSA_ONLY[0])); #endif br_ssl_client_set_default_rsapub(cc); br_ssl_engine_set_default_rsavrfy(&cc->eng); @@ -931,7 +922,7 @@ extern "C" { // we support only P256 EC curve for AWS IoT, no EC curve for Letsencrypt unless forced br_ssl_engine_set_ec(&cc->eng, &br_ec_p256_m15); -#ifdef ESP32 +#if defined(ESP32) || (defined(ESP8266) && defined(USE_MQTT_TLS_ECDSA)) br_ssl_engine_set_ecdsa(&cc->eng, &br_ecdsa_i15_vrfy_asn1); #endif } @@ -951,6 +942,7 @@ bool WiFiClientSecure_light::_connectSSL(const char* hostName) { // ============================================================ // allocate Thunk stack, move to alternate stack and initialize #ifdef ESP8266 + stack_thunk_light_set_size(_rsa_only); stack_thunk_light_add_ref(); #endif // ESP8266 LOG_HEAP_SIZE("Thunk allocated"); @@ -986,9 +978,11 @@ bool WiFiClientSecure_light::_connectSSL(const char* hostName) { br_x509_minimal_init(x509_minimal, &br_sha256_vtable, _ta_P, _ta_size); br_x509_minimal_set_rsa(x509_minimal, br_ssl_engine_get_rsavrfy(_eng)); br_x509_minimal_set_hash(x509_minimal, br_sha256_ID, &br_sha256_vtable); -#ifdef ESP32 - br_x509_minimal_set_ecdsa(x509_minimal, &br_ec_all_m15, &br_ecdsa_i15_vrfy_asn1); -#endif // ESP32 +#if defined(ESP32) || (defined(ESP8266) && defined(USE_MQTT_TLS_ECDSA)) + if (!_rsa_only) { + br_x509_minimal_set_ecdsa(x509_minimal, &br_ec_all_m15, &br_ecdsa_i15_vrfy_asn1); + } +#endif br_ssl_engine_set_x509(_eng, &x509_minimal->vtable); uint32_t now = UtcTime(); uint32_t cfg_time = CfgTime(); diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index bfd3828e4..a2847e178 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -462,6 +462,7 @@ // -- MQTT - TLS - AWS IoT ------------------------ // Using TLS starting with version v6.5.0.16 compilation will only work using Core 2.4.2 and 2.5.2. No longer supported: 2.3.0 //#define USE_MQTT_TLS // Use TLS for MQTT connection (+34.5k code, +7.0k mem and +4.8k additional during connection handshake) + #define USE_MQTT_TLS_ECDSA // (ESP8266 only, always on for ESP32) enable ECDSA in addition to RSA (+11.5k code) // #define USE_MQTT_TLS_CA_CERT // [DEPRECATED] Now TLS supports dual mode using SetOption132 - this flag is now ignored // #define USE_MQTT_AWS_IOT_LIGHT // Enable MQTT for AWS IoT in light mode, with user/password instead of private certificate // #define USE_MQTT_CLIENT_CERT // Enable MQTT with custom client certificate - requires a private key (+11.9k code, +0.4k mem) diff --git a/tasmota/tasmota_support/tasmota_ca.ino b/tasmota/tasmota_support/tasmota_ca.ino index c5056218c..2787dc4e4 100644 --- a/tasmota/tasmota_support/tasmota_ca.ino +++ b/tasmota/tasmota_support/tasmota_ca.ino @@ -115,12 +115,33 @@ static const unsigned char LetsEncrypt_ISRG_Root_X1_RSA_E[] = { #endif -#if ! defined(OMIT_AWS_CERT) +#if !defined(OMIT_AWS_CERT) /*********************************************************************************************\ - * Amazon Root CA, RSA 2048 bits SHA 256, valid until 20380117 + * Amazon Root CA1, RSA 2048 bits SHA 256, valid until 20380117 * * https://www.amazontrust.com/repository/ * Downloaded from https://www.amazontrust.com/repository/AmazonRootCA1.pem + * + * -----BEGIN CERTIFICATE----- + * MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF + * ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 + * b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL + * MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv + * b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj + * ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM + * 9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw + * IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6 + * VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L + * 93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm + * jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC + * AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA + * A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI + * U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs + * N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv + * o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU + * 5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy + * rqXRfboQnoZsG4q5WTP468SQvvG5 + * -----END CERTIFICATE----- * * to convert do: "bearssl ta AmazonRootCA1.pem" * then copy and paste below, chain the generic names to the same as below @@ -165,6 +186,62 @@ static const unsigned char PROGMEM AmazonRootCA1_RSA_E[] = { 0x01, 0x00, 0x01 }; + +/*********************************************************************************************\ + * Amazon Root CA3, EC, NIST P-256 curve, valid until 20400526 + * + * https://www.amazontrust.com/repository/ + * Downloaded from https://www.amazontrust.com/repository/AmazonRootCA3.pem + * + * -----BEGIN CERTIFICATE----- + * MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5 + * MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g + * Um9vdCBDQSAzMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG + * A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg + * Q0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZBf8ANm+gBG1bG8lKl + * ui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjrZt6j + * QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSr + * ttvXBp43rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkr + * BqWTrBqYaGFy+uGh0PsceGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteM + * YyRIHN8wfdVoOw== + * -----END CERTIFICATE----- + * + * to convert do: "bearssl ta AmazonRootCA3.pem" + * then copy and paste below, chain the generic names to the same as below + * remove "static" and add "PROGMEM" +\*********************************************************************************************/ + +static const unsigned char AmazonRootCA3_DN[] = { + 0x30, 0x39, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, + 0x02, 0x55, 0x53, 0x31, 0x0F, 0x30, 0x0D, 0x06, 0x03, 0x55, 0x04, 0x0A, + 0x13, 0x06, 0x41, 0x6D, 0x61, 0x7A, 0x6F, 0x6E, 0x31, 0x19, 0x30, 0x17, + 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x10, 0x41, 0x6D, 0x61, 0x7A, 0x6F, + 0x6E, 0x20, 0x52, 0x6F, 0x6F, 0x74, 0x20, 0x43, 0x41, 0x20, 0x33 +}; + +static const unsigned char AmazonRootCA3_EC_Q[] = { + 0x04, 0x29, 0x97, 0xA7, 0xC6, 0x41, 0x7F, 0xC0, 0x0D, 0x9B, 0xE8, 0x01, + 0x1B, 0x56, 0xC6, 0xF2, 0x52, 0xA5, 0xBA, 0x2D, 0xB2, 0x12, 0xE8, 0xD2, + 0x2E, 0xD7, 0xFA, 0xC9, 0xC5, 0xD8, 0xAA, 0x6D, 0x1F, 0x73, 0x81, 0x3B, + 0x3B, 0x98, 0x6B, 0x39, 0x7C, 0x33, 0xA5, 0xC5, 0x4E, 0x86, 0x8E, 0x80, + 0x17, 0x68, 0x62, 0x45, 0x57, 0x7D, 0x44, 0x58, 0x1D, 0xB3, 0x37, 0xE5, + 0x67, 0x08, 0xEB, 0x66, 0xDE +}; + +// static const br_x509_trust_anchor TAs[1] = { +// { +// { (unsigned char *)TA0_DN, sizeof TA0_DN }, +// BR_X509_TA_CA, +// { +// BR_KEYTYPE_EC, +// { .ec = { +// BR_EC_secp256r1, +// (unsigned char *)TA0_EC_Q, sizeof TA0_EC_Q, +// } } +// } +// } +// }; + #endif #if defined(INCLUDE_LOCAL_CERT) @@ -205,6 +282,22 @@ const br_x509_trust_anchor PROGMEM Tasmota_TA[] = { } } +#if defined(ESP32) || (defined(ESP8266) && defined(USE_MQTT_TLS_ECDSA)) + , + { + { (unsigned char *)AmazonRootCA3_DN, sizeof AmazonRootCA3_DN }, + BR_X509_TA_CA, + { + BR_KEYTYPE_EC, + { .ec = { + BR_EC_secp256r1, + (unsigned char *)AmazonRootCA3_EC_Q, sizeof AmazonRootCA3_EC_Q, + } } + } + } + +#endif // defined(ESP32) || (defined(ESP8266) && defined(USE_MQTT_TLS_ECDSA)) + #if defined(INCLUDE_LOCAL_CERT) , #endif diff --git a/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino b/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino index 584751fcc..caf8863f9 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino @@ -1392,6 +1392,8 @@ void MqttReconnect(void) { 120 : 376 : BR_ALERT_NO_APPLICATION_PROTOCOL */ AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_MQTT "TLS connection error: %d"), tlsClient->getLastError()); + +#if defined(ESP32) || (defined(ESP8266) && defined(USE_MQTT_TLS_ECDSA)) if (tlsClient->getLastError() == 296) { // in this special case of cipher mismatch, we force enable ECDSA // this would be the case for newer letsencrypt certificates now defaulting @@ -1400,6 +1402,7 @@ void MqttReconnect(void) { tlsClient->setECDSA(Settings->flag6.tls_use_ecdsa); AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_MQTT "TLS now enabling ECDSA 'SetOption165 1'"), tlsClient->getLastError()); } +#endif // defined(ESP32) || (defined(ESP8266) && defined(USE_MQTT_TLS_ECDSA)) } #endif /* From 662c9362eee2aee9f9409ef37cc6353eb1c48390 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Mon, 13 Oct 2025 22:25:45 +0200 Subject: [PATCH 010/136] HASPmota exception in 'cpicker' (colorwheel) (#24010) --- CHANGELOG.md | 1 + .../lv_haspmota/src/embedded/lv_haspmota.be | 5 + .../src/solidify/solidified_lv_haspmota.h | 332 ++++++++++-------- 3 files changed, 186 insertions(+), 152 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7635d2639..b4788e680 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. ### Fixed - TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA (#24000) - Extension Manager exception when `OtaUrl` is not defined or invalid +- HASPmota exception in `cpicker` (colorwheel) ### Removed diff --git a/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be b/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be index 6a6f038d3..10167ce54 100644 --- a/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be +++ b/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be @@ -2655,6 +2655,11 @@ class lvh_cpicker : lvh_obj # pad_inner is ignored (for now?) def set_pad_inner() end def get_pad_inner() end + + # map val to rgb which is mapped to a color instance + def get_val() + return self._lv_obj.get_rgb() + end end ################################################################################# diff --git a/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h b/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h index cee97693e..6058b6542 100644 --- a/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h +++ b/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h @@ -11408,7 +11408,7 @@ be_local_class(lvh_btnmatrix, })), be_str_weak(lvh_btnmatrix) ); -// compact class 'lvh_cpicker' ktab size: 21, total: 31 (saved 80 bytes) +// compact class 'lvh_cpicker' ktab size: 21, total: 33 (saved 96 bytes) static const bvalue be_ktab_class_lvh_cpicker[21] = { /* K0 */ be_nested_str_weak(_CW_MODES), /* K1 */ be_nested_str_weak(find), @@ -11416,21 +11416,21 @@ static const bvalue be_ktab_class_lvh_cpicker[21] = { /* K3 */ be_nested_str_weak(set_mode), /* K4 */ be_nested_str_weak(unknown_X20color_X20mode_X20_X27_X25s_X27), /* K5 */ be_nested_str_weak(value_error), - /* K6 */ be_nested_str_weak(get_rgb), - /* K7 */ be_nested_str_weak(_X23_X2506X), - /* K8 */ be_nested_str_weak(get_color_mode_fixed), - /* K9 */ be_nested_str_weak(get_color_mode), - /* K10 */ be_const_int(0), - /* K11 */ be_nested_str_weak(unknown), - /* K12 */ be_nested_str_weak(lv), - /* K13 */ be_nested_str_weak(colorwheel), - /* K14 */ be_nested_str_weak(init), - /* K15 */ be_nested_str_weak(set_scale_width), - /* K16 */ be_nested_str_weak(set_style_arc_width), - /* K17 */ be_nested_str_weak(parse_color), - /* K18 */ be_nested_str_weak(set_rgb), - /* K19 */ be_nested_str_weak(set_mode_fixed), - /* K20 */ be_nested_str_weak(get_style_arc_width), + /* K6 */ be_nested_str_weak(get_color_mode), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str_weak(unknown), + /* K9 */ be_nested_str_weak(set_mode_fixed), + /* K10 */ be_nested_str_weak(parse_color), + /* K11 */ be_nested_str_weak(set_rgb), + /* K12 */ be_nested_str_weak(get_rgb), + /* K13 */ be_nested_str_weak(_X23_X2506X), + /* K14 */ be_nested_str_weak(get_style_arc_width), + /* K15 */ be_nested_str_weak(lv), + /* K16 */ be_nested_str_weak(colorwheel), + /* K17 */ be_nested_str_weak(init), + /* K18 */ be_nested_str_weak(set_scale_width), + /* K19 */ be_nested_str_weak(set_style_arc_width), + /* K20 */ be_nested_str_weak(get_color_mode_fixed), }; @@ -11477,6 +11477,108 @@ be_local_closure(class_lvh_cpicker_set_mode, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: get_mode +********************************************************************/ +be_local_closure(class_lvh_cpicker_get_mode, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_cpicker, /* shared constants */ + be_str_weak(get_mode), + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x88040102, // 0000 GETMBR R1 R0 K2 + 0x8C040306, // 0001 GETMET R1 R1 K6 + 0x7C040200, // 0002 CALL R1 1 + 0x28080307, // 0003 GE R2 R1 K7 + 0x780A0008, // 0004 JMPF R2 #000E + 0x6008000C, // 0005 GETGBL R2 G12 + 0x880C0100, // 0006 GETMBR R3 R0 K0 + 0x7C080200, // 0007 CALL R2 1 + 0x14080202, // 0008 LT R2 R1 R2 + 0x780A0003, // 0009 JMPF R2 #000E + 0x88080100, // 000A GETMBR R2 R0 K0 + 0x94080401, // 000B GETIDX R2 R2 R1 + 0x80040400, // 000C RET 1 R2 + 0x70020000, // 000D JMP #000F + 0x80061000, // 000E RET 1 K8 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_mode_fixed +********************************************************************/ +be_local_closure(class_lvh_cpicker_set_mode_fixed, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_cpicker, /* shared constants */ + be_str_weak(set_mode_fixed), + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x60080017, // 0000 GETGBL R2 G23 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x5C040400, // 0003 MOVE R1 R2 + 0x88080102, // 0004 GETMBR R2 R0 K2 + 0x8C080509, // 0005 GETMET R2 R2 K9 + 0x5C100200, // 0006 MOVE R4 R1 + 0x7C080400, // 0007 CALL R2 2 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_color +********************************************************************/ +be_local_closure(class_lvh_cpicker_set_color, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_cpicker, /* shared constants */ + be_str_weak(set_color), + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x8C08010A, // 0000 GETMET R2 R0 K10 + 0x5C100200, // 0001 MOVE R4 R1 + 0x7C080400, // 0002 CALL R2 2 + 0x880C0102, // 0003 GETMBR R3 R0 K2 + 0x8C0C070B, // 0004 GETMET R3 R3 K11 + 0x5C140400, // 0005 MOVE R5 R2 + 0x7C0C0400, // 0006 CALL R3 2 + 0x80000000, // 0007 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: get_color ********************************************************************/ @@ -11495,10 +11597,10 @@ be_local_closure(class_lvh_cpicker_get_color, /* name */ &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ 0x88040102, // 0000 GETMBR R1 R0 K2 - 0x8C040306, // 0001 GETMET R1 R1 K6 + 0x8C04030C, // 0001 GETMET R1 R1 K12 0x7C040200, // 0002 CALL R1 1 0x60080018, // 0003 GETGBL R2 G24 - 0x580C0007, // 0004 LDCONST R3 K7 + 0x580C000D, // 0004 LDCONST R3 K13 0x5C100200, // 0005 MOVE R4 R1 0x7C080400, // 0006 CALL R2 2 0x80040400, // 0007 RET 1 R2 @@ -11533,36 +11635,9 @@ be_local_closure(class_lvh_cpicker_get_pad_inner, /* name */ /******************************************************************** -** Solidified function: get_mode_fixed +** Solidified function: get_scale_width ********************************************************************/ -be_local_closure(class_lvh_cpicker_get_mode_fixed, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_lvh_cpicker, /* shared constants */ - be_str_weak(get_mode_fixed), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040102, // 0000 GETMBR R1 R0 K2 - 0x8C040308, // 0001 GETMET R1 R1 K8 - 0x7C040200, // 0002 CALL R1 1 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_mode -********************************************************************/ -be_local_closure(class_lvh_cpicker_get_mode, /* name */ +be_local_closure(class_lvh_cpicker_get_scale_width, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -11573,25 +11648,14 @@ be_local_closure(class_lvh_cpicker_get_mode, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_lvh_cpicker, /* shared constants */ - be_str_weak(get_mode), + be_str_weak(get_scale_width), &be_const_str_solidified, - ( &(const binstruction[16]) { /* code */ + ( &(const binstruction[ 5]) { /* code */ 0x88040102, // 0000 GETMBR R1 R0 K2 - 0x8C040309, // 0001 GETMET R1 R1 K9 - 0x7C040200, // 0002 CALL R1 1 - 0x2808030A, // 0003 GE R2 R1 K10 - 0x780A0008, // 0004 JMPF R2 #000E - 0x6008000C, // 0005 GETGBL R2 G12 - 0x880C0100, // 0006 GETMBR R3 R0 K0 - 0x7C080200, // 0007 CALL R2 1 - 0x14080202, // 0008 LT R2 R1 R2 - 0x780A0003, // 0009 JMPF R2 #000E - 0x88080100, // 000A GETMBR R2 R0 K0 - 0x94080401, // 000B GETIDX R2 R2 R1 - 0x80040400, // 000C RET 1 R2 - 0x70020000, // 000D JMP #000F - 0x80061600, // 000E RET 1 K11 - 0x80000000, // 000F RET 0 + 0x8C04030E, // 0001 GETMET R1 R1 K14 + 0x580C0007, // 0002 LDCONST R3 K7 + 0x7C040400, // 0003 CALL R1 2 + 0x80040200, // 0004 RET 1 R1 }) ) ); @@ -11615,8 +11679,8 @@ be_local_closure(class_lvh_cpicker_init, /* name */ be_str_weak(init), &be_const_str_solidified, ( &(const binstruction[20]) { /* code */ - 0xB81A1800, // 0000 GETNGBL R6 K12 - 0x8C180D0D, // 0001 GETMET R6 R6 K13 + 0xB81A1E00, // 0000 GETNGBL R6 K15 + 0x8C180D10, // 0001 GETMET R6 R6 K16 0x5C200200, // 0002 MOVE R8 R1 0x50240200, // 0003 LDBOOL R9 1 0 0x7C180600, // 0004 CALL R6 3 @@ -11624,14 +11688,14 @@ be_local_closure(class_lvh_cpicker_init, /* name */ 0x60180003, // 0006 GETGBL R6 G3 0x5C1C0000, // 0007 MOVE R7 R0 0x7C180200, // 0008 CALL R6 1 - 0x8C180D0E, // 0009 GETMET R6 R6 K14 + 0x8C180D11, // 0009 GETMET R6 R6 K17 0x5C200200, // 000A MOVE R8 R1 0x5C240400, // 000B MOVE R9 R2 0x5C280600, // 000C MOVE R10 R3 0x5C2C0800, // 000D MOVE R11 R4 0x5C300A00, // 000E MOVE R12 R5 0x7C180C00, // 000F CALL R6 6 - 0x8C18010F, // 0010 GETMET R6 R0 K15 + 0x8C180112, // 0010 GETMET R6 R0 K18 0x54220018, // 0011 LDINT R8 25 0x7C180400, // 0012 CALL R6 2 0x80000000, // 0013 RET 0 @@ -11683,11 +11747,11 @@ be_local_closure(class_lvh_cpicker_set_scale_width, /* name */ &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ 0x88080102, // 0000 GETMBR R2 R0 K2 - 0x8C080510, // 0001 GETMET R2 R2 K16 + 0x8C080513, // 0001 GETMET R2 R2 K19 0x60100009, // 0002 GETGBL R4 G9 0x5C140200, // 0003 MOVE R5 R1 0x7C100200, // 0004 CALL R4 1 - 0x5814000A, // 0005 LDCONST R5 K10 + 0x58140007, // 0005 LDCONST R5 K7 0x7C080600, // 0006 CALL R2 3 0x80000000, // 0007 RET 0 }) @@ -11697,74 +11761,11 @@ be_local_closure(class_lvh_cpicker_set_scale_width, /* name */ /******************************************************************** -** Solidified function: set_color +** Solidified function: get_mode_fixed ********************************************************************/ -be_local_closure(class_lvh_cpicker_set_color, /* name */ +be_local_closure(class_lvh_cpicker_get_mode_fixed, /* name */ be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_lvh_cpicker, /* shared constants */ - be_str_weak(set_color), - &be_const_str_solidified, - ( &(const binstruction[ 8]) { /* code */ - 0x8C080111, // 0000 GETMET R2 R0 K17 - 0x5C100200, // 0001 MOVE R4 R1 - 0x7C080400, // 0002 CALL R2 2 - 0x880C0102, // 0003 GETMBR R3 R0 K2 - 0x8C0C0712, // 0004 GETMET R3 R3 K18 - 0x5C140400, // 0005 MOVE R5 R2 - 0x7C0C0400, // 0006 CALL R3 2 - 0x80000000, // 0007 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_mode_fixed -********************************************************************/ -be_local_closure(class_lvh_cpicker_set_mode_fixed, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_lvh_cpicker, /* shared constants */ - be_str_weak(set_mode_fixed), - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x60080017, // 0000 GETGBL R2 G23 - 0x5C0C0200, // 0001 MOVE R3 R1 - 0x7C080200, // 0002 CALL R2 1 - 0x5C040400, // 0003 MOVE R1 R2 - 0x88080102, // 0004 GETMBR R2 R0 K2 - 0x8C080513, // 0005 GETMET R2 R2 K19 - 0x5C100200, // 0006 MOVE R4 R1 - 0x7C080400, // 0007 CALL R2 2 - 0x80000000, // 0008 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_scale_width -********************************************************************/ -be_local_closure(class_lvh_cpicker_get_scale_width, /* name */ - be_nested_proto( - 4, /* nstack */ + 3, /* nstack */ 1, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -11773,14 +11774,40 @@ be_local_closure(class_lvh_cpicker_get_scale_width, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_lvh_cpicker, /* shared constants */ - be_str_weak(get_scale_width), + be_str_weak(get_mode_fixed), &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ + ( &(const binstruction[ 4]) { /* code */ 0x88040102, // 0000 GETMBR R1 R0 K2 0x8C040314, // 0001 GETMET R1 R1 K20 - 0x580C000A, // 0002 LDCONST R3 K10 - 0x7C040400, // 0003 CALL R1 2 - 0x80040200, // 0004 RET 1 R1 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_val +********************************************************************/ +be_local_closure(class_lvh_cpicker_get_val, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_cpicker, /* shared constants */ + be_str_weak(get_val), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040102, // 0000 GETMBR R1 R0 K2 + 0x8C04030C, // 0001 GETMET R1 R1 K12 + 0x7C040200, // 0002 CALL R1 1 + 0x80040200, // 0003 RET 1 R1 }) ) ); @@ -11794,12 +11821,20 @@ extern const bclass be_class_lvh_obj; be_local_class(lvh_cpicker, 0, &be_class_lvh_obj, - be_nested_map(13, + be_nested_map(14, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(get_scale_width, 9), be_const_closure(class_lvh_cpicker_get_scale_width_closure) }, - { be_const_key_weak(get_color, -1), be_const_closure(class_lvh_cpicker_get_color_closure) }, + { be_const_key_weak(get_val, 1), be_const_closure(class_lvh_cpicker_get_val_closure) }, + { be_const_key_weak(get_mode, -1), be_const_closure(class_lvh_cpicker_get_mode_closure) }, + { be_const_key_weak(set_mode_fixed, -1), be_const_closure(class_lvh_cpicker_set_mode_fixed_closure) }, + { be_const_key_weak(set_color, 8), be_const_closure(class_lvh_cpicker_set_color_closure) }, + { be_const_key_weak(set_scale_width, -1), be_const_closure(class_lvh_cpicker_set_scale_width_closure) }, + { be_const_key_weak(get_color, 9), be_const_closure(class_lvh_cpicker_get_color_closure) }, { be_const_key_weak(get_pad_inner, -1), be_const_closure(class_lvh_cpicker_get_pad_inner_closure) }, - { be_const_key_weak(_CW_MODES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { + { be_const_key_weak(get_scale_width, -1), be_const_closure(class_lvh_cpicker_get_scale_width_closure) }, + { be_const_key_weak(_lv_class, -1), be_const_class(be_class_lv_colorwheel) }, + { be_const_key_weak(init, -1), be_const_closure(class_lvh_cpicker_init_closure) }, + { be_const_key_weak(set_pad_inner, -1), be_const_closure(class_lvh_cpicker_set_pad_inner_closure) }, + { be_const_key_weak(_CW_MODES, 4), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { be_const_list( * be_nested_list(3, ( (struct bvalue*) &(const bvalue[]) { be_nested_str_weak(hue), @@ -11807,13 +11842,6 @@ be_local_class(lvh_cpicker, be_nested_str_weak(value), })) ) } )) }, { be_const_key_weak(get_mode_fixed, -1), be_const_closure(class_lvh_cpicker_get_mode_fixed_closure) }, - { be_const_key_weak(get_mode, -1), be_const_closure(class_lvh_cpicker_get_mode_closure) }, - { be_const_key_weak(init, -1), be_const_closure(class_lvh_cpicker_init_closure) }, - { be_const_key_weak(set_color, 8), be_const_closure(class_lvh_cpicker_set_color_closure) }, - { be_const_key_weak(_lv_class, -1), be_const_class(be_class_lv_colorwheel) }, - { be_const_key_weak(set_pad_inner, 4), be_const_closure(class_lvh_cpicker_set_pad_inner_closure) }, - { be_const_key_weak(set_scale_width, 7), be_const_closure(class_lvh_cpicker_set_scale_width_closure) }, - { be_const_key_weak(set_mode_fixed, -1), be_const_closure(class_lvh_cpicker_set_mode_fixed_closure) }, { be_const_key_weak(set_mode, 0), be_const_closure(class_lvh_cpicker_set_mode_closure) }, })), be_str_weak(lvh_cpicker) From 7b5613440255745f8828ee56081dae3653cd89d4 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:29:00 +0200 Subject: [PATCH 011/136] Update change logs --- CHANGELOG.md | 4 ++-- RELEASENOTES.md | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4788e680..952efae38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. ## [15.1.0.1] ### Added -- TLS enabled ECDSA by default for ESP8266 +- TLS enabled ECDSA by default for ESP8266 (#24009) ### Breaking Changed @@ -15,7 +15,7 @@ All notable changes to this project will be documented in this file. ### Fixed - TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA (#24000) - Extension Manager exception when `OtaUrl` is not defined or invalid -- HASPmota exception in `cpicker` (colorwheel) +- HASPmota exception in `cpicker` (colorwheel) (#24010) ### Removed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 5c80c3f49..6dd2daea7 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -75,19 +75,19 @@ Historical binaries can be downloaded from The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz`` -### ESP32, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-S2, ESP32-S3 and ESP32-P4 based +### ESP32, ESP32-C2, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-P4, ESP32-S2 and ESP32-S3 based The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.4**. - **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY** - **tasmota32solo1.bin** = The Tasmota version with most drivers including additional sensors and KNX for single core ESP32 and 4M+ flash. -- **tasmota32s2.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S2 with serial and 4M+ flash. -- **tasmota32s2cdc.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S2 with serial over embedded USB CDC only and 4M+ flash. -- **tasmota32s3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S3 with USB HWCDC and fallback to serial and 4M+ flash. - **tasmota32c2.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C2 with serial and 4M+ flash. - **tasmota32c3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C3 with USB HWCDC and fallback to serial and 4M+ flash. - **tasmota32c5.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C5 with USB HWCDC and fallback to serial and 4M+ flash. - **tasmota32c6.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C6 with USB HWCDC and fallback to serial and 4M+ flash. - **tasmota32p4.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-P4 with USB HWCDC and fallback to serial and 4M+ flash. +- **tasmota32s2.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S2 with serial and 4M+ flash. +- **tasmota32s2cdc.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S2 with serial over embedded USB CDC only and 4M+ flash. +- **tasmota32s3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S3 with USB HWCDC and fallback to serial and 4M+ flash. - **tasmota32-AD.bin** to **tasmota32-VN.bin** = The Tasmota version in different languages for 4M+ flash. - **tasmota32-bluetooth.bin** = The Bluetooth version adds BLE support for 4M+ flash. - **tasmota32-display.bin** = The Display version without Energy Monitoring but adds display support for 4M+ flash. @@ -114,6 +114,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ## Changelog v15.1.0.1 ### Added +- TLS enabled ECDSA by default for ESP8266 [#24009](https://github.com/arendst/Tasmota/issues/24009) ### Breaking Changed @@ -123,5 +124,6 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ### Fixed - TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA [#24000](https://github.com/arendst/Tasmota/issues/24000) - Extension Manager exception when `OtaUrl` is not defined or invalid +- HASPmota exception in `cpicker` (colorwheel) [#24010](https://github.com/arendst/Tasmota/issues/24010) ### Removed From c463ba608dd1ae1e961afb2ff1226708663e0025 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:57:13 +0200 Subject: [PATCH 012/136] Fix Extension Manager Light Theme support and Extensions input field control --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + .../berry_tasmota/src/embedded/extension_manager.be | 8 ++++---- .../src/solidify/solidified_extension_manager.h | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 952efae38..5e0d9b219 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. - TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA (#24000) - Extension Manager exception when `OtaUrl` is not defined or invalid - HASPmota exception in `cpicker` (colorwheel) (#24010) +- Extension Manager Light Theme support and Extensions input field control ### Removed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 6dd2daea7..0a81975b2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -124,6 +124,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ### Fixed - TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA [#24000](https://github.com/arendst/Tasmota/issues/24000) - Extension Manager exception when `OtaUrl` is not defined or invalid +- Extension Manager Light Theme support and Extensions input field control - HASPmota exception in `cpicker` (colorwheel) [#24010](https://github.com/arendst/Tasmota/issues/24010) ### Removed diff --git a/lib/libesp32/berry_tasmota/src/embedded/extension_manager.be b/lib/libesp32/berry_tasmota/src/embedded/extension_manager.be index 176c248f6..95a89519d 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/extension_manager.be +++ b/lib/libesp32/berry_tasmota/src/embedded/extension_manager.be @@ -430,17 +430,17 @@ class Extension_manager # for store # /* Extension Store specific styles */ ".store-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;}" - ".store-stats{font-size:0.9em;color:var(--c_in);}" + ".store-stats{font-size:0.9em;}" ".ext-store-item{background:var(--c_bg);border-radius:0.3em;margin-bottom:5px;padding:4px;}" ".ext-header{display:flex;justify-content:space-between;align-items:center;cursor:pointer;user-select:none;padding:5px;}" ".ext-title{display:flex;align-items:center;gap:6px;flex:1;padding:0;}" ".ext-name{font-weight:bold;}" ".ext-version{font-size:0.8em;}" - ".ext-arrow{color:var(--c_in);font-size:0.8em;}" + ".ext-arrow{font-size:0.8em;}" ".ext-badges{padding:0;}" # ".ext-badges{margin-left:auto;gap:8px;align-items:center;}" ".ext-details{width:min-content;min-width:100%;padding:0;display:none;}" - ".ext-desc{color:var(--c_in);font-size:0.8em;line-height:1.4;display:block;word-wrap:break-word;overflow-wrap:break-word;white-space:normal;padding:0 5px;}" + ".ext-desc{font-size:0.8em;line-height:1.4;display:block;word-wrap:break-word;overflow-wrap:break-word;white-space:normal;padding:0 5px;}" ".ext-actions{display:flex;gap:8px;padding:5px;}" ".btn-action{padding:0 12px;line-height:1.8em;font-size:0.9em;flex:1;}" @@ -631,7 +631,7 @@ class Extension_manager "
" "

") webserver.content_send(f"
" - "" + "" "
") webserver.content_send("

") diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_extension_manager.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_extension_manager.h index 8fd1eb5ff..ef1aa7b36 100644 --- a/lib/libesp32/berry_tasmota/src/solidify/solidified_extension_manager.h +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_extension_manager.h @@ -117,7 +117,7 @@ static const bvalue be_ktab_class_Extension_manager[182] = { /* K108 */ be_nested_str(Extensions_X20Manager), /* K109 */ be_nested_str(_X3Cdiv_X20style_X3D_X27padding_X3A0px_X205px_X3Btext_X2Dalign_X3Acenter_X3B_X27_X3E_X3Ch3_X3E_X3Chr_X3EExtension_X20Manager_X3Chr_X3E_X3C_X2Fh3_X3E_X3C_X2Fdiv_X3E), /* K110 */ be_nested_str_long(_X3Cscript_X3Efunction_X20loadext_X28_X29_X20_X7Beb_X28_X27store_X27_X29_X2Edisabled_X3Dtrue_X3Bx_X3Dnew_X20XMLHttpRequest_X28_X29_X3Bx_X2Etimeout_X3D4000_X3Bx_X2Eonreadystatechange_X20_X3D_X20_X28_X29_X20_X3D_X3E_X20_X7Bif_X28x_X2EreadyState_X3D_X3D4_X29_X7Bif_X28x_X2Estatus_X3D_X3D200_X29_X7Beb_X28_X27inet_X27_X29_X2Estyle_X2Edisplay_X3D_X27none_X27_X3Beb_X28_X27store_X27_X29_X2EouterHTML_X3Dx_X2EresponseText_X3B_X7D_X7D_X7D_X3Bx_X2Eopen_X28_X27GET_X27_X2C_X27_X3Fstore_X3D_X27_X29_X3Bx_X2Esend_X28_X29_X3B_X7Dwindow_X2Eonload_X3Dfunction_X28_X29_X7Bloadext_X28_X29_X3B_X7D_X3Bfunction_X20toggleDesc_X28id_X29_X20_X7Bvar_X20desc_X20_X3D_X20document_X2EgetElementById_X28_X27desc_X2D_X27_X20_X2B_X20id_X29_X3Bvar_X20arrow_X20_X3D_X20document_X2EgetElementById_X28_X27arrow_X2D_X27_X20_X2B_X20id_X29_X3Bif_X20_X28desc_X2Estyle_X2Edisplay_X20_X3D_X3D_X3D_X20_X27none_X27_X20_X7C_X7C_X20desc_X2Estyle_X2Edisplay_X20_X3D_X3D_X3D_X20_X27_X27_X29_X20_X7Bdesc_X2Estyle_X2Edisplay_X20_X3D_X20_X27block_X27_X3Barrow_X2EinnerHTML_X20_X3D_X20_X27_XE2_X96_XBC_X27_X3B_X7D_X20else_X20_X7Bdesc_X2Estyle_X2Edisplay_X20_X3D_X20_X27none_X27_X3Barrow_X2EinnerHTML_X20_X3D_X20_X27_XE2_X96_XB6_X27_X3B_X7D_X7Dfunction_X20filterExtensions_X28query_X29_X20_X7Bvar_X20items_X20_X3D_X20document_X2EgetElementsByClassName_X28_X27ext_X2Dstore_X2Ditem_X27_X29_X3Bquery_X20_X3D_X20query_X2EtoLowerCase_X28_X29_X3Bfor_X20_X28var_X20i_X20_X3D_X200_X3B_X20i_X20_X3C_X20items_X2Elength_X3B_X20i_X2B_X2B_X29_X20_X7Bvar_X20name_X20_X3D_X20items_X5Bi_X5D_X2EgetElementsByClassName_X28_X27ext_X2Dname_X27_X29_X5B0_X5D_X2EtextContent_X2EtoLowerCase_X28_X29_X3Bvar_X20desc_X20_X3D_X20items_X5Bi_X5D_X2EgetElementsByClassName_X28_X27ext_X2Ddesc_X27_X29_X5B0_X5D_X2EtextContent_X2EtoLowerCase_X28_X29_X3Bif_X20_X28name_X2Eincludes_X28query_X29_X20_X7C_X7C_X20desc_X2Eincludes_X28query_X29_X29_X20_X7Bitems_X5Bi_X5D_X2Estyle_X2Edisplay_X20_X3D_X20_X27block_X27_X3B_X7D_X20else_X20_X7Bitems_X5Bi_X5D_X2Estyle_X2Edisplay_X20_X3D_X20_X27none_X27_X3B_X7D_X7D_X7D_X3C_X2Fscript_X3E), - /* K111 */ be_nested_str_long(_X3Cfieldset_X20style_X3D_X27padding_X3A0_X205px_X3B_X27_X3E_X3Cstyle_X3E_X2Eext_X2Ditem_X7Bwidth_X3Amin_X2Dcontent_X3Bmin_X2Dwidth_X3A100_X25_X3B_X7D_X2Eext_X2Ditem_X20small_X7Bdisplay_X3Ablock_X3Bword_X2Dwrap_X3Abreak_X2Dword_X3Boverflow_X2Dwrap_X3Abreak_X2Dword_X3Bwhite_X2Dspace_X3Anormal_X3Bpadding_X2Dright_X3A5px_X3Bpadding_X2Dtop_X3A2px_X3B_X7D_X2Eext_X2Dcontrols_X7Bdisplay_X3Aflex_X3Bgap_X3A8px_X3Balign_X2Ditems_X3Acenter_X3Bmargin_X2Dtop_X3A4px_X3Bpadding_X3A0px_X7D_X2Ebtn_X2Dsmall_X7Bpadding_X3A0_X206px_X3Bline_X2Dheight_X3A1_X2E8rem_X3Bfont_X2Dsize_X3A0_X2E9rem_X3Bmin_X2Dwidth_X3Aauto_X3Bwidth_X3Aauto_X3Bflex_X2Dshrink_X3A0_X3B_X7Dform_X7Bpadding_X2Dtop_X3A0px_X3Bpadding_X2Dbottom_X3A0px_X3B_X7D_X2Erunning_X2Dindicator_X7Bdisplay_X3Ainline_X2Dblock_X3Bwidth_X3A8px_X3Bheight_X3A8px_X3Bborder_X2Dradius_X3A50_X25_X3Bmargin_X2Dright_X3A8px_X3Bbackground_X3Avar_X28_X2D_X2Dc_btnsvhvr_X29_X3Banimation_X3Apulse_X201_X2E5s_X20infinite_X3B_X7D_X40keyframes_X20pulse_X7B0_X25_X7Bopacity_X3A1_X3B_X7D50_X25_X7Bopacity_X3A0_X2E5_X3B_X7D100_X25_X7Bopacity_X3A1_X3B_X7D_X7D_X2Estore_X2Dheader_X7Bdisplay_X3Aflex_X3Bjustify_X2Dcontent_X3Aspace_X2Dbetween_X3Balign_X2Ditems_X3Acenter_X3Bmargin_X2Dbottom_X3A10px_X3B_X7D_X2Estore_X2Dstats_X7Bfont_X2Dsize_X3A0_X2E9em_X3Bcolor_X3Avar_X28_X2D_X2Dc_in_X29_X3B_X7D_X2Eext_X2Dstore_X2Ditem_X7Bbackground_X3Avar_X28_X2D_X2Dc_bg_X29_X3Bborder_X2Dradius_X3A0_X2E3em_X3Bmargin_X2Dbottom_X3A5px_X3Bpadding_X3A4px_X3B_X7D_X2Eext_X2Dheader_X7Bdisplay_X3Aflex_X3Bjustify_X2Dcontent_X3Aspace_X2Dbetween_X3Balign_X2Ditems_X3Acenter_X3Bcursor_X3Apointer_X3Buser_X2Dselect_X3Anone_X3Bpadding_X3A5px_X3B_X7D_X2Eext_X2Dtitle_X7Bdisplay_X3Aflex_X3Balign_X2Ditems_X3Acenter_X3Bgap_X3A6px_X3Bflex_X3A1_X3Bpadding_X3A0_X3B_X7D_X2Eext_X2Dname_X7Bfont_X2Dweight_X3Abold_X3B_X7D_X2Eext_X2Dversion_X7Bfont_X2Dsize_X3A0_X2E8em_X3B_X7D_X2Eext_X2Darrow_X7Bcolor_X3Avar_X28_X2D_X2Dc_in_X29_X3Bfont_X2Dsize_X3A0_X2E8em_X3B_X7D_X2Eext_X2Dbadges_X7Bpadding_X3A0_X3B_X7D_X2Eext_X2Ddetails_X7Bwidth_X3Amin_X2Dcontent_X3Bmin_X2Dwidth_X3A100_X25_X3Bpadding_X3A0_X3Bdisplay_X3Anone_X3B_X7D_X2Eext_X2Ddesc_X7Bcolor_X3Avar_X28_X2D_X2Dc_in_X29_X3Bfont_X2Dsize_X3A0_X2E8em_X3Bline_X2Dheight_X3A1_X2E4_X3Bdisplay_X3Ablock_X3Bword_X2Dwrap_X3Abreak_X2Dword_X3Boverflow_X2Dwrap_X3Abreak_X2Dword_X3Bwhite_X2Dspace_X3Anormal_X3Bpadding_X3A0_X205px_X3B_X7D_X2Eext_X2Dactions_X7Bdisplay_X3Aflex_X3Bgap_X3A8px_X3Bpadding_X3A5px_X3B_X7D_X2Ebtn_X2Daction_X7Bpadding_X3A0_X2012px_X3Bline_X2Dheight_X3A1_X2E8em_X3Bfont_X2Dsize_X3A0_X2E9em_X3Bflex_X3A1_X3B_X7D_X2Einstalled_X2Dbadge_X7Bborder_X2Dcolor_X3Avar_X28_X2D_X2Dc_btnhvr_X29_X3Bpadding_X3A0px_X204px_X3Bborder_X2Dradius_X3A4px_X3Bfont_X2Dsize_X3A0_X2E7em_X3Bborder_X2Dwidth_X3A2px_X3Bborder_X2Dstyle_X3Asolid_X3Bmargin_X2Dright_X3A3px_X3B_X7D_X2Eupdate_X2Dbadge_X7Bbackground_X3Avar_X28_X2D_X2Dc_btnhvr_X29_X3Bpadding_X3A2px_X206px_X3Bborder_X2Dradius_X3A4px_X3Bfont_X2Dsize_X3A0_X2E7em_X3Bmargin_X2Dright_X3A3px_X3Banimation_X3Apulse_X202s_X20infinite_X3B_X7D_X40keyframes_X20pulse_X7B0_X25_X7Bopacity_X3A1_X3B_X7D50_X25_X7Bopacity_X3A0_X2E7_X3B_X7D100_X25_X7Bopacity_X3A1_X3B_X7D_X7D_X3C_X2Fstyle_X3E_X3Clegend_X3E_X3Cb_X20title_X3D_X27Running_X20extensions_X27_X3E_X26nbsp_X3BInstalled_X20extensions_X3C_X2Fb_X3E_X3C_X2Flegend_X3E), + /* K111 */ be_nested_str_long(_X3Cfieldset_X20style_X3D_X27padding_X3A0_X205px_X3B_X27_X3E_X3Cstyle_X3E_X2Eext_X2Ditem_X7Bwidth_X3Amin_X2Dcontent_X3Bmin_X2Dwidth_X3A100_X25_X3B_X7D_X2Eext_X2Ditem_X20small_X7Bdisplay_X3Ablock_X3Bword_X2Dwrap_X3Abreak_X2Dword_X3Boverflow_X2Dwrap_X3Abreak_X2Dword_X3Bwhite_X2Dspace_X3Anormal_X3Bpadding_X2Dright_X3A5px_X3Bpadding_X2Dtop_X3A2px_X3B_X7D_X2Eext_X2Dcontrols_X7Bdisplay_X3Aflex_X3Bgap_X3A8px_X3Balign_X2Ditems_X3Acenter_X3Bmargin_X2Dtop_X3A4px_X3Bpadding_X3A0px_X7D_X2Ebtn_X2Dsmall_X7Bpadding_X3A0_X206px_X3Bline_X2Dheight_X3A1_X2E8rem_X3Bfont_X2Dsize_X3A0_X2E9rem_X3Bmin_X2Dwidth_X3Aauto_X3Bwidth_X3Aauto_X3Bflex_X2Dshrink_X3A0_X3B_X7Dform_X7Bpadding_X2Dtop_X3A0px_X3Bpadding_X2Dbottom_X3A0px_X3B_X7D_X2Erunning_X2Dindicator_X7Bdisplay_X3Ainline_X2Dblock_X3Bwidth_X3A8px_X3Bheight_X3A8px_X3Bborder_X2Dradius_X3A50_X25_X3Bmargin_X2Dright_X3A8px_X3Bbackground_X3Avar_X28_X2D_X2Dc_btnsvhvr_X29_X3Banimation_X3Apulse_X201_X2E5s_X20infinite_X3B_X7D_X40keyframes_X20pulse_X7B0_X25_X7Bopacity_X3A1_X3B_X7D50_X25_X7Bopacity_X3A0_X2E5_X3B_X7D100_X25_X7Bopacity_X3A1_X3B_X7D_X7D_X2Estore_X2Dheader_X7Bdisplay_X3Aflex_X3Bjustify_X2Dcontent_X3Aspace_X2Dbetween_X3Balign_X2Ditems_X3Acenter_X3Bmargin_X2Dbottom_X3A10px_X3B_X7D_X2Estore_X2Dstats_X7Bfont_X2Dsize_X3A0_X2E9em_X3B_X7D_X2Eext_X2Dstore_X2Ditem_X7Bbackground_X3Avar_X28_X2D_X2Dc_bg_X29_X3Bborder_X2Dradius_X3A0_X2E3em_X3Bmargin_X2Dbottom_X3A5px_X3Bpadding_X3A4px_X3B_X7D_X2Eext_X2Dheader_X7Bdisplay_X3Aflex_X3Bjustify_X2Dcontent_X3Aspace_X2Dbetween_X3Balign_X2Ditems_X3Acenter_X3Bcursor_X3Apointer_X3Buser_X2Dselect_X3Anone_X3Bpadding_X3A5px_X3B_X7D_X2Eext_X2Dtitle_X7Bdisplay_X3Aflex_X3Balign_X2Ditems_X3Acenter_X3Bgap_X3A6px_X3Bflex_X3A1_X3Bpadding_X3A0_X3B_X7D_X2Eext_X2Dname_X7Bfont_X2Dweight_X3Abold_X3B_X7D_X2Eext_X2Dversion_X7Bfont_X2Dsize_X3A0_X2E8em_X3B_X7D_X2Eext_X2Darrow_X7Bfont_X2Dsize_X3A0_X2E8em_X3B_X7D_X2Eext_X2Dbadges_X7Bpadding_X3A0_X3B_X7D_X2Eext_X2Ddetails_X7Bwidth_X3Amin_X2Dcontent_X3Bmin_X2Dwidth_X3A100_X25_X3Bpadding_X3A0_X3Bdisplay_X3Anone_X3B_X7D_X2Eext_X2Ddesc_X7Bfont_X2Dsize_X3A0_X2E8em_X3Bline_X2Dheight_X3A1_X2E4_X3Bdisplay_X3Ablock_X3Bword_X2Dwrap_X3Abreak_X2Dword_X3Boverflow_X2Dwrap_X3Abreak_X2Dword_X3Bwhite_X2Dspace_X3Anormal_X3Bpadding_X3A0_X205px_X3B_X7D_X2Eext_X2Dactions_X7Bdisplay_X3Aflex_X3Bgap_X3A8px_X3Bpadding_X3A5px_X3B_X7D_X2Ebtn_X2Daction_X7Bpadding_X3A0_X2012px_X3Bline_X2Dheight_X3A1_X2E8em_X3Bfont_X2Dsize_X3A0_X2E9em_X3Bflex_X3A1_X3B_X7D_X2Einstalled_X2Dbadge_X7Bborder_X2Dcolor_X3Avar_X28_X2D_X2Dc_btnhvr_X29_X3Bpadding_X3A0px_X204px_X3Bborder_X2Dradius_X3A4px_X3Bfont_X2Dsize_X3A0_X2E7em_X3Bborder_X2Dwidth_X3A2px_X3Bborder_X2Dstyle_X3Asolid_X3Bmargin_X2Dright_X3A3px_X3B_X7D_X2Eupdate_X2Dbadge_X7Bbackground_X3Avar_X28_X2D_X2Dc_btnhvr_X29_X3Bpadding_X3A2px_X206px_X3Bborder_X2Dradius_X3A4px_X3Bfont_X2Dsize_X3A0_X2E7em_X3Bmargin_X2Dright_X3A3px_X3Banimation_X3Apulse_X202s_X20infinite_X3B_X7D_X40keyframes_X20pulse_X7B0_X25_X7Bopacity_X3A1_X3B_X7D50_X25_X7Bopacity_X3A0_X2E7_X3B_X7D100_X25_X7Bopacity_X3A1_X3B_X7D_X7D_X3C_X2Fstyle_X3E_X3Clegend_X3E_X3Cb_X20title_X3D_X27Running_X20extensions_X27_X3E_X26nbsp_X3BInstalled_X20extensions_X3C_X2Fb_X3E_X3C_X2Flegend_X3E), /* K112 */ be_nested_str(list_extensions_in_fs), /* K113 */ be_nested_str(_X3Chr_X20style_X3D_X27margin_X3A2px_X200_X200_X200_X3B_X27_X3E), /* K114 */ be_nested_str(get_by_index), @@ -187,7 +187,7 @@ static const bvalue be_ktab_class_Extension_manager[182] = { /* K178 */ be_nested_str(_X3Cbutton_X20type_X3D_X27submit_X27_X20class_X3D_X27btn_X2Daction_X20bred_X27_X20name_X3D_X27d_X25s_X27_X20onclick_X3D_X27return_X20confirm_X28_X22Confirm_X20deletion_X20of_X20_X25s_X22_X29_X27_X3EUninstall_X3C_X2Fbutton_X3E), /* K179 */ be_nested_str_long(_X3Cbutton_X20type_X3D_X27submit_X27_X20class_X3D_X27btn_X2Daction_X27_X20name_X3D_X27i_X25s_X27_X20onclick_X3D_X27return_X20confirm_X28_X22Confirm_X20installation_X20of_X20_X25s_X22_X29_X27_X3EInstall_X3C_X2Fbutton_X3E_X3Cbutton_X20type_X3D_X27submit_X27_X20class_X3D_X27btn_X2Daction_X20bgrn_X27_X20name_X3D_X27I_X25s_X27_X20onclick_X3D_X27return_X20confirm_X28_X22Confirm_X20installation_X20of_X20_X25s_X22_X29_X27_X3EInstall_X2BRun_X3C_X2Fbutton_X3E), /* K180 */ be_nested_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3Chr_X20style_X3D_X27margin_X3A2px_X200_X200_X200_X3B_X27_X3E_X3Cp_X3E_X3C_X2Fp_X3E), - /* K181 */ be_nested_str(_X3Cform_X20action_X3D_X27_X2Fext_X27_X20method_X3D_X27post_X27_X3E_X3Cinput_X20type_X3D_X27text_X27_X20id_X3D_X27x_X27_X20name_X3D_X27x_X27_X20placeholder_X3D_X27_X25s_X27_X3E_X3C_X2Fform_X3E), + /* K181 */ be_nested_str(_X3Cform_X20action_X3D_X27_X2Fext_X27_X20method_X3D_X27post_X27_X3E_X3Cinput_X20type_X3D_X27text_X27_X20id_X3D_X27x_X27_X20name_X3D_X27x_X27_X20placeholder_X3D_X270_X20_X3D_X20User_X2C_X201_X20_X3D_X20Global_X27_X20value_X3D_X27_X25s_X27_X3E_X3C_X2Fform_X3E), }; From 7a06aa2cfe036c7b81d57fbe4d49a187b340a00b Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Tue, 14 Oct 2025 19:26:45 +0200 Subject: [PATCH 013/136] Berry add 'cb.free_cb' for extension manager (#24014) --- CHANGELOG.md | 1 + lib/libesp32/berry_mapping/src/be_cb_module.c | 45 + tasmota/berry/extensions/LVGL_Panel.tapp | Bin 0 -> 38712 bytes .../berry/extensions/LVGL_Panel/autoexec.be | 6 + .../berry/extensions/LVGL_Panel/lvgl_panel.be | 1096 +++++++++++++++++ .../berry/extensions/LVGL_Panel/manifest.json | 8 + 6 files changed, 1156 insertions(+) create mode 100644 tasmota/berry/extensions/LVGL_Panel.tapp create mode 100644 tasmota/berry/extensions/LVGL_Panel/autoexec.be create mode 100644 tasmota/berry/extensions/LVGL_Panel/lvgl_panel.be create mode 100644 tasmota/berry/extensions/LVGL_Panel/manifest.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e0d9b219..550940eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. ## [15.1.0.1] ### Added - TLS enabled ECDSA by default for ESP8266 (#24009) +- Berry add `cb.free_cb` for extension manager ### Breaking Changed diff --git a/lib/libesp32/berry_mapping/src/be_cb_module.c b/lib/libesp32/berry_mapping/src/be_cb_module.c index f04c162f7..2f485b2e9 100644 --- a/lib/libesp32/berry_mapping/src/be_cb_module.c +++ b/lib/libesp32/berry_mapping/src/be_cb_module.c @@ -343,6 +343,50 @@ static int call_berry_cb(int num, int v0, int v1, int v2, int v3, int v4) { return ret; } +/*********************************************************************************************\ + * Free a cb by function pointer +\*********************************************************************************************/ +static int be_cb_free_cb(bvm *vm) { + int32_t top = be_top(vm); +#if BE_MAPPING_ENABLE_INPUT_VALIDATION + // SECURITY: Input validation + if (top < 1) { + be_raise(vm, "value_error", "gen_cb requires at least 1 argument"); + } + + if (!be_iscomptr(vm, 1)) { + be_raise(vm, "value_error", "arg must be a comptr"); + } +#endif // BE_MAPPING_ENABLE_INPUT_VALIDATION + + void *cb = be_tocomptr(vm, 1); + + // Find slot number + int32_t slot; + for (slot = 0; slot < BE_MAX_CB; slot++) { + if (cb == (void*) berry_callback_array[slot]) { + break; + } + } + + if (slot >= BE_MAX_CB) { + be_raise(vm, "internal_error", "could not find cb"); + } + + // Fix GC object if needed + bvalue *found = &be_cb_hooks[slot].f; + if (be_isgcobj(found)) { + be_gc_fix_set(vm, found->v.gc, bfalse); // mark the function as gc so it can be freed + } + + // Record pointers + be_cb_hooks[slot].vm = NULL; + be_cb_hooks[slot].f.type = 0; + be_cb_hooks[slot].f.v.p = NULL; + + be_return_nil(vm); +} + /*********************************************************************************************\ * `be_cb_deinit`: SECURITY PATCHED * Clean any callback for this VM, they shouldn't call the registered function anymore @@ -406,6 +450,7 @@ void be_cb_deinit(bvm *vm) { /* @const_object_info_begin module cb (scope: global) { gen_cb, func(be_cb_gen_cb) + free_cb, func(be_cb_free_cb) get_cb_list, func(be_cb_get_cb_list) add_handler, func(be_cb_add_handler) diff --git a/tasmota/berry/extensions/LVGL_Panel.tapp b/tasmota/berry/extensions/LVGL_Panel.tapp new file mode 100644 index 0000000000000000000000000000000000000000..5b2fe94ebf5c25f5155754f335d1ba4803c16b9c GIT binary patch literal 38712 zcmc(ITXS1SlBRm?*@#w0KW#tE!$e0lIBtM830`D%YaoFRiK1<-b>T|XbbDnFgv$X5 z3%5N0Mbc_c#6HX~nCN-iw|(B1iJ1SfKV;^0=Vdnb`!cgG=K!G9BXuuq5jf{mWo2b$ zWoBh&)j9m?gAcD?<7fY$9=-V4tv|m#_|dg%{P&Y%ECv`B`(>sFU^FVC-J@CNJG=;?6SH zn~bY-*Y5RPdwelJ8H|tJeBzFWlTLf+#_dryo3^{zb>{}7=_H?{_B@}=rdfB6d#~HM z8)m(kV&&$IDtFd5fkW9!$maqs$J7_EQ&{o@yZ_u2mMe*X8@uJPYbF8O0)It9O zt>f0|xQ7;q*gVTeGh)q)FCIU4Uu5Gf$0#43c7}tldpPKV%9(4UW!{;cfLS^O!wR1h zgJ*_;`+Nep?Ky^I!({_J&)w@R=McFYz6pc3;U+m?)Y@~Rox91D)z-;wZrBD=zGi)C z&tnILbBW5yWQyLL03iBzHW&^aro`zi>z@uc&=Ps+HxG`!eDeIr-F^JE`_0{_PwzfH z`uaA?&QB(In!V0+tT@I4^b%Cf+v7RLunz!_4xa9Ri5hqBJ$U%w=xgBbK7VlZ_~6+y z_xY2j?yft$`}F9+{_}@-pSr{6PY<6wJE&t+K_6g;`d84lFQb!V+GX?hU^vr0e~sas z0kdJxowQ$P7}jn!cn!STt_%M01YHdmjkbpq@FaT(EF$v&u?KxOp3FDg3<%yina`(< zt*x`Ov-q)2`xTh&6j(w&fUfT4S=O0lIYzkEo?VQ)FWsOI z+E+0%hL{<>3$W&J0G7`t|Nj`6}^ zjmHp-oCTe1ewJlpt4pp`0&x9->Dv8De3~yEUj?m?={ThVQ(hFW!{}CMTEVeMU=`y4ud?L%(7Oy z4|&l7*?U)khTMaYgQnR42~f>RH8OL5Fjlcf5TfcZFpvnX&S}4&tr&U{}4R%yZR-{RgJW6)0CHi?hPRSDMV%ooo7>A(=OtN0}tsl zZQ0o9-PM1geQ70(kD+yskMrypYS)iz0L;)Tzt4K5$2ai!uzf-6Q2<~>QAFvwMs2L>RaB@NE|~i6NKIZU zggH#!(7{iwFLO1!lD2LNnh#JsAH$G)COX<3&_Yd0t+|`h<;Q6EfwyXbkTr05-G01_ z-dXc7(2;>hJ>J}J4`I5yvlAFzZ8y%&60Jx3Hds9Ud@>69F~Gc=A2-4U=8Nf{h8o*m zUC>TiG*z^0TANy`5tNM7Dk`9tzO?^#_by2dQocxplj}QJ{X2eK|vI9s>hqqn!_O3IMFHD z5@Bb3Ey%mYu6gm(6mb*UB(!5Jk+90>cEVl3#4BrR_$Ei!)z+2f)cg3YR)(&Ah&B!4 zafa0{Eg-BoUS(5Q)%XqGo}8hf(d0EIA()V$TZEzuoX~E%rVV8<_!#E|8&7t$|9)pC zEQglSseztiVT<`FYd6}bp6m&`f&>uefnC=y;54hi9)31h*Zf2$6_ZwK)|&5;XIoPh z;IqkOST6M5yA5$lt32y9(8u{{KAyRk?1rpj*mEmDvmH})2A;(zPR)1+M_MP@xd1Df z912ufhcoiC@RJK5Z5r&XEqAK%w;d7nAf3D=Jl*jK33fW zt#t-30GBu9Z#B)A40WN+B@}^XRPMHd>#iAv&U>do>ntD4;T);KMWy<11n!>n)}1_1 zp;qd}8k{bvYH_dK=oBU#rgu>Wrc9s>)m}%ortvcSzV(`dkeyB*VJTA6N9a0TU&b!z zevqSU@O{xL5bql*$l&;)@G_ua@3SF_4I^xT1o8PQ%chCrAkQ%3n8#2_3_%MT3d?2B7cpyMfE@WP&ba@G?o*A(B&Tpd18n(nN$&ppFX3g!x zZ3phcIM5&pl&5bo+WYq>*(_ysZN2sk_`&TD@;1`F#I>& zD3H%kpuAR99#BOWBesGrJ0WYCB8io>(C&1l1^W`eN9~+TB(C;**)ZcWEkKV>Yq15g z))hKl4INkva7xhR4Mh`Zf~xPQnkgW#CwuXGEf9nS=^F-<9k=ri9MO;@U^Z&N1h|T! za3h%=rltR&Sx09sG^WfzD4HpB4cx=+IFTtK$yX+~_;cZ7vP)c^0Wor=R16Gh0uRh!*^&z?|!m;Cdn65Yp;_{Vc_UbD;eiZd(dZ z$fLc)fQ~|PFm4f^*yRv~?Ou>vG)A$aG{xcy-ZS=tUHyd&I>q4tKJxMh7B$urlr=L% zW)jAvi+7wMVjw=rfHdnT0D+W3CWc9&3ZqXr#W;AgF(yuRa!M| z_mfo(Ct{?)f$ErI53Keey*@EJhwDo=#y~0?_OpjDG z=>(C9L8qhP;sv)YG}K)|6Ak*hsLV9ZSrV6t~o{C{IA3&KZip6&yb3 zd6;)eTOg}wYIVPB>;n93(>+p%RfxTqz&e%1i1bDcr{)@;Vme?pqF1o8HaK46`Af0f z826B8<5NUk5%%iq#AmGF6k1Fy7S98UAvz%KL9XbH(qEW~1NczrA?AHc@6uo-J2w`|GTJ|N{qp#mPcv57o z7KgJx$hiif6C_5s(EqFZ5scaG4bSxqx{c>bMnnl1%LBI!5RyH|7{e(Gq=hr2GwUFx zO@F~Q$a(9l6qmtfB?baqmGGmN$M+{lMbg*I@#55>4^1%x8=t^8{K_a=>LVqkhsy8b zb$Z1CONuhv04q_0y1^BW&b$l>3k3$`Jc>&h&kkv$WaFbJ_n*)t78gv`OZhwj0Of0x zDfy`k0A@U=p88xri;_x|ub?3^EOk%?L@7pNEL z%)3U%_oJIc4F*l>LHlpo4D<%s2tcGjMv~4le6bV)7R6!+Gr=0}(da;$LN=R$pGTlB zWnB)}qu0AsQ)NwDSdauA|Hdq%I=Np176tuYpHEJ*^V<65!n#G!H~(bxFmUAb2@Qc3 zL*Fe1kQmxZ1|l1Z-~|B!1np^ggUTlAxJd>8lHxjLEy3vcBZ#k}uAEbU99Bm;VC3A7Yt2b&#QR1`ijYD(sVw$1i&A6NoG&;yxnSF4n9@^J{0idZ5iONSm&DwX z5lf;%vDbfOty5y7pc8bCFOv7{WWaSiyz~h%$e-}-)+)kAg{mM#Wl5H3}!R2?>)nTVMfiAz@Kol5}cwGeC_LLfHC?b6;0Qquu3#y49KVF8&<^ zQ*oT?Oim$KkXT+}-Lwo1KE`YkXE!A~LRkY$GT1J#?dW5HteGV+nm@sHh!^q2tR5{HC4*kmL|Q8Cc0bhuIv$oyjOFPR*{G;8hETTwL@+dGwky1I zW4H6wy%KrKqE1JhBib1pr}fH0kL^p>7X@E<6x3BB{P?ik&5~ENSb&8M>E!48G13>f z0=W$mz49(^dYm)lMtfp<52Ya#O}YD)b`$cKMWP@(nJ$MpruEEKn0{0-NFIPFsKN1A zN^s?lcoasfIQe2Th?~vQTnH`KdX*vgsJ43m>2z8?X zBnr2}Qo?u!NWd0|bzuo0W5C}KEH0~+B+LZvPMTtrQb`n>F%~nJlIGPcU}W7$Ip&Yg zBqBOORD@}c;&V|f;k$qgU&$vir3GvA7;Y*J3w%z?2F7HTFD&!OU%bnN@G#U;42xD= zO5!16yW#@&;}Y4C2}bH~(~KE}1DKaj%L_~_Y0*{M?^R**D$GOgHHk0|tr3VE7)mb_ zh2Z@~zHG^U34+$pr*cZn){>kBC%)}MmrP1A#SguI+97ZKA;bfzpjI_a^|Bn74k$V5 zzOF2y%qrrV282kiNFm>%aIYVa_cEqWEwRTNxbFhgj|7$KxM#LnL-w(l5P*WC!wK>( z%_fTV$^wjgT^cYbB;8(N_}+v1Cc5M++9XK<@fjkktnaEcTdS}EGdlda{lQ00_)xN) zJnxZ@68vk#0ReD|$qn^F`q2;*N!kbuVIqkg42ht~rmDOlluIm;RM62n^6Q^i@-i+F zOO89?nnj=sw=b8plK}nWxim;Hx}snl`oUe9r6Tzqf!{EW%xBU#&AOvQNN%`V27dwa zNIkWg>13|h7I!J2hAJ(L<`n+iM-Lty$o2&+JD94ubuu3fD;#`!&bT{D_d);+J_$4c zQnxagq5x4{&ekToBmKj--zng?{K$Q=&SmpVz}VQrb5xBT4gO^5M7Z*G)R+%6B=7h% zM)!vGFKwA!%*(AKi@s;@tIr>Q_4vte9#_{di~bdpJz;9rBy$(56SWa#!rl&8KbbrkVkEg~8B*==AAlIlh8A}|TWrq6G9QMrtGYIuZSKQt&nLspyG%9Qe1aWi zgE1TbIBE8+t3MLMQV8|$s{f_#2q?E-?6z2sv2RQH!8XeX73o?>X96(-TVk2IAbXaU zsx0Bak{n}xN~o)<1JjWE9X9C{7Tds#r%+59m*8J3Z=cmXUJ0rONT)EAy@Yg(p#vE3 z8Rm@SqDwp|f=zEn8uFJ_em{EBvg727TN+Dp$V~^xd7x@5VjdOd13W4x`NLGw{D0^< zxUX=D34@g%8<=IF1$P=qE#DXa&24Gc602!GB4JqWN`N!=>2Pd2)DFvitR*3i=r@5# z1@@rZ=A^&5yc3j;8pkbW=*dpB*OH!CRk2)E(XHZ}GD6lYBDP>8Nm`^3&=6udX8$cQ z?2?v}F{M^uE{D(tNUJ;v(Ac7+VkyDHeHGc$9q+p^F)~d97SkOcLrbdRrlxNo4eX7q zI3IuxdiX@w$8GI``MGk*rmXvF{&M_z5zfVwn?p76IPZ=Io*jkEHg(I zGcHL=9ioJ&?{T7Vt~b!HvrTbITM8-oOBsPiolc;d-&9&0N#CF1^wIgB@Ow!5)QMwV z@|6O+isVTK1ng0>L6nqQN|cya>g9&mjQ>AaTUfU|X77ERY>Kzw)Iet746Y00wo2+( zYWI`ae%s#?@}@u%pLrsk5y@0WOaGe4ucA|lw5dv7pfCb_kPDMqXEYUE8ei5O3k1F- zz$_bP;1$+wzM_+c~LhyXFq_Y%^}V zz{0%K?!Lm}999ebc%Y1J1L{JMatTOlztCist$1p4G5IZecCgADnM6zZL5;w24Jp zSSq8wY(i&lYJ|vAOkCV>vcyh`8zv9@R$`*7zP?!dE%EVPgvVcOx*tXhHQI9!rLGmO z#E>gwP%&Z^Nzvf)79{cFklslNbIEW%06xs3*ZdZBzHI55SJpzE7IGgEt^+xB$}Ehf z@0cdXspCk_BY;?p*tT7wv^D?M_C-AVkpnCXz1QkOd~-X>pJm|>ef?k z6{#YWTP2W)rO!R|yeagd!DK8R359VlZZNBs2NWf=>y%YKof5*xOyYnmNREvor|33* z(Y{F|_#|f18Smd6IS!AI&M8!I8Mrpqyy_POrtySj`9fWrU978w zc7A*+yF;PL=`s)|^ELy6lFHLpwGp2st$BIqO#oUD+>lw2V%ihfvNCT{nL(JMrIOKU zlJiUg8ab?xQ3UCcLYjq#n3S+nwUy#S8KI`|u005Pi)zqJ8T!%aQ;``O(gxTi&rwUo z7dwIA2QyUFSPN~_sunw5T^Q(>`95P03tN;3Ng~7&z%TDq6!S`xQnWvop^lR+ig)?c zk1av6izb>dE8(RZcw1JV+W3>(e7by*z$``+&<4QvYJ_eo6ty;Fh!q_zjbUG+l(Y)W zhhh>RZ>MmstQstG1(pnAf*Hp-G?x6f(&=7MUo^1ByNjt6hKyk3rTUR<`OsK`oaLjo z4-KxMMBW7xX^cZGo3UELr=B7!zp=#fY0cQ?kYnHJt!=TH?EDoU^tLVJp$%Oht^`|n zfOHjal0eVA#Fl8St-%jsobE*_R9$jGQtO^skDITp)Ru|GT~A0+T~dAVmPDfTKmn^o zqXSsdjgYEMnLgpxY!OoFj?$L8b>SEn^TsR5~PIUU|qs@-eP zpepYI+&b-xmryq^;XN5s=RnlCmmpZ)n8M&bo8-Nhbf$EWXZfp76T)>zJ{f-{4&i}h zr9p@fL8uW2r-tz9^SLgb2>Jz;Xdjq=tX(Mv52;<9xyY~;C0@N1=za_BRi@TfuwY~ZM_U2!0 ze*4KfVixs}KT`;S<_LP^m@Y8JE!-wn{s4Q*cNx2#dxk3Gd+*8pudOA=wgj&d4T_fw zX+TQZcNW1EceZOGSV<~cO)7bnEeuxkq6)bIn6PvSggdGt{qW+6*IZQe)YGBllDeK3 zVjWeui2!T57d{nCo+Z;3BrHBNfe)vG7vD8@YSD$kO&$5<49jlJ^>gOy$R-}-YRlFh z%>fU)-Gt`e7BC4=IBLO=#U zj8Xf%rLnP@^WhakVl+kaAQFg!KZi|}Pl51hr#xSy#HbL*YwWu`kvdWW}Gh<1nw?*_Q8J0pwCDjjsVlE;uS^+7_p$KOQLd(1K zmg4qG$jiHWmF&G5+_LU^U%mFiOPKe{ex}&LcaTbjgP?E-Wro1IoDL-knP5YjZ`uv= zW5y&bM{JmJHF&kMyo+Pu6h+g?90C!yEj2vBk>|AzEKzLMN{7n1PAQ;7oraAJ zL7R1$A!~KWYqppx=)oDbePKHo(y_Weil<=i=&=}%J0ms+tnL|A7r6uHOL(wSf(0Q& zB-a9dfA&tq-=hbQA3Q!XsT>d$rPJ|S;dZEkI?U`vn(p}xChU9IXj|agwJNR3jqMnk z4p46S0jDuGME-u4f&DcwitQ}(rrv+w=*+K9-GG|)UbgaeTMPD7lZHW_bz zpXC$!j*=Y`#B(F~KRvN!|FGc3-*1dc4=(pg!q<>w0euhZv;CT3tfkkB_2 z?p;AD&IV7c-TO%m9x;>htY^?rM21jy+rp#veYm}Bo~p|)&eV_6nevv%L8O#tDvak6 zk|3i_t*ye8_qZ!N6{Z(gf7s=W=sF^3h<-74;AQ_?xdXVT*<&oXt zNEXzk3EC7;dsVIyB{QWWlmYcfY%FmN9mW8vIv@ba6VfpA{#?UaNw}f01 zwuHygG%D+$3pAU1*x9OnfMg^%jtKO?;E=O@3J2INaKn<&tSnkBHe}5(J7Ee5g5%F? z>yi8%xpW<){nUj^EVVF_)6>}rgIB(YpV;qpZ1_?Ka9wm4g`vTl6nshpoSBHH&QFSA zK+d*U50g%MP^MHY@dMzbb}T)sOaJ2yCBvVn^S;>?!Na!|G#(7BUq6a!7?nFKA|`IY zz^JD=A+fGsgamownS!#QG_T_$9{i;lHh9%Ti135|Wuw1y22J@CdD}QL*e9*ytrf^3 z_6V?q=0@UV;{d4e7_*UQDNDwc%{Ch|`-0}d5nRXma)l5#Yn!VFs4PG2AN*BfEqS@e zb%hXL%mDx#9eOD3C#w0IS2*)=T8tiO>s|MGCP695LpqkXV2D)}H_)(|K91PY$Oy0K z16=ii^zvhX`8EYr=QIThp7v*VA00l_Q?20x#Zy~`5cc7drwj|+x^>Gs5u*U&jpYLZ zOsaf&^yp!W?l7i;;*oQeJHNR9WdG>v!vnbgA3fZ|s~$!}{6(_%9`|LGD*j;$TuK5Kv4Zr(SR-!KtlC>6KAJT?8f?jUkT})by5FO6XDg{)Zih&6zpx-#y<;VH zVN_*1GrSc9zDw9vI5zEojXsk*wSd6-Z7Y5@M6teW?jhr9+?$;7?J!c~p+raF!>#aq zdL)$hLmk+S5MQj*n{*}VqJEss5A@wG_bwjvYO_$5=t%dFa`w87Gw(Yv9y;gUA4wSXW!9T-rL)yJ{_r@;|t4f1q-N9RFDjOa~En5$D zTvaB+cg_F&?8)Og_n2k1tj?pqe0Rtd)j_{TylHBExBe#dr+&WE{0@I^UwRy@EIPMP z_JUEPJt7w)3k`J>VYla1RIPuyShO)p38FfPXAK1I;z8 z=egr@k>=lVV|5^zzKcl5sF`(Y75!O>1WQYB6q^Y*kZtxU0nc#+!EP_DwJ@|E6AFPx z69^kH-x-Wua<{MrsGWjd-6oKWwp%dQstf)Wte@J4he zaL&w{L|@o?pVxyiQuAj98R(Lv{P0An-qAC7G+C*BzF|KuBH-#Je=Bzz`&7?{weNcI zwr5zEj2}lYpl_&6Z~p3L6RG>1nvAWYVYsZ}tkhxml-rzOiy&KyZ)@@b zkT^@hc$+DUf3g#LW))5{zKkiUago-z*hy;OH4UWSWSG^N-~LkCLNN3%3$y5QBfY-Z zDPEuN7OyXMFW22)z7bI1U&W?@JNgT^NRc}HX2jB}fO+7bBc&Zw-B6T#n}M71<4%*3`Z=`R zt^HwpG|hT<@%p3-t@g22`xrCTc!YDHNXevAr7kjh#Rxi<6hQFAX%tQ!UZ=jcgfuIo)ou)QiEl_3lYK z-$yXx?!2}gsS!)=SjkUzez@#p)*O7i8<;YfXYA5}h15BE44z>Ro4kAsYk3Ty^cLN` zwb|iDo1~vOsvO&F(t~KL7^4?B4fWe*tv21++q<#;%kA@>&)4tVxp6z$*dpAq=AIgn z&?Bpdo=8p9+Ws|a-CX}20B!H>-NeN%Xn>l?Dp{Ie($>x%_`7p2HmS`Gd4BWR_Nt&U)_IMT@eb~vXQup%uz zxI|pbq`?`tp~+fkYagG2H|GsiQM&&AEj9&o=a6mv`Nl=z$=CV>`#7k=Io^>-F72;m_y|mRlXQQ#ywecx zC~&h2ocpO~9cxhkl4RF0&_l>Hm^)mohbqGfwuctx59`G7U zZqzCV^rkgnGRXD%0?$>0scv+>vn2}ze?^S;LgRO4^NV4&$D40(@HO_FHnykdw=V%i z9v!Y5AE1-`)x{X6*vA`0L3G_;6Un&ZLgOGR(7~TPxy_pi?z|)&q(qr!2aoR?y-=)JNfvRWGybQ~o0g_# z^ay*m9eD%jzp= z^@f-a!c)mtw??FKxC_veeas|)CC}h!GdV*-VqOwx za4cdAJFV6hpB1vA;MBn_k>9ce#pYZtf#R^R-3Z%cSPEQjA$doSF^9)Tgc%z_HfyR| zT%ue;j|1pc81wz6MkY%mve)Yf2+f!3cAzNW?(HxO)78#*HZFEH&UZI1b~m&;_PQPM zm$2Bf5*Sn^_wcn4Iu!N|=~JPMXPzY~UB(;BRqi|7MZ4I?JGPhNF=hpu1n1jghFcmI zR*SlFk)TY^r-*8B2q9r{b#P?g0gL5T0h5GR>}(d;V8L{cFY$$QQFlwELue5#)jV(i zm%;(BJxT&~lu&-Gd_WtR@lzhsh!wUBPv<$z?ZT|kTKpU0G&I~iOBhtJ9YbGaDBtc1 zC=s6i!mMM=j4;E?qC5zQ4IlbbX|wRMhcw_=hP-ecI-s?%vyi#pJet_Q+yf`6@f|eb zcuXBez6x3TX)=s&_l1K8;y_8R?`N%C-C^tJ%TleEjJ{xP!9AvAXb2$u^5+@gRAX+W z9Wq-mk+eSY$sYRow<-cFw4~&Ul@ds&V#*7jCU=W+Y^lrMZ$IDL+dF#JP>VT8KKBND zdzv`N1nZ{`zv<@I)8Lwy=G^A3h!VN$;2g_Z99)Mz0cvf=t$pwURvI^c{VTWuD~;Wo zw=QKkYzE0YxJe4THVZ?F(6=bP0V}Z_oCHegs~QcF>r)(mfrKeIqR!z=T8I0h z1{V_@OG?G0u-IEDtajIe^fM(1myjrbgZ;7FRX}Tc=mNNYZx4q(!JiB6hW8bJ;jiUi z`JGngU7?EIl!n)39t0MZdo8#Wd?K$G!LwSS z|43^r^>7_0IF)YUeRqXQNqb7W2wlth>!l-%E%tIEFi}mjJ^aiz=(fhNyBc_<3qUMv z3JZtVL%;-e7vSb%vmjZRX@VfOgv&b?l;n7&14D={!_rGch|FTbMG$!$PRW9SFd0K@ zBNb;hgVk)9rm&f?QGjk`fMm0Xr9CKY%HrquDzBTLZ+RPP0vJ59Uqv)=q4O@ zJjEU|+rQnFCB#b-3*eQ;NdZAt;NZ+y6rwGmelU62b>VRf{uIe?wq4e8S>s`;INrM9 z&ryM%<>D6eLU;icP<(=M(KIk2=oBrnoW9fpXum2>daG82E=WN-Pk8uma`1>zUUo*3E4disYnkK(ICE354Jp8#ej43m z;wY7c9TcZ8Ocer1#vmh-l#bj%9YbO4t@42&5t)GxWLF|?)p2^7A+>OHT09P|GUzoz zGL-hDu1XsqFkG^IV9GU(t)E7Cjqm_s)-z=Sikn_#ZPsA4h*ww;wFy4rp-^j8%{mEh z)48hU^RTNRwpHDzFi+*}>YD^gk9$LXrn|gVeZ;sH@kjl)ZU16<`>R$> zNM?trg1sC}3OR_`PSUhODQY5Nluf9}tUWRY)ZBRTFl9BSn2K!CJc%Gwo?kTBXzz6M z7BbUo>+r|R0VG_IFM5sODH6*HF?9(+!qLEl4oNg%o-Suyl+@@#LNqvfT9k@h9pas9 z^EsT#${&K4+B5weXBA^*+tbauN%f`AgJUJQu7qp?F!3MRvWD{C&&D$x$cx^JSymlP zjTIpDY6BE2_*Hl#)Wfk_i`9rGht{eW&tKuNthBkfi1zvGEV#<_Lb+XEj;(09JMPA( z@L%{!xDbL1m&FXqsON!aO%O$i{>nhy?KI-HJmw~M)998q36SM593NEg^at6nhv@*r z0s+Kkg$KYL=L{L+V9p^TlyAbgWF5Iv+gZOXA);*%+z`7N;ifTQOu*X2p*hFn27`4g zYDv9zCmSX)IS*04t9J%tzNnTbBqC(U{PWJ_9EoQLAP!%5PhM5_emU;Urnli@d*~;? zXut?7CbB;Aq0%zsExaRkMbilJX@8a?2Bc(87#7FFmR?ufEblfeviBVU%l7ycLYjkK zFB>;2j5}4_3RH|}O7^v^&Hrw@76VJiF`_l2bhA8f{T-f!lbm$d34bX`0~O0sFzAqtOr7-u;FVyIQOhSJ@G4aVsv$iC zhCwZ+EJ#DblajWm-06e+ioNZi00$Sc3}ekD$)&m+u54HqU~{jK*Z_2tB06-Eo$SwH{t zzw?_pCE0n_t#`8LM}KzhgMZ5wD3k*H$KOAG@pqr?|L*61f9)Fo{j>n^f1!yuMjqtu s-~LOP=qbp>(MxgsPrtub9!p@kWE>B_`m_JY4t;?C{tv!C`3GM8KkbjR=l}o! literal 0 HcmV?d00001 diff --git a/tasmota/berry/extensions/LVGL_Panel/autoexec.be b/tasmota/berry/extensions/LVGL_Panel/autoexec.be new file mode 100644 index 000000000..5c2dd8260 --- /dev/null +++ b/tasmota/berry/extensions/LVGL_Panel/autoexec.be @@ -0,0 +1,6 @@ +# rm LVGL_Panel.tapp; zip -j -0 LVGL_Panel.tapp LVGL_Panel/autoexec.be LVGL_Panel/lvgl_panel.be LVGL_Panel/manifest.json +do # embed in `do` so we don't add anything to global namespace + import introspect + var leds_panel = introspect.module('lvgl_panel', true) # load module but don't cache + tasmota.add_extension(leds_panel) +end diff --git a/tasmota/berry/extensions/LVGL_Panel/lvgl_panel.be b/tasmota/berry/extensions/LVGL_Panel/lvgl_panel.be new file mode 100644 index 000000000..1c37f9296 --- /dev/null +++ b/tasmota/berry/extensions/LVGL_Panel/lvgl_panel.be @@ -0,0 +1,1096 @@ +# +# lvgl_panel.be - implements a real-time mirroring of LVGL display on the main page +# +# Copyright (C) 2025 Stephan Hadinger & Theo Arends +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# make sure we use `webserver_async` if it's already solidified +if !global.contains("webserver_async") || type(global.webserver_async) != 'class' + class webserver_async + ############################################################# + # class webserver_async_cnx + # + # This instance represents an active connection between + # the server and a client (TCP connection) + ############################################################# + static class webserver_async_cnx + var server # link to server object + var cnx # holds the tcpclientasync instance + var close_after_send # if true, close after we finished sending the out_buffer + var fastloop_cb # cb for fastloop + var buf_in # incoming buffer + var buf_in_offset + var buf_out + var phase # parsing phase: 0/ status line, 1/ headers, 2/ payload + # request + var req_verb # verb for request (we support only GET) + var req_uri # URI for request + var req_version # HTTP version for request + var header_host # 'Host' header - useful for redirections + # response + var resp_headers # (string) aggregate headers + var chunked # if true enable chunked encoding (default true) + # conversion + static var CODE_TO_STRING = { + # 100: "Continue", + 200: "OK", + # 204: "No Content", + 301: "Moved Permanently", + # 400: "Bad Request", + # 401: "Unauthorized", + # 403: "Payment Required", # not sure it's useful in Tasmota context + 404: "Not Found", + 500: "Internal Server Error", + # 501: "Not Implemented" + } + + ############################################################# + # init + # + # Called when a new connection is received from a client + # Arg: + # - server : main instance of `webserver_async` server + # - cnx : instance of `tcpclientasync` + # + # By default: + # version is HTTP/1.1 + # response is chunked-encoded + def init(server, cnx) + self.server = server + self.cnx = cnx + self.buf_in = '' + self.buf_in_offset = 0 + self.buf_out = bytes() + self.phase = 0 # 0 = status line + # util + self.close_after_send = false + # response + self.resp_headers = '' + self.chunked = true + # register cb + self.fastloop_cb = def () self.loop() end # the closure needs to be kept, to allow removal of fast_loop later + tasmota.add_fast_loop(self.fastloop_cb) + end + + ############################################################# + # set_chunked: sets whether the response is chunked encoded + # true by default + # + def set_chunked(chunked) + self.chunked = bool(chunked) + end + + ############################################################# + # connected: returns `true` if the connection is still open + # + def connected() + return self.cnx ? self.cnx.connected() : false + end + + ############################################################# + # buf_out_empty: returns `true` if out buffer is empty, + # i.e. all content was sent to client + # + def buf_out_empty() + return size(self.buf_out) == 0 + end + + ############################################################# + # _write: (internal method) write bytes + # + # Arg: + # v must be bytes() + # + def _write(v) + var sz_v = size(v) + if (sz_v == 0) return end # do nothing if empty content + + var buf_out = self.buf_out # keep a copy of reference in local variable (avoids multiple dereferencing) + var buf_out_sz = size(buf_out) + buf_out.resize(buf_out_sz + sz_v) + buf_out.setbytes(buf_out_sz, v) + + self._send() # try sending `self.buf_out` now + end + + ############################################################# + # close: close the connection to client + # + # Can be called multiple times + # Does nothing if connection is already closed + # + def close() + # log(f"WEB: closing cnx", 3) + if (self.cnx != nil) self.cnx.close() end + self.cnx = nil + end + + ############################################################# + # loop: called by fastloop every 5 ms + # + def loop() + if self.cnx == nil # if connection is closed, this instance is marked for deletion + tasmota.remove_fast_loop(self.fastloop_cb) # remove from fast_loop + self.fastloop_cb = nil # fastloop_cb can be garbage collected + return + end + + self._send() # try sending any pending output data + + var cnx = self.cnx # keep copy + if (cnx == nil) return end # it's possible that it was closed after _send() + + # any new incoming data received? + if cnx.available() > 0 + var buf_in_new = cnx.read() # read bytes() object + if (!self.buf_in) # use the same instance if none present + self.buf_in = buf_in_new + else # or append to current incoming buffer + self.buf_in += buf_in_new + end + end + + # parse incoming data if any + if (self.buf_in) + self.parse() + end + end + + ############################################################# + # _send: (internal method) try sending pendin data out + # + # the content is in `self.buf_out` + # + def _send() + # any data waiting to go out? + var cnx = self.cnx + if (cnx == nil) return end # abort if connection is closed + + var buf_out = self.buf_out # keep reference in local variable + if size(buf_out) > 0 + if cnx.listening() # is the client ready to receive? + var sent = cnx.write(buf_out) # send the buffer, `sent` contains the number of bytes actually sent + if sent > 0 # did we succeed in sending anything? + # we did sent something + if sent >= size(buf_out) # the entire buffer was sent, clear it + # all sent + self.buf_out.clear() + else # buffer was sent partially, remove what was sent from `out_buf` + # remove the first bytes already sent + self.buf_out.setbytes(0, buf_out, sent) # copy to index 0 (start of buffer), content from the same buffer starting at offset 'sent' + self.buf_out.resize(size(buf_out) - sent) # shrink buffer + end + end + end + else + # empty buffer, do the cleaning + # self.buf_out.clear() # TODO not needed? + # self.buf_in_offset = 0 # TODO really useful? + + if self.close_after_send # close connection if we have sent everything + self.close() + end + end + end + + ############################################################# + # parse incoming + # + # pre: self.buf_in is not empty + # post: self.buf_in has made progress (smaller or '') + def parse() + # log(f"WEB: incoming {bytes().fromstring(self.buf_in).tohex()}", 3) + if self.phase == 0 + self.parse_http_req_line() + elif self.phase == 1 + self.parse_http_headers() + elif self.phase == 2 + self.parse_http_payload() + end + end + + ############################################################# + # parse incoming request + # + # pre: self.buf_in is not empty + # post: self.buf_in has made progress (smaller or '') + def parse_http_req_line() + var m = global._re_http_srv.match2(self.buf_in, self.buf_in_offset) + # Ex: "GET / HTTP/1.1\r\n" + if m + var offset = m[0] + self.req_verb = m[1] # GET/POST... + self.req_uri = m[2] # / + self.req_version = m[3] # "1.0" or "1.1" + self.phase = 1 # proceed to parsing headers + self.buf_in = self.buf_in[offset .. ] # remove what we parsed + if tasmota.loglevel(4) + log(f"WEB: HTTP verb: {self.req_verb} URI: '{self.req_uri}' Version:{self.req_version}", 4) + end + self.parse_http_headers() + elif size(self.buf_in) > 100 # if no match and we still have 100 bytes, then it fails + log("WEB: error invalid request", 4) + self.close() + self.buf_in = '' + end + end + + ############################################################# + # parse incoming headers + def parse_http_headers() + while true + # print("parse_http_headers", "self.buf_in_offset=", self.buf_in_offset) + var m = global._re_http_srv_header.match2(self.buf_in, self.buf_in_offset) + # print("m=", m) + # Ex: [32, 'Content-Type', 'application/json'] + if m + self.event_http_header(m[1], m[2]) + self.buf_in_offset += m[0] + else # no more headers + var m2 = global._re_http_srv_body.match2(self.buf_in, self.buf_in_offset) + if m2 + # end of headers + # we keep \r\n which is used by pattern + self.buf_in = self.buf_in[self.buf_in_offset + m2[0] .. ] # truncate + self.buf_in_offset = 0 + + # self.event_http_headers_end() # no more headers + self.phase = 2 + self.parse_http_payload() # continue to parsing payload + end + if size(self.buf_in) > 1024 # we don't accept a single header larger than 1KB + log("WEB: error header is bigger than 1KB", 4) + self.close() + self.buf_in = '' + end + return + end + end + + end + + ############################################################# + # event_http_header: method called for each header received + # + # Default implementation only stores "Host" header + # and ignores all other headers + # + # Args: + # header_key: string + # header_value: string + # + def event_http_header(header_key, header_value) + # log(f"WEB: header key '{header_key}' = '{header_value}'") + + if (header_key == "Host") + self.header_host = header_value + end + end + + ############################################################# + # event_http_headers_end: called afte all headers are received + # + # By default does nothing + # + # def event_http_headers_end() + # end + + ############################################################# + # parse incoming payload (if any) + # + # Calls the server's dispatcher with 'verb' and 'uri' + # + # Payload is in `self.buf_in` + # + def parse_http_payload() + # log(f"WEB: parsing payload '{bytes().fromstring(self.buf_in).tohex()}'") + # dispatch request before parsing payload + self.server.dispatch(self, self.req_uri, self.req_verb) + end + + + ############################################################# + # Responses + ############################################################# + # send_header: add header to the response + # + # Args: + # name: key of header + # value: value of header + # first: if 'true' prepend, or append if 'false' + def send_header(name, value, first) + if first + self.resp_headers = f"{name}: {value}\r\n{self.resp_headers}" + else + self.resp_headers = f"{self.resp_headers}{name}: {value}\r\n" + end + end + + ############################################################# + # send: send response to client + # + # Args + # code: (int) http code (ex: 200) + # content_type: (string, opt) MIME type, "text/html" if not specified + # content: (bytes or string, opt) first content to send to client (you can send more later) + # + def send(code, content_type, content) + var response = f"HTTP/1.1 {code} {self.CODE_TO_STRING.find(code, 'UNKNOWN')}\r\n" + self.send_header("Content-Type", content_type ? content_type : "text/html", true) + + self.send_header("Accept-Ranges", "none") + # chunked encoding? + if self.chunked + self.send_header("Transfer-Encoding", "chunked") + end + # cors? + if self.server.cors + self.send_header("Access-Control-Allow-Origin", "*") + self.send_header("Access-Control-Allow-Methods", "*") + self.send_header("Access-Control-Allow-Headers", "*") + end + # others + self.send_header("Connection", "close") + + response += self.resp_headers + response += "\r\n" + self.resp_headers = nil + + # send status-line and headers + self.write_raw(response) + + # send first part of content + if (content) self.write(content) end + end + + ############################################################# + # write: writes a bytes or string piece of content + # + # If chunked encoding is enabled, it is sent as a separate chunk + # + # If content is empty, it can be sent as an empty chunk + # which is an indicator of end-of-content + # + def write(v) + if type(v) == 'string' # if string, convert to bytes + v = bytes().fromstring(v) + end + + # use chunk encoding + if self.chunked + var p1 = self.server.p1 + p1.clear() + p1.append(f"{size(v):X}\r\n") + p1.append(v) + p1.append("\r\n") + + # log(f"WEB: sending chunk '{p1.tohex()}'") + self._write(p1) + else + self._write(v) + end + end + + ############################################################# + # write_raw: low-level write of string or bytes (without chunk encoding) + # + # If content is empty, nothing is sent + # + def write_raw(v) + if (size(v) == 0) return end + + if type(v) == 'string' # if string, convert to bytes + v = bytes().fromstring(v) + end + + self._write(v) + end + + ############################################################# + # content_stop: signal that the response is finished + # + def content_stop() + self.write('') # send 'end-of-content' for chunked encoding + self.close_after_send = true # close connection when everything was sent to client + end + end + + ####################################################################### + # class webserver_async_dispatcher + # + # Pre-register callbacks triggered when a certain URL is accessed + # + # You can register either a pure function or a method and an instance + # + # Pure function: + # webserver_async_dispatcher(uri_prefix, nil, func, verb) + # will call: + # func(cnx, uri, verb) + # + # Instance and method: + # webserver_async_dispatcher(uri_prefix, instance, method, verb) + # will call: + # insatnce.method(cnx, uri, verb) + # + # Args in: + # uri_prefix: prefix string for matchin URI, must start with '/' + # cb_obj: 'nil' for pure function or instance from which we call a method + # cb_mth: pure function or method to call + # verb: verb to match, only supported: 'GET' or 'nil' for any + # + # Args of callback: + # cnx: instance of 'webserver_async_cnx' for the current connection + # uri: full uri of request + # verb: verb received (currently only GET is supported) + ####################################################################### + static class webserver_async_dispatcher + var uri_prefix # prefix string, must start with '/' + var verb # verb to match, or nil for ANY + var cb_obj # callback object (sent as first argument if not 'nil') + var cb_mth # callback function + + def init(uri_prefix, cb_obj, cb_mth, verb) + self.uri_prefix = uri_prefix + self.cb_obj = cb_obj + self.cb_mth = cb_mth + self.verb = verb + end + + # return true if matched + def dispatch(cnx, uri, verb) + import string + if string.find(uri, self.uri_prefix) == 0 + var match = false + if (self.verb == nil) || (self.verb == verb) + # method is valid + var cb_obj = self.cb_obj + if (cb_obj != nil) + self.cb_mth(self.cb_obj, cnx, uri, verb) + else + self.cb_mth(cnx, uri, verb) + end + return true + end + end + return false + end + end + + ############################################################# + # class webserver_async + # + # This is the main class to call + ############################################################# + var local_port # listening port, 80 is already used by Tasmota + var server # instance of `tcpserver` + var fastloop_cb # closure used by fastloop + # var timeout # default timeout for tcp connection + var connections # list of active connections + # var auth # web authentication string (Basic Auth) or `nil`, in format `user:password` as bade64 + # var cmd # GET url command + var dispatchers + # copied in each connection + var chunked # if true enable chunked encoding (default true) + var cors # if true send CORS headers (default false) + # + var p1 # temporary object bytes() to avoid reallocation + + # static var TIMEOUT = 1000 # default timeout: 1000ms + # static var HTTP_REQ = "^(\\w+) (\\S+) HTTP\\/(\\d\\.\\d)\r\n" + # static var HTTP_HEADER_REGEX = "([A-Za-z0-9-]+): (.*?)\r\n" # extract a header with its 2 parts + # static var HTTP_BODY_REGEX = "\r\n" # end of headers + + ############################################################# + # init + def init(port, timeout) + # if (timeout == nil) timeout = self.TIMEOUT end + # if (timeout == nil) timeout = 1000 end + self.connections = [] + self.dispatchers = [] + self.server = tcpserver(port) # throws an exception if port is not available + self.chunked = true + self.cors = false + self.p1 = bytes(100) # reserve 100 bytes by default + # TODO what about max_clients ? + self.compile_re() + # register cb + tasmota.add_driver(self) + self.fastloop_cb = def () self.loop() end + tasmota.add_fast_loop(self.fastloop_cb) + end + + ############################################################# + # compile once for all the regex + def compile_re() + import re + if !global.contains("_re_http_srv") + # global._re_http_srv = re.compile(self.HTTP_REQ) + # global._re_http_srv_header = re.compile(self.HTTP_HEADER_REGEX) + # global._re_http_srv_body = re.compile(self.HTTP_BODY_REGEX) + global._re_http_srv = re.compile("^(\\w+) (\\S+) HTTP\\/(\\d\\.\\d)\r\n") + global._re_http_srv_header = re.compile("([A-Za-z0-9-]+): (.*?)\r\n") + global._re_http_srv_body = re.compile("\r\n") + end + end + + ############################################################# + # enable or disable chunked mode (enabled by default) + def set_chunked(chunked) + self.chunked = bool(chunked) + end + + ############################################################# + # enable or disable CORS mode (enabled by default) + def set_cors(cors) + self.cors = bool(cors) + end + + ############################################################# + # Helper function to encode integer as hex (uppercase) + static def bytes_format_hex(b, i, default) + b.clear() + if (i == nil) b .. default return end + # sanity check + if (i < 0) i = -i end + if (i < 0) return end # special case for MININT + if (i == 0) b.resize(1) b[0] = 0x30 return end # return bytes("30") + + b.resize(8) + var len = 0 + while i > 0 + var digit = i & 0x0F + if (digit < 10) + b[len] = 0x30 + digit + else + b[len] = 0x37 + digit # 0x37 = 0x41 ('A') - 10 + end + len += 1 + i = (i >> 4) + end + # reverse order + b.resize(len) + b.reverse() + end + + ############################################################# + # Helper function to encode integer as int + static def bytes_append_int(b, i, default) + var sz = size(b) + if (i == 0) # just append '0' + b.resize(sz + 1) + b[sz] = 0x30 + elif (i != nil) # we have a non-zero value + var negative = false + # sanity check + if (i < 0) i = -i negative = true end + if (i < 0) return b end # special case for MININT + + if negative + b.resize(sz + 1) + b[sz] = 0x2D + sz += 1 + end + + var start = sz + while i > 0 + var digit = i % 10 + b.resize(sz + 1) + b[sz] = 0x30 + digit + sz += 1 + i = (i / 10) + end + # reverse order starting where the integer is + b.reverse(start) + + else # i is `nil`, append default + b.append(default) + end + return b + end + + ############################################################# + # closing web server + def close() + tasmota.remove_driver(self) + tasmota.remove_fast_loop(self.fastloop_cb) + self.fastloop_cb = nil + self.server.close() + + # close all active connections + for cnx: self.connections + cnx.close() + end + self.connections = nil # and free memory + end + + ############################################################# + # clean connections + # + # Remove any connections that is closed or in error + def clean_connections() + var idx = 0 + while idx < size(self.connections) + var cnx = self.connections[idx] + # remove if not connected + if !cnx.connected() + # log("WEB: does not appear to be connected") + cnx.close() + self.connections.remove(idx) + else + idx += 1 + end + end + end + + ############################################################# + # called by fastloop + def loop() + self.clean_connections() + # check if any incoming connection + while self.server.hasclient() + # retrieve new client + var cnx = self.webserver_async_cnx(self, self.server.acceptasync()) + cnx.set_chunked(self.chunked) + self.connections.push(cnx) + end + end + + ############################################################# + # add to dispatcher + def on(prefix, obj, mth, verb) + var dispatcher = self.webserver_async_dispatcher(prefix, obj, mth, verb) + self.dispatchers.push(dispatcher) + end + + ############################################################# + # add to dispatcher + def dispatch(cnx, uri, verb) + var idx = 0 + while idx < size(self.dispatchers) + if (self.dispatchers[idx].dispatch(cnx, uri, verb)) + return + end + idx += 1 + end + # fallback unsupported request + cnx.send(500, "text/plain") + cnx.write("Unsupported") + cnx.content_stop() + end + + end + + # assign the class to a global + global.webserver_async = webserver_async +end + +class lvgl_panel + var port + var web + var p1 # bytes() object reused when generating payload + var feeders + var _cb # callback to paint + + # static var SAMPLING = 100 + static var PORT = 8881 # default port 8881 + + static var HTML_HEAD1 = + "" + static var HTML_URL_F = + "" + static var HTML_HEAD2 = + '' + '' + '' + '' + static var HTML_CONTENT = + '' + '' + '' + '' + '
' + '' + '
' + static var HTML_END = + '' + '' + + def init(port) + if (port == nil) port = self.PORT end + self.port = port + + self.p1 = bytes(100) + self.feeders = [] + + # start network part + if tasmota.is_network_up() + self.init_network() + else + tasmota.when_network_up(/ -> self.init_network()) + end + end + + def init_network() + self.web = global.webserver_async(self.port) + + self.web.set_chunked(true) + self.web.set_cors(true) + self.web.on("/lvgl_feed", self, self.send_info_feed) # feed with lvgl pixels + self.web.on("/lvgl_touch", self, self.touch_received, "POST") # virtual touch screen + self.web.on("/lvgl", self, self.send_info_page) + + import cb + self._cb = cb.gen_cb(def (x1,y1,x2,y2,pixels) self.paint_cb(x1,y1,x2,y2,pixels) end) + lv.set_paint_cb(self._cb) + + tasmota.add_driver(self) + end + + ################################################################################# + # unload + # + # Uninstall the extension and deallocate all resources + ################################################################################# + def unload() + import introspect + import cb + self.close() # stop server + if (self._cb != nil) + lv.set_paint_cb(introspect.toptr(0)) # remove the paint_cb + cb.free_cb(self._cb) # free the cb + self._cb = nil + end + tasmota.remove_driver(self) # remove driver, normally already done by tasmota.unload_ext + global.undef("webserver_async") # free `webserver_async` if it was loaded as part of this file + end + + def close() + tasmota.remove_driver(self) + self.web.close() + end + + def update() + end + + def touch_received(cnx, uri, verb) + # log(f">>>TS: touch_received {uri=} {verb=} {cnx.buf_in=}") + cnx.close() + # Example of events: + # {"x":376,"y":258} + import json + import display + var touch = json.load(cnx.buf_in) # POST payload + if (touch == nil) + log(f"LVG: received invalid touch event '{cnx.buf_in}'") + return + end + + if (tasmota.loglevel(4)) + log(f"LVG: received touch event '{touch}'") + end + + display.touch_update(1, touch.find('x', 0), touch.find('y', 0), 0) + end + + def paint_cb(x1,y1,x2,y2,pixels) + if (size(self.feeders) == 0) return end # nothing to do if no feeders + + import introspect + var pixels_count = (x2-x1+1) * (y2-y1+1) + var pixels_bytes = bytes(introspect.toptr(pixels), pixels_count * 2) + #log(f">>>>>: {x1=} {x2=} {y1=} {y2=} {pixels_count=} {size(pixels_bytes)=}") + + var bytes_per_line = (x2 - x1 + 1) * 2 + var lines_remaining = (y2 - y1 + 1) + var lines_per_msg = 2000 / bytes_per_line + var bytes_per_msg = lines_per_msg * bytes_per_line + var y = y1 + var offset_bytes = 0 + + #log(f">>>>>: {x1=} {x2=} {y1=} {y2=} {bytes_per_line=} {lines_per_msg=} {bytes_per_msg=}") + + while lines_remaining > 0 + # compute the workload + # var payload = pixels_bytes[offset_bytes .. offset_bytes + bytes_per_msg - 1].tob64() # string in base64 + + var idx = 0 + var lines_to_send = (lines_per_msg > lines_remaining) ? lines_remaining : lines_per_msg + var bytes_to_send = lines_to_send * bytes_per_line + while idx < size(self.feeders) + self.feeders[idx].send_feed(x1, y, x2, y + lines_to_send - 1, pixels_bytes, offset_bytes, bytes_to_send) + idx += 1 + end + + # move to next message + offset_bytes += bytes_to_send + y += lines_to_send + lines_remaining -= lines_to_send + end + + # log(f">>>: paint {x1=} {y1=} {x2=} {y2=} {pixels_count=}", 2) + end + + def add_feed(feed) + if self.feeders.find(feed) == nil # make sure it's not already in the list + self.feeders.push(feed) + end + # enforce paint_cb the first time and if it changed over time + lv.set_paint_cb(self._cb) + end + + def remove_feed(feed) + var idx = self.feeders.find(feed) + if idx != nil + self.feeders.remove(idx) + end + end + + def send_info_page(cnx, uri, verb) + import string + var height = lv.get_ver_res() + var width = lv.get_hor_res() + + var host = cnx.header_host + var host_split = string.split(host, ':') # need to make it stronger + var ip = host_split[0] + var port = 80 + if size(host_split) > 1 + port = int(host_split[1]) + end + + cnx.send(200, "text/html") + cnx.write(self.HTML_HEAD1) + cnx.write(format(self.HTML_URL_F, ip, port)) + cnx.write(self.HTML_HEAD2) + cnx.write(format(self.HTML_CONTENT, width, height)) + cnx.write(self.HTML_END) + + cnx.content_stop() + end + + static class feeder + var app # overarching app (debug_panel) + var cnx # connection object + var w, h + + def init(app, cnx) + self.app = app + self.cnx = cnx + self.w = lv.get_hor_res() + self.h = lv.get_ver_res() + #tasmota.add_driver(self) + end + + def close() + self.app.remove_feed(self) + end + + # payload is max 16KB + def send_feed(x1, y1, x2, y2, pixels, idx, len) + var cnx = self.cnx + if !cnx.connected() + self.close() + return nil + end + + var server = self.cnx.server + # if cnx.buf_out_empty() + # if out buffer is not empty, do not send any new information + var app = self.app + var p1 = app.p1 + + p1.clear() + p1.append("id:") + server.bytes_append_int(p1, tasmota.millis()) + p1.append("\r\nevent:lvgl\r\ndata:") + + p1.append('{"x1":') + server.bytes_append_int(p1, x1) + p1.append(',"x2":') + server.bytes_append_int(p1, x2) + p1.append(',"y1":') + server.bytes_append_int(p1, y1) + p1.append(',"y2":') + server.bytes_append_int(p1, y2) + p1.append(',"b64":"') + p1.appendb64(pixels, idx, len) + p1.append('"}\r\n\r\n') + cnx.write(p1) + # end + end + + end + + def send_info_feed(cnx, uri, verb) + cnx.set_chunked(false) # no chunking since we use EventSource + cnx.send(200, "text/event-stream") + # + var feed = feeder(self, cnx) + self.add_feed(feed) + lv.scr_act().invalidate() # force a screen redraw for any new connection + end + + def web_add_main_button() + self.send_iframe_code() + end + + def send_iframe_code() + import webserver + self.update() + var ip = tasmota.wifi().find('ip') + if (ip == nil) + ip = tasmota.eth().find('ip') + end + if (ip != nil) + var height = lv.get_ver_res() + 10 + var width = lv.get_hor_res() + 20 + if (width < 340) width = 340 end + webserver.content_send( + f'' + '' + '' + '' + '' + '' + '
' + '
' + '' + '' + '' + '' + '
' + '
' + '' + ) + webserver.content_send( + '' + ) + end + end + +end + +return lvgl_panel() diff --git a/tasmota/berry/extensions/LVGL_Panel/manifest.json b/tasmota/berry/extensions/LVGL_Panel/manifest.json new file mode 100644 index 000000000..751e702e6 --- /dev/null +++ b/tasmota/berry/extensions/LVGL_Panel/manifest.json @@ -0,0 +1,8 @@ +{ + "name": "LVGL Panel", + "version": "0x190A0100", + "description": "Realtime display of the LVGL display in browser", + "author": "Stephan Hadinger", + "min_tasmota": "0x0F010002", + "features": "display" +} \ No newline at end of file From e3880f4b5b37663e898146e159ce249828b94133 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Wed, 15 Oct 2025 10:37:14 +0200 Subject: [PATCH 014/136] Add TasmotaLED documentation (AI generated) --- lib/lib_basic/TasmotaLED/README.md | 242 +++ .../TasmotaLED/TASMOTALED_DOCUMENTATION.md | 1493 +++++++++++++++++ 2 files changed, 1735 insertions(+) create mode 100644 lib/lib_basic/TasmotaLED/README.md create mode 100644 lib/lib_basic/TasmotaLED/TASMOTALED_DOCUMENTATION.md diff --git a/lib/lib_basic/TasmotaLED/README.md b/lib/lib_basic/TasmotaLED/README.md new file mode 100644 index 000000000..79eea1962 --- /dev/null +++ b/lib/lib_basic/TasmotaLED/README.md @@ -0,0 +1,242 @@ +# TasmotaLED + +A lightweight, high-performance library for controlling addressable LED strips on ESP32 microcontrollers. + +## Overview + +TasmotaLED is a streamlined replacement for NeoPixelBus, designed specifically for the Tasmota firmware. It focuses on efficient pixel pushing with minimal memory overhead while supporting multiple hardware acceleration methods. + +**Key Features:** +- Hardware-accelerated via RMT (preferred), SPI, or I2S +- Support for WS2812 and SK6812 LED strips +- 3-byte (RGB) and 4-byte (RGBW) pixel formats +- Flexible pixel ordering (GRB, RGB, RBG, BRG, BGR, GBR) +- Minimal memory footprint (2 buffers only) +- ESP32 platform exclusive + +## Quick Start + +```cpp +#include "TasmotaLED.h" +#include "TasmotaLEDPusher.h" + +// Create 60-LED WS2812 strip on GPIO 5 +TasmotaLED strip(ws2812_grb, 60); + +void setup() { + TasmotaLEDPusher *pusher = TasmotaLEDPusher::Create(TasmotaLed_HW_Default, 5); + strip.SetPusher(pusher); + strip.Begin(); + + // Set colors and display + strip.ClearTo(0xFF0000); // All red + strip.Show(); +} +``` + +## Architecture + +### Class Hierarchy + +``` +┌─────────────────────────────────────┐ +│ TasmotaLED │ +│ ┌──────────────┐ ┌──────────────┐│ +│ │ _buf_work │ │ _buf_show ││ +│ │ (editable) │─▶│ (internal) ││ +│ └──────────────┘ └──────────────┘│ +└──────────────┬──────────────────────┘ + │ uses + ▼ +┌──────────────────────────────────────┐ +│ TasmotaLEDPusher (Abstract) │ +└──────────────┬───────────────────────┘ + │ + ┌───────┼───────┐ + ▼ ▼ ▼ + ┌─────┐ ┌─────┐ ┌─────┐ + │ RMT │ │ SPI │ │ I2S │ + └─────┘ └─────┘ └─────┘ +``` + +### Hardware Support + +| Hardware | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C2 | ESP32-C6 | +|----------|-------|----------|----------|----------|----------|----------| +| **RMT** | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | +| **SPI** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| **I2S** | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | + +**Selection Priority:** RMT → I2S → SPI (auto-selected based on SOC capabilities) + +## Configuration + +### LED Type Encoding + +LED types are encoded in a 16-bit value: + +``` +Bits 15-8: Timing (WS2812=0, SK6812=1) +Bit 7: W Position (0=after RGB, 1=before RGB) +Bits 6-4: Pixel Order (GRB, RGB, BGR, etc.) +Bits 3-0: Bytes/Pixel (3=RGB, 4=RGBW) +``` + +**Predefined Types:** +```cpp +ws2812_grb // WS2812 with GRB ordering (most common) +sk6812_grbw // SK6812 with GRBW ordering +sk6812_grb // SK6812 with GRB ordering (no white) +``` + +**Custom Types:** +```cpp +uint16_t custom = TasmotaLed_3_RGB | // 3 bytes per pixel + TasmotaLed_RGB | // RGB ordering + TasmotaLed_WS2812; // WS2812 timing +``` + +### Pixel Ordering Options + +| Enum | Order | Description | +|------|-------|-------------| +| `TasmotaLed_GRB` | G, R, B | Green-Red-Blue (default) | +| `TasmotaLed_RGB` | R, G, B | Red-Green-Blue | +| `TasmotaLed_BGR` | B, G, R | Blue-Green-Red | +| `TasmotaLed_RBG` | R, B, G | Red-Blue-Green | +| `TasmotaLed_BRG` | B, R, G | Blue-Red-Green | +| `TasmotaLed_GBR` | G, B, R | Green-Blue-Red | + +## Timing Specifications + +### WS2812 Timing +``` +T0H: 400ns (bit 0 high time) +T0L: 850ns (bit 0 low time) +T1H: 800ns (bit 1 high time) +T1L: 450ns (bit 1 low time) +Reset: 80µs (reset pulse) +``` + +### SK6812 Timing +``` +T0H: 300ns (bit 0 high time) +T0L: 900ns (bit 0 low time) +T1H: 600ns (bit 1 high time) +T1L: 600ns (bit 1 low time) +Reset: 80µs (reset pulse) +``` + +### RMT Implementation +- Clock: 40 MHz (25ns resolution) +- Precision: ±25ns per timing parameter +- Memory: 192 symbols per channel +- Non-blocking with DMA + +### SPI Implementation +- Clock: 2.5 MHz +- Encoding: 3 SPI bits per LED bit +- Bit 0: `100` pattern +- Bit 1: `110` pattern +- Memory: 3× pixel buffer size + +## Memory Usage + +| Configuration | Memory Required | +|---------------|-----------------| +| 60 RGB pixels | ~460 bytes | +| 144 RGB pixels | ~964 bytes | +| 300 RGB pixels | ~1,900 bytes | +| 512 RGB pixels | ~3,172 bytes | +| 60 RGBW pixels | ~580 bytes | + +**Formula:** `~100 bytes + (2 × pixels × bytes_per_pixel)` + +**SPI Additional:** Add `3 × pixels × bytes_per_pixel` for encoding buffer + +## Performance + +### Transmission Times (WS2812/SK6812) +- 60 pixels: ~1.8 ms (max 555 Hz) +- 144 pixels: ~4.3 ms (max 232 Hz) +- 300 pixels: ~9.0 ms (max 111 Hz) +- 512 pixels: ~15.4 ms (max 65 Hz) + +### CPU Overhead +- **RMT:** <1% during transmission (DMA-based) +- **SPI:** <2% during transmission (DMA-based) +- **Format conversion:** ~124 µs for 512 RGB pixels + +## API Highlights + +### Core Methods + +```cpp +// Initialization +bool Begin() +void SetPusher(TasmotaLEDPusher *pusher) + +// Pixel manipulation +void SetPixelColor(int32_t index, uint32_t wrgb) +uint32_t GetPixelColor(int32_t index) +void ClearTo(uint32_t rgbw, int32_t first = 0, int32_t last = -1) + +// Display +void Show() +bool CanShow() + +// Configuration +void SetPixelCount(uint16_t num_leds) +void SetPixelSubType(uint8_t type) + +// Query +uint16_t PixelCount() const +uint8_t PixelSize() const +uint8_t * Pixels() const +``` + +### Color Format + +**RGB Strips (3 bytes):** +```cpp +0xRRGGBB +// Example: 0xFF0000 = Red +``` + +**RGBW Strips (4 bytes):** +```cpp +0xWWRRGGBB +// Example: 0xFF000000 = Pure white (W channel) +// Example: 0x00FF0000 = Red (RGB channels) +``` + +## Compile-Time Configuration + +Enable/disable hardware support: + +```cpp +#define TASMOTALED_HARDWARE_RMT 1 // Enable RMT (default: 1) +#define TASMOTALED_HARDWARE_SPI 0 // Enable SPI (default: 0) +#define TASMOTALED_HARDWARE_I2S 0 // Enable I2S (default: 0) +``` + +**Note:** If no hardware is enabled, SPI is automatically enabled as fallback. + +## Documentation + +For complete documentation including detailed API reference, integration guide, troubleshooting, and advanced usage, see: + +**[TASMOTALED_DOCUMENTATION.md](TASMOTALED_DOCUMENTATION.md)** + +## License + +GNU General Public License v3.0 + +Copyright (C) 2024 Stephan Hadinger + +## Credits + +- **Author:** Stephan Hadinger +- **Project:** Tasmota Firmware +- **Inspired by:** NeoPixelBus library +- **RMT Encoder:** Based on ESP-IDF examples diff --git a/lib/lib_basic/TasmotaLED/TASMOTALED_DOCUMENTATION.md b/lib/lib_basic/TasmotaLED/TASMOTALED_DOCUMENTATION.md new file mode 100644 index 000000000..f7f5c0dfa --- /dev/null +++ b/lib/lib_basic/TasmotaLED/TASMOTALED_DOCUMENTATION.md @@ -0,0 +1,1493 @@ +# TasmotaLED Library Documentation + +## Executive Summary + +TasmotaLED is a lightweight, high-performance library for controlling addressable LED strips on ESP32 microcontrollers. It serves as a streamlined replacement for the NeoPixelBus library, focusing on efficient pixel pushing with minimal memory overhead while supporting multiple hardware acceleration methods (RMT, SPI, I2S). + +**Key Features:** +- Hardware-accelerated LED control via RMT (preferred), SPI, or I2S +- Support for WS2812 and SK6812 LED strips +- 3-byte (RGB) and 4-byte (RGBW) pixel formats +- Flexible pixel ordering (GRB, RGB, RBG, BRG, BGR, GBR) +- Zero-copy buffer management for optimal performance +- ESP32 platform exclusive (ESP8266 not supported) + +**Version:** 1.0 +**Author:** Stephan Hadinger +**License:** GNU General Public License v3.0 +**Copyright:** 2024 + +--- + +## Table of Contents + +1. [Architecture Overview](#architecture-overview) +2. [Class Hierarchy](#class-hierarchy) +3. [LED Type Encoding System](#led-type-encoding-system) +4. [Hardware Acceleration](#hardware-acceleration) +5. [API Reference](#api-reference) +6. [Configuration Guide](#configuration-guide) +7. [Performance Characteristics](#performance-characteristics) +8. [Usage Examples](#usage-examples) +9. [Integration with Tasmota](#integration-with-tasmota) +10. [Troubleshooting](#troubleshooting) + +--- + +## Architecture Overview + +### Design Philosophy + +TasmotaLED is designed with the following principles: + +1. **Minimal Memory Footprint**: Uses only two buffers (work and show) with no buffer swapping overhead +2. **Hardware Acceleration First**: Leverages ESP32's RMT, SPI, or I2S peripherals for precise timing +3. **Zero-Copy Operations**: Direct buffer manipulation without intermediate copies +4. **NeoPixelBus Compatibility**: Similar API for easy migration from NeoPixelBus +5. **Compile-Time Optimization**: Hardware support can be selectively enabled/disabled + +### System Architecture + +``` +┌─────────────────────────────────────────────────────────────┐ +│ Application Layer │ +│ (Tasmota Light Driver) │ +└────────────────────┬────────────────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────────────┐ +│ TasmotaLED Class │ +│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ +│ │ _buf_work │ │ _buf_show │ │ Pixel Format │ │ +│ │ (editable) │─▶│ (internal) │ │ Conversion │ │ +│ └──────────────┘ └──────────────┘ └──────────────┘ │ +└────────────────────┬────────────────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────────────┐ +│ TasmotaLEDPusher (Abstract) │ +└────────────────────┬────────────────────────────────────────┘ + │ + ┌────────────┼────────────┐ + ▼ ▼ ▼ +┌──────────────┐ ┌──────────┐ ┌──────────┐ +│ RMT Pusher │ │ SPI │ │ I2S │ +│ (Primary) │ │ Pusher │ │ Pusher │ +└──────┬───────┘ └────┬─────┘ └────┬─────┘ + │ │ │ + ▼ ▼ ▼ +┌─────────────────────────────────────────┐ +│ ESP32 Hardware Peripherals │ +│ (RMT / SPI / I2S Controllers) │ +└─────────────────────────────────────────┘ +``` + + +### Memory Management + +TasmotaLED uses a dual-buffer system: + +1. **Work Buffer (`_buf_work`)**: + - Directly accessible by application + - Stores pixels in WRGB or RGB format (0xWWRRGGBB or 0xRRGGBB) + - Can be modified at any time + - Size: `pixel_count × pixel_size` bytes + +2. **Show Buffer (`_buf_show`)**: + - Internal buffer for hardware transmission + - Stores pixels in LED strip format (e.g., GRB, GRBW) + - Populated during `Show()` call with format conversion + - Size: `pixel_count × pixel_size` bytes + +**Memory Allocation Example:** +- 512 RGB pixels: 2 × 512 × 3 = 3,072 bytes (~3 KB) +- 512 RGBW pixels: 2 × 512 × 4 = 4,096 bytes (~4 KB) + +--- + +## Class Hierarchy + +### Class Diagram + +``` +┌─────────────────────────────────────────────────────────────┐ +│ TasmotaLED │ +├─────────────────────────────────────────────────────────────┤ +│ - _type: uint16_t │ +│ - _pixel_order: uint8_t │ +│ - _w_before: bool │ +│ - _timing: uint8_t │ +│ - _started: bool │ +│ - _dirty: bool │ +│ - _raw_format: bool │ +│ - _pixel_count: uint16_t │ +│ - _pixel_size: uint8_t │ +│ - _buf_work: uint8_t* │ +│ - _buf_show: uint8_t* │ +│ - _pixel_matrix: const uint8_t(*)[3] │ +│ - _pusher: TasmotaLEDPusher* │ +├─────────────────────────────────────────────────────────────┤ +│ + TasmotaLED(type, num_leds) │ +│ + ~TasmotaLED() │ +│ + Begin(): bool │ +│ + Show(): void │ +│ + SetPixelColor(index, wrgb): void │ +│ + GetPixelColor(index): uint32_t │ +│ + ClearTo(rgbw, first, last): void │ +│ + SetPixelCount(num_leds): void │ +│ + SetPixelSubType(type): void │ +│ + SetPusher(pusher): void │ +│ + CanShow(): bool │ +│ + Pixels(): uint8_t* │ +│ + PixelCount(): uint16_t │ +│ + PixelSize(): uint8_t │ +│ + GetType(): uint8_t │ +│ + IsDirty(): bool │ +│ + Dirty(): void │ +│ + SetRawFormat(raw): void │ +└─────────────────────────────────────────────────────────────┘ + │ + │ uses + ▼ +┌─────────────────────────────────────────────────────────────┐ +│ TasmotaLEDPusher (Abstract) │ +├─────────────────────────────────────────────────────────────┤ +│ # _initialized: bool │ +│ # _err: esp_err_t │ +│ # _pixel_count: uint16_t │ +│ # _pixel_size: uint16_t │ +│ # _led_timing: const TasmotaLED_Timing* │ +├─────────────────────────────────────────────────────────────┤ +│ + Begin(pixel_count, pixel_size, timing): bool │ +│ + Push(buf): bool = 0 │ +│ + CanShow(): bool = 0 │ +│ + SetPixelCount(pixel_count): bool = 0 │ +│ + Initialized(): bool │ +│ + Error(): esp_err_t │ +│ + static ResolveHardware(hw): uint32_t │ +│ + static Create(hw, gpio): TasmotaLEDPusher* │ +└─────────────────────────────────────────────────────────────┘ + △ + │ + ┌─────────────────┼─────────────────┐ + │ │ │ +┌─────────┴──────────┐ ┌────┴────────┐ ┌─────┴──────────┐ +│ TasmotaLEDPusherRMT│ │TasmotaLED │ │ TasmotaLED │ +│ │ │PusherSPI │ │PusherI2S │ +├────────────────────┤ ├─────────────┤ ├────────────────┤ +│ - _pin: int8_t │ │- _pin: int8_t│ │(Future) │ +│ - _channel: handle │ │- _spi_strip │ │ │ +│ - _led_encoder │ │- _with_dma │ │ │ +│ - _tx_config │ │ │ │ │ +├────────────────────┤ ├─────────────┤ ├────────────────┤ +│ + Push(): bool │ │+ Push(): bool│ │ │ +│ + CanShow(): bool │ │+ CanShow() │ │ │ +└────────────────────┘ └─────────────┘ └────────────────┘ +``` + + +--- + +## LED Type Encoding System + +### Type Encoding Structure + +The LED type is encoded in a 16-bit value with the following bit layout: + +``` +Bits 15-8: Timing Code (WS2812, SK6812, etc.) +Bit 7: W Channel Position (0=after RGB, 1=before RGB) +Bits 6-4: Pixel Order (GRB, RGB, RBG, BRG, BGR, GBR) +Bits 3-0: Bytes per Pixel (3=RGB, 4=RGBW) + +┌────────┬───┬───────┬──────────┐ +│15 8 │ 7 │ 6 4 │ 3 0 │ +├────────┼───┼───────┼──────────┤ +│ Timing │ W │ Order │ Size │ +└────────┴───┴───────┴──────────┘ +``` + +### Pixel Size Encoding (Bits 0-3) + +| Value | Enum | Description | Bytes per Pixel | +|-------|------|-------------|-----------------| +| `0x0` | `TasmotaLed_1_Def` | Default (same as RGB) | 3 | +| `0x1` | `TasmotaLed_3_RGB` | RGB format | 3 | +| `0x2` | `TasmotaLed_4_WRGB` | RGBW format | 4 | + +### Pixel Order Encoding (Bits 4-6) + +| Value | Enum | Description | Channel Order | +|-------|------|-------------|---------------| +| `0b000` | `TasmotaLed_Def` | Default (GRB) | G, R, B | +| `0b001` | `TasmotaLed_GRB` | Green-Red-Blue | G, R, B | +| `0b010` | `TasmotaLed_RGB` | Red-Green-Blue | R, G, B | +| `0b011` | `TasmotaLed_RBG` | Red-Blue-Green | R, B, G | +| `0b100` | `TasmotaLed_BRG` | Blue-Red-Green | B, R, G | +| `0b101` | `TasmotaLed_BGR` | Blue-Green-Red | B, G, R | +| `0b110` | `TasmotaLed_GBR` | Green-Blue-Red | G, B, R | + +### W Channel Position (Bit 7) + +| Value | Enum | Description | Format | +|-------|------|-------------|--------| +| `0` | `TasmotaLed_xxxW` | W after color | RGB + W | +| `1` | `TasmotaLed_Wxxx` | W before color | W + RGB | + +### Timing Code (Bits 8-15) + +| Value | Enum | Description | T0H | T0L | T1H | T1L | Reset | +|-------|------|-------------|-----|-----|-----|-----|-------| +| `0` | `TasmotaLed_WS2812` | WS2812/WS2812B | 400ns | 850ns | 800ns | 450ns | 80µs | +| `1` | `TasmotaLed_SK6812` | SK6812 | 300ns | 900ns | 600ns | 600ns | 80µs | + +### Predefined LED Types + +```cpp +enum TasmotaLEDTypes : uint16_t { + // WS2812 with GRB ordering (most common) + ws2812_grb = TasmotaLed_3_RGB | TasmotaLed_GRB | TasmotaLed_WS2812, + // Value: 0x0011 (decimal 17) + + // SK6812 with GRBW ordering and W after RGB + sk6812_grbw = TasmotaLed_4_WRGB | TasmotaLed_GRB | TasmotaLed_xxxW | TasmotaLed_SK6812, + // Value: 0x0112 (decimal 274) + + // SK6812 with GRB ordering (no white channel) + sk6812_grb = TasmotaLed_3_RGB | TasmotaLed_GRB | TasmotaLed_SK6812, + // Value: 0x0111 (decimal 273) +}; +``` + +### Type Encoding Examples + +```cpp +// WS2812 RGB strip with GRB ordering +uint16_t type1 = TasmotaLed_3_RGB | TasmotaLed_GRB | TasmotaLed_WS2812; +// Binary: 0000 0000 0001 0001 = 0x0011 + +// SK6812 RGBW strip with RGB ordering and W first +uint16_t type2 = TasmotaLed_4_WRGB | TasmotaLed_RGB | TasmotaLed_Wxxx | TasmotaLed_SK6812; +// Binary: 0000 0001 1010 0010 = 0x01A2 + +// WS2812 RGB strip with BGR ordering +uint16_t type3 = TasmotaLed_3_RGB | TasmotaLed_BGR | TasmotaLed_WS2812; +// Binary: 0000 0000 0101 0001 = 0x0051 +``` + + +--- + +## Hardware Acceleration + +### Hardware Support Matrix + +| Hardware | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C2 | ESP32-C6 | +|----------|-------|----------|----------|----------|----------|----------| +| **RMT** | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | +| **SPI** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| **I2S** | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | + +### Hardware Selection + +Hardware acceleration is selected using the `TasmotaLEDHardware` enum: + +```cpp +enum TasmotaLEDHardware : uint32_t { + TasmotaLed_HW_Default = 0x000000, // Auto-select best available + TasmotaLed_RMT = (1 << 0) << 16, // 0x010000 - RMT peripheral + TasmotaLed_SPI = (1 << 1) << 16, // 0x020000 - SPI peripheral + TasmotaLed_I2S = (1 << 2) << 16, // 0x040000 - I2S peripheral + TasmotaLed_HW_None = 0xFF << 16, // 0xFF0000 - No hardware support +}; +``` + +### Hardware Resolution Priority + +When `TasmotaLed_HW_Default` is specified, the library selects hardware in this order: + +1. **RMT** (if available) - Preferred for precision and low CPU overhead +2. **I2S** (if available) - Good for large strips +3. **SPI** (if available) - Fallback option, works on all ESP32 variants + +### Compile-Time Configuration + +Hardware support can be enabled/disabled at compile time: + +```cpp +// In your build configuration or before including TasmotaLED +#define TASMOTALED_HARDWARE_RMT 1 // Enable RMT (default: 1) +#define TASMOTALED_HARDWARE_I2S 0 // Enable I2S (default: 0) +#define TASMOTALED_HARDWARE_SPI 0 // Enable SPI (default: 0) +``` + +**Note:** If no hardware is explicitly enabled, SPI is automatically enabled as fallback. + +### RMT Implementation + +**Advantages:** +- Precise timing control (25ns resolution at 40MHz) +- Low CPU overhead +- Non-blocking operation with DMA +- Supports up to 8 channels (ESP32) or 4 channels (ESP32-S2/S3/C3) + +**Technical Details:** +- Clock resolution: 40 MHz (25ns per tick) +- Memory block: 192 symbols (768 bytes) +- Transaction queue depth: 4 +- Encoder: Custom LED strip encoder with bit-level control + +**Timing Precision:** +``` +WS2812: T0H=400ns (16 ticks), T0L=850ns (34 ticks) + T1H=800ns (32 ticks), T1L=450ns (18 ticks) + Reset=80µs (3200 ticks) + +SK6812: T0H=300ns (12 ticks), T0L=900ns (36 ticks) + T1H=600ns (24 ticks), T1L=600ns (24 ticks) + Reset=80µs (3200 ticks) +``` + +### SPI Implementation + +**Advantages:** +- Available on all ESP32 variants +- Works on ESP32-C2 (no RMT support) +- Reliable fallback option + +**Technical Details:** +- Clock frequency: 2.5 MHz +- Each LED bit encoded as 3 SPI bits +- Bit encoding: `0` = `100`, `1` = `110` +- DMA support: Optional (auto-selected) +- Memory overhead: 3× pixel buffer size + +**Bit Encoding:** +``` +LED bit 0: SPI bits 100 (high for 400ns, low for 800ns at 2.5MHz) +LED bit 1: SPI bits 110 (high for 800ns, low for 400ns at 2.5MHz) +``` + +### I2S Implementation + +**Status:** Planned but not yet implemented + +**Advantages:** +- Very high throughput +- Excellent for large LED installations +- Parallel data transmission + +--- + +## API Reference + +### TasmotaLED Class + +#### Constructor + +```cpp +TasmotaLED(uint16_t type, uint16_t num_leds) +``` + +Creates a new TasmotaLED instance. + +**Parameters:** +- `type`: LED type encoding (see LED Type Encoding section) +- `num_leds`: Number of LEDs in the strip + +**Example:** +```cpp +// Create a 60-LED WS2812 strip with GRB ordering +TasmotaLED strip(ws2812_grb, 60); + +// Create a 100-LED SK6812 RGBW strip +TasmotaLED strip(sk6812_grbw, 100); +``` + +#### Destructor + +```cpp +~TasmotaLED() +``` + +Cleans up resources, frees buffers, and deletes the pusher instance. + +#### Initialization Methods + +##### SetPusher() + +```cpp +void SetPusher(TasmotaLEDPusher *pusher) +``` + +Sets the hardware pusher implementation. Must be called before `Begin()`. + +**Parameters:** +- `pusher`: Pointer to a TasmotaLEDPusher instance (RMT, SPI, or I2S) + +**Example:** +```cpp +TasmotaLED strip(ws2812_grb, 60); +TasmotaLEDPusher *pusher = TasmotaLEDPusher::Create(TasmotaLed_RMT, 5); +strip.SetPusher(pusher); +``` + +##### Begin() + +```cpp +bool Begin(void) +``` + +Initializes the hardware pusher and prepares the strip for operation. + +**Returns:** `true` if initialization successful, `false` otherwise + +**Example:** +```cpp +if (strip.Begin()) { + // Strip is ready to use +} else { + // Initialization failed +} +``` + +#### Pixel Manipulation Methods + +##### SetPixelColor() + +```cpp +void SetPixelColor(int32_t index, uint32_t wrgb) +``` + +Sets the color of a single pixel. + +**Parameters:** +- `index`: Pixel index (0-based, negative values count from end) +- `wrgb`: Color value in 0xWWRRGGBB format (or 0xRRGGBB for RGB strips) + +**Example:** +```cpp +strip.SetPixelColor(0, 0xFF0000); // Red +strip.SetPixelColor(1, 0x00FF00); // Green +strip.SetPixelColor(2, 0x0000FF); // Blue +strip.SetPixelColor(-1, 0xFFFFFF); // Last pixel white +strip.SetPixelColor(10, 0x80FF8000); // RGBW: W=0x80, R=0xFF, G=0x80, B=0x00 +``` + +##### GetPixelColor() + +```cpp +uint32_t GetPixelColor(int32_t index) +``` + +Retrieves the color of a single pixel. + +**Parameters:** +- `index`: Pixel index (0-based, negative values count from end) + +**Returns:** Color value in 0xWWRRGGBB or 0xRRGGBB format + +**Example:** +```cpp +uint32_t color = strip.GetPixelColor(5); +uint8_t red = (color >> 16) & 0xFF; +uint8_t green = (color >> 8) & 0xFF; +uint8_t blue = color & 0xFF; +``` + +##### ClearTo() + +```cpp +void ClearTo(uint32_t rgbw, int32_t first = 0, int32_t last = -1) +``` + +Sets a range of pixels to the same color. + +**Parameters:** +- `rgbw`: Color value in 0xWWRRGGBB or 0xRRGGBB format +- `first`: First pixel index (default: 0) +- `last`: Last pixel index (default: -1 = last pixel) + +**Example:** +```cpp +strip.ClearTo(0x000000); // Clear entire strip to black +strip.ClearTo(0xFF0000, 0, 9); // Set first 10 pixels to red +strip.ClearTo(0x00FF00, 10, 19); // Set pixels 10-19 to green +strip.ClearTo(0x0000FF, -10, -1); // Set last 10 pixels to blue +``` + +##### Show() + +```cpp +void Show(void) +``` + +Pushes the pixel buffer to the LED strip. Converts from WRGB/RGB format to the strip's native format and transmits via hardware. + +**Example:** +```cpp +strip.SetPixelColor(0, 0xFF0000); +strip.SetPixelColor(1, 0x00FF00); +strip.Show(); // Update the strip +``` + +##### CanShow() + +```cpp +bool CanShow(void) const +``` + +Checks if the strip is ready to accept a new `Show()` command. + +**Returns:** `true` if ready, `false` if previous transmission still in progress + +**Example:** +```cpp +if (strip.CanShow()) { + strip.Show(); +} +``` + +#### Configuration Methods + +##### SetPixelCount() + +```cpp +void SetPixelCount(uint16_t num_leds) +``` + +Changes the number of LEDs in the strip. Reallocates buffers if necessary. + +**Parameters:** +- `num_leds`: New number of LEDs + +**Example:** +```cpp +strip.SetPixelCount(100); // Resize to 100 LEDs +``` + +##### SetPixelSubType() + +```cpp +void SetPixelSubType(uint8_t type) +``` + +Changes only the pixel ordering and size (lower 8 bits of type), keeping timing unchanged. + +**Parameters:** +- `type`: New subtype (bits 0-7 of type encoding) + +**Example:** +```cpp +// Change from GRB to RGB ordering +strip.SetPixelSubType(TasmotaLed_3_RGB | TasmotaLed_RGB); +``` + +##### SetRawFormat() + +```cpp +void SetRawFormat(bool raw_format) +``` + +Enables/disables raw format mode. When enabled, buffer is copied directly without format conversion. + +**Parameters:** +- `raw_format`: `true` for raw mode, `false` for automatic conversion + +**Example:** +```cpp +strip.SetRawFormat(true); // Disable format conversion +``` + +#### Query Methods + +##### PixelCount() + +```cpp +uint16_t PixelCount(void) const +``` + +Returns the number of LEDs in the strip. + +##### PixelSize() + +```cpp +uint8_t PixelSize(void) const +``` + +Returns the number of bytes per pixel (3 for RGB, 4 for RGBW). + +##### GetType() + +```cpp +uint8_t GetType(void) const +``` + +Returns the LED type encoding. + +##### Pixels() + +```cpp +uint8_t * Pixels(void) const +``` + +Returns a pointer to the work buffer for direct manipulation. + +**Example:** +```cpp +uint8_t *buf = strip.Pixels(); +// Direct buffer access (advanced usage) +buf[0] = 0xFF; // Set first byte +``` + +##### IsDirty() + +```cpp +bool IsDirty(void) const +``` + +Returns the dirty flag (for NeoPixelBus compatibility, but not used internally). + +##### Dirty() + +```cpp +void Dirty(void) +``` + +Sets the dirty flag to `true`. + + +### TasmotaLEDPusher Class (Abstract) + +#### Static Factory Methods + +##### Create() + +```cpp +static TasmotaLEDPusher * Create(uint32_t hw, int8_t gpio) +``` + +Creates a pusher instance for the specified hardware type. + +**Parameters:** +- `hw`: Hardware type (TasmotaLed_RMT, TasmotaLed_SPI, TasmotaLed_I2S, or TasmotaLed_HW_Default) +- `gpio`: GPIO pin number for LED data output + +**Returns:** Pointer to pusher instance, or `nullptr` if creation failed + +**Example:** +```cpp +TasmotaLEDPusher *pusher = TasmotaLEDPusher::Create(TasmotaLed_RMT, 5); +if (pusher) { + strip.SetPusher(pusher); +} +``` + +##### ResolveHardware() + +```cpp +static uint32_t ResolveHardware(uint32_t hw) +``` + +Resolves hardware type based on SOC capabilities. + +**Parameters:** +- `hw`: Requested hardware type + +**Returns:** Resolved hardware type (removes unsupported flags) + +#### Instance Methods + +##### Begin() + +```cpp +virtual bool Begin(uint16_t pixel_count, uint16_t pixel_size, + const TasmotaLED_Timing * led_timing) +``` + +Initializes the hardware pusher. + +**Parameters:** +- `pixel_count`: Number of LEDs +- `pixel_size`: Bytes per pixel (3 or 4) +- `led_timing`: Pointer to timing structure + +**Returns:** `true` if successful + +##### Push() + +```cpp +virtual bool Push(uint8_t *buf) = 0 +``` + +Pushes pixel data to the LED strip (pure virtual). + +**Parameters:** +- `buf`: Pointer to pixel buffer in strip format + +**Returns:** `true` if successful + +##### CanShow() + +```cpp +virtual bool CanShow(void) = 0 +``` + +Checks if hardware is ready for next transmission (pure virtual). + +**Returns:** `true` if ready + +##### SetPixelCount() + +```cpp +virtual bool SetPixelCount(uint16_t pixel_count) = 0 +``` + +Updates pixel count (pure virtual). + +**Parameters:** +- `pixel_count`: New number of pixels + +**Returns:** `true` if successful + +##### Initialized() + +```cpp +bool Initialized(void) const +``` + +Returns initialization status. + +##### Error() + +```cpp +esp_err_t Error(void) const +``` + +Returns last error code. + +--- + +## Configuration Guide + +### Basic Setup + +#### Step 1: Include Headers + +```cpp +#include "TasmotaLED.h" +#include "TasmotaLEDPusher.h" +``` + +#### Step 2: Create Strip Instance + +```cpp +// For WS2812 RGB strip with 60 LEDs +TasmotaLED strip(ws2812_grb, 60); + +// For SK6812 RGBW strip with 100 LEDs +TasmotaLED strip(sk6812_grbw, 100); + +// Custom configuration +uint16_t custom_type = TasmotaLed_3_RGB | TasmotaLed_RGB | TasmotaLed_WS2812; +TasmotaLED strip(custom_type, 144); +``` + +#### Step 3: Create and Assign Pusher + +```cpp +// Auto-select best hardware for GPIO 5 +TasmotaLEDPusher *pusher = TasmotaLEDPusher::Create(TasmotaLed_HW_Default, 5); +if (pusher) { + strip.SetPusher(pusher); +} else { + // Handle error +} + +// Or explicitly request RMT +TasmotaLEDPusher *pusher = TasmotaLEDPusher::Create(TasmotaLed_RMT, 5); +``` + +#### Step 4: Initialize + +```cpp +if (!strip.Begin()) { + // Handle initialization error + Serial.println("Failed to initialize LED strip"); +} +``` + +#### Step 5: Use the Strip + +```cpp +// Set colors +strip.ClearTo(0x000000); // Clear to black +strip.SetPixelColor(0, 0xFF0000); // First pixel red +strip.SetPixelColor(1, 0x00FF00); // Second pixel green +strip.Show(); // Update strip +``` + +### Advanced Configuration + +#### Custom LED Type + +```cpp +// Create custom type: RGB, BGR ordering, WS2812 timing +uint16_t custom_type = TasmotaLed_3_RGB | // 3 bytes per pixel + TasmotaLed_BGR | // BGR ordering + TasmotaLed_WS2812; // WS2812 timing + +TasmotaLED strip(custom_type, 60); +``` + +#### RGBW with W Channel First + +```cpp +// SK6812 RGBW with W channel before RGB +uint16_t rgbw_type = TasmotaLed_4_WRGB | // 4 bytes per pixel + TasmotaLed_RGB | // RGB ordering + TasmotaLed_Wxxx | // W first + TasmotaLed_SK6812; // SK6812 timing + +TasmotaLED strip(rgbw_type, 100); +``` + +#### Multiple Strips + +```cpp +// Strip 1 on GPIO 5 +TasmotaLED strip1(ws2812_grb, 60); +TasmotaLEDPusher *pusher1 = TasmotaLEDPusher::Create(TasmotaLed_RMT, 5); +strip1.SetPusher(pusher1); +strip1.Begin(); + +// Strip 2 on GPIO 18 +TasmotaLED strip2(sk6812_grbw, 100); +TasmotaLEDPusher *pusher2 = TasmotaLEDPusher::Create(TasmotaLed_RMT, 18); +strip2.SetPusher(pusher2); +strip2.Begin(); +``` + +#### Raw Format Mode + +```cpp +strip.SetRawFormat(true); // Disable automatic format conversion + +// Now buffer must be in strip's native format (e.g., GRB for WS2812) +uint8_t *buf = strip.Pixels(); +buf[0] = 0xFF; // Green +buf[1] = 0x00; // Red +buf[2] = 0x00; // Blue +strip.Show(); +``` + +### Compile-Time Configuration + +#### Enable/Disable Hardware Support + +In your `platformio.ini` or build flags: + +```ini +build_flags = + -DTASMOTALED_HARDWARE_RMT=1 + -DTASMOTALED_HARDWARE_SPI=1 + -DTASMOTALED_HARDWARE_I2S=0 +``` + +Or in your code before including TasmotaLED: + +```cpp +#define TASMOTALED_HARDWARE_RMT 1 +#define TASMOTALED_HARDWARE_SPI 0 +#define TASMOTALED_HARDWARE_I2S 0 + +#include "TasmotaLED.h" +``` + + +--- + +## Performance Characteristics + +### Memory Usage + +#### Per-Strip Overhead + +| Component | Size | Description | +|-----------|------|-------------| +| TasmotaLED object | ~60 bytes | Class instance | +| Work buffer | `pixels × size` | Editable buffer (RGB or RGBW) | +| Show buffer | `pixels × size` | Internal transmission buffer | +| Pusher object | ~40-80 bytes | Hardware implementation | +| **Total** | **~100 + (2 × pixels × size)** | | + +#### Examples + +| Configuration | Memory Usage | +|---------------|--------------| +| 60 RGB pixels | ~460 bytes | +| 144 RGB pixels | ~964 bytes | +| 300 RGB pixels | ~1,900 bytes | +| 512 RGB pixels | ~3,172 bytes | +| 60 RGBW pixels | ~580 bytes | +| 144 RGBW pixels | ~1,252 bytes | + +#### SPI Additional Overhead + +SPI requires 3× buffer for encoding: + +| Configuration | Additional Memory | +|---------------|-------------------| +| 60 RGB pixels | +540 bytes | +| 144 RGB pixels | +1,296 bytes | +| 300 RGB pixels | +2,700 bytes | + +### Timing Performance + +#### Buffer Operations (512 RGB pixels) + +| Operation | Time | Notes | +|-----------|------|-------| +| `ClearTo(0x000000)` | ~15 µs | Optimized memset | +| `ClearTo(0xFF0000)` | ~124 µs | Per-pixel write | +| `SetPixelColor()` | ~0.2 µs | Single pixel | +| Format conversion | ~124 µs | RGB→GRB conversion | +| `Show()` (RMT) | ~16.2 ms | Actual transmission | +| `Show()` (SPI) | ~16.6 ms | Transmission + encoding | + +#### Transmission Times + +Transmission time depends on pixel count and timing: + +**WS2812 (30 µs per pixel):** +- 60 pixels: ~1.8 ms +- 144 pixels: ~4.3 ms +- 300 pixels: ~9.0 ms +- 512 pixels: ~15.4 ms + +**SK6812 (30 µs per pixel):** +- Similar to WS2812 + +**Maximum Refresh Rate:** +- 60 pixels: ~555 Hz +- 144 pixels: ~232 Hz +- 300 pixels: ~111 Hz +- 512 pixels: ~65 Hz + +### CPU Overhead + +#### RMT Implementation +- **Setup:** ~100 µs (one-time) +- **Per Show():** ~150 µs (format conversion + DMA setup) +- **During transmission:** Near zero (DMA handles transfer) +- **CPU usage:** <1% during transmission + +#### SPI Implementation +- **Setup:** ~200 µs (one-time) +- **Per Show():** ~550 µs (encoding + format conversion) +- **During transmission:** Near zero (DMA handles transfer) +- **CPU usage:** <2% during transmission + +### Optimization Tips + +1. **Minimize Show() Calls** + ```cpp + // Bad: Multiple Show() calls + for (int i = 0; i < 60; i++) { + strip.SetPixelColor(i, color); + strip.Show(); // 60 transmissions! + } + + // Good: Single Show() call + for (int i = 0; i < 60; i++) { + strip.SetPixelColor(i, color); + } + strip.Show(); // 1 transmission + ``` + +2. **Use ClearTo() for Bulk Operations** + ```cpp + // Faster than loop with SetPixelColor() + strip.ClearTo(0xFF0000, 0, 29); // First 30 pixels red + ``` + +3. **Check CanShow() Before Show()** + ```cpp + if (strip.CanShow()) { + strip.Show(); + } + ``` + +4. **Direct Buffer Access for Complex Patterns** + ```cpp + uint8_t *buf = strip.Pixels(); + // Direct manipulation (advanced) + for (int i = 0; i < strip.PixelCount() * strip.PixelSize(); i++) { + buf[i] = pattern[i]; + } + strip.Show(); + ``` + +--- + +## Usage Examples + +### Basic Initialization + +```cpp +#include "TasmotaLED.h" +#include "TasmotaLEDPusher.h" + +// Create strip instance +TasmotaLED strip(ws2812_grb, 60); + +void setup() { + // Create pusher with auto hardware selection + TasmotaLEDPusher *pusher = TasmotaLEDPusher::Create(TasmotaLed_HW_Default, 5); + if (pusher) { + strip.SetPusher(pusher); + if (strip.Begin()) { + // Strip ready + strip.ClearTo(0x000000); // Clear to black + strip.Show(); + } + } +} +``` + +### Setting Pixels + +```cpp +// Set individual pixels +strip.SetPixelColor(0, 0xFF0000); // Red +strip.SetPixelColor(1, 0x00FF00); // Green +strip.SetPixelColor(2, 0x0000FF); // Blue + +// Set range of pixels +strip.ClearTo(0xFF0000, 0, 9); // First 10 pixels red + +// Update strip +strip.Show(); +``` + +### RGBW Control + +```cpp +TasmotaLED strip(sk6812_grbw, 60); + +// Pure white using W channel +strip.ClearTo(0xFF000000); // W=0xFF, RGB=0 + +// Warm white (W + Red) +strip.ClearTo(0x80FF0000); // W=0x80, R=0xFF, G=0, B=0 + +// RGB color (no W) +strip.ClearTo(0x00FF00FF); // W=0, R=0xFF, G=0, B=0xFF (Magenta) + +strip.Show(); +``` + +### Non-Blocking Updates + +```cpp +void loop() { + // Check if strip is ready before updating + if (strip.CanShow()) { + // Update pixels + for (int i = 0; i < strip.PixelCount(); i++) { + strip.SetPixelColor(i, colors[i]); + } + strip.Show(); + } + + // Other code continues without blocking +} +``` + + +--- + +## Integration with Tasmota + +### Tasmota Light Driver Integration + +TasmotaLED is designed to integrate seamlessly with Tasmota's light driver system. Here's how it fits into the Tasmota architecture: + +#### Integration Points + +1. **Driver Initialization (FUNC_INIT)** + ```cpp + void TasmotaLEDInit(void) { + // Create strip based on Settings + uint16_t led_type = Settings->light_type; + uint16_t led_count = Settings->light_pixels; + int8_t gpio = Pin(GPIO_LED); + + strip = new TasmotaLED(led_type, led_count); + + // Create pusher with hardware auto-selection + TasmotaLEDPusher *pusher = TasmotaLEDPusher::Create( + TasmotaLed_HW_Default, gpio); + + if (pusher) { + strip->SetPusher(pusher); + if (strip->Begin()) { + AddLog(LOG_LEVEL_INFO, "LED: Initialized %d pixels on GPIO %d", + led_count, gpio); + } + } + } + ``` + +2. **Pixel Updates (FUNC_SET_CHANNELS)** + ```cpp + void TasmotaLEDUpdate(void) { + // Get color data from Tasmota light engine + for (int i = 0; i < strip->PixelCount(); i++) { + uint32_t color = GetPixelColorFromLightEngine(i); + strip->SetPixelColor(i, color); + } + + // Push to hardware + if (strip->CanShow()) { + strip->Show(); + } + } + ``` + +3. **Configuration Changes** + ```cpp + void TasmotaLEDReconfigure(void) { + // Handle pixel count changes + if (new_pixel_count != strip->PixelCount()) { + strip->SetPixelCount(new_pixel_count); + } + + // Handle type changes + if (new_led_type != strip->GetType()) { + strip->SetPixelSubType(new_led_type & 0xFF); + } + } + ``` + +### Tasmota Commands + +When integrated with Tasmota, these commands control the LED strip: + +| Command | Description | Example | +|---------|-------------|---------| +| `Pixels` | Set number of LEDs | `Pixels 60` | +| `Scheme` | Set color scheme | `Scheme 2` | +| `Speed` | Set animation speed | `Speed 10` | +| `Width` | Set effect width | `Width 1` | +| `Color` | Set RGB color | `Color #FF0000` | +| `White` | Set white channel | `White 50` | +| `Dimmer` | Set brightness | `Dimmer 75` | +| `Fade` | Enable fade | `Fade 1` | + +### Settings Storage + +Tasmota stores LED configuration in Settings structure: + +```cpp +struct SETTINGS { + // ... + uint16_t light_pixels; // Number of LEDs + uint8_t light_type; // LED type encoding + uint8_t light_scheme; // Animation scheme + uint8_t light_speed; // Animation speed + uint8_t light_width; // Effect width + // ... +}; +``` + +### Hardware Selection in Tasmota + +Tasmota automatically selects the best hardware based on: + +1. **SOC Capabilities**: Checks what hardware is available +2. **GPIO Availability**: Ensures GPIO is not in use +3. **Performance Requirements**: Selects RMT for best performance +4. **Fallback**: Uses SPI if RMT unavailable + +```cpp +uint32_t TasmotaSelectHardware(void) { + uint32_t hw = TasmotaLed_HW_Default; + + // Force SPI on ESP32-C2 (no RMT) + #ifdef CONFIG_IDF_TARGET_ESP32C2 + hw = TasmotaLed_SPI; + #endif + + // User override via SetOption + if (Settings->flag5.led_use_spi) { + hw = TasmotaLed_SPI; + } + + return hw; +} +``` + +--- + +## Troubleshooting + +### Common Issues + +#### 1. Strip Not Lighting Up + +**Symptoms:** No LEDs light up after calling `Show()` + +**Possible Causes:** +- Pusher not initialized +- Wrong GPIO pin +- Incorrect LED type +- Power supply issues + +**Solutions:** +```cpp +// Check initialization +if (!strip.Begin()) { + Serial.println("Failed to initialize"); + // Check pusher creation + if (pusher == nullptr) { + Serial.println("Pusher creation failed"); + } +} + +// Verify GPIO +Serial.printf("Using GPIO %d\n", gpio_pin); + +// Test with simple pattern +strip.ClearTo(0xFF0000); // All red +strip.Show(); +``` + +#### 2. Wrong Colors + +**Symptoms:** Colors appear incorrect (e.g., red shows as green) + +**Possible Causes:** +- Incorrect pixel ordering +- Wrong LED type + +**Solutions:** +```cpp +// Try different orderings +strip.SetPixelSubType(TasmotaLed_3_RGB | TasmotaLed_RGB); // RGB +strip.SetPixelSubType(TasmotaLed_3_RGB | TasmotaLed_GRB); // GRB +strip.SetPixelSubType(TasmotaLed_3_RGB | TasmotaLed_BGR); // BGR + +// Test each ordering +strip.ClearTo(0xFF0000); // Should be red +strip.Show(); +``` + +#### 3. Flickering or Glitches + +**Symptoms:** Random flickering, incorrect colors, or partial updates + +**Possible Causes:** +- Timing issues +- Insufficient power +- Long cable runs +- Electromagnetic interference + +**Solutions:** +```cpp +// Try different timing +uint16_t type_ws2812 = TasmotaLed_3_RGB | TasmotaLed_GRB | TasmotaLed_WS2812; +uint16_t type_sk6812 = TasmotaLed_3_RGB | TasmotaLed_GRB | TasmotaLed_SK6812; + +// Check power supply (5V, sufficient amperage) +// Add capacitor (1000µF) across power supply +// Keep data cable short (<1m) or use level shifter +``` + +#### 4. Memory Allocation Failures + +**Symptoms:** `Begin()` returns false, crashes, or resets + +**Possible Causes:** +- Too many LEDs for available memory +- Memory fragmentation + +**Solutions:** +```cpp +// Check available heap +Serial.printf("Free heap: %d bytes\n", ESP.getFreeHeap()); + +// Calculate required memory +uint32_t required = strip.PixelCount() * strip.PixelSize() * 2; +Serial.printf("Required: %d bytes\n", required); + +// Reduce pixel count if necessary +if (required > ESP.getFreeHeap() / 2) { + strip.SetPixelCount(smaller_count); +} +``` + +#### 5. Performance Issues + +**Symptoms:** Slow updates, low frame rate + +**Possible Causes:** +- Too many `Show()` calls +- Inefficient pixel updates +- Wrong hardware selection + +**Solutions:** +```cpp +// Batch updates +for (int i = 0; i < strip.PixelCount(); i++) { + strip.SetPixelColor(i, colors[i]); +} +strip.Show(); // Single show call + +// Use ClearTo() for bulk operations +strip.ClearTo(0xFF0000, 0, 29); // Faster than loop + +// Check hardware +Serial.printf("Using hardware: 0x%08X\n", hw_type); + +// Verify CanShow() before Show() +if (strip.CanShow()) { + strip.Show(); +} +``` + +### Debug Logging + +Enable debug logging to diagnose issues: + +```cpp +// In Tasmota, set log level +SerialLog 4 // Debug level + +// Look for these messages: +// LED: RMT gpio 5 +// LED: SPI gpio 5 +// LED: Error create RMT bus failed 5 err=XXX +``` + +### Hardware-Specific Issues + +#### ESP32-C2 +- Only SPI supported (no RMT) +- Ensure `TASMOTALED_HARDWARE_SPI` is enabled + +#### ESP32-S2/S3 +- RMT channels limited to 4 +- Check channel availability if using multiple strips + +#### ESP32 Classic +- RMT channels limited to 8 +- Most flexible hardware support + +### Timing Verification + +Verify timing with oscilloscope or logic analyzer: + +**WS2812 Expected:** +- T0H: 400ns ±150ns +- T0L: 850ns ±150ns +- T1H: 800ns ±150ns +- T1L: 450ns ±150ns +- Reset: >50µs + +**SK6812 Expected:** +- T0H: 300ns ±150ns +- T0L: 900ns ±150ns +- T1H: 600ns ±150ns +- T1L: 600ns ±150ns +- Reset: >80µs + +--- + +## Appendix + +### Pixel Order Matrix + +The library uses a lookup table for pixel ordering: + +```cpp +static const uint8_t TASMOTALED_CHANNEL_ORDERS[8][3] = { + {1, 0, 2}, // Def=GRB (0) + {1, 0, 2}, // GRB (1) + {0, 1, 2}, // RGB (2) + {0, 2, 1}, // RBG (3) + {2, 1, 0}, // BRG (4) + {1, 2, 0}, // BGR (5) + {2, 0, 1}, // GBR (6) + {1, 0, 2} // GRB (7) - fallback +}; +``` + +**Interpretation:** +- Index 0: Position of Red channel +- Index 1: Position of Green channel +- Index 2: Position of Blue channel + +**Example:** GRB ordering `{1, 0, 2}` means: +- Red goes to position 1 +- Green goes to position 0 +- Blue goes to position 2 +- Result: G(0) R(1) B(2) + +### Timing Structure + +```cpp +typedef struct TasmotaLED_Timing { + uint16_t T0H; // Bit 0 high time (nanoseconds) + uint16_t T0L; // Bit 0 low time (nanoseconds) + uint16_t T1H; // Bit 1 high time (nanoseconds) + uint16_t T1L; // Bit 1 low time (nanoseconds) + uint32_t Reset; // Reset time (nanoseconds) +} TasmotaLED_Timing; +``` + +### Comparison with NeoPixelBus + +| Feature | TasmotaLED | NeoPixelBus | +|---------|------------|-------------| +| **Memory** | Lower (2 buffers) | Higher (3+ buffers) | +| **Code Size** | ~15 KB | ~40 KB | +| **Hardware** | RMT, SPI, I2S | RMT, I2S, UART, BitBang | +| **ESP8266** | ❌ No | ✅ Yes | +| **ESP32** | ✅ Yes | ✅ Yes | +| **Buffer Swap** | No (copy on Show) | Yes (double buffering) | +| **Dirty Flag** | Ignored | Used | +| **API** | Similar | Full-featured | +| **Performance** | Optimized | Feature-rich | + +### License + +``` +TasmotaLED - Lightweight implementation for addressable LEDs +Copyright (C) 2024 Stephan Hadinger + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +``` + +--- + +## Revision History + +| Version | Date | Changes | +|---------|------|---------| +| 1.0 | 2024 | Initial release with RMT and SPI support | + +--- + +**End of Documentation** From 9d3daed003877f433cbaae65ee483deae805493c Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 15 Oct 2025 15:24:05 +0200 Subject: [PATCH 015/136] Update change logs --- CHANGELOG.md | 2 +- RELEASENOTES.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 550940eec..a6b7d6e71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file. ## [15.1.0.1] ### Added - TLS enabled ECDSA by default for ESP8266 (#24009) -- Berry add `cb.free_cb` for extension manager +- Berry add `cb.free_cb` for extension manager (#24014) ### Breaking Changed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0a81975b2..654777097 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -115,6 +115,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ## Changelog v15.1.0.1 ### Added - TLS enabled ECDSA by default for ESP8266 [#24009](https://github.com/arendst/Tasmota/issues/24009) +- Berry add `cb.free_cb` for extension manager [#24014](https://github.com/arendst/Tasmota/issues/24014) ### Breaking Changed From 2660ad72abc7a448b85c230d5aa78cf9bd7ef3cd Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Wed, 15 Oct 2025 16:57:01 +0200 Subject: [PATCH 016/136] Add type checking to byteslib (#24015) --- lib/libesp32/berry/src/be_byteslib.c | 26 +++++++++++++++--- lib/libesp32/berry/tests/bytes.be | 41 +++++++++++++++++++++------- 2 files changed, 53 insertions(+), 14 deletions(-) diff --git a/lib/libesp32/berry/src/be_byteslib.c b/lib/libesp32/berry/src/be_byteslib.c index 82053443d..c55c7a436 100644 --- a/lib/libesp32/berry/src/be_byteslib.c +++ b/lib/libesp32/berry/src/be_byteslib.c @@ -854,8 +854,12 @@ static int m_add(bvm *vm) if (argc >= 2 && be_isint(vm, 2)) { int32_t v = be_toint(vm, 2); int vsize = 1; - if (argc >= 3 && be_isint(vm, 3)) { - vsize = be_toint(vm, 3); + if (argc >= 3) { + if (be_isint(vm, 3)) { + vsize = be_toint(vm, 3); + } else { + goto type_error; + } } switch (vsize) { case 0: break; @@ -873,6 +877,8 @@ static int m_add(bvm *vm) m_write_attributes(vm, 1, &attr); /* update attributes */ be_return(vm); } +type_error: + be_raise(vm, "type_error", "operands must be int"); be_return_nil(vm); } @@ -928,6 +934,7 @@ static int m_get(bvm *vm, bbool sign) be_pushint(vm, ret); be_return(vm); } + be_raise(vm, "type_error", "operands must be int"); be_return_nil(vm); } @@ -958,6 +965,7 @@ static int m_getfloat(bvm *vm) be_pushreal(vm, ret_f); be_return(vm); } + be_raise(vm, "type_error", "operands must be int"); be_return_nil(vm); } @@ -990,8 +998,12 @@ static int m_set(bvm *vm) int32_t idx = be_toint(vm, 2); int32_t value = be_toint(vm, 3); int vsize = 1; - if (argc >= 4 && be_isint(vm, 4)) { - vsize = be_toint(vm, 4); + if (argc >= 4) { + if (be_isint(vm, 4)) { + vsize = be_toint(vm, 4); + } else { + goto type_error; + } } if (idx < 0) { idx = attr.len + idx; /* if index is negative, count from end */ @@ -1015,6 +1027,8 @@ static int m_set(bvm *vm) // m_write_attributes(vm, 1, &attr); /* update attributes */ be_return_nil(vm); } +type_error: + be_raise(vm, "type_error", "operands must be int"); be_return_nil(vm); } @@ -1046,6 +1060,7 @@ static int m_setfloat(bvm *vm) } be_return_nil(vm); } + be_raise(vm, "type_error", "operands must be int or float"); be_return_nil(vm); } @@ -1072,6 +1087,7 @@ static int m_addfloat(bvm *vm) m_write_attributes(vm, 1, &attr); /* update attributes */ be_return(vm); } + be_raise(vm, "type_error", "operands must be int or float"); be_return_nil(vm); } @@ -1117,6 +1133,8 @@ static int m_setbytes(bvm *vm) if (from_len > 0) { memmove(attr.bufptr + idx, buf_ptr + from_byte, from_len); } + } else { + be_raise(vm, "type_error", "operands must be int and bytes"); } be_return_nil(vm); } diff --git a/lib/libesp32/berry/tests/bytes.be b/lib/libesp32/berry/tests/bytes.be index 6462fc1d0..1cece8e63 100644 --- a/lib/libesp32/berry/tests/bytes.be +++ b/lib/libesp32/berry/tests/bytes.be @@ -53,11 +53,6 @@ b.add(0x12345678, -2) assert(str(b) == "bytes('2278785678563412785678')") b.add(0x12345678, -4) assert(str(b) == "bytes('227878567856341278567812345678')") -b.add(0xAABBCC, 3) -assert(str(b) == "bytes('227878567856341278567812345678CCBBAA')") -b.add(0x998877, -3) -assert(str(b) == "bytes('227878567856341278567812345678CCBBAA998877')") - #- get -# b=bytes("000102030405") @@ -355,8 +350,34 @@ b = bytes("AABBCC") assert(bytes().fromstring(bytes("11").tob64()) == bytes('45513D3D')) assert(b.appendb64(c, 1, 1) == bytes("AABBCC45513D3D")) -#- asstring truncates if NULL is present -# -s=bytes("414243").asstring() -assert(size(s) == 3) -s=bytes("410000").asstring() -assert(size(s) == 1) +# bytes assign 3-byte values +b = bytes("1122") +assert(b.add(0x334455, 3) == bytes('1122554433')) +assert(b.add(0x334455, -3) == bytes('1122554433334455')) + +# new type testing in set/add methods +b = bytes("0000000000") + +assert_error(def () b.set(0, 0.5, 4) end, 'type_error') +assert_error(def () b.set(0, nil, 4) end, 'type_error') +assert_error(def () b.set(0, 1, nil) end, 'type_error') +assert_error(def () b.set(0, 1, 3.5) end, 'type_error') +assert_error(def () b.set(0, 'foo', 4) end, 'type_error') +assert_error(def () b.set(0, 4, 'foo') end, 'type_error') +assert_error(def () b.set(0, 0.5) end, 'type_error') +assert_error(def () b.set(0, nil) end, 'type_error') +assert_error(def () b.set(0, 'foo') end, 'type_error') +assert_error(def () b.set() end, 'type_error') + +assert_error(def () b.add(0.5, 4) end, 'type_error') +assert_error(def () b.add(nil, 4) end, 'type_error') +assert_error(def () b.add(5, 1.5) end, 'type_error') +assert_error(def () b.add(5, nil) end, 'type_error') +assert_error(def () b.add('foo', 4) end, 'type_error') +assert_error(def () b.add(5, 'foo') end, 'type_error') +assert_error(def () b.add() end, 'type_error') + +assert_error(def () b.addfloat(true) end, 'type_error') +assert_error(def () b.addfloat(nil) end, 'type_error') +assert_error(def () b.addfloat('foo') end, 'type_error') +assert_error(def () b.addfloat() end, 'type_error') From 0c625b0860bae29a1e1b474676942bbf2428146f Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Wed, 15 Oct 2025 17:03:39 +0200 Subject: [PATCH 017/136] Berry make LVGL Panel and Led Panel compatible with VPN (#24016) --- tasmota/berry/extensions/LVGL_Panel.tapp | Bin 38712 -> 38890 bytes .../berry/extensions/LVGL_Panel/lvgl_panel.be | 6 +++++- tasmota/berry/extensions/Leds_Panel.tapp | Bin 36944 -> 37122 bytes .../berry/extensions/Leds_Panel/leds_panel.be | 6 +++++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tasmota/berry/extensions/LVGL_Panel.tapp b/tasmota/berry/extensions/LVGL_Panel.tapp index 5b2fe94ebf5c25f5155754f335d1ba4803c16b9c..d26bbc0a0c082720b4b93c8fcf3f2ab008bebb2e 100644 GIT binary patch delta 460 zcmdn7j_K8UCf)#VW)?065ZJoeZz8WE`_@hGGPZAex6!njQFnKne{^B}!)F&JGcbTK zFM|w2PFZ?Rd_iJfYK~q~YG?>219Rin_ZiJw-*0}(c)puAGq)hWs6?T-q$o2lee(KV zg?b26uecy5vqYmjHK{nYs4TTeFC#TECACOH-6OxaL|s!yLETDSGuj|lK|w)TAw9K3 z0V1IQQKpcXm!eRTn4PMS3e;O!k^wYaAt^O2zbI9qBqLQJEwiW?sKrX13#eZqGfhDw zvp~VtRv|AlM_8ezMghW8SJwo~D@;DwtHPX`m$LaquPM7O(BskHV~iGD1O@^KgM68r zn3tKBT3n)+Rh*v(_9Zl2CVNdiz-nkTaIu7u{;_Tq8G`fdPbh z8Dto8%F=V<3lj5EbM%r@Lqj+jn2qY*Wth~x+x(RAeD~yIz0#8_`{Xvy?=xWMh~4HJ zJ$IT$+~n(1<=73=-ev&tDII8B2YXzS!R)AX5v)=n;*F2jpzrTcVs zkntcHbC_Wlfo=t1UIqz}v%z3VqwrJ)hTO!w%(T?v61}YA{JhW*Rt9E}eMhD%uxU>N GDFXl{ZB+LF diff --git a/tasmota/berry/extensions/LVGL_Panel/lvgl_panel.be b/tasmota/berry/extensions/LVGL_Panel/lvgl_panel.be index 1c37f9296..37c0c12a5 100644 --- a/tasmota/berry/extensions/LVGL_Panel/lvgl_panel.be +++ b/tasmota/berry/extensions/LVGL_Panel/lvgl_panel.be @@ -1035,8 +1035,12 @@ class lvgl_panel def send_iframe_code() import webserver + import string self.update() - var ip = tasmota.wifi().find('ip') + var ip = string.split(webserver.header('Host'), ':')[0] # get 'Host' header and take everything before the first ':' + if (ip == nil || ip == '') + ip = tasmota.wifi().find('ip') + end if (ip == nil) ip = tasmota.eth().find('ip') end diff --git a/tasmota/berry/extensions/Leds_Panel.tapp b/tasmota/berry/extensions/Leds_Panel.tapp index cba48be17818fbddbeb9a644c8819f00ad46798e..c19e4e1ec3cb82f9c1bef834c974684fc03d11b0 100644 GIT binary patch delta 496 zcmcbxfT?K_6JLNgGYc032v}{ljGoA+z#g#lYKCR%$e_u= z{dzhewWSr@42/#SE?M1Y0{cr!A|F+;){C0r-3?N<*2g&`gdm@bq68VLbQ8lUzt Upu3lqff?jhtqBTjU;9Do08IRuH~;_u delta 258 zcmZo##B^Z+6JLNgGYc032;|MY88wklf&GAPOvXXon2n|f7 Date: Wed, 15 Oct 2025 22:58:04 +0200 Subject: [PATCH 018/136] Berry animation update palettes converted from WLED project (#24021) --- .../src/animations/all_wled_palettes.anim | 671 ++++++ .../src/animations/all_wled_palettes.be | 1872 ++++++----------- 2 files changed, 1355 insertions(+), 1188 deletions(-) create mode 100644 lib/libesp32/berry_animation/src/animations/all_wled_palettes.anim diff --git a/lib/libesp32/berry_animation/src/animations/all_wled_palettes.anim b/lib/libesp32/berry_animation/src/animations/all_wled_palettes.anim new file mode 100644 index 000000000..2988f245c --- /dev/null +++ b/lib/libesp32/berry_animation/src/animations/all_wled_palettes.anim @@ -0,0 +1,671 @@ +# WLED Palettes converted to DSL format +# Auto-generated from from_wled/src/wled_palettes.h +# Total palettes: 59 + +# Gradient palette "ib_jul01_gp", originally from http://seaviewsensing.com/pub/cpt-city/ing/xmas/ib_jul01.c3g +palette PALETTE_JUL = [ + (0, 0xE2060C) # 0.0% rgb(226,6,12) (start) + (94, 0x1A604E) # 36.9% rgb(26,96,78) + (132, 0x82BD5E) # 51.8% rgb(130,189,94) + (255, 0xB10309) # 100.0% rgb(177,3,9) (end) +] + +# Gradient palette "es_vintage_57_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/vintage/es_vintage_57.c3g +palette PALETTE_GRINTAGE = [ + (0, 0x1D0803) # 0.0% rgb(29,8,3) (start) + (53, 0x4C0100) # 20.8% rgb(76,1,0) + (104, 0x8E601C) # 40.8% rgb(142,96,28) + (153, 0xD3BF3D) # 60.0% rgb(211,191,61) + (255, 0x75812A) # 100.0% rgb(117,129,42) (end) +] + +# Gradient palette "es_vintage_01_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/vintage/es_vintage_01.c3g +palette PALETTE_VINTAGE = [ + (0, 0x291218) # 0.0% rgb(41,18,24) (start) + (51, 0x490016) # 20.0% rgb(73,0,22) + (76, 0xA5AA26) # 29.8% rgb(165,170,38) + (101, 0xFFBD50) # 39.6% rgb(255,189,80) + (127, 0x8B3828) # 49.8% rgb(139,56,40) + (153, 0x490016) # 60.0% rgb(73,0,22) + (229, 0x291218) # 89.8% rgb(41,18,24) + (255, 0x291218) # 100.0% rgb(41,18,24) (end) +] + +# Gradient palette "es_rivendell_15_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/rivendell/es_rivendell_15.c3g +palette PALETTE_RIVENDELL = [ + (0, 0x18452C) # 0.0% rgb(24,69,44) (start) + (101, 0x496946) # 39.6% rgb(73,105,70) + (165, 0x818C61) # 64.7% rgb(129,140,97) + (242, 0xC8CCA6) # 94.9% rgb(200,204,166) + (255, 0xC8CCA6) # 100.0% rgb(200,204,166) (end) +] + +# Gradient palette "rgi_15_gp", originally from http://seaviewsensing.com/pub/cpt-city/ds/rgi/rgi_15.c3g +palette PALETTE_RED_BLUE = [ + (0, 0x290E63) # 0.0% rgb(41,14,99) (start) + (31, 0x80184A) # 12.2% rgb(128,24,74) + (63, 0xE32232) # 24.7% rgb(227,34,50) + (95, 0x841F4C) # 37.3% rgb(132,31,76) + (127, 0x2F1D66) # 49.8% rgb(47,29,102) + (159, 0x6D2F65) # 62.4% rgb(109,47,101) + (191, 0xB04264) # 74.9% rgb(176,66,100) + (223, 0x813968) # 87.5% rgb(129,57,104) + (255, 0x54306C) # 100.0% rgb(84,48,108) (end) +] + +# Gradient palette "retro2_16_gp", originally from http://seaviewsensing.com/pub/cpt-city/ma/retro2/retro2_16.c3g +palette PALETTE_YELLOWOUT = [ + (0, 0xDEBF08) # 0.0% rgb(222,191,8) (start) + (255, 0x753401) # 100.0% rgb(117,52,1) (end) +] + +# Gradient palette "Analogous_1_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/red/Analogous_1.c3g +palette PALETTE_ANALOGOUS = [ + (0, 0x2600FF) # 0.0% rgb(38,0,255) (start) + (63, 0x5600FF) # 24.7% rgb(86,0,255) + (127, 0x8B00FF) # 49.8% rgb(139,0,255) + (191, 0xC40075) # 74.9% rgb(196,0,117) + (255, 0xFF0000) # 100.0% rgb(255,0,0) (end) +] + +# Gradient palette "es_pinksplash_08_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/pink_splash/es_pinksplash_08.c3g +palette PALETTE_SPLASH = [ + (0, 0xBA3FFF) # 0.0% rgb(186,63,255) (start) + (127, 0xE30955) # 49.8% rgb(227,9,85) + (175, 0xEACDD5) # 68.6% rgb(234,205,213) + (221, 0xCD26B0) # 86.7% rgb(205,38,176) + (255, 0xCD26B0) # 100.0% rgb(205,38,176) (end) +] + +# Gradient palette "es_ocean_breeze_036_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/ocean_breeze/es_ocean_breeze_036.c3g +palette PALETTE_BREEZE = [ + (0, 0x103033) # 0.0% rgb(16,48,51) (start) + (89, 0x1BA6AF) # 34.9% rgb(27,166,175) + (153, 0xC5E9FF) # 60.0% rgb(197,233,255) + (255, 0x009198) # 100.0% rgb(0,145,152) (end) +] + +# Gradient palette "departure_gp", originally from http://seaviewsensing.com/pub/cpt-city/mjf/departure.c3g +palette PALETTE_DEPARTURE = [ + (0, 0x352200) # 0.0% rgb(53,34,0) (start) + (42, 0x563300) # 16.5% rgb(86,51,0) + (63, 0x936C31) # 24.7% rgb(147,108,49) + (84, 0xD4A66C) # 32.9% rgb(212,166,108) + (106, 0xEBD4B4) # 41.6% rgb(235,212,180) + (116, 0xFFFFFF) # 45.5% rgb(255,255,255) + (138, 0xBFFFC1) # 54.1% rgb(191,255,193) + (148, 0x54FF58) # 58.0% rgb(84,255,88) + (170, 0x00FF00) # 66.7% rgb(0,255,0) + (191, 0x00C000) # 74.9% rgb(0,192,0) + (212, 0x008000) # 83.1% rgb(0,128,0) + (255, 0x008000) # 100.0% rgb(0,128,0) (end) +] + +# Gradient palette "es_landscape_64_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/landscape/es_landscape_64.c3g +palette PALETTE_LANDSCAPE = [ + (0, 0x000000) # 0.0% rgb(0,0,0) (start) + (37, 0x1F5913) # 14.5% rgb(31,89,19) + (76, 0x48B22B) # 29.8% rgb(72,178,43) + (127, 0x96EB05) # 49.8% rgb(150,235,5) + (128, 0xBAEA77) # 50.2% rgb(186,234,119) + (130, 0xDEE9FC) # 51.0% rgb(222,233,252) + (153, 0xC5DBE7) # 60.0% rgb(197,219,231) + (204, 0x84B3FD) # 80.0% rgb(132,179,253) + (255, 0x1C6BE1) # 100.0% rgb(28,107,225) (end) +] + +# Gradient palette "es_landscape_33_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/landscape/es_landscape_33.c3g +palette PALETTE_BEACH = [ + (0, 0x0C2D00) # 0.0% rgb(12,45,0) (start) + (19, 0x655602) # 7.5% rgb(101,86,2) + (38, 0xCF8004) # 14.9% rgb(207,128,4) + (63, 0xF3C512) # 24.7% rgb(243,197,18) + (66, 0x6DC492) # 25.9% rgb(109,196,146) + (255, 0x052707) # 100.0% rgb(5,39,7) (end) +] + +# Gradient palette "rainbowsherbet_gp", originally from http://seaviewsensing.com/pub/cpt-city/ma/icecream/rainbowsherbet.c3g +palette PALETTE_SHERBET = [ + (0, 0xFF6629) # 0.0% rgb(255,102,41) (start) + (43, 0xFF8C5A) # 16.9% rgb(255,140,90) + (86, 0xFF335A) # 33.7% rgb(255,51,90) + (127, 0xFF99A9) # 49.8% rgb(255,153,169) + (170, 0xFFFFF9) # 66.7% rgb(255,255,249) + (209, 0x71FF55) # 82.0% rgb(113,255,85) + (255, 0x9DFF89) # 100.0% rgb(157,255,137) (end) +] + +# Gradient palette "gr65_hult_gp", originally from http://seaviewsensing.com/pub/cpt-city/hult/gr65_hult.c3g +palette PALETTE_HULT = [ + (0, 0xFBD8FC) # 0.0% rgb(251,216,252) (start) + (48, 0xFFC0FF) # 18.8% rgb(255,192,255) + (89, 0xEF5FF1) # 34.9% rgb(239,95,241) + (160, 0x3399D9) # 62.7% rgb(51,153,217) + (216, 0x18B8AE) # 84.7% rgb(24,184,174) + (255, 0x18B8AE) # 100.0% rgb(24,184,174) (end) +] + +# Gradient palette "gr64_hult_gp", originally from http://seaviewsensing.com/pub/cpt-city/hult/gr64_hult.c3g +palette PALETTE_HULT64 = [ + (0, 0x18B8AE) # 0.0% rgb(24,184,174) (start) + (66, 0x08A296) # 25.9% rgb(8,162,150) + (104, 0x7C8907) # 40.8% rgb(124,137,7) + (130, 0xB2BA16) # 51.0% rgb(178,186,22) + (150, 0x7C8907) # 58.8% rgb(124,137,7) + (201, 0x069C90) # 78.8% rgb(6,156,144) + (239, 0x008075) # 93.7% rgb(0,128,117) + (255, 0x008075) # 100.0% rgb(0,128,117) (end) +] + +# Gradient palette "GMT_drywet_gp", originally from http://seaviewsensing.com/pub/cpt-city/gmt/GMT_drywet.c3g +palette PALETTE_DRYWET = [ + (0, 0x776121) # 0.0% rgb(119,97,33) (start) + (42, 0xEBC758) # 16.5% rgb(235,199,88) + (84, 0xA9EE7C) # 32.9% rgb(169,238,124) + (127, 0x25EEE8) # 49.8% rgb(37,238,232) + (170, 0x0778EC) # 66.7% rgb(7,120,236) + (212, 0x1B01AF) # 83.1% rgb(27,1,175) + (255, 0x043365) # 100.0% rgb(4,51,101) (end) +] + +# Gradient palette "ib15_gp", originally from http://seaviewsensing.com/pub/cpt-city/ing/general/ib15.c3g +palette PALETTE_REWHI = [ + (0, 0xB1A0C7) # 0.0% rgb(177,160,199) (start) + (72, 0xCD9E95) # 28.2% rgb(205,158,149) + (89, 0xE99B65) # 34.9% rgb(233,155,101) + (107, 0xFF5F3F) # 42.0% rgb(255,95,63) + (141, 0xC0626D) # 55.3% rgb(192,98,109) + (255, 0x84659F) # 100.0% rgb(132,101,159) (end) +] + +# Gradient palette "Tertiary_01_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/vermillion/Tertiary_01.c3g +palette PALETTE_TERTIARY = [ + (0, 0x0019FF) # 0.0% rgb(0,25,255) (start) + (63, 0x268C75) # 24.7% rgb(38,140,117) + (127, 0x56FF00) # 49.8% rgb(86,255,0) + (191, 0xA78C13) # 74.9% rgb(167,140,19) + (255, 0xFF1929) # 100.0% rgb(255,25,41) (end) +] + +# Gradient palette "lava_gp", originally from http://seaviewsensing.com/pub/cpt-city/neota/elem/lava.c3g +palette PALETTE_FIRE = [ + (0, 0x000000) # 0.0% rgb(0,0,0) (start) + (46, 0x4D0000) # 18.0% rgb(77,0,0) + (96, 0xB10000) # 37.6% rgb(177,0,0) + (108, 0xC42609) # 42.4% rgb(196,38,9) + (119, 0xD74C13) # 46.7% rgb(215,76,19) + (146, 0xEB731D) # 57.3% rgb(235,115,29) + (174, 0xFF9929) # 68.2% rgb(255,153,41) + (188, 0xFFB229) # 73.7% rgb(255,178,41) + (202, 0xFFCC29) # 79.2% rgb(255,204,41) + (218, 0xFFE629) # 85.5% rgb(255,230,41) + (234, 0xFFFF29) # 91.8% rgb(255,255,41) + (244, 0xFFFF8F) # 95.7% rgb(255,255,143) + (255, 0xFFFFFF) # 100.0% rgb(255,255,255) (end) +] + +# Gradient palette "fierce-ice_gp", originally from http://seaviewsensing.com/pub/cpt-city/neota/elem/fierce-ice.c3g +palette PALETTE_ICEFIRE = [ + (0, 0x000000) # 0.0% rgb(0,0,0) (start) + (59, 0x003375) # 23.1% rgb(0,51,117) + (119, 0x0066FF) # 46.7% rgb(0,102,255) + (149, 0x2699FF) # 58.4% rgb(38,153,255) + (180, 0x56CCFF) # 70.6% rgb(86,204,255) + (217, 0xA7E6FF) # 85.1% rgb(167,230,255) + (255, 0xFFFFFF) # 100.0% rgb(255,255,255) (end) +] + +# Gradient palette "Colorfull_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Colorfull.c3g +palette PALETTE_CYANE = [ + (0, 0x3D9B2C) # 0.0% rgb(61,155,44) (start) + (25, 0x5FAE4D) # 9.8% rgb(95,174,77) + (60, 0x84C171) # 23.5% rgb(132,193,113) + (93, 0x9AA67D) # 36.5% rgb(154,166,125) + (106, 0xAF8A88) # 41.6% rgb(175,138,136) + (109, 0xB77989) # 42.7% rgb(183,121,137) + (113, 0xC2688A) # 44.3% rgb(194,104,138) + (116, 0xE1B3A5) # 45.5% rgb(225,179,165) + (124, 0xFFFFC0) # 48.6% rgb(255,255,192) + (168, 0xA7DACB) # 65.9% rgb(167,218,203) + (255, 0x54B6D7) # 100.0% rgb(84,182,215) (end) +] + +# Gradient palette "Pink_Purple_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Pink_Purple.c3g +palette PALETTE_LIGHT_PINK = [ + (0, 0x4F206D) # 0.0% rgb(79,32,109) (start) + (25, 0x5A2875) # 9.8% rgb(90,40,117) + (51, 0x66307C) # 20.0% rgb(102,48,124) + (76, 0x8D87B9) # 29.8% rgb(141,135,185) + (102, 0xB4DEF8) # 40.0% rgb(180,222,248) + (109, 0xD0ECFC) # 42.7% rgb(208,236,252) + (114, 0xEDFAFF) # 44.7% rgb(237,250,255) + (122, 0xCEC8EF) # 47.8% rgb(206,200,239) + (149, 0xB195DE) # 58.4% rgb(177,149,222) + (183, 0xBB82CB) # 71.8% rgb(187,130,203) + (255, 0xC66FB8) # 100.0% rgb(198,111,184) (end) +] + +# Gradient palette "Sunset_Real_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Sunset_Real.c3g +palette PALETTE_SUNSET = [ + (0, 0xB50000) # 0.0% rgb(181,0,0) (start) + (22, 0xDA5500) # 8.6% rgb(218,85,0) + (51, 0xFFAA00) # 20.0% rgb(255,170,0) + (85, 0xD3554D) # 33.3% rgb(211,85,77) + (135, 0xA700A9) # 52.9% rgb(167,0,169) + (198, 0x4900BC) # 77.6% rgb(73,0,188) + (255, 0x0000CF) # 100.0% rgb(0,0,207) (end) +] + +# Gradient palette "Sunset_Yellow_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Sunset_Yellow.c3g +palette PALETTE_PASTEL = [ + (0, 0x3D87B8) # 0.0% rgb(61,135,184) (start) + (36, 0x81BCA9) # 14.1% rgb(129,188,169) + (87, 0xCBF19B) # 34.1% rgb(203,241,155) + (100, 0xE4ED8D) # 39.2% rgb(228,237,141) + (107, 0xFFE87F) # 42.0% rgb(255,232,127) + (115, 0xFBCA82) # 45.1% rgb(251,202,130) + (120, 0xF8AC85) # 47.1% rgb(248,172,133) + (128, 0xFBCA82) # 50.2% rgb(251,202,130) + (180, 0xFFE87F) # 70.6% rgb(255,232,127) + (223, 0xFFF278) # 87.5% rgb(255,242,120) + (255, 0xFFFC71) # 100.0% rgb(255,252,113) (end) +] + +# Gradient palette "Beech_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Beech.c3g +palette PALETTE_BEECH = [ + (0, 0xFFFEEC) # 0.0% rgb(255,254,236) (start) + (12, 0xFFFEEC) # 4.7% rgb(255,254,236) + (22, 0xFFFEEC) # 8.6% rgb(255,254,236) + (26, 0xDFE0B2) # 10.2% rgb(223,224,178) + (28, 0xC0C37C) # 11.0% rgb(192,195,124) + (28, 0xB0FFE7) # 11.0% rgb(176,255,231) + (50, 0x7BFBEC) # 19.6% rgb(123,251,236) + (71, 0x4AF6F1) # 27.8% rgb(74,246,241) + (93, 0x21E1E4) # 36.5% rgb(33,225,228) + (120, 0x00CCD7) # 47.1% rgb(0,204,215) + (133, 0x04A8B2) # 52.2% rgb(4,168,178) + (136, 0x0A848F) # 53.3% rgb(10,132,143) + (136, 0x33BDD4) # 53.3% rgb(51,189,212) + (208, 0x179FC9) # 81.6% rgb(23,159,201) + (255, 0x0081BE) # 100.0% rgb(0,129,190) (end) +] + +# Gradient palette "Another_Sunset_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Another_Sunset.c3g +palette PALETTE_SUNSET2 = [ + (0, 0xAF793E) # 0.0% rgb(175,121,62) (start) + (29, 0x80673C) # 11.4% rgb(128,103,60) + (68, 0x54543A) # 26.7% rgb(84,84,58) + (68, 0xF8B837) # 26.7% rgb(248,184,55) + (97, 0xEFCC5D) # 38.0% rgb(239,204,93) + (124, 0xE6E185) # 48.6% rgb(230,225,133) + (178, 0x667D81) # 69.8% rgb(102,125,129) + (255, 0x001A7D) # 100.0% rgb(0,26,125) (end) +] + +# Gradient palette "es_autumn_19_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/autumn/es_autumn_19.c3g +palette PALETTE_AUTUMN = [ + (0, 0x5A0E05) # 0.0% rgb(90,14,5) (start) + (51, 0x8B290D) # 20.0% rgb(139,41,13) + (84, 0xB44611) # 32.9% rgb(180,70,17) + (104, 0xC0CA7D) # 40.8% rgb(192,202,125) + (112, 0xB18903) # 43.9% rgb(177,137,3) + (122, 0xBEC883) # 47.8% rgb(190,200,131) + (124, 0xC0CA7C) # 48.6% rgb(192,202,124) + (135, 0xB18903) # 52.9% rgb(177,137,3) + (142, 0xC2CB76) # 55.7% rgb(194,203,118) + (163, 0xB14411) # 63.9% rgb(177,68,17) + (204, 0x80230C) # 80.0% rgb(128,35,12) + (249, 0x4A0502) # 97.6% rgb(74,5,2) + (255, 0x4A0502) # 100.0% rgb(74,5,2) (end) +] + +# Gradient palette "BlacK_Blue_Magenta_White_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/basic/BlacK_Blue_Magenta_White.c3g +palette PALETTE_MAGENTA = [ + (0, 0x000000) # 0.0% rgb(0,0,0) (start) + (42, 0x000075) # 16.5% rgb(0,0,117) + (84, 0x0000FF) # 32.9% rgb(0,0,255) + (127, 0x7100FF) # 49.8% rgb(113,0,255) + (170, 0xFF00FF) # 66.7% rgb(255,0,255) + (212, 0xFF80FF) # 83.1% rgb(255,128,255) + (255, 0xFFFFFF) # 100.0% rgb(255,255,255) (end) +] + +# Gradient palette "BlacK_Magenta_Red_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/basic/BlacK_Magenta_Red.c3g +palette PALETTE_MAGRED = [ + (0, 0x000000) # 0.0% rgb(0,0,0) (start) + (63, 0x710075) # 24.7% rgb(113,0,117) + (127, 0xFF00FF) # 49.8% rgb(255,0,255) + (191, 0xFF0075) # 74.9% rgb(255,0,117) + (255, 0xFF0000) # 100.0% rgb(255,0,0) (end) +] + +# Gradient palette "BlacK_Red_Magenta_Yellow_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/basic/BlacK_Red_Magenta_Yellow.c3g +palette PALETTE_YELMAG = [ + (0, 0x000000) # 0.0% rgb(0,0,0) (start) + (42, 0x710000) # 16.5% rgb(113,0,0) + (84, 0xFF0000) # 32.9% rgb(255,0,0) + (127, 0xFF0075) # 49.8% rgb(255,0,117) + (170, 0xFF00FF) # 66.7% rgb(255,0,255) + (212, 0xFF8075) # 83.1% rgb(255,128,117) + (255, 0xFFFF00) # 100.0% rgb(255,255,0) (end) +] + +# Gradient palette "Blue_Cyan_Yellow_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/basic/Blue_Cyan_Yellow.c3g +palette PALETTE_YELBLU = [ + (0, 0x0000FF) # 0.0% rgb(0,0,255) (start) + (63, 0x0080FF) # 24.7% rgb(0,128,255) + (127, 0x00FFFF) # 49.8% rgb(0,255,255) + (191, 0x71FF75) # 74.9% rgb(113,255,117) + (255, 0xFFFF00) # 100.0% rgb(255,255,0) (end) +] + +# Custom palette by Aircoookie +palette PALETTE_ORANGE_TEAL = [ + (0, 0x00965C) # 0.0% rgb(0,150,92) (start) + (55, 0x00965C) # 21.6% rgb(0,150,92) + (200, 0xFF4800) # 78.4% rgb(255,72,0) + (255, 0xFF4800) # 100.0% rgb(255,72,0) (end) +] + +# Custom palette by Aircoookie +palette PALETTE_TIAMAT = [ + (0, 0x01020E) # 0.0% rgb(1,2,14) (start) + (33, 0x020523) # 12.9% rgb(2,5,35) + (100, 0x0D875C) # 39.2% rgb(13,135,92) + (120, 0x2BFFC1) # 47.1% rgb(43,255,193) + (140, 0xF707F9) # 54.9% rgb(247,7,249) + (160, 0xC111D0) # 62.7% rgb(193,17,208) + (180, 0x27FF9A) # 70.6% rgb(39,255,154) + (200, 0x04D5EC) # 78.4% rgb(4,213,236) + (220, 0x27FC87) # 86.3% rgb(39,252,135) + (240, 0xC1D5FD) # 94.1% rgb(193,213,253) + (255, 0xFFF9FF) # 100.0% rgb(255,249,255) (end) +] + +# Custom palette by Aircoookie +palette PALETTE_APRIL_NIGHT = [ + (0, 0x01052D) # 0.0% rgb(1,5,45) (start) + (10, 0x01052D) # 3.9% rgb(1,5,45) + (25, 0x05A9AF) # 9.8% rgb(5,169,175) + (40, 0x01052D) # 15.7% rgb(1,5,45) + (61, 0x01052D) # 23.9% rgb(1,5,45) + (76, 0x2DAF1F) # 29.8% rgb(45,175,31) + (91, 0x01052D) # 35.7% rgb(1,5,45) + (112, 0x01052D) # 43.9% rgb(1,5,45) + (127, 0xF99605) # 49.8% rgb(249,150,5) + (143, 0x01052D) # 56.1% rgb(1,5,45) + (162, 0x01052D) # 63.5% rgb(1,5,45) + (178, 0xFF5C00) # 69.8% rgb(255,92,0) + (193, 0x01052D) # 75.7% rgb(1,5,45) + (214, 0x01052D) # 83.9% rgb(1,5,45) + (229, 0xDF2D48) # 89.8% rgb(223,45,72) + (244, 0x01052D) # 95.7% rgb(1,5,45) + (255, 0x01052D) # 100.0% rgb(1,5,45) (end) +] + +palette PALETTE_ORANGERY = [ + (0, 0xFF5F17) # 0.0% rgb(255,95,23) (start) + (30, 0xFF5200) # 11.8% rgb(255,82,0) + (60, 0xDF0D08) # 23.5% rgb(223,13,8) + (90, 0x902C02) # 35.3% rgb(144,44,2) + (120, 0xFF6E11) # 47.1% rgb(255,110,17) + (150, 0xFF4500) # 58.8% rgb(255,69,0) + (180, 0x9E0D0B) # 70.6% rgb(158,13,11) + (210, 0xF15211) # 82.4% rgb(241,82,17) + (255, 0xD52504) # 100.0% rgb(213,37,4) (end) +] + +# inspired by Mark Kriegsman https://gist.github.com/kriegsman/756ea6dcae8e30845b5a +palette PALETTE_C9 = [ + (0, 0xB80400) # 0.0% rgb(184,4,0) (start) + (60, 0xB80400) # 23.5% rgb(184,4,0) + (65, 0x902C02) # 25.5% rgb(144,44,2) + (125, 0x902C02) # 49.0% rgb(144,44,2) + (130, 0x046002) # 51.0% rgb(4,96,2) + (190, 0x046002) # 74.5% rgb(4,96,2) + (195, 0x070758) # 76.5% rgb(7,7,88) + (255, 0x070758) # 100.0% rgb(7,7,88) (end) +] + +palette PALETTE_SAKURA = [ + (0, 0xC4130A) # 0.0% rgb(196,19,10) (start) + (65, 0xFF452D) # 25.5% rgb(255,69,45) + (130, 0xDF2D48) # 51.0% rgb(223,45,72) + (195, 0xFF5267) # 76.5% rgb(255,82,103) + (255, 0xDF0D11) # 100.0% rgb(223,13,17) (end) +] + +palette PALETTE_AURORA = [ + (0, 0x01052D) # 0.0% rgb(1,5,45) (start) + (64, 0x00C817) # 25.1% rgb(0,200,23) + (128, 0x00FF00) # 50.2% rgb(0,255,0) + (170, 0x00F32D) # 66.7% rgb(0,243,45) + (200, 0x008707) # 78.4% rgb(0,135,7) + (255, 0x01052D) # 100.0% rgb(1,5,45) (end) +] + +palette PALETTE_ATLANTICA = [ + (0, 0x001C70) # 0.0% rgb(0,28,112) (start) + (50, 0x2060FF) # 19.6% rgb(32,96,255) + (100, 0x00F32D) # 39.2% rgb(0,243,45) + (150, 0x0C5F52) # 58.8% rgb(12,95,82) + (200, 0x19BE5F) # 78.4% rgb(25,190,95) + (255, 0x28AA50) # 100.0% rgb(40,170,80) (end) +] + +palette PALETTE_C9_2 = [ + (0, 0x067E02) # 0.0% rgb(6,126,2) (start) + (45, 0x067E02) # 17.6% rgb(6,126,2) + (46, 0x041E72) # 18.0% rgb(4,30,114) + (90, 0x041E72) # 35.3% rgb(4,30,114) + (91, 0xFF0500) # 35.7% rgb(255,5,0) + (135, 0xFF0500) # 52.9% rgb(255,5,0) + (136, 0xC43902) # 53.3% rgb(196,57,2) + (180, 0xC43902) # 70.6% rgb(196,57,2) + (181, 0x895502) # 71.0% rgb(137,85,2) + (255, 0x895502) # 100.0% rgb(137,85,2) (end) +] + +# C9, but brighter and with a less purple blue +palette PALETTE_C9_NEW = [ + (0, 0xFF0500) # 0.0% rgb(255,5,0) (start) + (60, 0xFF0500) # 23.5% rgb(255,5,0) + (61, 0xC43902) # 23.9% rgb(196,57,2) + (120, 0xC43902) # 47.1% rgb(196,57,2) + (121, 0x067E02) # 47.5% rgb(6,126,2) + (180, 0x067E02) # 70.6% rgb(6,126,2) + (181, 0x041E72) # 71.0% rgb(4,30,114) + (255, 0x041E72) # 100.0% rgb(4,30,114) (end) +] + +# Gradient palette "temperature_gp", originally from http://seaviewsensing.com/pub/cpt-city/arendal/temperature.c3g +palette PALETTE_TEMPERATURE = [ + (0, 0x145CAB) # 0.0% rgb(20,92,171) (start) + (14, 0x0F6FBA) # 5.5% rgb(15,111,186) + (28, 0x068ED3) # 11.0% rgb(6,142,211) + (42, 0x02A1E3) # 16.5% rgb(2,161,227) + (56, 0x10B5EF) # 22.0% rgb(16,181,239) + (70, 0x26BCC9) # 27.5% rgb(38,188,201) + (84, 0x56CCC8) # 32.9% rgb(86,204,200) + (99, 0x8BDBB0) # 38.8% rgb(139,219,176) + (113, 0xB6E57D) # 44.3% rgb(182,229,125) + (127, 0xC4E63F) # 49.8% rgb(196,230,63) + (141, 0xF1F016) # 55.3% rgb(241,240,22) + (155, 0xFEDE1E) # 60.8% rgb(254,222,30) + (170, 0xFBC704) # 66.7% rgb(251,199,4) + (184, 0xF79D09) # 72.2% rgb(247,157,9) + (198, 0xF3720F) # 77.6% rgb(243,114,15) + (226, 0xD51E1D) # 88.6% rgb(213,30,29) + (240, 0x972623) # 94.1% rgb(151,38,35) + (255, 0x972623) # 100.0% rgb(151,38,35) (end) +] + +# Gradient palette "bhw1_01_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_01.c3g +palette PALETTE_RETRO_CLOWN = [ + (0, 0xF2A826) # 0.0% rgb(242,168,38) (start) + (117, 0xE24E50) # 45.9% rgb(226,78,80) + (255, 0xA136E1) # 100.0% rgb(161,54,225) (end) +] + +# Gradient palette "bhw1_04_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_04.c3g +palette PALETTE_CANDY = [ + (0, 0xF3F217) # 0.0% rgb(243,242,23) (start) + (15, 0xF2A826) # 5.9% rgb(242,168,38) + (142, 0x6F1597) # 55.7% rgb(111,21,151) + (198, 0x4A1696) # 77.6% rgb(74,22,150) + (255, 0x000075) # 100.0% rgb(0,0,117) (end) +] + +# Gradient palette "bhw1_05_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_05.c3g +palette PALETTE_TOXY_REAF = [ + (0, 0x02EF7E) # 0.0% rgb(2,239,126) (start) + (255, 0x9123D9) # 100.0% rgb(145,35,217) (end) +] + +# Gradient palette "bhw1_06_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_06.c3g +palette PALETTE_FAIRY_REAF = [ + (0, 0xDC13BB) # 0.0% rgb(220,19,187) (start) + (160, 0x0CE1DB) # 62.7% rgb(12,225,219) + (219, 0xCBF2DF) # 85.9% rgb(203,242,223) + (255, 0xFFFFFF) # 100.0% rgb(255,255,255) (end) +] + +# Gradient palette "bhw1_14_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_14.c3g +palette PALETTE_SEMI_BLUE = [ + (0, 0x000000) # 0.0% rgb(0,0,0) (start) + (12, 0x180426) # 4.7% rgb(24,4,38) + (53, 0x370854) # 20.8% rgb(55,8,84) + (80, 0x2B309F) # 31.4% rgb(43,48,159) + (119, 0x1F59ED) # 46.7% rgb(31,89,237) + (145, 0x323BA6) # 56.9% rgb(50,59,166) + (186, 0x471E62) # 72.9% rgb(71,30,98) + (233, 0x1F0F2D) # 91.4% rgb(31,15,45) + (255, 0x000000) # 100.0% rgb(0,0,0) (end) +] + +# Gradient palette "bhw1_three_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_three.c3g +palette PALETTE_PINK_CANDY = [ + (0, 0xFFFFFF) # 0.0% rgb(255,255,255) (start) + (45, 0x3240FF) # 17.6% rgb(50,64,255) + (112, 0xF210BA) # 43.9% rgb(242,16,186) + (140, 0xFFFFFF) # 54.9% rgb(255,255,255) + (155, 0xF210BA) # 60.8% rgb(242,16,186) + (196, 0x740DA6) # 76.9% rgb(116,13,166) + (255, 0xFFFFFF) # 100.0% rgb(255,255,255) (end) +] + +# Gradient palette "bhw1_w00t_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_w00t.c3g +palette PALETTE_RED_REAF = [ + (0, 0x244472) # 0.0% rgb(36,68,114) (start) + (104, 0x95C3F8) # 40.8% rgb(149,195,248) + (188, 0xFF0000) # 73.7% rgb(255,0,0) + (255, 0x5E0E09) # 100.0% rgb(94,14,9) (end) +] + +# Gradient palette "bhw2_23_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw2/bhw2_23.c3g +palette PALETTE_AQUA_FLASH = [ + (0, 0x000000) # 0.0% rgb(0,0,0) (start) + (66, 0x82F2F5) # 25.9% rgb(130,242,245) + (96, 0xFFFF35) # 37.6% rgb(255,255,53) + (124, 0xFFFFFF) # 48.6% rgb(255,255,255) + (153, 0xFFFF35) # 60.0% rgb(255,255,53) + (188, 0x82F2F5) # 73.7% rgb(130,242,245) + (255, 0x000000) # 100.0% rgb(0,0,0) (end) +] + +# Gradient palette "bhw2_xc_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw2/bhw2_xc.c3g +palette PALETTE_YELBLU_HOT = [ + (0, 0x2B1E39) # 0.0% rgb(43,30,57) (start) + (58, 0x490077) # 22.7% rgb(73,0,119) + (122, 0x57004A) # 47.8% rgb(87,0,74) + (158, 0xC53916) # 62.0% rgb(197,57,22) + (183, 0xDA751B) # 71.8% rgb(218,117,27) + (219, 0xEFB120) # 85.9% rgb(239,177,32) + (255, 0xF6F71B) # 100.0% rgb(246,247,27) (end) +] + +# Gradient palette "bhw2_45_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw2/bhw2_45.c3g +palette PALETTE_LITE_LIGHT = [ + (0, 0x000000) # 0.0% rgb(0,0,0) (start) + (9, 0x141516) # 3.5% rgb(20,21,22) + (40, 0x2E2B31) # 15.7% rgb(46,43,49) + (66, 0x2E2B31) # 25.9% rgb(46,43,49) + (101, 0x3D1041) # 39.6% rgb(61,16,65) + (255, 0x000000) # 100.0% rgb(0,0,0) (end) +] + +# Gradient palette "bhw2_22_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw2/bhw2_22.c3g +palette PALETTE_RED_FLASH = [ + (0, 0x000000) # 0.0% rgb(0,0,0) (start) + (99, 0xF20C08) # 38.8% rgb(242,12,8) + (130, 0xFDE4A3) # 51.0% rgb(253,228,163) + (155, 0xF20C08) # 60.8% rgb(242,12,8) + (255, 0x000000) # 100.0% rgb(0,0,0) (end) +] + +# Gradient palette "bhw3_40_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw3/bhw3_40.c3g +palette PALETTE_BLINK_RED = [ + (0, 0x040704) # 0.0% rgb(4,7,4) (start) + (43, 0x28193E) # 16.9% rgb(40,25,62) + (76, 0x3D0F24) # 29.8% rgb(61,15,36) + (109, 0xCF2760) # 42.7% rgb(207,39,96) + (127, 0xFF9CB8) # 49.8% rgb(255,156,184) + (165, 0xB949CF) # 64.7% rgb(185,73,207) + (204, 0x6942F0) # 80.0% rgb(105,66,240) + (255, 0x4D1D4E) # 100.0% rgb(77,29,78) (end) +] + +# Gradient palette "bhw3_52_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw3/bhw3_52.c3g +palette PALETTE_RED_SHIFT = [ + (0, 0x62165D) # 0.0% rgb(98,22,93) (start) + (45, 0x671649) # 17.6% rgb(103,22,73) + (99, 0xC02D38) # 38.8% rgb(192,45,56) + (132, 0xEBBB3B) # 51.8% rgb(235,187,59) + (175, 0xE4551A) # 68.6% rgb(228,85,26) + (201, 0xE43830) # 78.8% rgb(228,56,48) + (255, 0x020002) # 100.0% rgb(2,0,2) (end) +] + +# Gradient palette "bhw4_097_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw4/bhw4_097.c3g +palette PALETTE_RED_TIDE = [ + (0, 0xFB2E00) # 0.0% rgb(251,46,0) (start) + (28, 0xFF8B19) # 11.0% rgb(255,139,25) + (43, 0xF69E3F) # 16.9% rgb(246,158,63) + (58, 0xF6D87B) # 22.7% rgb(246,216,123) + (84, 0xF35E0A) # 32.9% rgb(243,94,10) + (114, 0xB1410B) # 44.7% rgb(177,65,11) + (140, 0xFFF173) # 54.9% rgb(255,241,115) + (168, 0xB1410B) # 65.9% rgb(177,65,11) + (196, 0xFAE99E) # 76.9% rgb(250,233,158) + (216, 0xFF5E06) # 84.7% rgb(255,94,6) + (255, 0x7E0804) # 100.0% rgb(126,8,4) (end) +] + +# Gradient palette "bhw4_017_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw4/bhw4_017.c3g +palette PALETTE_CANDY2 = [ + (0, 0x6D6666) # 0.0% rgb(109,102,102) (start) + (25, 0x2A3147) # 9.8% rgb(42,49,71) + (48, 0x796054) # 18.8% rgb(121,96,84) + (73, 0xF1D61A) # 28.6% rgb(241,214,26) + (89, 0xD8682C) # 34.9% rgb(216,104,44) + (130, 0x2A3147) # 51.0% rgb(42,49,71) + (163, 0xFFB12F) # 63.9% rgb(255,177,47) + (186, 0xF1D61A) # 72.9% rgb(241,214,26) + (211, 0x6D6666) # 82.7% rgb(109,102,102) + (255, 0x14130D) # 100.0% rgb(20,19,13) (end) +] + +palette PALETTE_TRAFFIC_LIGHT = [ + (0, 0x000000) # 0.0% rgb(0,0,0) (start) + (85, 0x00FF00) # 33.3% rgb(0,255,0) + (170, 0xFFFF00) # 66.7% rgb(255,255,0) + (255, 0xFF0000) # 100.0% rgb(255,0,0) (end) +] + +palette PALETTE_AURORA_2 = [ + (0, 0x11B10D) # 0.0% rgb(17,177,13) (start) + (64, 0x79F205) # 25.1% rgb(121,242,5) + (128, 0x19AD79) # 50.2% rgb(25,173,121) + (192, 0xFA4D7F) # 75.3% rgb(250,77,127) + (255, 0xAB65DD) # 100.0% rgb(171,101,221) (end) +] diff --git a/lib/libesp32/berry_animation/src/animations/all_wled_palettes.be b/lib/libesp32/berry_animation/src/animations/all_wled_palettes.be index 61aa31c92..d96f2e6cc 100644 --- a/lib/libesp32/berry_animation/src/animations/all_wled_palettes.be +++ b/lib/libesp32/berry_animation/src/animations/all_wled_palettes.be @@ -1,1188 +1,685 @@ -# Generated Berry code from Animation DSL -# Source: all_wled_palettes.anim -# -# This file was automatically generated by compile_all_examples.sh -# Do not edit manually - changes will be overwritten +# WLED Palettes converted to Berry format +# Auto-generated from from_wled/src/wled_palettes.h +# Total palettes: 59 +# +# Format: VRGB (Value/Position, Red, Green, Blue) as hex bytes -# Complete WLED Palette Collection for Berry Animation Framework -# Converted from both .c3g files and WLED header definitions -# Total palettes: 104 -# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# = -# Palettes from downloaded .c3g files -# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# = -# Source: Analogous_1.c3g -# Auto-generated strip initialization (using Tasmota configuration) - -var PALETTE_ANALOGOUS_1_ = bytes( - "003300FF" # 0.0% rgb(51,0,255) (start) - "406600FF" # 25.0% rgb(102,0,255) - "809900FF" # 50.0% rgb(153,0,255) - "BFCC0080" # 75.0% rgb(204,0,128) - "FFFF0000" # 100.0% rgb(255,0,0) (end) -) -# Source: Another_Sunset.c3g -var PALETTE_ANOTHER_SUNSET_ = bytes( - "00B97949" # 0.0% rgb(185,121,73) (start) - "1E8E6747" # 11.7% rgb(142,103,71) - "44645445" # 26.8% rgb(100,84,69) - "44F9B842" # 26.8% rgb(249,184,66) - "61F1CC69" # 38.2% rgb(241,204,105) - "7DEAE190" # 48.8% rgb(234,225,144) - "B3757D8C" # 70.1% rgb(117,125,140) - "FF001A88" # 100.0% rgb(0,26,136) (end) -) -# Source: Beech.c3g -var PALETTE_BEECH_ = bytes( - "00FFFEEE" # 0.0% rgb(255,254,238) (start) - "0CFFFEEE" # 4.8% rgb(255,254,238) - "17FFFEEE" # 9.0% rgb(255,254,238) - "1AE4E0BA" # 10.3% rgb(228,224,186) - "1DC9C387" # 11.3% rgb(201,195,135) - "1DBAFFEA" # 11.3% rgb(186,255,234) - "338AFBEE" # 19.9% rgb(138,251,238) - "475AF6F3" # 27.9% rgb(90,246,243) - "5D2DE1E7" # 36.6% rgb(45,225,231) - "7800CCDB" # 47.2% rgb(0,204,219) - "8608A8BA" # 52.4% rgb(8,168,186) - "88108499" # 53.4% rgb(16,132,153) - "8841BDD9" # 53.4% rgb(65,189,217) - "D1219FCF" # 81.8% rgb(33,159,207) - "FF0081C5" # 100.0% rgb(0,129,197) (end) -) -# Source: BlacK_Blue_Magenta_White.c3g -var PALETTE_BLACK_BLUE_MAGENTA_WHITE_ = bytes( - "00000000" # 0.0% rgb(0,0,0) (start) - "2B000080" # 16.7% rgb(0,0,128) - "550000FF" # 33.3% rgb(0,0,255) - "808000FF" # 50.0% rgb(128,0,255) - "AAFF00FF" # 66.7% rgb(255,0,255) - "D4FF80FF" # 83.3% rgb(255,128,255) - "FFFFFFFF" # 100.0% rgb(255,255,255) (end) -) -# Source: BlacK_Magenta_Red.c3g -var PALETTE_BLACK_MAGENTA_RED_ = bytes( - "00000000" # 0.0% rgb(0,0,0) (start) - "40800080" # 25.0% rgb(128,0,128) - "80FF00FF" # 50.0% rgb(255,0,255) - "BFFF0080" # 75.0% rgb(255,0,128) - "FFFF0000" # 100.0% rgb(255,0,0) (end) -) -# Source: BlacK_Red_Magenta_Yellow.c3g -var PALETTE_BLACK_RED_MAGENTA_YELLOW_ = bytes( - "00000000" # 0.0% rgb(0,0,0) (start) - "2B800000" # 16.7% rgb(128,0,0) - "55FF0000" # 33.3% rgb(255,0,0) - "80FF0080" # 50.0% rgb(255,0,128) - "AAFF00FF" # 66.7% rgb(255,0,255) - "D4FF8080" # 83.3% rgb(255,128,128) - "FFFFFF00" # 100.0% rgb(255,255,0) (end) -) -# Source: Blue_Cyan_Yellow.c3g -var PALETTE_BLUE_CYAN_YELLOW_ = bytes( - "000000FF" # 0.0% rgb(0,0,255) (start) - "400080FF" # 25.0% rgb(0,128,255) - "8000FFFF" # 50.0% rgb(0,255,255) - "BF80FF80" # 75.0% rgb(128,255,128) - "FFFFFF00" # 100.0% rgb(255,255,0) (end) -) -# Source: Colorfull.c3g -var PALETTE_COLORFULL_ = bytes( - "004C9B36" # 0.0% rgb(76,155,54) (start) - "1A6FAE59" # 10.0% rgb(111,174,89) - "3C92C17D" # 23.5% rgb(146,193,125) - "5DA6A688" # 36.6% rgb(166,166,136) - "6AB98A93" # 41.6% rgb(185,138,147) - "6DC17994" # 42.9% rgb(193,121,148) - "71CA6895" # 44.4% rgb(202,104,149) - "75E5B3AE" # 45.7% rgb(229,179,174) - "7DFFFFC7" # 48.9% rgb(255,255,199) - "A8B2DAD1" # 65.9% rgb(178,218,209) - "FF64B6DB" # 100.0% rgb(100,182,219) (end) -) -# Source: GMT_drywet.c3g -var PALETTE_GMT_DRYWET_ = bytes( - "0086612A" # 0.0% rgb(134,97,42) (start) - "2BEEC764" # 16.7% rgb(238,199,100) - "55B4EE87" # 33.3% rgb(180,238,135) - "8032EEEB" # 50.0% rgb(50,238,235) - "AA0C78EE" # 66.7% rgb(12,120,238) - "D42601B7" # 83.3% rgb(38,1,183) - "FF083371" # 100.0% rgb(8,51,113) (end) -) -# Source: Pink_Purple.c3g -var PALETTE_PINK_PURPLE_ = bytes( - "005F2079" # 0.0% rgb(95,32,121) (start) - "1A6A2880" # 10.0% rgb(106,40,128) - "33753087" # 20.0% rgb(117,48,135) - "4C9A87C0" # 30.0% rgb(154,135,192) - "66BEDEF9" # 40.0% rgb(190,222,249) - "6DD7ECFC" # 42.9% rgb(215,236,252) - "73F0FAFF" # 44.9% rgb(240,250,255) - "7AD5C8F1" # 47.9% rgb(213,200,241) - "96BB95E2" # 58.8% rgb(187,149,226) - "B7C482D1" # 72.0% rgb(196,130,209) - "FFCE6FBF" # 100.0% rgb(206,111,191) (end) -) -# Source: Sunset_Real.c3g -var PALETTE_SUNSET_REAL_ = bytes( - "00BF0000" # 0.0% rgb(191,0,0) (start) - "17DF5500" # 8.8% rgb(223,85,0) - "34FFAA00" # 20.4% rgb(255,170,0) - "55D95559" # 33.4% rgb(217,85,89) - "88B200B2" # 53.3% rgb(178,0,178) - "C65900C3" # 77.8% rgb(89,0,195) - "FF0000D4" # 100.0% rgb(0,0,212) (end) -) -# Source: Sunset_Yellow.c3g -var PALETTE_SUNSET_YELLOW_ = bytes( - "004C87BF" # 0.0% rgb(76,135,191) (start) - "258FBCB2" # 14.5% rgb(143,188,178) - "57D2F1A5" # 34.2% rgb(210,241,165) - "64E8ED97" # 39.2% rgb(232,237,151) - "6CFFE88A" # 42.2% rgb(255,232,138) - "74FCCA8D" # 45.4% rgb(252,202,141) - "78F9AC90" # 47.2% rgb(249,172,144) - "81FCCA8D" # 50.4% rgb(252,202,141) - "B5FFE88A" # 71.0% rgb(255,232,138) - "DFFFF283" # 87.5% rgb(255,242,131) - "FFFFFC7D" # 100.0% rgb(255,252,125) (end) -) -# Source: Tertiary_01.c3g -var PALETTE_TERTIARY_01_ = bytes( - "000019FF" # 0.0% rgb(0,25,255) (start) - "40338C80" # 25.0% rgb(51,140,128) - "8066FF00" # 50.0% rgb(102,255,0) - "BFB28C1A" # 75.0% rgb(178,140,26) - "FFFF1933" # 100.0% rgb(255,25,51) (end) -) -# Source: bhw1_01.c3g -var PALETTE_BHW1_01_ = bytes( - "00F4A830" # 0.0% rgb(244,168,48) (start) - "75E64E5C" # 46.0% rgb(230,78,92) - "FFAD36E4" # 100.0% rgb(173,54,228) (end) -) -# Source: bhw1_04.c3g -var PALETTE_BHW1_04_ = bytes( - "00F5F21F" # 0.0% rgb(245,242,31) (start) - "0FF4A830" # 6.0% rgb(244,168,48) - "8F7E15A1" # 56.0% rgb(126,21,161) - "C75A16A0" # 78.0% rgb(90,22,160) - "FF000080" # 100.0% rgb(0,0,128) (end) -) -# Source: bhw1_05.c3g -var PALETTE_BHW1_05_ = bytes( - "0005EF89" # 0.0% rgb(5,239,137) (start) - "FF9E23DD" # 100.0% rgb(158,35,221) (end) -) -# Source: bhw1_06.c3g -var PALETTE_BHW1_06_ = bytes( - "00E113C2" # 0.0% rgb(225,19,194) (start) - "A113E1DF" # 63.0% rgb(19,225,223) - "DBD2F2E3" # 86.0% rgb(210,242,227) - "FFFFFFFF" # 100.0% rgb(255,255,255) (end) -) -# Source: bhw1_14.c3g -var PALETTE_BHW1_14_ = bytes( - "00000000" # 0.0% rgb(0,0,0) (start) - "0C230430" # 4.8% rgb(35,4,48) - "36460860" # 21.0% rgb(70,8,96) - "513830A8" # 31.7% rgb(56,48,168) - "782B59EF" # 47.0% rgb(43,89,239) - "92403BAF" # 57.1% rgb(64,59,175) - "BA561E6E" # 73.0% rgb(86,30,110) - "EA2B0F37" # 91.6% rgb(43,15,55) - "FF000000" # 100.0% rgb(0,0,0) (end) -) -# Source: bhw1_three.c3g -var PALETTE_BHW1_THREE_ = bytes( - "00FFFFFF" # 0.0% rgb(255,255,255) (start) - "2E4040FF" # 18.0% rgb(64,64,255) - "70F410C1" # 44.0% rgb(244,16,193) - "70F410C1" # 44.0% rgb(244,16,193) - "8CFFFFFF" # 55.0% rgb(255,255,255) - "9CF410C1" # 61.0% rgb(244,16,193) - "C4830DAF" # 77.0% rgb(131,13,175) - "FFFFFFFF" # 100.0% rgb(255,255,255) (end) -) -# Source: bhw1_w00t.c3g -var PALETTE_BHW1_W00T_ = bytes( - "0031447E" # 0.0% rgb(49,68,126) (start) - "69A2C3F9" # 41.0% rgb(162,195,249) - "BDFF0000" # 74.0% rgb(255,0,0) - "FF6E0E0E" # 100.0% rgb(110,14,14) (end) -) -# Source: bhw2_22.c3g -var PALETTE_BHW2_22_ = bytes( - "00000000" # 0.0% rgb(0,0,0) (start) - "63F40C0C" # 39.0% rgb(244,12,12) - "82FDE4AC" # 51.0% rgb(253,228,172) - "9CF40C0C" # 61.0% rgb(244,12,12) - "FF000000" # 100.0% rgb(0,0,0) (end) -) -# Source: bhw2_23.c3g -var PALETTE_BHW2_23_ = bytes( - "00000000" # 0.0% rgb(0,0,0) (start) - "4290F2F6" # 26.0% rgb(144,242,246) - "61FFFF40" # 38.0% rgb(255,255,64) - "7DFFFFFF" # 49.0% rgb(255,255,255) - "99FFFF40" # 60.0% rgb(255,255,64) - "BD90F2F6" # 74.0% rgb(144,242,246) - "FF000000" # 100.0% rgb(0,0,0) (end) -) -# Source: bhw2_45.c3g -var PALETTE_BHW2_45_ = bytes( - "00000000" # 0.0% rgb(0,0,0) (start) - "0A1E151E" # 3.8% rgb(30,21,30) - "293C2B3C" # 16.0% rgb(60,43,60) - "423C2B3C" # 26.0% rgb(60,43,60) - "664C104D" # 40.0% rgb(76,16,77) - "FF000000" # 100.0% rgb(0,0,0) (end) -) -# Source: bhw2_xc.c3g -var PALETTE_BHW2_XC_ = bytes( - "00381E44" # 0.0% rgb(56,30,68) (start) - "3B590082" # 23.0% rgb(89,0,130) - "7A670056" # 48.0% rgb(103,0,86) - "9ECD391D" # 62.0% rgb(205,57,29) - "B8DF7523" # 72.0% rgb(223,117,35) - "DBF1B129" # 86.0% rgb(241,177,41) - "FFF7F723" # 100.0% rgb(247,247,35) (end) -) -# Source: bhw3_40.c3g -var PALETTE_BHW3_40_ = bytes( - "00070707" # 0.0% rgb(7,7,7) (start) - "2B351949" # 17.0% rgb(53,25,73) - "4C4C0F2E" # 30.0% rgb(76,15,46) - "6ED6276C" # 43.0% rgb(214,39,108) - "80FF9CBF" # 50.0% rgb(255,156,191) - "A6C249D4" # 65.0% rgb(194,73,212) - "CC7842F2" # 80.0% rgb(120,66,242) - "FF5D1D5A" # 100.0% rgb(93,29,90) (end) -) -# Source: bhw3_52.c3g -var PALETTE_BHW3_52_ = bytes( - "00721669" # 0.0% rgb(114,22,105) (start) - "2E761655" # 18.0% rgb(118,22,85) - "63C92D43" # 39.0% rgb(201,45,67) - "85EEBB46" # 52.0% rgb(238,187,70) - "B0E85522" # 69.0% rgb(232,85,34) - "C9E8383B" # 79.0% rgb(232,56,59) - "FF050004" # 100.0% rgb(5,0,4) (end) -) -# Source: bhw4_017.c3g -var PALETTE_BHW4_017_ = bytes( - "007C6672" # 0.0% rgb(124,102,114) (start) - "1A373153" # 10.0% rgb(55,49,83) - "30886060" # 19.0% rgb(136,96,96) - "4AF3D622" # 29.0% rgb(243,214,34) - "59DE6836" # 35.0% rgb(222,104,54) - "82373153" # 51.0% rgb(55,49,83) - "A3FFB13A" # 64.0% rgb(255,177,58) - "BAF3D622" # 73.0% rgb(243,214,34) - "D47C6672" # 83.0% rgb(124,102,114) - "FF1D1312" # 100.0% rgb(29,19,18) (end) -) -# Source: bhw4_097.c3g -var PALETTE_BHW4_097_ = bytes( - "00FC2E00" # 0.0% rgb(252,46,0) (start) - "1CFF8B21" # 11.0% rgb(255,139,33) - "2BF79E4A" # 17.0% rgb(247,158,74) - "3BF7D886" # 23.0% rgb(247,216,134) - "54F55E0F" # 33.0% rgb(245,94,15) - "73BB4110" # 45.0% rgb(187,65,16) - "8CFFF17F" # 55.0% rgb(255,241,127) - "A8BB4110" # 66.0% rgb(187,65,16) - "C4FBE9A7" # 77.0% rgb(251,233,167) - "D9FF5E09" # 85.0% rgb(255,94,9) - "FF8C0806" # 100.0% rgb(140,8,6) (end) -) -# Source: departure.c3g -var PALETTE_DEPARTURE_ = bytes( - "00442200" # 0.0% rgb(68,34,0) (start) - "2B442200" # 16.7% rgb(68,34,0) - "2B663300" # 16.7% rgb(102,51,0) - "40663300" # 25.0% rgb(102,51,0) - "40A06C3C" # 25.0% rgb(160,108,60) - "55A06C3C" # 33.3% rgb(160,108,60) - "55DAA678" # 33.3% rgb(218,166,120) - "6ADAA678" # 41.7% rgb(218,166,120) - "6AEED4BC" # 41.7% rgb(238,212,188) - "75EED4BC" # 45.8% rgb(238,212,188) - "75FFFFFF" # 45.8% rgb(255,255,255) - "8AFFFFFF" # 54.2% rgb(255,255,255) - "8AC8FFC8" # 54.2% rgb(200,255,200) - "95C8FFC8" # 58.3% rgb(200,255,200) - "9564FF64" # 58.3% rgb(100,255,100) - "AA64FF64" # 66.7% rgb(100,255,100) - "AA00FF00" # 66.7% rgb(0,255,0) - "BF00FF00" # 75.0% rgb(0,255,0) - "BF00C000" # 75.0% rgb(0,192,0) - "D400C000" # 83.3% rgb(0,192,0) - "D4008000" # 83.3% rgb(0,128,0) - "FF008000" # 100.0% rgb(0,128,0) (end) -) -# Source: es_autumn_19.c3g -var PALETTE_ES_AUTUMN_19_ = bytes( - "006A0E08" # 0.0% rgb(106,14,8) (start) - "33992913" # 20.0% rgb(153,41,19) - "54BE4618" # 33.0% rgb(190,70,24) - "69C9CA88" # 41.0% rgb(201,202,136) - "70BB8905" # 44.0% rgb(187,137,5) - "7AC7C88E" # 48.0% rgb(199,200,142) - "7DC9CA87" # 49.0% rgb(201,202,135) - "87BB8905" # 53.0% rgb(187,137,5) - "8FCACB81" # 56.0% rgb(202,203,129) - "A3BB4418" # 64.0% rgb(187,68,24) - "CC8E2311" # 80.0% rgb(142,35,17) - "FA5A0504" # 98.0% rgb(90,5,4) - "FF5A0504" # 100.0% rgb(90,5,4) (end) -) -# Source: es_landscape_33.c3g -var PALETTE_ES_LANDSCAPE_33_ = bytes( - "00132D00" # 0.0% rgb(19,45,0) (start) - "14745603" # 7.8% rgb(116,86,3) - "26D68007" # 15.0% rgb(214,128,7) - "40F5C519" # 25.0% rgb(245,197,25) - "427CC49C" # 26.0% rgb(124,196,156) - "FF09270B" # 100.0% rgb(9,39,11) (end) -) -# Source: es_landscape_64.c3g -var PALETTE_ES_LANDSCAPE_64_ = bytes( - "00000000" # 0.0% rgb(0,0,0) (start) - "252B591A" # 14.7% rgb(43,89,26) - "4C57B235" # 30.0% rgb(87,178,53) - "80A3EB08" # 50.0% rgb(163,235,8) - "81C3EA82" # 50.5% rgb(195,234,130) - "82E3E9FC" # 51.0% rgb(227,233,252) - "99CDDBEA" # 60.0% rgb(205,219,234) - "CC92B3FD" # 80.0% rgb(146,179,253) - "FF276BE4" # 100.0% rgb(39,107,228) (end) -) -# Source: es_ocean_breeze_036.c3g -var PALETTE_ES_OCEAN_BREEZE_036_ = bytes( - "0019303E" # 0.0% rgb(25,48,62) (start) - "5926A6B7" # 35.0% rgb(38,166,183) - "99CDE9FF" # 60.0% rgb(205,233,255) - "FF0091A2" # 100.0% rgb(0,145,162) (end) -) -# Source: es_pinksplash_08.c3g -var PALETTE_ES_PINKSPLASH_08_ = bytes( - "00C33FFF" # 0.0% rgb(195,63,255) (start) - "80E70961" # 50.0% rgb(231,9,97) - "B0EDCDDA" # 69.0% rgb(237,205,218) - "DED426B8" # 87.0% rgb(212,38,184) - "FFD426B8" # 100.0% rgb(212,38,184) (end) -) -# Source: es_rivendell_15.c3g -var PALETTE_ES_RIVENDELL_15_ = bytes( - "00234536" # 0.0% rgb(35,69,54) (start) - "66586952" # 40.0% rgb(88,105,82) - "A68F8C6D" # 65.0% rgb(143,140,109) - "F2D0CCAF" # 95.0% rgb(208,204,175) - "FFD0CCAF" # 100.0% rgb(208,204,175) (end) -) -# Source: es_vintage_01.c3g -var PALETTE_ES_VINTAGE_01_ = bytes( - "00361220" # 0.0% rgb(54,18,32) (start) - "3359001E" # 20.0% rgb(89,0,30) - "4CB0AA30" # 30.0% rgb(176,170,48) - "66FFBD5C" # 40.0% rgb(255,189,92) - "80993832" # 50.0% rgb(153,56,50) - "9959001E" # 60.0% rgb(89,0,30) - "E5361220" # 90.0% rgb(54,18,32) - "FF361220" # 100.0% rgb(54,18,32) (end) -) -# Source: es_vintage_57.c3g -var PALETTE_ES_VINTAGE_57_ = bytes( - "00290805" # 0.0% rgb(41,8,5) (start) - "365C0100" # 21.0% rgb(92,1,0) - "689B6024" # 40.9% rgb(155,96,36) - "99D9BF48" # 60.0% rgb(217,191,72) - "FF848134" # 100.0% rgb(132,129,52) (end) -) -# Source: fierce-ice.c3g -var PALETTE_FIERCE_ICE_ = bytes( - "00000000" # 0.0% rgb(0,0,0) (start) - "3C003380" # 23.4% rgb(0,51,128) - "770066FF" # 46.8% rgb(0,102,255) - "963399FF" # 58.8% rgb(51,153,255) - "B466CCFF" # 70.8% rgb(102,204,255) - "DAB2E6FF" # 85.4% rgb(178,230,255) - "FFFFFFFF" # 100.0% rgb(255,255,255) (end) -) -# Source: gr64_hult.c3g -var PALETTE_GR64_HULT_ = bytes( - "0022B8B6" # 0.0% rgb(34,184,182) (start) - "420EA2A0" # 26.0% rgb(14,162,160) - "698B890B" # 41.0% rgb(139,137,11) - "82BCBA1E" # 51.0% rgb(188,186,30) - "968B890B" # 59.0% rgb(139,137,11) - "C90A9C9A" # 79.0% rgb(10,156,154) - "F0008080" # 94.0% rgb(0,128,128) - "FF008080" # 100.0% rgb(0,128,128) (end) -) -# Source: gr65_hult.c3g -var PALETTE_GR65_HULT_ = bytes( - "00FCD8FC" # 0.0% rgb(252,216,252) (start) - "30FFC0FF" # 19.0% rgb(255,192,255) - "59F15FF3" # 35.0% rgb(241,95,243) - "A14199DD" # 63.0% rgb(65,153,221) - "D922B8B6" # 85.0% rgb(34,184,182) - "FF22B8B6" # 100.0% rgb(34,184,182) (end) -) -# Source: ib15.c3g -var PALETTE_IB15_ = bytes( - "00BBA0CD" # 0.0% rgb(187,160,205) (start) - "48D49E9F" # 28.4% rgb(212,158,159) - "59EC9B71" # 35.0% rgb(236,155,113) - "6BFF5F4A" # 42.0% rgb(255,95,74) - "8DC96279" # 55.3% rgb(201,98,121) - "FF9265A8" # 100.0% rgb(146,101,168) (end) -) -# Source: ib_jul01.c3g -var PALETTE_IB_JUL01_ = bytes( - "00E60611" # 0.0% rgb(230,6,17) (start) - "5E25605A" # 37.0% rgb(37,96,90) - "8590BD6A" # 52.0% rgb(144,189,106) - "FFBB030D" # 100.0% rgb(187,3,13) (end) -) -# Source: lava.c3g -var PALETTE_LAVA_ = bytes( - "00000000" # 0.0% rgb(0,0,0) (start) - "2E5D0000" # 18.1% rgb(93,0,0) - "61BB0000" # 38.0% rgb(187,0,0) - "6CCC260D" # 42.4% rgb(204,38,13) - "77DD4C1A" # 46.8% rgb(221,76,26) - "93EE7326" # 57.6% rgb(238,115,38) - "AEFF9933" # 68.4% rgb(255,153,51) - "BDFFB233" # 74.0% rgb(255,178,51) - "CBFFCC33" # 79.5% rgb(255,204,51) - "DAFFE633" # 85.7% rgb(255,230,51) - "EAFFFF33" # 91.8% rgb(255,255,51) - "F5FFFF99" # 95.9% rgb(255,255,153) - "FFFFFFFF" # 100.0% rgb(255,255,255) (end) -) -# Source: rainbowsherbet.c3g -var PALETTE_RAINBOWSHERBET_ = bytes( - "00FF6633" # 0.0% rgb(255,102,51) (start) - "2BFF8C66" # 17.0% rgb(255,140,102) - "57FF3366" # 34.0% rgb(255,51,102) - "80FF99B2" # 50.0% rgb(255,153,178) - "ABFFFFFA" # 67.0% rgb(255,255,250) - "D180FF61" # 82.0% rgb(128,255,97) - "FFA9FF94" # 100.0% rgb(169,255,148) (end) -) -# Source: retro2_16.c3g -var PALETTE_RETRO2_16_ = bytes( - "00E3BF0C" # 0.0% rgb(227,191,12) (start) - "FF843402" # 100.0% rgb(132,52,2) (end) -) -# Source: rgi_15.c3g -var PALETTE_RGI_15_ = bytes( - "00360E6F" # 0.0% rgb(54,14,111) (start) - "208E1856" # 12.5% rgb(142,24,86) - "40E7223D" # 25.0% rgb(231,34,61) - "60921F58" # 37.5% rgb(146,31,88) - "803D1D72" # 50.0% rgb(61,29,114) - "9F7C2F71" # 62.5% rgb(124,47,113) - "BFBA4270" # 75.0% rgb(186,66,112) - "DF8F3974" # 87.5% rgb(143,57,116) - "FF643078" # 100.0% rgb(100,48,120) (end) -) -# Source: temperature.c3g -var PALETTE_TEMPERATURE_ = bytes( - "001E5CB3" # 0.0% rgb(30,92,179) (start) - "0E1E5CB3" # 5.5% rgb(30,92,179) - "0E176FC1" # 5.5% rgb(23,111,193) - "1C176FC1" # 11.2% rgb(23,111,193) - "1C0B8ED8" # 11.2% rgb(11,142,216) - "2B0B8ED8" # 16.7% rgb(11,142,216) - "2B04A1E6" # 16.7% rgb(4,161,230) - "3904A1E6" # 22.2% rgb(4,161,230) - "3919B5F1" # 22.2% rgb(25,181,241) - "4719B5F1" # 27.8% rgb(25,181,241) - "4733BCCF" # 27.8% rgb(51,188,207) - "5533BCCF" # 33.3% rgb(51,188,207) - "5566CCCE" # 33.3% rgb(102,204,206) - "6366CCCE" # 38.8% rgb(102,204,206) - "6399DBB8" # 38.8% rgb(153,219,184) - "7199DBB8" # 44.5% rgb(153,219,184) - "71C0E588" # 44.5% rgb(192,229,136) - "80C0E588" # 50.0% rgb(192,229,136) - "80CCE64B" # 50.0% rgb(204,230,75) - "8ECCE64B" # 55.5% rgb(204,230,75) - "8EF3F01D" # 55.5% rgb(243,240,29) - "9CF3F01D" # 61.2% rgb(243,240,29) - "9CFEDE27" # 61.2% rgb(254,222,39) - "AAFEDE27" # 66.7% rgb(254,222,39) - "AAFCC707" # 66.7% rgb(252,199,7) - "B8FCC707" # 72.2% rgb(252,199,7) - "B8F89D0E" # 72.2% rgb(248,157,14) - "C6F89D0E" # 77.8% rgb(248,157,14) - "C6F57215" # 77.8% rgb(245,114,21) - "D4F57215" # 83.3% rgb(245,114,21) - "D4F1471C" # 83.3% rgb(241,71,28) - "E3F1471C" # 88.8% rgb(241,71,28) - "E3DB1E26" # 88.8% rgb(219,30,38) - "F1DB1E26" # 94.5% rgb(219,30,38) - "F1A4262C" # 94.5% rgb(164,38,44) - "FFA4262C" # 100.0% rgb(164,38,44) (end) -) -# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# = -# Palettes from WLED header file -# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# = -# Source: Jul (ib_jul01_gp) from wled_palettes.h +# Gradient palette "ib_jul01_gp", originally from http://seaviewsensing.com/pub/cpt-city/ing/xmas/ib_jul01.c3g var PALETTE_JUL_ = bytes( - "00E60611" # pos=0 wled=rgb(226,6,12) orig=rgb(230,6,17) - "5E25605A" # pos=94 wled=rgb(26,96,78) orig=rgb(37,96,90) - "8490BD6A" # pos=132 wled=rgb(130,189,94) orig=rgb(144,189,106) - "FFBB030D" # pos=255 wled=rgb(177,3,9) orig=rgb(187,3,13) + "00E2060C" # pos=0 rgb(226,6,12) + "5E1A604E" # pos=94 rgb(26,96,78) + "8482BD5E" # pos=132 rgb(130,189,94) + "FFB10309" # pos=255 rgb(177,3,9) ) -# Source: Grintage (es_vintage_57_gp) from wled_palettes.h -var PALETTE_GRINTAGE_ = bytes( - "00290805" # pos=0 wled=rgb(29,8,3) orig=rgb(41,8,5) - "355C0100" # pos=53 wled=rgb(76,1,0) orig=rgb(92,1,0) - "689B6024" # pos=104 wled=rgb(142,96,28) orig=rgb(155,96,36) - "99D9BF48" # pos=153 wled=rgb(211,191,61) orig=rgb(217,191,72) - "FF848134" # pos=255 wled=rgb(117,129,42) orig=rgb(132,129,52) -) -# Source: Vintage (es_vintage_01_gp) from wled_palettes.h -var PALETTE_VINTAGE_ = bytes( - "00361220" # pos=0 wled=rgb(41,18,24) orig=rgb(54,18,32) - "3359001D" # pos=51 wled=rgb(73,0,22) orig=rgb(89,0,29) - "4CB0AA30" # pos=76 wled=rgb(165,170,38) orig=rgb(176,170,48) - "65FFBD5C" # pos=101 wled=rgb(255,189,80) orig=rgb(255,189,92) - "7F993832" # pos=127 wled=rgb(139,56,40) orig=rgb(153,56,50) - "9959001D" # pos=153 wled=rgb(73,0,22) orig=rgb(89,0,29) - "E5361220" # pos=229 wled=rgb(41,18,24) orig=rgb(54,18,32) - "FF361220" # pos=255 wled=rgb(41,18,24) orig=rgb(54,18,32) -) -# Source: Rivendell (es_rivendell_15_gp) from wled_palettes.h -var PALETTE_RIVENDELL_ = bytes( - "00234536" # pos=0 wled=rgb(24,69,44) orig=rgb(35,69,54) - "65596952" # pos=101 wled=rgb(73,105,70) orig=rgb(89,105,82) - "A58F8C6D" # pos=165 wled=rgb(129,140,97) orig=rgb(143,140,109) - "F2D0CCAF" # pos=242 wled=rgb(200,204,166) orig=rgb(208,204,175) - "FFD0CCAF" # pos=255 wled=rgb(200,204,166) orig=rgb(208,204,175) -) -# Source: Red & Blue (rgi_15_gp) from wled_palettes.h -var PALETTE_RED_AND_BLUE_ = bytes( - "00360E6F" # pos=0 wled=rgb(41,14,99) orig=rgb(54,14,111) - "1F8E1856" # pos=31 wled=rgb(128,24,74) orig=rgb(142,24,86) - "3FE7223D" # pos=63 wled=rgb(227,34,50) orig=rgb(231,34,61) - "5F921F58" # pos=95 wled=rgb(132,31,76) orig=rgb(146,31,88) - "7F3D1D72" # pos=127 wled=rgb(47,29,102) orig=rgb(61,29,114) - "9F7C2F71" # pos=159 wled=rgb(109,47,101) orig=rgb(124,47,113) - "BFBA4270" # pos=191 wled=rgb(176,66,100) orig=rgb(186,66,112) - "DF8F3974" # pos=223 wled=rgb(129,57,104) orig=rgb(143,57,116) - "FF643078" # pos=255 wled=rgb(84,48,108) orig=rgb(100,48,120) -) -# Source: Yellowout (retro2_16_gp) from wled_palettes.h -var PALETTE_YELLOWOUT_ = bytes( - "00E3BF0C" # pos=0 wled=rgb(222,191,8) orig=rgb(227,191,12) - "FF843402" # pos=255 wled=rgb(117,52,1) orig=rgb(132,52,2) -) -# Source: Analogous (Analogous_1_gp) from wled_palettes.h -var PALETTE_ANALOGOUS_ = bytes( - "003300FF" # pos=0 wled=rgb(38,0,255) orig=rgb(51,0,255) - "3F6600FF" # pos=63 wled=rgb(86,0,255) orig=rgb(102,0,255) - "7F9900FF" # pos=127 wled=rgb(139,0,255) orig=rgb(153,0,255) - "BFCC0080" # pos=191 wled=rgb(196,0,117) orig=rgb(204,0,128) - "FFFF0000" # pos=255 wled=rgb(255,0,0) orig=rgb(255,0,0) -) -# Source: Splash (es_pinksplash_08_gp) from wled_palettes.h -var PALETTE_SPLASH_ = bytes( - "00C33FFF" # pos=0 wled=rgb(186,63,255) orig=rgb(195,63,255) - "7FE70961" # pos=127 wled=rgb(227,9,85) orig=rgb(231,9,97) - "AFEDCDDA" # pos=175 wled=rgb(234,205,213) orig=rgb(237,205,218) - "DDD426B8" # pos=221 wled=rgb(205,38,176) orig=rgb(212,38,184) - "FFD426B8" # pos=255 wled=rgb(205,38,176) orig=rgb(212,38,184) -) -# Source: Breeze (es_ocean_breeze_036_gp) from wled_palettes.h -var PALETTE_BREEZE_ = bytes( - "0019303E" # pos=0 wled=rgb(16,48,51) orig=rgb(25,48,62) - "5926A6B7" # pos=89 wled=rgb(27,166,175) orig=rgb(38,166,183) - "99CDE9FF" # pos=153 wled=rgb(197,233,255) orig=rgb(205,233,255) - "FF0091A2" # pos=255 wled=rgb(0,145,152) orig=rgb(0,145,162) -) -# Source: Departure (departure_gp) from wled_palettes.h -# var PALETTE_DEPARTURE_ = bytes( -# "00442200" # pos=0 wled=rgb(53,34,0) orig=rgb(68,34,0) -# "2A663300" # pos=42 wled=rgb(86,51,0) orig=rgb(102,51,0) -# "3FA06C3C" # pos=63 wled=rgb(147,108,49) orig=rgb(160,108,60) -# "54DAA678" # pos=84 wled=rgb(212,166,108) orig=rgb(218,166,120) -# "6AEED4BC" # pos=106 wled=rgb(235,212,180) orig=rgb(238,212,188) -# "74FFFFFF" # pos=116 wled=rgb(255,255,255) orig=rgb(255,255,255) -# "8AC8FFC8" # pos=138 wled=rgb(191,255,193) orig=rgb(200,255,200) -# "9464FF64" # pos=148 wled=rgb(84,255,88) orig=rgb(100,255,100) -# "AA00FF00" # pos=170 wled=rgb(0,255,0) orig=rgb(0,255,0) -# "BF00C000" # pos=191 wled=rgb(0,192,0) orig=rgb(0,192,0) -# "D4008000" # pos=212 wled=rgb(0,128,0) orig=rgb(0,128,0) -# "FF008000" # pos=255 wled=rgb(0,128,0) orig=rgb(0,128,0) -# ) -# Source: Landscape (es_landscape_64_gp) from wled_palettes.h -var PALETTE_LANDSCAPE_ = bytes( - "00000000" # pos=0 wled=rgb(0,0,0) orig=rgb(0,0,0) - "252B591A" # pos=37 wled=rgb(31,89,19) orig=rgb(43,89,26) - "4C57B235" # pos=76 wled=rgb(72,178,43) orig=rgb(87,178,53) - "7FA3EB08" # pos=127 wled=rgb(150,235,5) orig=rgb(163,235,8) - "80C3EA82" # pos=128 wled=rgb(186,234,119) orig=rgb(195,234,130) - "82E3E9FC" # pos=130 wled=rgb(222,233,252) orig=rgb(227,233,252) - "99CDDBEA" # pos=153 wled=rgb(197,219,231) orig=rgb(205,219,234) - "CC92B3FD" # pos=204 wled=rgb(132,179,253) orig=rgb(146,179,253) - "FF276BE4" # pos=255 wled=rgb(28,107,225) orig=rgb(39,107,228) -) -# Source: Beach (es_landscape_33_gp) from wled_palettes.h -var PALETTE_BEACH_ = bytes( - "00132D00" # pos=0 wled=rgb(12,45,0) orig=rgb(19,45,0) - "13745604" # pos=19 wled=rgb(101,86,2) orig=rgb(116,86,4) - "26D68007" # pos=38 wled=rgb(207,128,4) orig=rgb(214,128,7) - "3FF5C519" # pos=63 wled=rgb(243,197,18) orig=rgb(245,197,25) - "427CC49C" # pos=66 wled=rgb(109,196,146) orig=rgb(124,196,156) - "FF09270B" # pos=255 wled=rgb(5,39,7) orig=rgb(9,39,11) -) -# Source: Sherbet (rainbowsherbet_gp) from wled_palettes.h -var PALETTE_SHERBET_ = bytes( - "00FF6633" # pos=0 wled=rgb(255,102,41) orig=rgb(255,102,51) - "2BFF8C66" # pos=43 wled=rgb(255,140,90) orig=rgb(255,140,102) - "56FF3366" # pos=86 wled=rgb(255,51,90) orig=rgb(255,51,102) - "7FFF99B2" # pos=127 wled=rgb(255,153,169) orig=rgb(255,153,178) - "AAFFFFFA" # pos=170 wled=rgb(255,255,249) orig=rgb(255,255,250) - "D180FF61" # pos=209 wled=rgb(113,255,85) orig=rgb(128,255,97) - "FFA9FF94" # pos=255 wled=rgb(157,255,137) orig=rgb(169,255,148) -) -# Source: Hult (gr65_hult_gp) from wled_palettes.h -var PALETTE_HULT_ = bytes( - "00FCD8FC" # pos=0 wled=rgb(251,216,252) orig=rgb(252,216,252) - "30FFC0FF" # pos=48 wled=rgb(255,192,255) orig=rgb(255,192,255) - "59F15FF3" # pos=89 wled=rgb(239,95,241) orig=rgb(241,95,243) - "A04199DD" # pos=160 wled=rgb(51,153,217) orig=rgb(65,153,221) - "D823B8B6" # pos=216 wled=rgb(24,184,174) orig=rgb(35,184,182) - "FF23B8B6" # pos=255 wled=rgb(24,184,174) orig=rgb(35,184,182) -) -# Source: Hult64 (gr64_hult_gp) from wled_palettes.h -var PALETTE_HULT64_ = bytes( - "0023B8B6" # pos=0 wled=rgb(24,184,174) orig=rgb(35,184,182) - "420EA2A0" # pos=66 wled=rgb(8,162,150) orig=rgb(14,162,160) - "688B890B" # pos=104 wled=rgb(124,137,7) orig=rgb(139,137,11) - "82BCBA1D" # pos=130 wled=rgb(178,186,22) orig=rgb(188,186,29) - "968B890B" # pos=150 wled=rgb(124,137,7) orig=rgb(139,137,11) - "C90B9C9A" # pos=201 wled=rgb(6,156,144) orig=rgb(11,156,154) - "EF008080" # pos=239 wled=rgb(0,128,117) orig=rgb(0,128,128) - "FF008080" # pos=255 wled=rgb(0,128,117) orig=rgb(0,128,128) -) -# Source: Drywet (GMT_drywet_gp) from wled_palettes.h -var PALETTE_DRYWET_ = bytes( - "0086612A" # pos=0 wled=rgb(119,97,33) orig=rgb(134,97,42) - "2AEEC764" # pos=42 wled=rgb(235,199,88) orig=rgb(238,199,100) - "54B4EE87" # pos=84 wled=rgb(169,238,124) orig=rgb(180,238,135) - "7F32EEEB" # pos=127 wled=rgb(37,238,232) orig=rgb(50,238,235) - "AA0C78EE" # pos=170 wled=rgb(7,120,236) orig=rgb(12,120,238) - "D42601B7" # pos=212 wled=rgb(27,1,175) orig=rgb(38,1,183) - "FF083371" # pos=255 wled=rgb(4,51,101) orig=rgb(8,51,113) -) -# Source: Rewhi (ib15_gp) from wled_palettes.h -var PALETTE_REWHI_ = bytes( - "00BBA0CD" # pos=0 wled=rgb(177,160,199) orig=rgb(187,160,205) - "48D49E9F" # pos=72 wled=rgb(205,158,149) orig=rgb(212,158,159) - "59EC9B71" # pos=89 wled=rgb(233,155,101) orig=rgb(236,155,113) - "6BFF5F4A" # pos=107 wled=rgb(255,95,63) orig=rgb(255,95,74) - "8DC96279" # pos=141 wled=rgb(192,98,109) orig=rgb(201,98,121) - "FF9265A8" # pos=255 wled=rgb(132,101,159) orig=rgb(146,101,168) -) -# Source: Tertiary (Tertiary_01_gp) from wled_palettes.h -var PALETTE_TERTIARY_ = bytes( - "000019FF" # pos=0 wled=rgb(0,25,255) orig=rgb(0,25,255) - "3F338C80" # pos=63 wled=rgb(38,140,117) orig=rgb(51,140,128) - "7F66FF00" # pos=127 wled=rgb(86,255,0) orig=rgb(102,255,0) - "BFB28C1A" # pos=191 wled=rgb(167,140,19) orig=rgb(178,140,26) - "FFFF1933" # pos=255 wled=rgb(255,25,41) orig=rgb(255,25,51) -) -# Source: Fire (lava_gp) from wled_palettes.h -var PALETTE_FIRE_ = bytes( - "00000000" # pos=0 wled=rgb(0,0,0) orig=rgb(0,0,0) - "2E5D0000" # pos=46 wled=rgb(77,0,0) orig=rgb(93,0,0) - "60BB0000" # pos=96 wled=rgb(177,0,0) orig=rgb(187,0,0) - "6CCC260D" # pos=108 wled=rgb(196,38,9) orig=rgb(204,38,13) - "77DD4C1A" # pos=119 wled=rgb(215,76,19) orig=rgb(221,76,26) - "92EE7326" # pos=146 wled=rgb(235,115,29) orig=rgb(238,115,38) - "AEFF9933" # pos=174 wled=rgb(255,153,41) orig=rgb(255,153,51) - "BCFFB233" # pos=188 wled=rgb(255,178,41) orig=rgb(255,178,51) - "CAFFCC33" # pos=202 wled=rgb(255,204,41) orig=rgb(255,204,51) - "DAFFE633" # pos=218 wled=rgb(255,230,41) orig=rgb(255,230,51) - "EAFFFF33" # pos=234 wled=rgb(255,255,41) orig=rgb(255,255,51) - "F4FFFF99" # pos=244 wled=rgb(255,255,143) orig=rgb(255,255,153) - "FFFFFFFF" # pos=255 wled=rgb(255,255,255) orig=rgb(255,255,255) -) -# Source: Icefire (fierce_ice_gp) from wled_palettes.h -var PALETTE_ICEFIRE_ = bytes( - "00000000" # pos=0 wled=rgb(0,0,0) orig=rgb(0,0,0) - "3B003380" # pos=59 wled=rgb(0,51,117) orig=rgb(0,51,128) - "770066FF" # pos=119 wled=rgb(0,102,255) orig=rgb(0,102,255) - "953399FF" # pos=149 wled=rgb(38,153,255) orig=rgb(51,153,255) - "B466CCFF" # pos=180 wled=rgb(86,204,255) orig=rgb(102,204,255) - "D9B2E6FF" # pos=217 wled=rgb(167,230,255) orig=rgb(178,230,255) - "FFFFFFFF" # pos=255 wled=rgb(255,255,255) orig=rgb(255,255,255) -) -# Source: Cyane (Colorfull_gp) from wled_palettes.h -var PALETTE_CYANE_ = bytes( - "004C9B36" # pos=0 wled=rgb(61,155,44) orig=rgb(76,155,54) - "196FAE59" # pos=25 wled=rgb(95,174,77) orig=rgb(111,174,89) - "3C92C17D" # pos=60 wled=rgb(132,193,113) orig=rgb(146,193,125) - "5DA6A688" # pos=93 wled=rgb(154,166,125) orig=rgb(166,166,136) - "6AB98A93" # pos=106 wled=rgb(175,138,136) orig=rgb(185,138,147) - "6DC17994" # pos=109 wled=rgb(183,121,137) orig=rgb(193,121,148) - "71CA6895" # pos=113 wled=rgb(194,104,138) orig=rgb(202,104,149) - "74E5B3AE" # pos=116 wled=rgb(225,179,165) orig=rgb(229,179,174) - "7CFFFFC7" # pos=124 wled=rgb(255,255,192) orig=rgb(255,255,199) - "A8B2DAD1" # pos=168 wled=rgb(167,218,203) orig=rgb(178,218,209) - "FF64B6DB" # pos=255 wled=rgb(84,182,215) orig=rgb(100,182,219) -) -# Source: Light Pink (Pink_Purple_gp) from wled_palettes.h -var PALETTE_LIGHT_PINK_ = bytes( - "005F2079" # pos=0 wled=rgb(79,32,109) orig=rgb(95,32,121) - "196A2880" # pos=25 wled=rgb(90,40,117) orig=rgb(106,40,128) - "33753087" # pos=51 wled=rgb(102,48,124) orig=rgb(117,48,135) - "4C9A87C0" # pos=76 wled=rgb(141,135,185) orig=rgb(154,135,192) - "66BEDEF9" # pos=102 wled=rgb(180,222,248) orig=rgb(190,222,249) - "6DD7ECFC" # pos=109 wled=rgb(208,236,252) orig=rgb(215,236,252) - "72F0FAFF" # pos=114 wled=rgb(237,250,255) orig=rgb(240,250,255) - "7AD5C8F1" # pos=122 wled=rgb(206,200,239) orig=rgb(213,200,241) - "95BB95E2" # pos=149 wled=rgb(177,149,222) orig=rgb(187,149,226) - "B7C482D1" # pos=183 wled=rgb(187,130,203) orig=rgb(196,130,209) - "FFCE6FBF" # pos=255 wled=rgb(198,111,184) orig=rgb(206,111,191) -) -# Source: Sunset (Sunset_Real_gp) from wled_palettes.h -var PALETTE_SUNSET_ = bytes( - "00BF0000" # pos=0 wled=rgb(181,0,0) orig=rgb(191,0,0) - "16DF5500" # pos=22 wled=rgb(218,85,0) orig=rgb(223,85,0) - "33FFAA00" # pos=51 wled=rgb(255,170,0) orig=rgb(255,170,0) - "55D95559" # pos=85 wled=rgb(211,85,77) orig=rgb(217,85,89) - "87B200B2" # pos=135 wled=rgb(167,0,169) orig=rgb(178,0,178) - "C65900C3" # pos=198 wled=rgb(73,0,188) orig=rgb(89,0,195) - "FF0000D4" # pos=255 wled=rgb(0,0,207) orig=rgb(0,0,212) -) -# Source: Pastel (Sunset_Yellow_gp) from wled_palettes.h -var PALETTE_PASTEL_ = bytes( - "004C87BF" # pos=0 wled=rgb(61,135,184) orig=rgb(76,135,191) - "248FBCB2" # pos=36 wled=rgb(129,188,169) orig=rgb(143,188,178) - "57D2F1A5" # pos=87 wled=rgb(203,241,155) orig=rgb(210,241,165) - "64E8ED97" # pos=100 wled=rgb(228,237,141) orig=rgb(232,237,151) - "6BFFE88A" # pos=107 wled=rgb(255,232,127) orig=rgb(255,232,138) - "73FCCA8D" # pos=115 wled=rgb(251,202,130) orig=rgb(252,202,141) - "78F9AC90" # pos=120 wled=rgb(248,172,133) orig=rgb(249,172,144) - "80FCCA8D" # pos=128 wled=rgb(251,202,130) orig=rgb(252,202,141) - "B4FFE88A" # pos=180 wled=rgb(255,232,127) orig=rgb(255,232,138) - "DFFFF283" # pos=223 wled=rgb(255,242,120) orig=rgb(255,242,131) - "FFFFFC7D" # pos=255 wled=rgb(255,252,113) orig=rgb(255,252,125) -) -# Source: Beech (Beech_gp) from wled_palettes.h -# var PALETTE_BEECH_ = bytes( -# "00FFFEEE" # pos=0 wled=rgb(255,254,236) orig=rgb(255,254,238) -# "0CFFFEEE" # pos=12 wled=rgb(255,254,236) orig=rgb(255,254,238) -# "16FFFEEE" # pos=22 wled=rgb(255,254,236) orig=rgb(255,254,238) -# "1AE4E0BA" # pos=26 wled=rgb(223,224,178) orig=rgb(228,224,186) -# "1CC9C387" # pos=28 wled=rgb(192,195,124) orig=rgb(201,195,135) -# "1CBAFFEA" # pos=28 wled=rgb(176,255,231) orig=rgb(186,255,234) -# "328AFBEE" # pos=50 wled=rgb(123,251,236) orig=rgb(138,251,238) -# "475AF6F3" # pos=71 wled=rgb(74,246,241) orig=rgb(90,246,243) -# "5D2DE1E7" # pos=93 wled=rgb(33,225,228) orig=rgb(45,225,231) -# "7800CCDB" # pos=120 wled=rgb(0,204,215) orig=rgb(0,204,219) -# "8508A8BA" # pos=133 wled=rgb(4,168,178) orig=rgb(8,168,186) -# "88108499" # pos=136 wled=rgb(10,132,143) orig=rgb(16,132,153) -# "8841BDD9" # pos=136 wled=rgb(51,189,212) orig=rgb(65,189,217) -# "D0219FCF" # pos=208 wled=rgb(23,159,201) orig=rgb(33,159,207) -# "FF0081C5" # pos=255 wled=rgb(0,129,190) orig=rgb(0,129,197) -# ) -# Source: Sunset2 (Another_Sunset_gp) from wled_palettes.h -var PALETTE_SUNSET2_ = bytes( - "00B97949" # pos=0 wled=rgb(175,121,62) orig=rgb(185,121,73) - "1D8E6747" # pos=29 wled=rgb(128,103,60) orig=rgb(142,103,71) - "44645445" # pos=68 wled=rgb(84,84,58) orig=rgb(100,84,69) - "44F9B842" # pos=68 wled=rgb(248,184,55) orig=rgb(249,184,66) - "61F1CC69" # pos=97 wled=rgb(239,204,93) orig=rgb(241,204,105) - "7CEAE190" # pos=124 wled=rgb(230,225,133) orig=rgb(234,225,144) - "B2757D8C" # pos=178 wled=rgb(102,125,129) orig=rgb(117,125,140) - "FF001A88" # pos=255 wled=rgb(0,26,125) orig=rgb(0,26,136) -) -# Source: Autumn (es_autumn_19_gp) from wled_palettes.h -var PALETTE_AUTUMN_ = bytes( - "006A0E08" # pos=0 wled=rgb(90,14,5) orig=rgb(106,14,8) - "33992913" # pos=51 wled=rgb(139,41,13) orig=rgb(153,41,19) - "54BE4618" # pos=84 wled=rgb(180,70,17) orig=rgb(190,70,24) - "68C9CA88" # pos=104 wled=rgb(192,202,125) orig=rgb(201,202,136) - "70BB8905" # pos=112 wled=rgb(177,137,3) orig=rgb(187,137,5) - "7AC7C88E" # pos=122 wled=rgb(190,200,131) orig=rgb(199,200,142) - "7CC9CA87" # pos=124 wled=rgb(192,202,124) orig=rgb(201,202,135) - "87BB8905" # pos=135 wled=rgb(177,137,3) orig=rgb(187,137,5) - "8ECACB81" # pos=142 wled=rgb(194,203,118) orig=rgb(202,203,129) - "A3BB4418" # pos=163 wled=rgb(177,68,17) orig=rgb(187,68,24) - "CC8E2311" # pos=204 wled=rgb(128,35,12) orig=rgb(142,35,17) - "F95A0504" # pos=249 wled=rgb(74,5,2) orig=rgb(90,5,4) - "FF5A0504" # pos=255 wled=rgb(74,5,2) orig=rgb(90,5,4) -) -# Source: Magenta (BlacK_Blue_Magenta_White_gp) from wled_palettes.h -var PALETTE_MAGENTA_ = bytes( - "00000000" # pos=0 wled=rgb(0,0,0) orig=rgb(0,0,0) - "2A000080" # pos=42 wled=rgb(0,0,117) orig=rgb(0,0,128) - "540000FF" # pos=84 wled=rgb(0,0,255) orig=rgb(0,0,255) - "7F8000FF" # pos=127 wled=rgb(113,0,255) orig=rgb(128,0,255) - "AAFF00FF" # pos=170 wled=rgb(255,0,255) orig=rgb(255,0,255) - "D4FF80FF" # pos=212 wled=rgb(255,128,255) orig=rgb(255,128,255) - "FFFFFFFF" # pos=255 wled=rgb(255,255,255) orig=rgb(255,255,255) -) -# Source: Magred (BlacK_Magenta_Red_gp) from wled_palettes.h -var PALETTE_MAGRED_ = bytes( - "00000000" # pos=0 wled=rgb(0,0,0) orig=rgb(0,0,0) - "3F800080" # pos=63 wled=rgb(113,0,117) orig=rgb(128,0,128) - "7FFF00FF" # pos=127 wled=rgb(255,0,255) orig=rgb(255,0,255) - "BFFF0080" # pos=191 wled=rgb(255,0,117) orig=rgb(255,0,128) - "FFFF0000" # pos=255 wled=rgb(255,0,0) orig=rgb(255,0,0) -) -# Source: Yelmag (BlacK_Red_Magenta_Yellow_gp) from wled_palettes.h -var PALETTE_YELMAG_ = bytes( - "00000000" # pos=0 wled=rgb(0,0,0) orig=rgb(0,0,0) - "2A800000" # pos=42 wled=rgb(113,0,0) orig=rgb(128,0,0) - "54FF0000" # pos=84 wled=rgb(255,0,0) orig=rgb(255,0,0) - "7FFF0080" # pos=127 wled=rgb(255,0,117) orig=rgb(255,0,128) - "AAFF00FF" # pos=170 wled=rgb(255,0,255) orig=rgb(255,0,255) - "D4FF8080" # pos=212 wled=rgb(255,128,117) orig=rgb(255,128,128) - "FFFFFF00" # pos=255 wled=rgb(255,255,0) orig=rgb(255,255,0) -) -# Source: Yelblu (Blue_Cyan_Yellow_gp) from wled_palettes.h -var PALETTE_YELBLU_ = bytes( - "000000FF" # pos=0 wled=rgb(0,0,255) orig=rgb(0,0,255) - "3F0080FF" # pos=63 wled=rgb(0,128,255) orig=rgb(0,128,255) - "7F00FFFF" # pos=127 wled=rgb(0,255,255) orig=rgb(0,255,255) - "BF80FF80" # pos=191 wled=rgb(113,255,117) orig=rgb(128,255,128) - "FFFFFF00" # pos=255 wled=rgb(255,255,0) orig=rgb(255,255,0) -) -# Source: Temperature (temperature_gp) from wled_palettes.h -# var PALETTE_TEMPERATURE_ = bytes( -# "001E5CB3" # pos=0 wled=rgb(20,92,171) orig=rgb(30,92,179) -# "0E176FC1" # pos=14 wled=rgb(15,111,186) orig=rgb(23,111,193) -# "1C0B8ED8" # pos=28 wled=rgb(6,142,211) orig=rgb(11,142,216) -# "2A04A1E6" # pos=42 wled=rgb(2,161,227) orig=rgb(4,161,230) -# "3819B5F1" # pos=56 wled=rgb(16,181,239) orig=rgb(25,181,241) -# "4633BCCF" # pos=70 wled=rgb(38,188,201) orig=rgb(51,188,207) -# "5466CCCE" # pos=84 wled=rgb(86,204,200) orig=rgb(102,204,206) -# "6399DBB8" # pos=99 wled=rgb(139,219,176) orig=rgb(153,219,184) -# "71C0E588" # pos=113 wled=rgb(182,229,125) orig=rgb(192,229,136) -# "7FCCE64A" # pos=127 wled=rgb(196,230,63) orig=rgb(204,230,74) -# "8DF3F01D" # pos=141 wled=rgb(241,240,22) orig=rgb(243,240,29) -# "9BFEDE27" # pos=155 wled=rgb(254,222,30) orig=rgb(254,222,39) -# "AAFCC707" # pos=170 wled=rgb(251,199,4) orig=rgb(252,199,7) -# "B8F89D0D" # pos=184 wled=rgb(247,157,9) orig=rgb(248,157,13) -# "C6F57215" # pos=198 wled=rgb(243,114,15) orig=rgb(245,114,21) -# "E2DB1E26" # pos=226 wled=rgb(213,30,29) orig=rgb(219,30,38) -# "F0A4262C" # pos=240 wled=rgb(151,38,35) orig=rgb(164,38,44) -# "FFA4262C" # pos=255 wled=rgb(151,38,35) orig=rgb(164,38,44) -# ) -# Source: Retro Clown (retro_clown_gp) from wled_palettes.h -var PALETTE_RETRO_CLOWN_ = bytes( - "00F4A830" # pos=0 wled=rgb(242,168,38) orig=rgb(244,168,48) - "75E64E5C" # pos=117 wled=rgb(226,78,80) orig=rgb(230,78,92) - "FFAD36E4" # pos=255 wled=rgb(161,54,225) orig=rgb(173,54,228) -) -# Source: Candy (candy_gp) from wled_palettes.h -var PALETTE_CANDY_ = bytes( - "00F5F21F" # pos=0 wled=rgb(243,242,23) orig=rgb(245,242,31) - "0FF4A830" # pos=15 wled=rgb(242,168,38) orig=rgb(244,168,48) - "8E7E15A1" # pos=142 wled=rgb(111,21,151) orig=rgb(126,21,161) - "C65A16A0" # pos=198 wled=rgb(74,22,150) orig=rgb(90,22,160) - "FF000080" # pos=255 wled=rgb(0,0,117) orig=rgb(0,0,128) -) -# Source: Toxy Reaf (toxy_reaf_gp) from wled_palettes.h -var PALETTE_TOXY_REAF_ = bytes( - "0004EF89" # pos=0 wled=rgb(2,239,126) orig=rgb(4,239,137) - "FF9E23DD" # pos=255 wled=rgb(145,35,217) orig=rgb(158,35,221) -) -# Source: Fairy Reaf (fairy_reaf_gp) from wled_palettes.h -var PALETTE_FAIRY_REAF_ = bytes( - "00E113C2" # pos=0 wled=rgb(220,19,187) orig=rgb(225,19,194) - "A013E1DF" # pos=160 wled=rgb(12,225,219) orig=rgb(19,225,223) - "DBD2F2E3" # pos=219 wled=rgb(203,242,223) orig=rgb(210,242,227) - "FFFFFFFF" # pos=255 wled=rgb(255,255,255) orig=rgb(255,255,255) -) -# Source: Semi Blue (semi_blue_gp) from wled_palettes.h -var PALETTE_SEMI_BLUE_ = bytes( - "00000000" # pos=0 wled=rgb(0,0,0) orig=rgb(0,0,0) - "0C230430" # pos=12 wled=rgb(24,4,38) orig=rgb(35,4,48) - "35460860" # pos=53 wled=rgb(55,8,84) orig=rgb(70,8,96) - "503930A8" # pos=80 wled=rgb(43,48,159) orig=rgb(57,48,168) - "772B59EF" # pos=119 wled=rgb(31,89,237) orig=rgb(43,89,239) - "91403BAF" # pos=145 wled=rgb(50,59,166) orig=rgb(64,59,175) - "BA561E6E" # pos=186 wled=rgb(71,30,98) orig=rgb(86,30,110) - "E92B0F37" # pos=233 wled=rgb(31,15,45) orig=rgb(43,15,55) - "FF000000" # pos=255 wled=rgb(0,0,0) orig=rgb(0,0,0) -) -# Source: Pink Candy (pink_candy_gp) from wled_palettes.h -var PALETTE_PINK_CANDY_ = bytes( - "00FFFFFF" # pos=0 wled=rgb(255,255,255) orig=rgb(255,255,255) - "2D4040FF" # pos=45 wled=rgb(50,64,255) orig=rgb(64,64,255) - "70F410C1" # pos=112 wled=rgb(242,16,186) orig=rgb(244,16,193) - "8CFFFFFF" # pos=140 wled=rgb(255,255,255) orig=rgb(255,255,255) - "9BF410C1" # pos=155 wled=rgb(242,16,186) orig=rgb(244,16,193) - "C4830DAF" # pos=196 wled=rgb(116,13,166) orig=rgb(131,13,175) - "FFFFFFFF" # pos=255 wled=rgb(255,255,255) orig=rgb(255,255,255) -) -# Source: Red Reaf (red_reaf_gp) from wled_palettes.h -var PALETTE_RED_REAF_ = bytes( - "0031447E" # pos=0 wled=rgb(36,68,114) orig=rgb(49,68,126) - "68A2C3F9" # pos=104 wled=rgb(149,195,248) orig=rgb(162,195,249) - "BCFF0000" # pos=188 wled=rgb(255,0,0) orig=rgb(255,0,0) - "FF6E0E0D" # pos=255 wled=rgb(94,14,9) orig=rgb(110,14,13) -) -# Source: Aqua Flash (aqua_flash_gp) from wled_palettes.h -var PALETTE_AQUA_FLASH_ = bytes( - "00000000" # pos=0 wled=rgb(0,0,0) orig=rgb(0,0,0) - "4290F2F6" # pos=66 wled=rgb(130,242,245) orig=rgb(144,242,246) - "60FFFF40" # pos=96 wled=rgb(255,255,53) orig=rgb(255,255,64) - "7CFFFFFF" # pos=124 wled=rgb(255,255,255) orig=rgb(255,255,255) - "99FFFF40" # pos=153 wled=rgb(255,255,53) orig=rgb(255,255,64) - "BC90F2F6" # pos=188 wled=rgb(130,242,245) orig=rgb(144,242,246) - "FF000000" # pos=255 wled=rgb(0,0,0) orig=rgb(0,0,0) -) -# Source: Yelblu Hot (yelblu_hot_gp) from wled_palettes.h -var PALETTE_YELBLU_HOT_ = bytes( - "00391E44" # pos=0 wled=rgb(43,30,57) orig=rgb(57,30,68) - "3A590082" # pos=58 wled=rgb(73,0,119) orig=rgb(89,0,130) - "7A670056" # pos=122 wled=rgb(87,0,74) orig=rgb(103,0,86) - "9ECD391D" # pos=158 wled=rgb(197,57,22) orig=rgb(205,57,29) - "B7DF7523" # pos=183 wled=rgb(218,117,27) orig=rgb(223,117,35) - "DBF1B129" # pos=219 wled=rgb(239,177,32) orig=rgb(241,177,41) - "FFF7F723" # pos=255 wled=rgb(246,247,27) orig=rgb(247,247,35) -) -# Source: Lite Light (lite_light_gp) from wled_palettes.h -var PALETTE_LITE_LIGHT_ = bytes( - "00000000" # pos=0 wled=rgb(0,0,0) orig=rgb(0,0,0) - "091E151D" # pos=9 wled=rgb(20,21,22) orig=rgb(30,21,29) - "283C2B3C" # pos=40 wled=rgb(46,43,49) orig=rgb(60,43,60) - "423C2B3C" # pos=66 wled=rgb(46,43,49) orig=rgb(60,43,60) - "654C104D" # pos=101 wled=rgb(61,16,65) orig=rgb(76,16,77) - "FF000000" # pos=255 wled=rgb(0,0,0) orig=rgb(0,0,0) -) -# Source: Red Flash (red_flash_gp) from wled_palettes.h -var PALETTE_RED_FLASH_ = bytes( - "00000000" # pos=0 wled=rgb(0,0,0) orig=rgb(0,0,0) - "63F40C0C" # pos=99 wled=rgb(242,12,8) orig=rgb(244,12,12) - "82FDE4AC" # pos=130 wled=rgb(253,228,163) orig=rgb(253,228,172) - "9BF40C0C" # pos=155 wled=rgb(242,12,8) orig=rgb(244,12,12) - "FF000000" # pos=255 wled=rgb(0,0,0) orig=rgb(0,0,0) -) -# Source: Blink Red (blink_red_gp) from wled_palettes.h -var PALETTE_BLINK_RED_ = bytes( - "00080707" # pos=0 wled=rgb(4,7,4) orig=rgb(8,7,7) - "2B351949" # pos=43 wled=rgb(40,25,62) orig=rgb(53,25,73) - "4C4C0F2E" # pos=76 wled=rgb(61,15,36) orig=rgb(76,15,46) - "6DD6276C" # pos=109 wled=rgb(207,39,96) orig=rgb(214,39,108) - "7FFF9CBF" # pos=127 wled=rgb(255,156,184) orig=rgb(255,156,191) - "A5C249D4" # pos=165 wled=rgb(185,73,207) orig=rgb(194,73,212) - "CC7842F2" # pos=204 wled=rgb(105,66,240) orig=rgb(120,66,242) - "FF5D1D5A" # pos=255 wled=rgb(77,29,78) orig=rgb(93,29,90) -) -# Source: Red Shift (red_shift_gp) from wled_palettes.h -var PALETTE_RED_SHIFT_ = bytes( - "00721669" # pos=0 wled=rgb(98,22,93) orig=rgb(114,22,105) - "2D761655" # pos=45 wled=rgb(103,22,73) orig=rgb(118,22,85) - "63C92D43" # pos=99 wled=rgb(192,45,56) orig=rgb(201,45,67) - "84EEBB46" # pos=132 wled=rgb(235,187,59) orig=rgb(238,187,70) - "AFE85522" # pos=175 wled=rgb(228,85,26) orig=rgb(232,85,34) - "C9E8383B" # pos=201 wled=rgb(228,56,48) orig=rgb(232,56,59) - "FF040004" # pos=255 wled=rgb(2,0,2) orig=rgb(4,0,4) -) -# Source: Red Tide (red_tide_gp) from wled_palettes.h -var PALETTE_RED_TIDE_ = bytes( - "00FC2E00" # pos=0 wled=rgb(251,46,0) orig=rgb(252,46,0) - "1CFF8B21" # pos=28 wled=rgb(255,139,25) orig=rgb(255,139,33) - "2BF79E4A" # pos=43 wled=rgb(246,158,63) orig=rgb(247,158,74) - "3AF7D886" # pos=58 wled=rgb(246,216,123) orig=rgb(247,216,134) - "54F55E0F" # pos=84 wled=rgb(243,94,10) orig=rgb(245,94,15) - "72BB4110" # pos=114 wled=rgb(177,65,11) orig=rgb(187,65,16) - "8CFFF17F" # pos=140 wled=rgb(255,241,115) orig=rgb(255,241,127) - "A8BB4110" # pos=168 wled=rgb(177,65,11) orig=rgb(187,65,16) - "C4FBE9A7" # pos=196 wled=rgb(250,233,158) orig=rgb(251,233,167) - "D8FF5E09" # pos=216 wled=rgb(255,94,6) orig=rgb(255,94,9) - "FF8C0807" # pos=255 wled=rgb(126,8,4) orig=rgb(140,8,7) -) -# Source: Candy2 (candy2_gp) from wled_palettes.h -var PALETTE_CANDY2_ = bytes( - "007C6672" # pos=0 wled=rgb(109,102,102) orig=rgb(124,102,114) - "19373153" # pos=25 wled=rgb(42,49,71) orig=rgb(55,49,83) - "30886060" # pos=48 wled=rgb(121,96,84) orig=rgb(136,96,96) - "49F3D622" # pos=73 wled=rgb(241,214,26) orig=rgb(243,214,34) - "59DE6836" # pos=89 wled=rgb(216,104,44) orig=rgb(222,104,54) - "82373153" # pos=130 wled=rgb(42,49,71) orig=rgb(55,49,83) - "A3FFB13A" # pos=163 wled=rgb(255,177,47) orig=rgb(255,177,58) - "BAF3D622" # pos=186 wled=rgb(241,214,26) orig=rgb(243,214,34) - "D37C6672" # pos=211 wled=rgb(109,102,102) orig=rgb(124,102,114) - "FF1E1313" # pos=255 wled=rgb(20,19,13) orig=rgb(30,19,19) -) -# Source: Orange & Teal (Orange_Teal_gp) from wled_palettes.h -var PALETTE_ORANGE_AND_TEAL_ = bytes( - "00009668" # pos=0 wled=rgb(0,150,92) orig=rgb(0,150,104) - "37009668" # pos=55 wled=rgb(0,150,92) orig=rgb(0,150,104) - "C8FF4800" # pos=200 wled=rgb(255,72,0) orig=rgb(255,72,0) - "FFFF4800" # pos=255 wled=rgb(255,72,0) orig=rgb(255,72,0) -) -# Source: April Night (April_Night_gp) from wled_palettes.h -var PALETTE_APRIL_NIGHT_ = bytes( - "00020537" # pos=0 wled=rgb(1,5,45) orig=rgb(2,5,55) - "0A020537" # pos=10 wled=rgb(1,5,45) orig=rgb(2,5,55) - "1909A9B7" # pos=25 wled=rgb(5,169,175) orig=rgb(9,169,183) - "28020537" # pos=40 wled=rgb(1,5,45) orig=rgb(2,5,55) - "3D020537" # pos=61 wled=rgb(1,5,45) orig=rgb(2,5,55) - "4C3BAF28" # pos=76 wled=rgb(45,175,31) orig=rgb(59,175,40) - "5B020537" # pos=91 wled=rgb(1,5,45) orig=rgb(2,5,55) - "70020537" # pos=112 wled=rgb(1,5,45) orig=rgb(2,5,55) - "7FFA9608" # pos=127 wled=rgb(249,150,5) orig=rgb(250,150,8) - "8F020537" # pos=143 wled=rgb(1,5,45) orig=rgb(2,5,55) - "A2020537" # pos=162 wled=rgb(1,5,45) orig=rgb(2,5,55) - "B2FF5C00" # pos=178 wled=rgb(255,92,0) orig=rgb(255,92,0) - "C1020537" # pos=193 wled=rgb(1,5,45) orig=rgb(2,5,55) - "D6020537" # pos=214 wled=rgb(1,5,45) orig=rgb(2,5,55) - "E5E42D54" # pos=229 wled=rgb(223,45,72) orig=rgb(228,45,84) - "F4020537" # pos=244 wled=rgb(1,5,45) orig=rgb(2,5,55) - "FF020537" # pos=255 wled=rgb(1,5,45) orig=rgb(2,5,55) -) -# Source: Orangery (Orangery_gp) from wled_palettes.h -var PALETTE_ORANGERY_ = bytes( - "00FF5F1F" # pos=0 wled=rgb(255,95,23) orig=rgb(255,95,31) - "1EFF5200" # pos=30 wled=rgb(255,82,0) orig=rgb(255,82,0) - "3CE40D0C" # pos=60 wled=rgb(223,13,8) orig=rgb(228,13,12) - "5A9D2C04" # pos=90 wled=rgb(144,44,2) orig=rgb(157,44,4) - "78FF6E18" # pos=120 wled=rgb(255,110,17) orig=rgb(255,110,24) - "96FF4500" # pos=150 wled=rgb(255,69,0) orig=rgb(255,69,0) - "B4AA0D10" # pos=180 wled=rgb(158,13,11) orig=rgb(170,13,16) - "D2F35218" # pos=210 wled=rgb(241,82,17) orig=rgb(243,82,24) - "FFDB2507" # pos=255 wled=rgb(213,37,4) orig=rgb(219,37,7) -) -# Source: C9 (C9_gp) from wled_palettes.h -var PALETTE_C9_ = bytes( - "00C10400" # pos=0 wled=rgb(184,4,0) orig=rgb(193,4,0) - "3CC10400" # pos=60 wled=rgb(184,4,0) orig=rgb(193,4,0) - "419D2C04" # pos=65 wled=rgb(144,44,2) orig=rgb(157,44,4) - "7D9D2C04" # pos=125 wled=rgb(144,44,2) orig=rgb(157,44,4) - "82086004" # pos=130 wled=rgb(4,96,2) orig=rgb(8,96,4) - "BE086004" # pos=190 wled=rgb(4,96,2) orig=rgb(8,96,4) - "C30C0764" # pos=195 wled=rgb(7,7,88) orig=rgb(12,7,100) - "FF0C0764" # pos=255 wled=rgb(7,7,88) orig=rgb(12,7,100) -) -# Source: Sakura (Sakura_gp) from wled_palettes.h -var PALETTE_SAKURA_ = bytes( - "00CC130F" # pos=0 wled=rgb(196,19,10) orig=rgb(204,19,15) - "41FF4537" # pos=65 wled=rgb(255,69,45) orig=rgb(255,69,55) - "82E42D54" # pos=130 wled=rgb(223,45,72) orig=rgb(228,45,84) - "C3FF5273" # pos=195 wled=rgb(255,82,103) orig=rgb(255,82,115) - "FFE40D18" # pos=255 wled=rgb(223,13,17) orig=rgb(228,13,24) -) -# Source: Aurora (Aurora_gp) from wled_palettes.h -var PALETTE_AURORA_ = bytes( - "00020537" # pos=0 wled=rgb(1,5,45) orig=rgb(2,5,55) - "4000C81F" # pos=64 wled=rgb(0,200,23) orig=rgb(0,200,31) - "8000FF00" # pos=128 wled=rgb(0,255,0) orig=rgb(0,255,0) - "AA00F337" # pos=170 wled=rgb(0,243,45) orig=rgb(0,243,55) - "C800870B" # pos=200 wled=rgb(0,135,7) orig=rgb(0,135,11) - "FF020537" # pos=255 wled=rgb(1,5,45) orig=rgb(2,5,55) -) -# Source: Atlantica (Atlantica_gp) from wled_palettes.h -var PALETTE_ATLANTICA_ = bytes( - "00001C7C" # pos=0 wled=rgb(0,28,112) orig=rgb(0,28,124) - "01553229" # pos=1 wled=rgb(70,50,32) orig=rgb(85,50,41) - "60FFFF70" # pos=96 wled=rgb(255,2060,100) orig=rgb(255,255,112) - "00F52DA0" # pos=0 wled=rgb(243,45,150) orig=rgb(245,45,160) - "0C6F5200" # pos=12 wled=rgb(95,82,0) orig=rgb(111,82,0) - "0542C821" # pos=5 wled=rgb(52,200,25) orig=rgb(66,200,33) - "BE6F1308" # pos=190 wled=rgb(95,19,5) orig=rgb(111,19,8) - "FF35AA5C" # pos=255 wled=rgb(40,170,80) orig=rgb(53,170,92) -) -# Source: C9 2 (C9_2_gp) from wled_palettes.h -var PALETTE_C9_2_ = bytes( - "000B7E04" # pos=0 wled=rgb(6,126,2) orig=rgb(11,126,4) - "2D0B7E04" # pos=45 wled=rgb(6,126,2) orig=rgb(11,126,4) - "2E081E7E" # pos=46 wled=rgb(4,30,114) orig=rgb(8,30,126) - "5A081E7E" # pos=90 wled=rgb(4,30,114) orig=rgb(8,30,126) - "5BFF0500" # pos=91 wled=rgb(255,5,0) orig=rgb(255,5,0) - "87FF0500" # pos=135 wled=rgb(255,5,0) orig=rgb(255,5,0) - "88CC3904" # pos=136 wled=rgb(196,57,2) orig=rgb(204,57,4) - "B4CC3904" # pos=180 wled=rgb(196,57,2) orig=rgb(204,57,4) - "B5975504" # pos=181 wled=rgb(137,85,2) orig=rgb(151,85,4) - "FF975504" # pos=255 wled=rgb(137,85,2) orig=rgb(151,85,4) -) -# Source: trafficlight (trafficlight_gp) from wled_palettes.h -var PALETTE_TRAFFICLIGHT_ = bytes( - "00000000" # pos=0 wled=rgb(0,0,0) orig=rgb(0,0,0) - "5500FF00" # pos=85 wled=rgb(0,255,0) orig=rgb(0,255,0) - "AAFFFF00" # pos=170 wled=rgb(255,255,0) orig=rgb(255,255,0) - "FFFF0000" # pos=255 wled=rgb(255,0,0) orig=rgb(255,0,0) -) -# Source: Aurora 2 (Aurora2_gp) from wled_palettes.h -var PALETTE_AURORA_2_ = bytes( - "001AB113" # pos=0 wled=rgb(17,177,13) orig=rgb(26,177,19) - "4088F208" # pos=64 wled=rgb(121,242,5) orig=rgb(136,242,8) - "8024AD84" # pos=128 wled=rgb(25,173,121) orig=rgb(36,173,132) - "C0FB4D8A" # pos=192 wled=rgb(250,77,127) orig=rgb(251,77,138) - "FFB665E1" # pos=255 wled=rgb(171,101,221) orig=rgb(182,101,225) -) -# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# = -# Export palettes with human-readable names -# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# =# = -# Berry code block +# Gradient palette "es_vintage_57_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/vintage/es_vintage_57.c3g +var PALETTE_GRINTAGE_ = bytes( + "001D0803" # pos=0 rgb(29,8,3) + "354C0100" # pos=53 rgb(76,1,0) + "688E601C" # pos=104 rgb(142,96,28) + "99D3BF3D" # pos=153 rgb(211,191,61) + "FF75812A" # pos=255 rgb(117,129,42) +) + +# Gradient palette "es_vintage_01_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/vintage/es_vintage_01.c3g +var PALETTE_VINTAGE_ = bytes( + "00291218" # pos=0 rgb(41,18,24) + "33490016" # pos=51 rgb(73,0,22) + "4CA5AA26" # pos=76 rgb(165,170,38) + "65FFBD50" # pos=101 rgb(255,189,80) + "7F8B3828" # pos=127 rgb(139,56,40) + "99490016" # pos=153 rgb(73,0,22) + "E5291218" # pos=229 rgb(41,18,24) + "FF291218" # pos=255 rgb(41,18,24) +) + +# Gradient palette "es_rivendell_15_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/rivendell/es_rivendell_15.c3g +var PALETTE_RIVENDELL_ = bytes( + "0018452C" # pos=0 rgb(24,69,44) + "65496946" # pos=101 rgb(73,105,70) + "A5818C61" # pos=165 rgb(129,140,97) + "F2C8CCA6" # pos=242 rgb(200,204,166) + "FFC8CCA6" # pos=255 rgb(200,204,166) +) + +# Gradient palette "rgi_15_gp", originally from http://seaviewsensing.com/pub/cpt-city/ds/rgi/rgi_15.c3g +var PALETTE_RED_BLUE_ = bytes( + "00290E63" # pos=0 rgb(41,14,99) + "1F80184A" # pos=31 rgb(128,24,74) + "3FE32232" # pos=63 rgb(227,34,50) + "5F841F4C" # pos=95 rgb(132,31,76) + "7F2F1D66" # pos=127 rgb(47,29,102) + "9F6D2F65" # pos=159 rgb(109,47,101) + "BFB04264" # pos=191 rgb(176,66,100) + "DF813968" # pos=223 rgb(129,57,104) + "FF54306C" # pos=255 rgb(84,48,108) +) + +# Gradient palette "retro2_16_gp", originally from http://seaviewsensing.com/pub/cpt-city/ma/retro2/retro2_16.c3g +var PALETTE_YELLOWOUT_ = bytes( + "00DEBF08" # pos=0 rgb(222,191,8) + "FF753401" # pos=255 rgb(117,52,1) +) + +# Gradient palette "Analogous_1_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/red/Analogous_1.c3g +var PALETTE_ANALOGOUS_ = bytes( + "002600FF" # pos=0 rgb(38,0,255) + "3F5600FF" # pos=63 rgb(86,0,255) + "7F8B00FF" # pos=127 rgb(139,0,255) + "BFC40075" # pos=191 rgb(196,0,117) + "FFFF0000" # pos=255 rgb(255,0,0) +) + +# Gradient palette "es_pinksplash_08_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/pink_splash/es_pinksplash_08.c3g +var PALETTE_SPLASH_ = bytes( + "00BA3FFF" # pos=0 rgb(186,63,255) + "7FE30955" # pos=127 rgb(227,9,85) + "AFEACDD5" # pos=175 rgb(234,205,213) + "DDCD26B0" # pos=221 rgb(205,38,176) + "FFCD26B0" # pos=255 rgb(205,38,176) +) + +# Gradient palette "es_ocean_breeze_036_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/ocean_breeze/es_ocean_breeze_036.c3g +var PALETTE_BREEZE_ = bytes( + "00103033" # pos=0 rgb(16,48,51) + "591BA6AF" # pos=89 rgb(27,166,175) + "99C5E9FF" # pos=153 rgb(197,233,255) + "FF009198" # pos=255 rgb(0,145,152) +) + +# Gradient palette "departure_gp", originally from http://seaviewsensing.com/pub/cpt-city/mjf/departure.c3g +var PALETTE_DEPARTURE_ = bytes( + "00352200" # pos=0 rgb(53,34,0) + "2A563300" # pos=42 rgb(86,51,0) + "3F936C31" # pos=63 rgb(147,108,49) + "54D4A66C" # pos=84 rgb(212,166,108) + "6AEBD4B4" # pos=106 rgb(235,212,180) + "74FFFFFF" # pos=116 rgb(255,255,255) + "8ABFFFC1" # pos=138 rgb(191,255,193) + "9454FF58" # pos=148 rgb(84,255,88) + "AA00FF00" # pos=170 rgb(0,255,0) + "BF00C000" # pos=191 rgb(0,192,0) + "D4008000" # pos=212 rgb(0,128,0) + "FF008000" # pos=255 rgb(0,128,0) +) + +# Gradient palette "es_landscape_64_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/landscape/es_landscape_64.c3g +var PALETTE_LANDSCAPE_ = bytes( + "00000000" # pos=0 rgb(0,0,0) + "251F5913" # pos=37 rgb(31,89,19) + "4C48B22B" # pos=76 rgb(72,178,43) + "7F96EB05" # pos=127 rgb(150,235,5) + "80BAEA77" # pos=128 rgb(186,234,119) + "82DEE9FC" # pos=130 rgb(222,233,252) + "99C5DBE7" # pos=153 rgb(197,219,231) + "CC84B3FD" # pos=204 rgb(132,179,253) + "FF1C6BE1" # pos=255 rgb(28,107,225) +) + +# Gradient palette "es_landscape_33_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/landscape/es_landscape_33.c3g +var PALETTE_BEACH_ = bytes( + "000C2D00" # pos=0 rgb(12,45,0) + "13655602" # pos=19 rgb(101,86,2) + "26CF8004" # pos=38 rgb(207,128,4) + "3FF3C512" # pos=63 rgb(243,197,18) + "426DC492" # pos=66 rgb(109,196,146) + "FF052707" # pos=255 rgb(5,39,7) +) + +# Gradient palette "rainbowsherbet_gp", originally from http://seaviewsensing.com/pub/cpt-city/ma/icecream/rainbowsherbet.c3g +var PALETTE_SHERBET_ = bytes( + "00FF6629" # pos=0 rgb(255,102,41) + "2BFF8C5A" # pos=43 rgb(255,140,90) + "56FF335A" # pos=86 rgb(255,51,90) + "7FFF99A9" # pos=127 rgb(255,153,169) + "AAFFFFF9" # pos=170 rgb(255,255,249) + "D171FF55" # pos=209 rgb(113,255,85) + "FF9DFF89" # pos=255 rgb(157,255,137) +) + +# Gradient palette "gr65_hult_gp", originally from http://seaviewsensing.com/pub/cpt-city/hult/gr65_hult.c3g +var PALETTE_HULT_ = bytes( + "00FBD8FC" # pos=0 rgb(251,216,252) + "30FFC0FF" # pos=48 rgb(255,192,255) + "59EF5FF1" # pos=89 rgb(239,95,241) + "A03399D9" # pos=160 rgb(51,153,217) + "D818B8AE" # pos=216 rgb(24,184,174) + "FF18B8AE" # pos=255 rgb(24,184,174) +) + +# Gradient palette "gr64_hult_gp", originally from http://seaviewsensing.com/pub/cpt-city/hult/gr64_hult.c3g +var PALETTE_HULT64_ = bytes( + "0018B8AE" # pos=0 rgb(24,184,174) + "4208A296" # pos=66 rgb(8,162,150) + "687C8907" # pos=104 rgb(124,137,7) + "82B2BA16" # pos=130 rgb(178,186,22) + "967C8907" # pos=150 rgb(124,137,7) + "C9069C90" # pos=201 rgb(6,156,144) + "EF008075" # pos=239 rgb(0,128,117) + "FF008075" # pos=255 rgb(0,128,117) +) + +# Gradient palette "GMT_drywet_gp", originally from http://seaviewsensing.com/pub/cpt-city/gmt/GMT_drywet.c3g +var PALETTE_DRYWET_ = bytes( + "00776121" # pos=0 rgb(119,97,33) + "2AEBC758" # pos=42 rgb(235,199,88) + "54A9EE7C" # pos=84 rgb(169,238,124) + "7F25EEE8" # pos=127 rgb(37,238,232) + "AA0778EC" # pos=170 rgb(7,120,236) + "D41B01AF" # pos=212 rgb(27,1,175) + "FF043365" # pos=255 rgb(4,51,101) +) + +# Gradient palette "ib15_gp", originally from http://seaviewsensing.com/pub/cpt-city/ing/general/ib15.c3g +var PALETTE_REWHI_ = bytes( + "00B1A0C7" # pos=0 rgb(177,160,199) + "48CD9E95" # pos=72 rgb(205,158,149) + "59E99B65" # pos=89 rgb(233,155,101) + "6BFF5F3F" # pos=107 rgb(255,95,63) + "8DC0626D" # pos=141 rgb(192,98,109) + "FF84659F" # pos=255 rgb(132,101,159) +) + +# Gradient palette "Tertiary_01_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/vermillion/Tertiary_01.c3g +var PALETTE_TERTIARY_ = bytes( + "000019FF" # pos=0 rgb(0,25,255) + "3F268C75" # pos=63 rgb(38,140,117) + "7F56FF00" # pos=127 rgb(86,255,0) + "BFA78C13" # pos=191 rgb(167,140,19) + "FFFF1929" # pos=255 rgb(255,25,41) +) + +# Gradient palette "lava_gp", originally from http://seaviewsensing.com/pub/cpt-city/neota/elem/lava.c3g +var PALETTE_FIRE_ = bytes( + "00000000" # pos=0 rgb(0,0,0) + "2E4D0000" # pos=46 rgb(77,0,0) + "60B10000" # pos=96 rgb(177,0,0) + "6CC42609" # pos=108 rgb(196,38,9) + "77D74C13" # pos=119 rgb(215,76,19) + "92EB731D" # pos=146 rgb(235,115,29) + "AEFF9929" # pos=174 rgb(255,153,41) + "BCFFB229" # pos=188 rgb(255,178,41) + "CAFFCC29" # pos=202 rgb(255,204,41) + "DAFFE629" # pos=218 rgb(255,230,41) + "EAFFFF29" # pos=234 rgb(255,255,41) + "F4FFFF8F" # pos=244 rgb(255,255,143) + "FFFFFFFF" # pos=255 rgb(255,255,255) +) + +# Gradient palette "fierce-ice_gp", originally from http://seaviewsensing.com/pub/cpt-city/neota/elem/fierce-ice.c3g +var PALETTE_ICEFIRE_ = bytes( + "00000000" # pos=0 rgb(0,0,0) + "3B003375" # pos=59 rgb(0,51,117) + "770066FF" # pos=119 rgb(0,102,255) + "952699FF" # pos=149 rgb(38,153,255) + "B456CCFF" # pos=180 rgb(86,204,255) + "D9A7E6FF" # pos=217 rgb(167,230,255) + "FFFFFFFF" # pos=255 rgb(255,255,255) +) + +# Gradient palette "Colorfull_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Colorfull.c3g +var PALETTE_CYANE_ = bytes( + "003D9B2C" # pos=0 rgb(61,155,44) + "195FAE4D" # pos=25 rgb(95,174,77) + "3C84C171" # pos=60 rgb(132,193,113) + "5D9AA67D" # pos=93 rgb(154,166,125) + "6AAF8A88" # pos=106 rgb(175,138,136) + "6DB77989" # pos=109 rgb(183,121,137) + "71C2688A" # pos=113 rgb(194,104,138) + "74E1B3A5" # pos=116 rgb(225,179,165) + "7CFFFFC0" # pos=124 rgb(255,255,192) + "A8A7DACB" # pos=168 rgb(167,218,203) + "FF54B6D7" # pos=255 rgb(84,182,215) +) + +# Gradient palette "Pink_Purple_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Pink_Purple.c3g +var PALETTE_LIGHT_PINK_ = bytes( + "004F206D" # pos=0 rgb(79,32,109) + "195A2875" # pos=25 rgb(90,40,117) + "3366307C" # pos=51 rgb(102,48,124) + "4C8D87B9" # pos=76 rgb(141,135,185) + "66B4DEF8" # pos=102 rgb(180,222,248) + "6DD0ECFC" # pos=109 rgb(208,236,252) + "72EDFAFF" # pos=114 rgb(237,250,255) + "7ACEC8EF" # pos=122 rgb(206,200,239) + "95B195DE" # pos=149 rgb(177,149,222) + "B7BB82CB" # pos=183 rgb(187,130,203) + "FFC66FB8" # pos=255 rgb(198,111,184) +) + +# Gradient palette "Sunset_Real_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Sunset_Real.c3g +var PALETTE_SUNSET_ = bytes( + "00B50000" # pos=0 rgb(181,0,0) + "16DA5500" # pos=22 rgb(218,85,0) + "33FFAA00" # pos=51 rgb(255,170,0) + "55D3554D" # pos=85 rgb(211,85,77) + "87A700A9" # pos=135 rgb(167,0,169) + "C64900BC" # pos=198 rgb(73,0,188) + "FF0000CF" # pos=255 rgb(0,0,207) +) + +# Gradient palette "Sunset_Yellow_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Sunset_Yellow.c3g +var PALETTE_PASTEL_ = bytes( + "003D87B8" # pos=0 rgb(61,135,184) + "2481BCA9" # pos=36 rgb(129,188,169) + "57CBF19B" # pos=87 rgb(203,241,155) + "64E4ED8D" # pos=100 rgb(228,237,141) + "6BFFE87F" # pos=107 rgb(255,232,127) + "73FBCA82" # pos=115 rgb(251,202,130) + "78F8AC85" # pos=120 rgb(248,172,133) + "80FBCA82" # pos=128 rgb(251,202,130) + "B4FFE87F" # pos=180 rgb(255,232,127) + "DFFFF278" # pos=223 rgb(255,242,120) + "FFFFFC71" # pos=255 rgb(255,252,113) +) + +# Gradient palette "Beech_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Beech.c3g +var PALETTE_BEECH_ = bytes( + "00FFFEEC" # pos=0 rgb(255,254,236) + "0CFFFEEC" # pos=12 rgb(255,254,236) + "16FFFEEC" # pos=22 rgb(255,254,236) + "1ADFE0B2" # pos=26 rgb(223,224,178) + "1CC0C37C" # pos=28 rgb(192,195,124) + "1CB0FFE7" # pos=28 rgb(176,255,231) + "327BFBEC" # pos=50 rgb(123,251,236) + "474AF6F1" # pos=71 rgb(74,246,241) + "5D21E1E4" # pos=93 rgb(33,225,228) + "7800CCD7" # pos=120 rgb(0,204,215) + "8504A8B2" # pos=133 rgb(4,168,178) + "880A848F" # pos=136 rgb(10,132,143) + "8833BDD4" # pos=136 rgb(51,189,212) + "D0179FC9" # pos=208 rgb(23,159,201) + "FF0081BE" # pos=255 rgb(0,129,190) +) + +# Gradient palette "Another_Sunset_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/atmospheric/Another_Sunset.c3g +var PALETTE_SUNSET2_ = bytes( + "00AF793E" # pos=0 rgb(175,121,62) + "1D80673C" # pos=29 rgb(128,103,60) + "4454543A" # pos=68 rgb(84,84,58) + "44F8B837" # pos=68 rgb(248,184,55) + "61EFCC5D" # pos=97 rgb(239,204,93) + "7CE6E185" # pos=124 rgb(230,225,133) + "B2667D81" # pos=178 rgb(102,125,129) + "FF001A7D" # pos=255 rgb(0,26,125) +) + +# Gradient palette "es_autumn_19_gp", originally from http://seaviewsensing.com/pub/cpt-city/es/autumn/es_autumn_19.c3g +var PALETTE_AUTUMN_ = bytes( + "005A0E05" # pos=0 rgb(90,14,5) + "338B290D" # pos=51 rgb(139,41,13) + "54B44611" # pos=84 rgb(180,70,17) + "68C0CA7D" # pos=104 rgb(192,202,125) + "70B18903" # pos=112 rgb(177,137,3) + "7ABEC883" # pos=122 rgb(190,200,131) + "7CC0CA7C" # pos=124 rgb(192,202,124) + "87B18903" # pos=135 rgb(177,137,3) + "8EC2CB76" # pos=142 rgb(194,203,118) + "A3B14411" # pos=163 rgb(177,68,17) + "CC80230C" # pos=204 rgb(128,35,12) + "F94A0502" # pos=249 rgb(74,5,2) + "FF4A0502" # pos=255 rgb(74,5,2) +) + +# Gradient palette "BlacK_Blue_Magenta_White_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/basic/BlacK_Blue_Magenta_White.c3g +var PALETTE_MAGENTA_ = bytes( + "00000000" # pos=0 rgb(0,0,0) + "2A000075" # pos=42 rgb(0,0,117) + "540000FF" # pos=84 rgb(0,0,255) + "7F7100FF" # pos=127 rgb(113,0,255) + "AAFF00FF" # pos=170 rgb(255,0,255) + "D4FF80FF" # pos=212 rgb(255,128,255) + "FFFFFFFF" # pos=255 rgb(255,255,255) +) + +# Gradient palette "BlacK_Magenta_Red_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/basic/BlacK_Magenta_Red.c3g +var PALETTE_MAGRED_ = bytes( + "00000000" # pos=0 rgb(0,0,0) + "3F710075" # pos=63 rgb(113,0,117) + "7FFF00FF" # pos=127 rgb(255,0,255) + "BFFF0075" # pos=191 rgb(255,0,117) + "FFFF0000" # pos=255 rgb(255,0,0) +) + +# Gradient palette "BlacK_Red_Magenta_Yellow_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/basic/BlacK_Red_Magenta_Yellow.c3g +var PALETTE_YELMAG_ = bytes( + "00000000" # pos=0 rgb(0,0,0) + "2A710000" # pos=42 rgb(113,0,0) + "54FF0000" # pos=84 rgb(255,0,0) + "7FFF0075" # pos=127 rgb(255,0,117) + "AAFF00FF" # pos=170 rgb(255,0,255) + "D4FF8075" # pos=212 rgb(255,128,117) + "FFFFFF00" # pos=255 rgb(255,255,0) +) + +# Gradient palette "Blue_Cyan_Yellow_gp", originally from http://seaviewsensing.com/pub/cpt-city/nd/basic/Blue_Cyan_Yellow.c3g +var PALETTE_YELBLU_ = bytes( + "000000FF" # pos=0 rgb(0,0,255) + "3F0080FF" # pos=63 rgb(0,128,255) + "7F00FFFF" # pos=127 rgb(0,255,255) + "BF71FF75" # pos=191 rgb(113,255,117) + "FFFFFF00" # pos=255 rgb(255,255,0) +) + +# Custom palette by Aircoookie +var PALETTE_ORANGE_TEAL_ = bytes( + "0000965C" # pos=0 rgb(0,150,92) + "3700965C" # pos=55 rgb(0,150,92) + "C8FF4800" # pos=200 rgb(255,72,0) + "FFFF4800" # pos=255 rgb(255,72,0) +) + +# Custom palette by Aircoookie +var PALETTE_TIAMAT_ = bytes( + "0001020E" # pos=0 rgb(1,2,14) + "21020523" # pos=33 rgb(2,5,35) + "640D875C" # pos=100 rgb(13,135,92) + "782BFFC1" # pos=120 rgb(43,255,193) + "8CF707F9" # pos=140 rgb(247,7,249) + "A0C111D0" # pos=160 rgb(193,17,208) + "B427FF9A" # pos=180 rgb(39,255,154) + "C804D5EC" # pos=200 rgb(4,213,236) + "DC27FC87" # pos=220 rgb(39,252,135) + "F0C1D5FD" # pos=240 rgb(193,213,253) + "FFFFF9FF" # pos=255 rgb(255,249,255) +) + +# Custom palette by Aircoookie +var PALETTE_APRIL_NIGHT_ = bytes( + "0001052D" # pos=0 rgb(1,5,45) + "0A01052D" # pos=10 rgb(1,5,45) + "1905A9AF" # pos=25 rgb(5,169,175) + "2801052D" # pos=40 rgb(1,5,45) + "3D01052D" # pos=61 rgb(1,5,45) + "4C2DAF1F" # pos=76 rgb(45,175,31) + "5B01052D" # pos=91 rgb(1,5,45) + "7001052D" # pos=112 rgb(1,5,45) + "7FF99605" # pos=127 rgb(249,150,5) + "8F01052D" # pos=143 rgb(1,5,45) + "A201052D" # pos=162 rgb(1,5,45) + "B2FF5C00" # pos=178 rgb(255,92,0) + "C101052D" # pos=193 rgb(1,5,45) + "D601052D" # pos=214 rgb(1,5,45) + "E5DF2D48" # pos=229 rgb(223,45,72) + "F401052D" # pos=244 rgb(1,5,45) + "FF01052D" # pos=255 rgb(1,5,45) +) + +var PALETTE_ORANGERY_ = bytes( + "00FF5F17" # pos=0 rgb(255,95,23) + "1EFF5200" # pos=30 rgb(255,82,0) + "3CDF0D08" # pos=60 rgb(223,13,8) + "5A902C02" # pos=90 rgb(144,44,2) + "78FF6E11" # pos=120 rgb(255,110,17) + "96FF4500" # pos=150 rgb(255,69,0) + "B49E0D0B" # pos=180 rgb(158,13,11) + "D2F15211" # pos=210 rgb(241,82,17) + "FFD52504" # pos=255 rgb(213,37,4) +) + +# inspired by Mark Kriegsman https://gist.github.com/kriegsman/756ea6dcae8e30845b5a +var PALETTE_C9_ = bytes( + "00B80400" # pos=0 rgb(184,4,0) + "3CB80400" # pos=60 rgb(184,4,0) + "41902C02" # pos=65 rgb(144,44,2) + "7D902C02" # pos=125 rgb(144,44,2) + "82046002" # pos=130 rgb(4,96,2) + "BE046002" # pos=190 rgb(4,96,2) + "C3070758" # pos=195 rgb(7,7,88) + "FF070758" # pos=255 rgb(7,7,88) +) + +var PALETTE_SAKURA_ = bytes( + "00C4130A" # pos=0 rgb(196,19,10) + "41FF452D" # pos=65 rgb(255,69,45) + "82DF2D48" # pos=130 rgb(223,45,72) + "C3FF5267" # pos=195 rgb(255,82,103) + "FFDF0D11" # pos=255 rgb(223,13,17) +) + +var PALETTE_AURORA_ = bytes( + "0001052D" # pos=0 rgb(1,5,45) + "4000C817" # pos=64 rgb(0,200,23) + "8000FF00" # pos=128 rgb(0,255,0) + "AA00F32D" # pos=170 rgb(0,243,45) + "C8008707" # pos=200 rgb(0,135,7) + "FF01052D" # pos=255 rgb(1,5,45) +) + +var PALETTE_ATLANTICA_ = bytes( + "00001C70" # pos=0 rgb(0,28,112) + "322060FF" # pos=50 rgb(32,96,255) + "6400F32D" # pos=100 rgb(0,243,45) + "960C5F52" # pos=150 rgb(12,95,82) + "C819BE5F" # pos=200 rgb(25,190,95) + "FF28AA50" # pos=255 rgb(40,170,80) +) + +var PALETTE_C9_2_ = bytes( + "00067E02" # pos=0 rgb(6,126,2) + "2D067E02" # pos=45 rgb(6,126,2) + "2E041E72" # pos=46 rgb(4,30,114) + "5A041E72" # pos=90 rgb(4,30,114) + "5BFF0500" # pos=91 rgb(255,5,0) + "87FF0500" # pos=135 rgb(255,5,0) + "88C43902" # pos=136 rgb(196,57,2) + "B4C43902" # pos=180 rgb(196,57,2) + "B5895502" # pos=181 rgb(137,85,2) + "FF895502" # pos=255 rgb(137,85,2) +) + +# C9, but brighter and with a less purple blue +var PALETTE_C9_NEW_ = bytes( + "00FF0500" # pos=0 rgb(255,5,0) + "3CFF0500" # pos=60 rgb(255,5,0) + "3DC43902" # pos=61 rgb(196,57,2) + "78C43902" # pos=120 rgb(196,57,2) + "79067E02" # pos=121 rgb(6,126,2) + "B4067E02" # pos=180 rgb(6,126,2) + "B5041E72" # pos=181 rgb(4,30,114) + "FF041E72" # pos=255 rgb(4,30,114) +) + +# Gradient palette "temperature_gp", originally from http://seaviewsensing.com/pub/cpt-city/arendal/temperature.c3g +var PALETTE_TEMPERATURE_ = bytes( + "00145CAB" # pos=0 rgb(20,92,171) + "0E0F6FBA" # pos=14 rgb(15,111,186) + "1C068ED3" # pos=28 rgb(6,142,211) + "2A02A1E3" # pos=42 rgb(2,161,227) + "3810B5EF" # pos=56 rgb(16,181,239) + "4626BCC9" # pos=70 rgb(38,188,201) + "5456CCC8" # pos=84 rgb(86,204,200) + "638BDBB0" # pos=99 rgb(139,219,176) + "71B6E57D" # pos=113 rgb(182,229,125) + "7FC4E63F" # pos=127 rgb(196,230,63) + "8DF1F016" # pos=141 rgb(241,240,22) + "9BFEDE1E" # pos=155 rgb(254,222,30) + "AAFBC704" # pos=170 rgb(251,199,4) + "B8F79D09" # pos=184 rgb(247,157,9) + "C6F3720F" # pos=198 rgb(243,114,15) + "E2D51E1D" # pos=226 rgb(213,30,29) + "F0972623" # pos=240 rgb(151,38,35) + "FF972623" # pos=255 rgb(151,38,35) +) + +# Gradient palette "bhw1_01_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_01.c3g +var PALETTE_RETRO_CLOWN_ = bytes( + "00F2A826" # pos=0 rgb(242,168,38) + "75E24E50" # pos=117 rgb(226,78,80) + "FFA136E1" # pos=255 rgb(161,54,225) +) + +# Gradient palette "bhw1_04_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_04.c3g +var PALETTE_CANDY_ = bytes( + "00F3F217" # pos=0 rgb(243,242,23) + "0FF2A826" # pos=15 rgb(242,168,38) + "8E6F1597" # pos=142 rgb(111,21,151) + "C64A1696" # pos=198 rgb(74,22,150) + "FF000075" # pos=255 rgb(0,0,117) +) + +# Gradient palette "bhw1_05_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_05.c3g +var PALETTE_TOXY_REAF_ = bytes( + "0002EF7E" # pos=0 rgb(2,239,126) + "FF9123D9" # pos=255 rgb(145,35,217) +) + +# Gradient palette "bhw1_06_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_06.c3g +var PALETTE_FAIRY_REAF_ = bytes( + "00DC13BB" # pos=0 rgb(220,19,187) + "A00CE1DB" # pos=160 rgb(12,225,219) + "DBCBF2DF" # pos=219 rgb(203,242,223) + "FFFFFFFF" # pos=255 rgb(255,255,255) +) + +# Gradient palette "bhw1_14_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_14.c3g +var PALETTE_SEMI_BLUE_ = bytes( + "00000000" # pos=0 rgb(0,0,0) + "0C180426" # pos=12 rgb(24,4,38) + "35370854" # pos=53 rgb(55,8,84) + "502B309F" # pos=80 rgb(43,48,159) + "771F59ED" # pos=119 rgb(31,89,237) + "91323BA6" # pos=145 rgb(50,59,166) + "BA471E62" # pos=186 rgb(71,30,98) + "E91F0F2D" # pos=233 rgb(31,15,45) + "FF000000" # pos=255 rgb(0,0,0) +) + +# Gradient palette "bhw1_three_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_three.c3g +var PALETTE_PINK_CANDY_ = bytes( + "00FFFFFF" # pos=0 rgb(255,255,255) + "2D3240FF" # pos=45 rgb(50,64,255) + "70F210BA" # pos=112 rgb(242,16,186) + "8CFFFFFF" # pos=140 rgb(255,255,255) + "9BF210BA" # pos=155 rgb(242,16,186) + "C4740DA6" # pos=196 rgb(116,13,166) + "FFFFFFFF" # pos=255 rgb(255,255,255) +) + +# Gradient palette "bhw1_w00t_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw1/bhw1_w00t.c3g +var PALETTE_RED_REAF_ = bytes( + "00244472" # pos=0 rgb(36,68,114) + "6895C3F8" # pos=104 rgb(149,195,248) + "BCFF0000" # pos=188 rgb(255,0,0) + "FF5E0E09" # pos=255 rgb(94,14,9) +) + +# Gradient palette "bhw2_23_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw2/bhw2_23.c3g +var PALETTE_AQUA_FLASH_ = bytes( + "00000000" # pos=0 rgb(0,0,0) + "4282F2F5" # pos=66 rgb(130,242,245) + "60FFFF35" # pos=96 rgb(255,255,53) + "7CFFFFFF" # pos=124 rgb(255,255,255) + "99FFFF35" # pos=153 rgb(255,255,53) + "BC82F2F5" # pos=188 rgb(130,242,245) + "FF000000" # pos=255 rgb(0,0,0) +) + +# Gradient palette "bhw2_xc_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw2/bhw2_xc.c3g +var PALETTE_YELBLU_HOT_ = bytes( + "002B1E39" # pos=0 rgb(43,30,57) + "3A490077" # pos=58 rgb(73,0,119) + "7A57004A" # pos=122 rgb(87,0,74) + "9EC53916" # pos=158 rgb(197,57,22) + "B7DA751B" # pos=183 rgb(218,117,27) + "DBEFB120" # pos=219 rgb(239,177,32) + "FFF6F71B" # pos=255 rgb(246,247,27) +) + +# Gradient palette "bhw2_45_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw2/bhw2_45.c3g +var PALETTE_LITE_LIGHT_ = bytes( + "00000000" # pos=0 rgb(0,0,0) + "09141516" # pos=9 rgb(20,21,22) + "282E2B31" # pos=40 rgb(46,43,49) + "422E2B31" # pos=66 rgb(46,43,49) + "653D1041" # pos=101 rgb(61,16,65) + "FF000000" # pos=255 rgb(0,0,0) +) + +# Gradient palette "bhw2_22_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw2/bhw2_22.c3g +var PALETTE_RED_FLASH_ = bytes( + "00000000" # pos=0 rgb(0,0,0) + "63F20C08" # pos=99 rgb(242,12,8) + "82FDE4A3" # pos=130 rgb(253,228,163) + "9BF20C08" # pos=155 rgb(242,12,8) + "FF000000" # pos=255 rgb(0,0,0) +) + +# Gradient palette "bhw3_40_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw3/bhw3_40.c3g +var PALETTE_BLINK_RED_ = bytes( + "00040704" # pos=0 rgb(4,7,4) + "2B28193E" # pos=43 rgb(40,25,62) + "4C3D0F24" # pos=76 rgb(61,15,36) + "6DCF2760" # pos=109 rgb(207,39,96) + "7FFF9CB8" # pos=127 rgb(255,156,184) + "A5B949CF" # pos=165 rgb(185,73,207) + "CC6942F0" # pos=204 rgb(105,66,240) + "FF4D1D4E" # pos=255 rgb(77,29,78) +) + +# Gradient palette "bhw3_52_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw3/bhw3_52.c3g +var PALETTE_RED_SHIFT_ = bytes( + "0062165D" # pos=0 rgb(98,22,93) + "2D671649" # pos=45 rgb(103,22,73) + "63C02D38" # pos=99 rgb(192,45,56) + "84EBBB3B" # pos=132 rgb(235,187,59) + "AFE4551A" # pos=175 rgb(228,85,26) + "C9E43830" # pos=201 rgb(228,56,48) + "FF020002" # pos=255 rgb(2,0,2) +) + +# Gradient palette "bhw4_097_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw4/bhw4_097.c3g +var PALETTE_RED_TIDE_ = bytes( + "00FB2E00" # pos=0 rgb(251,46,0) + "1CFF8B19" # pos=28 rgb(255,139,25) + "2BF69E3F" # pos=43 rgb(246,158,63) + "3AF6D87B" # pos=58 rgb(246,216,123) + "54F35E0A" # pos=84 rgb(243,94,10) + "72B1410B" # pos=114 rgb(177,65,11) + "8CFFF173" # pos=140 rgb(255,241,115) + "A8B1410B" # pos=168 rgb(177,65,11) + "C4FAE99E" # pos=196 rgb(250,233,158) + "D8FF5E06" # pos=216 rgb(255,94,6) + "FF7E0804" # pos=255 rgb(126,8,4) +) + +# Gradient palette "bhw4_017_gp", originally from http://seaviewsensing.com/pub/cpt-city/bhw/bhw4/bhw4_017.c3g +var PALETTE_CANDY2_ = bytes( + "006D6666" # pos=0 rgb(109,102,102) + "192A3147" # pos=25 rgb(42,49,71) + "30796054" # pos=48 rgb(121,96,84) + "49F1D61A" # pos=73 rgb(241,214,26) + "59D8682C" # pos=89 rgb(216,104,44) + "822A3147" # pos=130 rgb(42,49,71) + "A3FFB12F" # pos=163 rgb(255,177,47) + "BAF1D61A" # pos=186 rgb(241,214,26) + "D36D6666" # pos=211 rgb(109,102,102) + "FF14130D" # pos=255 rgb(20,19,13) +) + +var PALETTE_TRAFFIC_LIGHT_ = bytes( + "00000000" # pos=0 rgb(0,0,0) + "5500FF00" # pos=85 rgb(0,255,0) + "AAFFFF00" # pos=170 rgb(255,255,0) + "FFFF0000" # pos=255 rgb(255,0,0) +) + +var PALETTE_AURORA_2_ = bytes( + "0011B10D" # pos=0 rgb(17,177,13) + "4079F205" # pos=64 rgb(121,242,5) + "8019AD79" # pos=128 rgb(25,173,121) + "C0FA4D7F" # pos=192 rgb(250,77,127) + "FFAB65DD" # pos=255 rgb(171,101,221) +) + +# Palette map for easy access by name class WLED_Palettes static map = { - "Analogous 1": PALETTE_ANALOGOUS_1_, - "Another Sunset": PALETTE_ANOTHER_SUNSET_, - "Beech": PALETTE_BEECH_, - "Black Blue Magenta White": PALETTE_BLACK_BLUE_MAGENTA_WHITE_, - "Black Magenta Red": PALETTE_BLACK_MAGENTA_RED_, - "Black Red Magenta Yellow": PALETTE_BLACK_RED_MAGENTA_YELLOW_, - "Blue Cyan Yellow": PALETTE_BLUE_CYAN_YELLOW_, - "Colorfull": PALETTE_COLORFULL_, - "Gmt Drywet": PALETTE_GMT_DRYWET_, - "Pink Purple": PALETTE_PINK_PURPLE_, - "Sunset Real": PALETTE_SUNSET_REAL_, - "Sunset Yellow": PALETTE_SUNSET_YELLOW_, - "Tertiary 01": PALETTE_TERTIARY_01_, - "Bhw1 01": PALETTE_BHW1_01_, - "Bhw1 04": PALETTE_BHW1_04_, - "Bhw1 05": PALETTE_BHW1_05_, - "Bhw1 06": PALETTE_BHW1_06_, - "Bhw1 14": PALETTE_BHW1_14_, - "Bhw1 Three": PALETTE_BHW1_THREE_, - "Bhw1 W00T": PALETTE_BHW1_W00T_, - "Bhw2 22": PALETTE_BHW2_22_, - "Bhw2 23": PALETTE_BHW2_23_, - "Bhw2 45": PALETTE_BHW2_45_, - "Bhw2 Xc": PALETTE_BHW2_XC_, - "Bhw3 40": PALETTE_BHW3_40_, - "Bhw3 52": PALETTE_BHW3_52_, - "Bhw4 017": PALETTE_BHW4_017_, - "Bhw4 097": PALETTE_BHW4_097_, - "Departure": PALETTE_DEPARTURE_, - "Es Autumn 19": PALETTE_ES_AUTUMN_19_, - "Es Landscape 33": PALETTE_ES_LANDSCAPE_33_, - "Es Landscape 64": PALETTE_ES_LANDSCAPE_64_, - "Es Ocean Breeze 036": PALETTE_ES_OCEAN_BREEZE_036_, - "Es Pinksplash 08": PALETTE_ES_PINKSPLASH_08_, - "Es Rivendell 15": PALETTE_ES_RIVENDELL_15_, - "Es Vintage 01": PALETTE_ES_VINTAGE_01_, - "Es Vintage 57": PALETTE_ES_VINTAGE_57_, - "Fierce-Ice": PALETTE_FIERCE_ICE_, - "Gr64 Hult": PALETTE_GR64_HULT_, - "Gr65 Hult": PALETTE_GR65_HULT_, - "Ib15": PALETTE_IB15_, - "Ib Jul01": PALETTE_IB_JUL01_, - "Lava": PALETTE_LAVA_, - "Rainbowsherbet": PALETTE_RAINBOWSHERBET_, - "Retro2 16": PALETTE_RETRO2_16_, - "Rgi 15": PALETTE_RGI_15_, - "Temperature": PALETTE_TEMPERATURE_, "Jul": PALETTE_JUL_, "Grintage": PALETTE_GRINTAGE_, "Vintage": PALETTE_VINTAGE_, "Rivendell": PALETTE_RIVENDELL_, - "Red & Blue": PALETTE_RED_AND_BLUE_, + "Red & Blue": PALETTE_RED_BLUE_, "Yellowout": PALETTE_YELLOWOUT_, "Analogous": PALETTE_ANALOGOUS_, "Splash": PALETTE_SPLASH_, @@ -1209,6 +706,16 @@ class WLED_Palettes "Magred": PALETTE_MAGRED_, "Yelmag": PALETTE_YELMAG_, "Yelblu": PALETTE_YELBLU_, + "Orange & Teal": PALETTE_ORANGE_TEAL_, + "Tiamat": PALETTE_TIAMAT_, + "April Night": PALETTE_APRIL_NIGHT_, + "Orangery": PALETTE_ORANGERY_, + "C9": PALETTE_C9_, + "Sakura": PALETTE_SAKURA_, + "Aurora": PALETTE_AURORA_, + "Atlantica": PALETTE_ATLANTICA_, + "C9 2": PALETTE_C9_2_, + "C9 New": PALETTE_C9_NEW_, "Temperature": PALETTE_TEMPERATURE_, "Retro Clown": PALETTE_RETRO_CLOWN_, "Candy": PALETTE_CANDY_, @@ -1225,20 +732,9 @@ class WLED_Palettes "Red Shift": PALETTE_RED_SHIFT_, "Red Tide": PALETTE_RED_TIDE_, "Candy2": PALETTE_CANDY2_, - "Orange & Teal": PALETTE_ORANGE_AND_TEAL_, - "April Night": PALETTE_APRIL_NIGHT_, - "Orangery": PALETTE_ORANGERY_, - "C9": PALETTE_C9_, - "Sakura": PALETTE_SAKURA_, - "Aurora": PALETTE_AURORA_, - "Atlantica": PALETTE_ATLANTICA_, - "C9 2": PALETTE_C9_2_, - "trafficlight": PALETTE_TRAFFICLIGHT_, - "Aurora 2": PALETTE_AURORA_2_, + "Traffic Light": PALETTE_TRAFFIC_LIGHT_, + "Aurora 2": PALETTE_AURORA_2_ } end return {"wled_palettes": WLED_Palettes} - -# End berry code block - From 9011e9a69e6bb71b40b7ebcfcacc966ab4e8af2e Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sat, 18 Oct 2025 12:32:57 +0200 Subject: [PATCH 019/136] LVGL library from v9.3.0 to v9.4.0 (#24028) --- CHANGELOG.md | 1 + .../generate/LVGL_API_Reference.md | 71 +- .../generate/be_lv_c_mapping.h | 43 + .../generate/be_lvgl_module.c | 77 +- .../lv_binding_berry/mapping/lv_enum.h | 97 +- .../lv_binding_berry/mapping/lv_funcs.h | 84 +- .../src/be_lvgl_ctypes_definitions.c | 201 +- .../src/embedded/lvgl_ctypes.py | 221 +- .../lv_binding_berry/tools/convert.py | 8 +- .../lv_binding_berry/tools/preprocessor.py | 4 + .../src/embedded/lv_1_constants.be | 65 +- .../lv_haspmota/src/embedded/lv_haspmota.be | 14 +- .../src/solidify/solidified_lv_haspmota.h | 2 +- lib/libesp32_lvgl/lvgl/README.md | 639 +- lib/libesp32_lvgl/lvgl/library.json | 2 +- lib/libesp32_lvgl/lvgl/library.properties | 2 +- lib/libesp32_lvgl/lvgl/lv_conf_template.h | 243 +- lib/libesp32_lvgl/lvgl/lv_version.h | 8 +- lib/libesp32_lvgl/lvgl/lvgl.h | 22 +- lib/libesp32_lvgl/lvgl/lvgl_private.h | 2 +- lib/libesp32_lvgl/lvgl/src/core/lv_global.h | 50 +- lib/libesp32_lvgl/lvgl/src/core/lv_obj.c | 175 +- lib/libesp32_lvgl/lvgl/src/core/lv_obj.h | 95 +- lib/libesp32_lvgl/lvgl/src/core/lv_obj_draw.c | 4 + lib/libesp32_lvgl/lvgl/src/core/lv_obj_draw.h | 3 +- .../lvgl/src/core/lv_obj_event.c | 63 +- .../lvgl/src/core/lv_obj_id_builtin.c | 4 +- lib/libesp32_lvgl/lvgl/src/core/lv_obj_pos.c | 148 +- .../lvgl/src/core/lv_obj_private.h | 3 +- .../lvgl/src/core/lv_obj_property.c | 2 +- .../lvgl/src/core/lv_obj_property.h | 16 +- .../lvgl/src/core/lv_obj_style.c | 74 +- .../lvgl/src/core/lv_obj_style.h | 72 +- .../lvgl/src/core/lv_obj_style_gen.c | 8 + .../lvgl/src/core/lv_obj_style_gen.h | 7 + .../lvgl/src/core/lv_obj_style_private.h | 1 + lib/libesp32_lvgl/lvgl/src/core/lv_obj_tree.h | 4 +- lib/libesp32_lvgl/lvgl/src/core/lv_refr.c | 363 +- .../lvgl/src/core/lv_refr_private.h | 15 + .../lvgl/src/display/lv_display.c | 96 +- .../lvgl/src/display/lv_display.h | 56 +- .../helium/lv_draw_buf_convert_helium.c | 100 + .../helium/lv_draw_buf_convert_helium.h | 57 + .../src/draw/convert/lv_draw_buf_convert.c | 130 + .../src/draw/convert/lv_draw_buf_convert.h | 39 + .../convert/neon/lv_draw_buf_convert_neon.c | 132 + .../convert/neon/lv_draw_buf_convert_neon.h | 58 + .../lvgl/src/draw/dma2d/lv_draw_dma2d.c | 132 +- .../lvgl/src/draw/dma2d/lv_draw_dma2d_fill.c | 8 +- .../lvgl/src/draw/dma2d/lv_draw_dma2d_img.c | 124 +- .../src/draw/dma2d/lv_draw_dma2d_private.h | 11 +- .../lvgl/src/draw/espressif/ppa/lv_draw_ppa.c | 255 + .../lvgl/src/draw/espressif/ppa/lv_draw_ppa.h | 57 + .../src/draw/espressif/ppa/lv_draw_ppa_buf.c | 52 + .../src/draw/espressif/ppa/lv_draw_ppa_fill.c | 48 + .../src/draw/espressif/ppa/lv_draw_ppa_img.c | 77 + .../draw/espressif/ppa/lv_draw_ppa_private.h | 185 + .../lvgl/src/draw/eve/lv_draw_eve.c | 164 + .../lvgl/src/draw/eve/lv_draw_eve.h | 57 + .../lvgl/src/draw/eve/lv_draw_eve_arc.c | 325 + .../lvgl/src/draw/eve/lv_draw_eve_fill.c | 121 + .../lvgl/src/draw/eve/lv_draw_eve_image.c | 299 + .../lvgl/src/draw/eve/lv_draw_eve_letter.c | 233 + .../lvgl/src/draw/eve/lv_draw_eve_line.c | 63 + .../lvgl/src/draw/eve/lv_draw_eve_private.h | 117 + .../lvgl/src/draw/eve/lv_draw_eve_ram_g.c | 221 + .../lvgl/src/draw/eve/lv_draw_eve_ram_g.h | 48 + .../lvgl/src/draw/eve/lv_draw_eve_target.h | 79 + .../lvgl/src/draw/eve/lv_draw_eve_triangle.c | 127 + lib/libesp32_lvgl/lvgl/src/draw/eve/lv_eve.c | 265 + lib/libesp32_lvgl/lvgl/src/draw/eve/lv_eve.h | 151 + lib/libesp32_lvgl/lvgl/src/draw/lv_draw.c | 96 +- lib/libesp32_lvgl/lvgl/src/draw/lv_draw.h | 79 +- lib/libesp32_lvgl/lvgl/src/draw/lv_draw_3d.c | 2 + lib/libesp32_lvgl/lvgl/src/draw/lv_draw_3d.h | 2 + lib/libesp32_lvgl/lvgl/src/draw/lv_draw_arc.h | 6 +- lib/libesp32_lvgl/lvgl/src/draw/lv_draw_buf.c | 214 +- lib/libesp32_lvgl/lvgl/src/draw/lv_draw_buf.h | 51 +- .../lvgl/src/draw/lv_draw_buf_private.h | 13 +- .../lvgl/src/draw/lv_draw_image.c | 6 +- .../lvgl/src/draw/lv_draw_image.h | 4 +- .../lvgl/src/draw/lv_draw_label.c | 85 +- .../lvgl/src/draw/lv_draw_label.h | 14 +- .../lvgl/src/draw/lv_draw_private.h | 11 +- .../lvgl/src/draw/lv_draw_rect.c | 11 +- .../lvgl/src/draw/lv_draw_rect.h | 24 +- .../lvgl/src/draw/lv_draw_vector.c | 583 +- .../lvgl/src/draw/lv_draw_vector.h | 180 +- .../lvgl/src/draw/lv_draw_vector_private.h | 52 +- .../lvgl/src/draw/lv_image_decoder.c | 52 +- .../lvgl/src/draw/lv_image_dsc.h | 5 + .../lvgl/src/draw/nema_gfx/lv_draw_nema_gfx.c | 21 +- .../lvgl/src/draw/nema_gfx/lv_draw_nema_gfx.h | 5 + .../draw/nema_gfx/lv_draw_nema_gfx_border.c | 2 +- .../src/draw/nema_gfx/lv_draw_nema_gfx_fill.c | 67 +- .../src/draw/nema_gfx/lv_draw_nema_gfx_img.c | 97 +- .../draw/nema_gfx/lv_draw_nema_gfx_label.c | 34 +- .../draw/nema_gfx/lv_draw_nema_gfx_layer.c | 2 +- .../src/draw/nema_gfx/lv_draw_nema_gfx_line.c | 2 +- .../nema_gfx/lv_draw_nema_gfx_stm32_hal.c | 2 +- .../draw/nema_gfx/lv_draw_nema_gfx_triangle.c | 6 +- .../draw/nema_gfx/lv_draw_nema_gfx_utils.h | 2 +- .../draw/nema_gfx/lv_draw_nema_gfx_vector.c | 161 + .../lvgl/src/draw/nxp/g2d/lv_draw_buf_g2d.c | 6 +- .../lvgl/src/draw/nxp/g2d/lv_draw_g2d.c | 72 +- .../lvgl/src/draw/nxp/g2d/lv_draw_g2d.h | 8 +- .../lvgl/src/draw/nxp/g2d/lv_draw_g2d_fill.c | 57 +- .../lvgl/src/draw/nxp/g2d/lv_draw_g2d_img.c | 288 +- .../lvgl/src/draw/nxp/g2d/lv_g2d_buf_map.c | 69 +- .../lvgl/src/draw/nxp/g2d/lv_g2d_buf_map.h | 6 +- .../lvgl/src/draw/nxp/g2d/lv_g2d_utils.c | 87 +- .../lvgl/src/draw/nxp/g2d/lv_g2d_utils.h | 15 +- .../lvgl/src/draw/nxp/pxp/lv_draw_buf_pxp.c | 4 +- .../lvgl/src/draw/nxp/pxp/lv_draw_pxp.c | 11 +- .../lvgl/src/draw/nxp/pxp/lv_draw_pxp.h | 2 +- .../lvgl/src/draw/nxp/pxp/lv_draw_pxp_img.c | 137 +- .../lvgl/src/draw/nxp/pxp/lv_draw_pxp_layer.c | 2 +- .../lvgl/src/draw/nxp/pxp/lv_pxp_cfg.h | 4 + .../lvgl/src/draw/nxp/pxp/lv_pxp_osa.c | 2 +- .../src/draw/nxp/vglite/lv_draw_buf_vglite.c | 131 - .../lvgl/src/draw/nxp/vglite/lv_draw_vglite.c | 638 - .../lvgl/src/draw/nxp/vglite/lv_draw_vglite.h | 101 - .../src/draw/nxp/vglite/lv_draw_vglite_arc.c | 684 - .../draw/nxp/vglite/lv_draw_vglite_border.c | 248 - .../src/draw/nxp/vglite/lv_draw_vglite_fill.c | 269 - .../src/draw/nxp/vglite/lv_draw_vglite_img.c | 449 - .../draw/nxp/vglite/lv_draw_vglite_label.c | 270 - .../draw/nxp/vglite/lv_draw_vglite_layer.c | 156 - .../src/draw/nxp/vglite/lv_draw_vglite_line.c | 169 - .../draw/nxp/vglite/lv_draw_vglite_triangle.c | 214 - .../lvgl/src/draw/nxp/vglite/lv_vglite_buf.c | 116 - .../lvgl/src/draw/nxp/vglite/lv_vglite_buf.h | 124 - .../src/draw/nxp/vglite/lv_vglite_matrix.c | 81 - .../src/draw/nxp/vglite/lv_vglite_matrix.h | 80 - .../lvgl/src/draw/nxp/vglite/lv_vglite_path.c | 217 - .../lvgl/src/draw/nxp/vglite/lv_vglite_path.h | 98 - .../src/draw/nxp/vglite/lv_vglite_utils.c | 286 - .../src/draw/nxp/vglite/lv_vglite_utils.h | 183 - .../lvgl/src/draw/opengles/lv_draw_opengles.c | 141 +- .../src/draw/renesas/dave2d/lv_draw_dave2d.c | 247 +- .../src/draw/renesas/dave2d/lv_draw_dave2d.h | 38 +- .../draw/renesas/dave2d/lv_draw_dave2d_arc.c | 13 - .../renesas/dave2d/lv_draw_dave2d_border.c | 26 - .../draw/renesas/dave2d/lv_draw_dave2d_fill.c | 21 - .../renesas/dave2d/lv_draw_dave2d_image.c | 13 - .../renesas/dave2d/lv_draw_dave2d_label.c | 93 +- .../draw/renesas/dave2d/lv_draw_dave2d_line.c | 16 - .../dave2d/lv_draw_dave2d_mask_rectangle.c | 12 - .../renesas/dave2d/lv_draw_dave2d_triangle.c | 19 +- .../renesas/dave2d/lv_draw_dave2d_utils.c | 30 - .../renesas/dave2d/lv_draw_dave2d_utils.h | 2 - .../lvgl/src/draw/sdl/lv_draw_sdl.c | 2 +- .../lvgl/src/draw/sdl/lv_draw_sdl.h | 3 +- .../draw/sw/blend/helium/lv_blend_helium.S | 16 +- .../draw/sw/blend/helium/lv_blend_helium.h | 326 +- .../draw/sw/blend/lv_draw_sw_blend_to_al88.c | 2 +- .../sw/blend/lv_draw_sw_blend_to_argb8888.c | 8 +- ..._draw_sw_blend_to_argb8888_premultiplied.c | 18 +- .../draw/sw/blend/lv_draw_sw_blend_to_i1.c | 6 +- .../draw/sw/blend/lv_draw_sw_blend_to_l8.c | 8 +- .../sw/blend/lv_draw_sw_blend_to_rgb565.c | 32 +- .../lv_draw_sw_blend_to_rgb565_swapped.h | 2 +- .../sw/blend/lv_draw_sw_blend_to_rgb888.c | 26 +- .../src/draw/sw/blend/neon/lv_blend_neon.S | 705 - .../src/draw/sw/blend/neon/lv_blend_neon.h | 1265 +- .../neon/lv_draw_sw_blend_neon_to_rgb565.c | 2093 ++ .../neon/lv_draw_sw_blend_neon_to_rgb565.h | 190 + .../neon/lv_draw_sw_blend_neon_to_rgb888.c | 1704 ++ .../neon/lv_draw_sw_blend_neon_to_rgb888.h | 158 + .../lvgl/src/draw/sw/lv_draw_sw.c | 13 +- .../lvgl/src/draw/sw/lv_draw_sw.h | 3 +- .../lvgl/src/draw/sw/lv_draw_sw_grad.c | 2 +- .../lvgl/src/draw/sw/lv_draw_sw_grad.h | 2 +- .../lvgl/src/draw/sw/lv_draw_sw_img.c | 230 +- .../lvgl/src/draw/sw/lv_draw_sw_letter.c | 39 +- .../lvgl/src/draw/sw/lv_draw_sw_mask.c | 10 +- .../lvgl/src/draw/sw/lv_draw_sw_transform.c | 2 +- .../lvgl/src/draw/sw/lv_draw_sw_triangle.c | 4 +- .../lvgl/src/draw/sw/lv_draw_sw_vector.c | 41 +- .../src/draw/vg_lite/lv_draw_buf_vg_lite.c | 13 +- .../lvgl/src/draw/vg_lite/lv_draw_vg_lite.c | 43 +- .../lvgl/src/draw/vg_lite/lv_draw_vg_lite.h | 2 +- .../src/draw/vg_lite/lv_draw_vg_lite_border.c | 2 +- .../src/draw/vg_lite/lv_draw_vg_lite_fill.c | 8 + .../src/draw/vg_lite/lv_draw_vg_lite_img.c | 156 +- .../src/draw/vg_lite/lv_draw_vg_lite_label.c | 317 +- .../draw/vg_lite/lv_draw_vg_lite_mask_rect.c | 2 +- .../src/draw/vg_lite/lv_draw_vg_lite_type.h | 5 + .../src/draw/vg_lite/lv_draw_vg_lite_vector.c | 126 +- .../lvgl/src/draw/vg_lite/lv_vg_lite_grad.c | 70 +- .../lvgl/src/draw/vg_lite/lv_vg_lite_grad.h | 6 + .../lvgl/src/draw/vg_lite/lv_vg_lite_math.c | 2 +- .../lvgl/src/draw/vg_lite/lv_vg_lite_path.c | 11 +- .../lvgl/src/draw/vg_lite/lv_vg_lite_path.h | 14 - .../lvgl/src/draw/vg_lite/lv_vg_lite_utils.c | 195 +- .../lvgl/src/draw/vg_lite/lv_vg_lite_utils.h | 26 +- .../src/drivers/display/drm/lv_linux_drm.c | 94 +- .../src/drivers/display/drm/lv_linux_drm.h | 84 + .../drivers/display/drm/lv_linux_drm_common.c | 128 + .../drivers/display/drm/lv_linux_drm_egl.c | 746 + .../display/drm/lv_linux_drm_egl_private.h | 76 + .../src/drivers/display/fb/lv_linux_fbdev.c | 127 +- .../lvgl/src/drivers/display/ft81x/lv_ft81x.h | 37 +- .../drivers/display/ft81x/lv_ft81x_defines.h | 4 +- .../drivers/display/lcd/lv_lcd_generic_mipi.c | 13 + .../display/lovyan_gfx/lv_lgfx_user.hpp | 53 + .../display/lovyan_gfx/lv_lovyan_gfx.cpp | 145 + .../display/lovyan_gfx/lv_lovyan_gfx.h | 45 + .../src/drivers/display/nv3007/lv_nv3007.c | 226 + .../src/drivers/display/nv3007/lv_nv3007.h | 94 + .../display/nxp_elcdif/lv_nxp_elcdif.c | 185 + .../display/nxp_elcdif/lv_nxp_elcdif.h | 84 + .../src/drivers/display/st_ltdc/lv_st_ltdc.c | 6 +- .../drivers/draw/eve/lv_draw_eve_display.c | 278 + .../drivers/draw/eve/lv_draw_eve_display.h | 151 + .../draw/eve/lv_draw_eve_display_defines.h | 1207 + .../lvgl/src/drivers/evdev/lv_evdev.c | 178 +- .../lvgl/src/drivers/evdev/lv_evdev.h | 10 +- .../lvgl/src/drivers/glfw/lv_glfw_window.c | 403 - .../lvgl/src/drivers/glfw/lv_glfw_window.h | 115 - .../src/drivers/glfw/lv_glfw_window_private.h | 70 - .../src/drivers/glfw/lv_opengles_driver.c | 499 - .../src/drivers/glfw/lv_opengles_texture.c | 177 - .../lvgl/src/drivers/libinput/lv_xkb.h | 4 +- .../lvgl/src/drivers/lv_drivers.h | 13 +- .../lvgl/src/drivers/nuttx/lv_nuttx_entry.c | 26 +- .../lvgl/src/drivers/nuttx/lv_nuttx_entry.h | 4 + .../src/drivers/nuttx/lv_nuttx_image_cache.c | 8 +- .../lvgl/src/drivers/nuttx/lv_nuttx_mouse.c | 200 + .../lvgl/src/drivers/nuttx/lv_nuttx_mouse.h | 57 + .../src/drivers/nuttx/lv_nuttx_profiler.c | 38 + .../src/drivers/nuttx/lv_nuttx_profiler.h | 2 + .../opengles/assets/lv_opengles_shader.c | 275 + .../opengles/assets/lv_opengles_shader.h | 39 + .../lvgl/src/drivers/opengles/glad/README.md | 5 + .../opengles/glad/include/EGL/eglplatform.h | 181 + .../opengles/glad/include/KHR/khrplatform.h | 317 + .../drivers/opengles/glad/include/glad/egl.h | 665 + .../opengles/glad/include/glad/gles2.h | 1111 + .../lvgl/src/drivers/opengles/glad/src/egl.c | 353 + .../src/drivers/opengles/glad/src/gles2.c | 558 + .../{glfw => opengles}/lv_opengles_debug.c | 4 + .../{glfw => opengles}/lv_opengles_debug.h | 26 +- .../src/drivers/opengles/lv_opengles_driver.c | 628 + .../{glfw => opengles}/lv_opengles_driver.h | 16 +- .../src/drivers/opengles/lv_opengles_egl.c | 558 + .../src/drivers/opengles/lv_opengles_egl.h | 56 + .../opengles/lv_opengles_egl_private.h | 102 + .../src/drivers/opengles/lv_opengles_glfw.c | 696 + .../src/drivers/opengles/lv_opengles_glfw.h | 88 + .../drivers/opengles/lv_opengles_private.h | 113 + .../drivers/opengles/lv_opengles_texture.c | 269 + .../{glfw => opengles}/lv_opengles_texture.h | 15 +- .../opengles/lv_opengles_texture_private.h | 57 + .../src/drivers/opengles/lv_opengles_window.h | 102 + .../opengl_shader/lv_opengl_shader_internal.h | 124 + .../opengl_shader/lv_opengl_shader_manager.c | 648 + .../opengl_shader/lv_opengl_shader_program.c | 124 + .../lvgl/src/drivers/sdl/lv_sdl_keyboard.c | 11 +- .../lvgl/src/drivers/sdl/lv_sdl_mousewheel.h | 2 +- .../lvgl/src/drivers/sdl/lv_sdl_window.c | 25 +- .../lvgl/src/drivers/sdl/lv_sdl_window.h | 6 + .../lvgl/src/drivers/uefi/lv_uefi_context.c | 2 +- .../lvgl/src/drivers/uefi/lv_uefi_context.h | 2 +- .../lvgl/src/drivers/uefi/lv_uefi_display.c | 2 +- .../src/drivers/uefi/lv_uefi_indev_keyboard.c | 6 +- .../src/drivers/uefi/lv_uefi_indev_pointer.c | 6 +- .../src/drivers/uefi/lv_uefi_indev_touch.c | 6 +- .../lvgl/src/drivers/uefi/lv_uefi_private.c | 2 +- .../lvgl/src/drivers/wayland/lv_wayland.c | 175 +- .../lvgl/src/drivers/wayland/lv_wayland.h | 2 +- .../src/drivers/wayland/lv_wayland_private.h | 114 +- .../lvgl/src/drivers/wayland/lv_wl_dmabuf.c | 443 +- .../lvgl/src/drivers/wayland/lv_wl_keyboard.c | 4 +- .../lvgl/src/drivers/wayland/lv_wl_pointer.c | 10 +- .../src/drivers/wayland/lv_wl_pointer_axis.c | 4 +- .../lvgl/src/drivers/wayland/lv_wl_seat.c | 2 - .../lvgl/src/drivers/wayland/lv_wl_shell.c | 184 - .../lvgl/src/drivers/wayland/lv_wl_shm.c | 35 +- .../lvgl/src/drivers/wayland/lv_wl_touch.c | 55 +- .../lvgl/src/drivers/wayland/lv_wl_touch.h | 2 +- .../lvgl/src/drivers/wayland/lv_wl_window.c | 108 +- .../lvgl/src/drivers/wayland/lv_wl_window.h | 16 +- .../wayland/lv_wl_window_decorations.c | 43 +- .../src/drivers/wayland/lv_wl_xdg_shell.c | 65 +- .../src/drivers/windows/lv_windows_context.c | 2 +- .../src/drivers/windows/lv_windows_display.c | 16 +- .../src/drivers/windows/lv_windows_display.h | 4 +- .../lvgl/src/font/lv_binfont_loader.c | 5 +- lib/libesp32_lvgl/lvgl/src/font/lv_font.c | 12 +- lib/libesp32_lvgl/lvgl/src/font/lv_font.h | 19 +- .../lvgl/src/font/lv_font_fmt_txt.c | 13 +- .../src/font/lv_font_montserrat_14_aligned.c | 2 +- .../lvgl/src/font/lv_font_simsun_14_cjk.c | 20789 ------------- .../lvgl/src/font/lv_font_simsun_16_cjk.c | 24154 ---------------- .../lvgl/src/font/lv_symbol_def.h | 2 +- lib/libesp32_lvgl/lvgl/src/indev/lv_indev.c | 129 +- lib/libesp32_lvgl/lvgl/src/indev/lv_indev.h | 11 +- .../lvgl/src/indev/lv_indev_gesture.c | 49 +- .../lvgl/src/indev/lv_indev_gesture.h | 7 +- .../lvgl/src/indev/lv_indev_gesture_private.h | 2 +- .../lvgl/src/indev/lv_indev_private.h | 5 + .../lvgl/src/indev/lv_indev_scroll.c | 30 +- .../lvgl/src/layouts/flex/lv_flex.c | 4 +- .../lvgl/src/layouts/grid/lv_grid.c | 58 +- .../lvgl/src/libs/FT800-FT813/EVE.h | 1257 + .../lvgl/src/libs/FT800-FT813/EVE_commands.c | 3926 +++ .../lvgl/src/libs/FT800-FT813/EVE_commands.h | 339 + .../lvgl/src/libs/FT800-FT813/EVE_config.h | 26 + .../src/libs/FT800-FT813/EVE_supplemental.c | 145 + .../src/libs/FT800-FT813/EVE_suppplemental.h | 53 + .../lvgl/src/libs/FT800-FT813/EVE_target.h | 111 + .../lvgl/src/libs/FT800-FT813/LICENSE | 20 + .../lvgl/src/libs/FT800-FT813/README.md | 245 + .../lvgl/src/libs/barcode/lv_barcode.c | 1 + .../src/libs/bin_decoder/lv_bin_decoder.c | 15 +- .../lvgl/src/libs/ffmpeg/lv_ffmpeg.c | 2 +- .../libs/freetype/LiberationSans-LICENSE.txt | 102 + .../libs/freetype/LiberationSans-Regular.ttf | Bin 0 -> 410820 bytes .../lvgl/src/libs/freetype/arial.ttf | Bin 311636 -> 0 bytes .../{LICENSE.txt => freetype-LICENSE.txt} | 0 .../lvgl/src/libs/freetype/lv_freetype.c | 4 + .../lvgl/src/libs/frogfs/LICENSE.txt | 362 + .../src/libs/frogfs/include/frogfs/frogfs.h | 260 + .../libs/frogfs/include/frogfs/frogfs_types.h | 6 + .../lvgl/src/libs/frogfs/src/decomp_raw.c | 77 + .../lvgl/src/libs/frogfs/src/frogfs.c | 449 + .../lvgl/src/libs/frogfs/src/frogfs_format.h | 90 + .../lvgl/src/libs/frogfs/src/frogfs_priv.h | 71 + .../lvgl/src/libs/fsdrv/lv_fs_frogfs.c | 341 + .../lvgl/src/libs/fsdrv/lv_fsdrv.h | 23 + .../lvgl/src/libs/gif/AnimatedGIF/LICENSE | 204 + .../libs/gif/AnimatedGIF/src/AnimatedGIF.h | 227 + .../lvgl/src/libs/gif/AnimatedGIF/src/gif.c | 1504 + .../lvgl/src/libs/gif/LICENSE.txt | 2 - lib/libesp32_lvgl/lvgl/src/libs/gif/gifdec.c | 823 - lib/libesp32_lvgl/lvgl/src/libs/gif/gifdec.h | 71 - .../lvgl/src/libs/gif/gifdec_mve.h | 140 - lib/libesp32_lvgl/lvgl/src/libs/gif/lv_gif.c | 213 +- lib/libesp32_lvgl/lvgl/src/libs/gif/lv_gif.h | 14 +- .../src/libs/gltf/fastgltf/lv_fastgltf.hpp | 124 + .../src/libs/gltf/gltf_data/lv_gltf_bind.cpp | 153 + .../src/libs/gltf/gltf_data/lv_gltf_bind.h | 106 + .../src/libs/gltf/gltf_data/lv_gltf_data.cpp | 271 + .../gltf_data/lv_gltf_data_animations.cpp | 244 + .../gltf/gltf_data/lv_gltf_data_cache.cpp | 103 + .../gltf/gltf_data/lv_gltf_data_injest.cpp | 843 + .../gltf/gltf_data/lv_gltf_data_internal.h | 252 + .../gltf/gltf_data/lv_gltf_data_internal.hpp | 373 + .../libs/gltf/gltf_data/lv_gltf_data_mesh.cpp | 52 + .../libs/gltf/gltf_data/lv_gltf_data_node.cpp | 103 + .../gltf/gltf_data/lv_gltf_data_primitive.cpp | 126 + .../gltf/gltf_data/lv_gltf_data_shader.cpp | 60 + .../libs/gltf/gltf_data/lv_gltf_data_skin.cpp | 68 + .../gltf/gltf_data/lv_gltf_data_texture.cpp | 87 + .../src/libs/gltf/gltf_data/lv_gltf_model.h | 135 + .../gltf_data/lv_gltf_uniform_locations.cpp | 115 + .../libs/gltf/gltf_view/assets/chromatic.c | 7545 +++++ .../gltf_view/assets/lv_gltf_view_shader.c | 3517 +++ .../gltf_view/assets/lv_gltf_view_shader.h | 39 + .../gltf/gltf_view/ibl/lv_gltf_ibl_sampler.c | 573 + .../gltf/gltf_view/ibl/lv_gltf_ibl_sampler.h | 96 + .../lvgl/src/libs/gltf/gltf_view/lv_gltf.h | 353 + .../src/libs/gltf/gltf_view/lv_gltf_view.cpp | 676 + .../gltf/gltf_view/lv_gltf_view_internal.h | 138 + .../gltf/gltf_view/lv_gltf_view_render.cpp | 1263 + .../gltf/gltf_view/lv_gltf_view_shader.cpp | 400 + .../lvgl/src/libs/gltf/math/lv_gltf_math.cpp | 78 + .../lvgl/src/libs/gltf/math/lv_gltf_math.hpp | 84 + .../lvgl/src/libs/gltf/stb_image/stb_image.h | 8366 ++++++ .../lvgl/src/libs/gstreamer/lv_gstreamer.c | 628 + .../lvgl/src/libs/gstreamer/lv_gstreamer.h | 188 + .../libs/gstreamer/lv_gstreamer_internal.h | 74 + .../src/libs/libjpeg_turbo/lv_libjpeg_turbo.c | 12 +- .../lvgl/src/libs/libpng/lv_libpng.c | 10 +- .../lvgl/src/libs/lodepng/lodepng.c | 11 +- .../lvgl/src/libs/qrcode/lv_qrcode.c | 59 +- .../lvgl/src/libs/qrcode/lv_qrcode.h | 15 + .../lvgl/src/libs/qrcode/lv_qrcode_private.h | 1 + lib/libesp32_lvgl/lvgl/src/libs/svg/lv_svg.h | 37 +- .../lvgl/src/libs/svg/lv_svg_decoder.c | 20 +- .../lvgl/src/libs/svg/lv_svg_parser.c | 57 +- .../lvgl/src/libs/svg/lv_svg_render.c | 344 +- .../lvgl/src/libs/svg/lv_svg_render.h | 10 +- .../lvgl/src/libs/thorvg/tvgInitializer.cpp | 2 +- .../lvgl/src/libs/thorvg/tvgLottieBuilder.cpp | 4 +- .../src/libs/thorvg/tvgLottieModifier.cpp | 2 +- .../lvgl/src/libs/thorvg/tvgRender.h | 2 +- .../lvgl/src/libs/thorvg/tvgSvgLoader.cpp | 2 +- .../src/libs/thorvg/tvgSvgSceneBuilder.cpp | 2 +- .../lvgl/src/libs/thorvg/tvgSwRenderer.cpp | 2 +- .../lvgl/src/libs/thorvg/tvgTaskScheduler.h | 4 + .../lvgl/src/libs/thorvg/tvgXmlParser.cpp | 2 +- .../lvgl/src/libs/tiny_ttf/lv_tiny_ttf.c | 142 +- .../lvgl/src/libs/tjpgd/lv_tjpgd.c | 28 +- .../lvgl/src/libs/vg_lite_driver/LICENSE.txt | 26 + .../Series/gc255/0x40A/vg_lite_options.h | 113 + .../Series/gc355/0x0_1215/vg_lite_options.h | 117 + .../Series/gc355/0x0_1216/vg_lite_options.h | 117 + .../Series/gc555/0x423/vg_lite_options.h | 115 + .../Series/gc555/0x423_ECO/vg_lite_options.h | 115 + .../src/libs/vg_lite_driver/VGLite/vg_lite.c | 7404 +++++ .../vg_lite_driver/VGLite/vg_lite_context.h | 313 + .../vg_lite_driver/VGLite/vg_lite_image.c | 2385 ++ .../vg_lite_driver/VGLite/vg_lite_matrix.c | 167 + .../vg_lite_driver/VGLite/vg_lite_options.h | 40 + .../libs/vg_lite_driver/VGLite/vg_lite_path.c | 5495 ++++ .../vg_lite_driver/VGLite/vg_lite_stroke.c | 5421 ++++ .../VGLiteKernel/vg_lite_debug.h | 77 + .../vg_lite_driver/VGLiteKernel/vg_lite_hal.h | 332 + .../vg_lite_driver/VGLiteKernel/vg_lite_hw.h | 98 + .../VGLiteKernel/vg_lite_kernel.c | 1387 + .../VGLiteKernel/vg_lite_kernel.h | 592 + .../VGLiteKernel/vg_lite_option.h | 143 + .../VGLiteKernel/vg_lite_type.h | 80 + .../src/libs/vg_lite_driver/add_lvgl_if.sh | 13 + .../src/libs/vg_lite_driver/inc/vg_lite.h | 1458 + .../lv_vg_lite_hal/lv_vg_lite_hal.c | 606 + .../lv_vg_lite_hal/vg_lite_os.c | 16 + .../lv_vg_lite_hal/vg_lite_platform.h | 52 + lib/libesp32_lvgl/lvgl/src/lv_api_map_v9_2.h | 57 + lib/libesp32_lvgl/lvgl/src/lv_api_map_v9_3.h | 97 + lib/libesp32_lvgl/lvgl/src/lv_conf_internal.h | 658 +- lib/libesp32_lvgl/lvgl/src/lv_conf_kconfig.h | 2 +- lib/libesp32_lvgl/lvgl/src/lv_init.c | 68 +- .../src/misc/cache/class/lv_cache_class.h | 1 + .../src/misc/cache/class/lv_cache_sc_da.c | 515 + .../src/misc/cache/class/lv_cache_sc_da.h | 44 + .../lvgl/src/misc/cache/lv_cache.c | 3 +- .../lvgl/src/misc/cache/lv_cache_entry.c | 40 +- .../src/misc/cache/lv_cache_entry_private.h | 18 +- .../lvgl/src/misc/cache/lv_cache_private.h | 2 +- lib/libesp32_lvgl/lvgl/src/misc/lv_anim.c | 57 +- .../lvgl/src/misc/lv_anim_private.h | 7 + .../lvgl/src/misc/lv_anim_timeline.c | 88 +- .../lvgl/src/misc/lv_anim_timeline.h | 57 +- .../lvgl/src/misc/lv_anim_timeline_private.h | 67 + lib/libesp32_lvgl/lvgl/src/misc/lv_color.h | 29 +- lib/libesp32_lvgl/lvgl/src/misc/lv_color_op.c | 2 +- lib/libesp32_lvgl/lvgl/src/misc/lv_color_op.h | 2 +- lib/libesp32_lvgl/lvgl/src/misc/lv_event.c | 38 + lib/libesp32_lvgl/lvgl/src/misc/lv_event.h | 20 +- .../lvgl/src/misc/lv_event_private.h | 5 + lib/libesp32_lvgl/lvgl/src/misc/lv_fs.c | 155 +- lib/libesp32_lvgl/lvgl/src/misc/lv_fs.h | 73 +- .../lvgl/src/misc/lv_fs_private.h | 7 - lib/libesp32_lvgl/lvgl/src/misc/lv_grad.c | 5 - lib/libesp32_lvgl/lvgl/src/misc/lv_grad.h | 6 - lib/libesp32_lvgl/lvgl/src/misc/lv_lru.c | 2 +- lib/libesp32_lvgl/lvgl/src/misc/lv_math.c | 2 + lib/libesp32_lvgl/lvgl/src/misc/lv_matrix.c | 19 +- .../lvgl/src/misc/lv_profiler_builtin.c | 8 +- .../lvgl/src/misc/lv_profiler_builtin_posix.c | 134 + .../src/misc/lv_profiler_builtin_private.h | 9 + lib/libesp32_lvgl/lvgl/src/misc/lv_style.c | 38 +- lib/libesp32_lvgl/lvgl/src/misc/lv_style.h | 26 +- .../lvgl/src/misc/lv_style_gen.c | 8 + .../lvgl/src/misc/lv_style_gen.h | 6 + lib/libesp32_lvgl/lvgl/src/misc/lv_text.c | 113 +- lib/libesp32_lvgl/lvgl/src/misc/lv_text.h | 73 +- .../lvgl/src/misc/lv_text_private.h | 74 +- lib/libesp32_lvgl/lvgl/src/misc/lv_timer.h | 1 + .../lvgl/src/misc/lv_timer_private.h | 4 +- lib/libesp32_lvgl/lvgl/src/misc/lv_tree.h | 28 +- lib/libesp32_lvgl/lvgl/src/misc/lv_types.h | 61 +- .../lvgl/src/osal/lv_cmsis_rtos2.c | 6 +- .../lvgl/src/osal/lv_cmsis_rtos2.h | 2 +- lib/libesp32_lvgl/lvgl/src/osal/lv_freertos.c | 7 +- lib/libesp32_lvgl/lvgl/src/osal/lv_freertos.h | 2 +- lib/libesp32_lvgl/lvgl/src/osal/lv_linux.c | 116 +- .../osal/{lv_linux_private.h => lv_linux.h} | 18 +- lib/libesp32_lvgl/lvgl/src/osal/lv_mqx.c | 7 +- lib/libesp32_lvgl/lvgl/src/osal/lv_mqx.h | 2 +- lib/libesp32_lvgl/lvgl/src/osal/lv_os.c | 21 +- lib/libesp32_lvgl/lvgl/src/osal/lv_os.h | 238 +- lib/libesp32_lvgl/lvgl/src/osal/lv_os_none.c | 4 +- .../lvgl/src/osal/lv_os_private.h | 232 + lib/libesp32_lvgl/lvgl/src/osal/lv_pthread.c | 7 +- lib/libesp32_lvgl/lvgl/src/osal/lv_pthread.h | 1 + lib/libesp32_lvgl/lvgl/src/osal/lv_rtthread.c | 7 +- lib/libesp32_lvgl/lvgl/src/osal/lv_sdl2.c | 7 +- lib/libesp32_lvgl/lvgl/src/osal/lv_windows.c | 7 +- .../others/file_explorer/lv_file_explorer.c | 77 +- .../src/others/font_manager/lv_font_manager.c | 38 +- .../src/others/font_manager/lv_font_manager.h | 2 +- .../font_manager/lv_font_manager_recycle.c | 16 + .../font_manager/lv_font_manager_recycle.h | 7 + .../lvgl/src/others/gridnav/lv_gridnav.c | 8 +- .../lvgl/src/others/ime/lv_ime_pinyin.h | 2 +- .../lvgl/src/others/monkey/lv_monkey.h | 20 +- .../lvgl/src/others/observer/lv_observer.c | 643 +- .../lvgl/src/others/observer/lv_observer.h | 223 +- .../src/others/observer/lv_observer_private.h | 10 + .../lvgl/src/others/snapshot/lv_snapshot.c | 50 +- .../lvgl/src/others/sysmon/lv_sysmon.c | 83 +- .../lvgl/src/others/sysmon/lv_sysmon.h | 22 + .../src/others/sysmon/lv_sysmon_private.h | 3 + .../lvgl/src/others/test/lv_test_indev.c | 18 + .../lvgl/src/others/test/lv_test_indev.h | 5 + .../src/others/test/lv_test_indev_gesture.c | 24 + .../src/others/test/lv_test_indev_gesture.h | 5 + .../others/test/lv_test_screenshot_compare.c | 14 +- .../others/test/lv_test_screenshot_compare.h | 2 + .../src/others/translation/lv_translation.c | 298 + .../src/others/translation/lv_translation.h | 147 + .../translation/lv_translation_private.h | 59 + .../src/others/vg_lite_tvg/vg_lite_tvg.cpp | 124 +- .../lvgl/src/others/xml/lv_xml.c | 483 +- .../lvgl/src/others/xml/lv_xml.h | 52 +- .../lvgl/src/others/xml/lv_xml_base_types.c | 298 +- .../lvgl/src/others/xml/lv_xml_base_types.h | 59 + .../lvgl/src/others/xml/lv_xml_component.c | 348 +- .../lvgl/src/others/xml/lv_xml_component.h | 30 +- .../src/others/xml/lv_xml_component_private.h | 9 +- .../lvgl/src/others/xml/lv_xml_load.c | 361 + .../lvgl/src/others/xml/lv_xml_load.h | 77 + .../xml/lv_xml_load_private.h} | 33 +- .../lvgl/src/others/xml/lv_xml_parser.c | 14 +- .../lvgl/src/others/xml/lv_xml_parser.h | 5 + .../lvgl/src/others/xml/lv_xml_private.h | 18 +- .../lvgl/src/others/xml/lv_xml_style.c | 255 +- .../lvgl/src/others/xml/lv_xml_style.h | 26 +- .../lvgl/src/others/xml/lv_xml_test.c | 613 + .../lvgl/src/others/xml/lv_xml_test.h | 121 + .../lvgl/src/others/xml/lv_xml_translation.c | 180 + .../lvgl/src/others/xml/lv_xml_translation.h | 53 + .../lvgl/src/others/xml/lv_xml_update.h | 8 +- .../lvgl/src/others/xml/lv_xml_utils.c | 80 +- .../lvgl/src/others/xml/lv_xml_utils.h | 14 +- .../lvgl/src/others/xml/lv_xml_widget.c | 18 +- .../lvgl/src/others/xml/lv_xml_widget.h | 28 +- .../others/xml/parsers/lv_xml_arc_parser.c | 42 +- .../others/xml/parsers/lv_xml_arc_parser.h | 8 +- .../others/xml/parsers/lv_xml_bar_parser.c | 49 +- .../others/xml/parsers/lv_xml_bar_parser.h | 8 +- .../others/xml/parsers/lv_xml_button_parser.c | 2 +- .../others/xml/parsers/lv_xml_button_parser.h | 8 +- .../xml/parsers/lv_xml_buttonmatrix_parser.c | 2 +- .../xml/parsers/lv_xml_buttonmatrix_parser.h | 4 +- .../xml/parsers/lv_xml_calendar_parser.c | 24 +- .../xml/parsers/lv_xml_calendar_parser.h | 6 +- .../others/xml/parsers/lv_xml_canvas_parser.h | 6 +- .../others/xml/parsers/lv_xml_chart_parser.c | 20 +- .../others/xml/parsers/lv_xml_chart_parser.h | 8 +- .../xml/parsers/lv_xml_checkbox_parser.h | 6 +- .../xml/parsers/lv_xml_dropdown_parser.c | 2 +- .../xml/parsers/lv_xml_dropdown_parser.h | 8 +- .../others/xml/parsers/lv_xml_event_parser.c | 170 - .../others/xml/parsers/lv_xml_image_parser.c | 24 +- .../others/xml/parsers/lv_xml_image_parser.h | 4 +- .../xml/parsers/lv_xml_keyboard_parser.c | 3 +- .../xml/parsers/lv_xml_keyboard_parser.h | 2 +- .../others/xml/parsers/lv_xml_label_parser.c | 47 +- .../others/xml/parsers/lv_xml_label_parser.h | 8 +- .../others/xml/parsers/lv_xml_obj_parser.c | 856 +- .../others/xml/parsers/lv_xml_obj_parser.h | 45 +- .../others/xml/parsers/lv_xml_qrcode_parser.c | 68 + .../others/xml/parsers/lv_xml_qrcode_parser.h | 40 + .../others/xml/parsers/lv_xml_roller_parser.c | 36 +- .../others/xml/parsers/lv_xml_roller_parser.h | 8 +- .../others/xml/parsers/lv_xml_scale_parser.c | 38 +- .../others/xml/parsers/lv_xml_scale_parser.h | 8 +- .../others/xml/parsers/lv_xml_slider_parser.c | 48 +- .../others/xml/parsers/lv_xml_slider_parser.h | 8 +- .../xml/parsers/lv_xml_spangroup_parser.c | 15 +- .../xml/parsers/lv_xml_spangroup_parser.h | 8 +- .../xml/parsers/lv_xml_spinbox_parser.c | 79 + .../xml/parsers/lv_xml_spinbox_parser.h | 40 + .../others/xml/parsers/lv_xml_switch_parser.c | 76 + ..._event_parser.h => lv_xml_switch_parser.h} | 12 +- .../others/xml/parsers/lv_xml_table_parser.c | 12 +- .../others/xml/parsers/lv_xml_table_parser.h | 8 +- .../xml/parsers/lv_xml_tabview_parser.c | 30 +- .../xml/parsers/lv_xml_tabview_parser.h | 10 +- .../xml/parsers/lv_xml_textarea_parser.c | 4 +- .../xml/parsers/lv_xml_textarea_parser.h | 2 +- .../src/stdlib/builtin/lv_mem_core_builtin.c | 6 +- .../src/stdlib/builtin/lv_string_builtin.c | 2 +- .../lvgl/src/stdlib/builtin/lv_tlsf_private.h | 2 +- .../lvgl/src/stdlib/clib/lv_mem_core_clib.c | 2 +- .../lvgl/src/stdlib/clib/lv_sprintf_clib.c | 2 +- .../lvgl/src/stdlib/clib/lv_string_clib.c | 2 +- .../micropython/lv_mem_core_micropython.c | 2 +- .../stdlib/rtthread/lv_mem_core_rtthread.c | 2 +- .../lvgl/src/stdlib/uefi/lv_mem_core_uefi.c | 2 +- .../src/themes/default/lv_theme_default.c | 75 +- .../src/themes/default/lv_theme_default.h | 12 +- .../lvgl/src/themes/mono/lv_theme_mono.c | 86 +- .../lvgl/src/themes/simple/lv_theme_simple.c | 68 +- .../lvgl/src/themes/simple/lv_theme_simple.h | 2 +- lib/libesp32_lvgl/lvgl/src/tick/lv_tick.c | 22 +- lib/libesp32_lvgl/lvgl/src/tick/lv_tick.h | 23 +- .../lvgl/src/tick/lv_tick_private.h | 2 +- .../lvgl/src/widgets/3dtexture/lv_3dtexture.c | 20 +- .../lvgl/src/widgets/3dtexture/lv_3dtexture.h | 8 + .../widgets/3dtexture/lv_3dtexture_private.h | 2 + .../lvgl/src/widgets/animimage/lv_animimage.c | 4 +- .../lvgl/src/widgets/animimage/lv_animimage.h | 2 +- .../lvgl/src/widgets/arc/lv_arc.c | 66 + .../lvgl/src/widgets/arc/lv_arc.h | 38 +- .../lvgl/src/widgets/arclabel/lv_arclabel.c | 644 + .../lvgl/src/widgets/arclabel/lv_arclabel.h | 255 + .../widgets/arclabel/lv_arclabel_private.h | 77 + .../lvgl/src/widgets/bar/lv_bar.c | 47 + .../lvgl/src/widgets/bar/lv_bar.h | 25 + .../lvgl/src/widgets/button/lv_button.c | 2 +- .../widgets/buttonmatrix/lv_buttonmatrix.c | 13 +- .../lvgl/src/widgets/calendar/lv_calendar.c | 62 +- .../lvgl/src/widgets/calendar/lv_calendar.h | 47 +- .../calendar/lv_calendar_header_dropdown.c | 5 +- .../lvgl/src/widgets/canvas/lv_canvas.c | 6 + .../lvgl/src/widgets/chart/lv_chart.c | 382 +- .../lvgl/src/widgets/chart/lv_chart.h | 43 +- .../lvgl/src/widgets/chart/lv_chart_private.h | 2 +- .../lvgl/src/widgets/checkbox/lv_checkbox.c | 23 +- .../lvgl/src/widgets/dropdown/lv_dropdown.c | 95 +- .../lvgl/src/widgets/dropdown/lv_dropdown.h | 13 +- .../lvgl/src/widgets/image/lv_image.c | 135 +- .../lvgl/src/widgets/image/lv_image.h | 44 +- .../lvgl/src/widgets/keyboard/lv_keyboard.c | 9 + .../lvgl/src/widgets/keyboard/lv_keyboard.h | 90 +- .../lvgl/src/widgets/label/lv_label.c | 362 +- .../lvgl/src/widgets/label/lv_label.h | 57 +- .../lvgl/src/widgets/label/lv_label_private.h | 3 + .../lvgl/src/widgets/menu/lv_menu.c | 8 +- .../lvgl/src/widgets/menu/lv_menu.h | 2 +- .../lvgl/src/widgets/menu/lv_menu_private.h | 2 +- .../lvgl/src/widgets/msgbox/lv_msgbox.c | 22 +- .../lvgl/src/widgets/msgbox/lv_msgbox.h | 9 - .../src/widgets/objx_templ/lv_objx_templ.c | 2 +- .../src/widgets/objx_templ/lv_objx_templ.h | 8 +- .../src/widgets/property/lv_obj_properties.c | 4 +- .../widgets/property/lv_obj_property_names.h | 4 +- .../widgets/property/lv_style_properties.c | 3 +- .../widgets/property/lv_style_properties.h | 3 +- .../lvgl/src/widgets/roller/lv_roller.c | 125 +- .../lvgl/src/widgets/roller/lv_roller.h | 22 +- .../lvgl/src/widgets/scale/lv_scale.c | 119 +- .../lvgl/src/widgets/scale/lv_scale.h | 65 +- .../lvgl/src/widgets/slider/lv_slider.c | 68 + .../lvgl/src/widgets/slider/lv_slider.h | 29 +- .../lvgl/src/widgets/span/lv_span.c | 181 +- .../lvgl/src/widgets/span/lv_span.h | 41 + .../lvgl/src/widgets/spinbox/lv_spinbox.c | 105 +- .../lvgl/src/widgets/spinbox/lv_spinbox.h | 46 +- .../lvgl/src/widgets/switch/lv_switch.c | 2 +- .../lvgl/src/widgets/table/lv_table.c | 56 +- .../lvgl/src/widgets/tabview/lv_tabview.c | 24 +- .../lvgl/src/widgets/tabview/lv_tabview.h | 9 + .../lvgl/src/widgets/textarea/lv_textarea.c | 94 +- .../lvgl/src/widgets/textarea/lv_textarea.h | 10 +- tasmota/lvgl_berry/tasmota_lv_conf.h | 253 +- 652 files changed, 101666 insertions(+), 60673 deletions(-) create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/convert/helium/lv_draw_buf_convert_helium.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/convert/helium/lv_draw_buf_convert_helium.h create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/convert/lv_draw_buf_convert.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/convert/lv_draw_buf_convert.h create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/convert/neon/lv_draw_buf_convert_neon.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/convert/neon/lv_draw_buf_convert_neon.h create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/espressif/ppa/lv_draw_ppa.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/espressif/ppa/lv_draw_ppa.h create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/espressif/ppa/lv_draw_ppa_buf.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/espressif/ppa/lv_draw_ppa_fill.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/espressif/ppa/lv_draw_ppa_img.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/espressif/ppa/lv_draw_ppa_private.h create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve.h create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve_arc.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve_fill.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve_image.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve_letter.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve_line.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve_private.h create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve_ram_g.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve_ram_g.h create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve_target.h create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_draw_eve_triangle.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_eve.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/eve/lv_eve.h create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nema_gfx/lv_draw_nema_gfx_vector.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_draw_buf_vglite.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_draw_vglite.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_draw_vglite.h delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_draw_vglite_arc.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_draw_vglite_border.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_draw_vglite_fill.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_draw_vglite_img.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_draw_vglite_label.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_draw_vglite_layer.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_draw_vglite_line.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_draw_vglite_triangle.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_vglite_buf.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_vglite_buf.h delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_vglite_matrix.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_vglite_matrix.h delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_vglite_path.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_vglite_path.h delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_vglite_utils.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/nxp/vglite/lv_vglite_utils.h delete mode 100644 lib/libesp32_lvgl/lvgl/src/draw/sw/blend/neon/lv_blend_neon.S create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/sw/blend/neon/lv_draw_sw_blend_neon_to_rgb565.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/sw/blend/neon/lv_draw_sw_blend_neon_to_rgb565.h create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/sw/blend/neon/lv_draw_sw_blend_neon_to_rgb888.c create mode 100644 lib/libesp32_lvgl/lvgl/src/draw/sw/blend/neon/lv_draw_sw_blend_neon_to_rgb888.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/display/drm/lv_linux_drm_common.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/display/drm/lv_linux_drm_egl.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/display/drm/lv_linux_drm_egl_private.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/display/lovyan_gfx/lv_lgfx_user.hpp create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/display/lovyan_gfx/lv_lovyan_gfx.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/display/lovyan_gfx/lv_lovyan_gfx.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/display/nv3007/lv_nv3007.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/display/nv3007/lv_nv3007.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/display/nxp_elcdif/lv_nxp_elcdif.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/display/nxp_elcdif/lv_nxp_elcdif.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/draw/eve/lv_draw_eve_display.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/draw/eve/lv_draw_eve_display.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/draw/eve/lv_draw_eve_display_defines.h delete mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/glfw/lv_glfw_window.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/glfw/lv_glfw_window.h delete mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/glfw/lv_glfw_window_private.h delete mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/glfw/lv_opengles_driver.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/glfw/lv_opengles_texture.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/nuttx/lv_nuttx_mouse.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/nuttx/lv_nuttx_mouse.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/assets/lv_opengles_shader.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/assets/lv_opengles_shader.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/glad/README.md create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/glad/include/EGL/eglplatform.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/glad/include/KHR/khrplatform.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/glad/include/glad/egl.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/glad/include/glad/gles2.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/glad/src/egl.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/glad/src/gles2.c rename lib/libesp32_lvgl/lvgl/src/drivers/{glfw => opengles}/lv_opengles_debug.c (93%) rename lib/libesp32_lvgl/lvgl/src/drivers/{glfw => opengles}/lv_opengles_debug.h (61%) create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/lv_opengles_driver.c rename lib/libesp32_lvgl/lvgl/src/drivers/{glfw => opengles}/lv_opengles_driver.h (77%) create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/lv_opengles_egl.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/lv_opengles_egl.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/lv_opengles_egl_private.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/lv_opengles_glfw.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/lv_opengles_glfw.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/lv_opengles_private.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/lv_opengles_texture.c rename lib/libesp32_lvgl/lvgl/src/drivers/{glfw => opengles}/lv_opengles_texture.h (67%) create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/lv_opengles_texture_private.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/lv_opengles_window.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/opengl_shader/lv_opengl_shader_internal.h create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/opengl_shader/lv_opengl_shader_manager.c create mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/opengles/opengl_shader/lv_opengl_shader_program.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/drivers/wayland/lv_wl_shell.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/font/lv_font_simsun_14_cjk.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/font/lv_font_simsun_16_cjk.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/FT800-FT813/EVE.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/FT800-FT813/EVE_commands.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/FT800-FT813/EVE_commands.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/FT800-FT813/EVE_config.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/FT800-FT813/EVE_supplemental.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/FT800-FT813/EVE_suppplemental.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/FT800-FT813/EVE_target.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/FT800-FT813/LICENSE create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/FT800-FT813/README.md create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/freetype/LiberationSans-LICENSE.txt create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/freetype/LiberationSans-Regular.ttf delete mode 100644 lib/libesp32_lvgl/lvgl/src/libs/freetype/arial.ttf rename lib/libesp32_lvgl/lvgl/src/libs/freetype/{LICENSE.txt => freetype-LICENSE.txt} (100%) create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/frogfs/LICENSE.txt create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/frogfs/include/frogfs/frogfs.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/frogfs/include/frogfs/frogfs_types.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/frogfs/src/decomp_raw.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/frogfs/src/frogfs.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/frogfs/src/frogfs_format.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/frogfs/src/frogfs_priv.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/fsdrv/lv_fs_frogfs.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gif/AnimatedGIF/LICENSE create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gif/AnimatedGIF/src/AnimatedGIF.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gif/AnimatedGIF/src/gif.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gif/LICENSE.txt delete mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gif/gifdec.c delete mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gif/gifdec.h delete mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gif/gifdec_mve.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/fastgltf/lv_fastgltf.hpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_bind.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_bind.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data_animations.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data_cache.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data_injest.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data_internal.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data_internal.hpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data_mesh.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data_node.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data_primitive.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data_shader.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data_skin.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_data_texture.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_model.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_data/lv_gltf_uniform_locations.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_view/assets/chromatic.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_view/assets/lv_gltf_view_shader.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_view/assets/lv_gltf_view_shader.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_view/ibl/lv_gltf_ibl_sampler.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_view/ibl/lv_gltf_ibl_sampler.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_view/lv_gltf.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_view/lv_gltf_view.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_view/lv_gltf_view_internal.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_view/lv_gltf_view_render.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/gltf_view/lv_gltf_view_shader.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/math/lv_gltf_math.cpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/math/lv_gltf_math.hpp create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gltf/stb_image/stb_image.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gstreamer/lv_gstreamer.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gstreamer/lv_gstreamer.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/gstreamer/lv_gstreamer_internal.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/LICENSE.txt create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/Series/gc255/0x40A/vg_lite_options.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/Series/gc355/0x0_1215/vg_lite_options.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/Series/gc355/0x0_1216/vg_lite_options.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/Series/gc555/0x423/vg_lite_options.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/Series/gc555/0x423_ECO/vg_lite_options.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/vg_lite.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/vg_lite_context.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/vg_lite_image.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/vg_lite_matrix.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/vg_lite_options.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/vg_lite_path.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLite/vg_lite_stroke.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLiteKernel/vg_lite_debug.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLiteKernel/vg_lite_hal.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLiteKernel/vg_lite_hw.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLiteKernel/vg_lite_kernel.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLiteKernel/vg_lite_kernel.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLiteKernel/vg_lite_option.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/VGLiteKernel/vg_lite_type.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/add_lvgl_if.sh create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/inc/vg_lite.h create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/lv_vg_lite_hal/lv_vg_lite_hal.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/lv_vg_lite_hal/vg_lite_os.c create mode 100644 lib/libesp32_lvgl/lvgl/src/libs/vg_lite_driver/lv_vg_lite_hal/vg_lite_platform.h create mode 100644 lib/libesp32_lvgl/lvgl/src/lv_api_map_v9_2.h create mode 100644 lib/libesp32_lvgl/lvgl/src/lv_api_map_v9_3.h create mode 100644 lib/libesp32_lvgl/lvgl/src/misc/cache/class/lv_cache_sc_da.c create mode 100644 lib/libesp32_lvgl/lvgl/src/misc/cache/class/lv_cache_sc_da.h create mode 100644 lib/libesp32_lvgl/lvgl/src/misc/lv_anim_timeline_private.h create mode 100644 lib/libesp32_lvgl/lvgl/src/misc/lv_profiler_builtin_posix.c rename lib/libesp32_lvgl/lvgl/src/osal/{lv_linux_private.h => lv_linux.h} (84%) create mode 100644 lib/libesp32_lvgl/lvgl/src/others/translation/lv_translation.c create mode 100644 lib/libesp32_lvgl/lvgl/src/others/translation/lv_translation.h create mode 100644 lib/libesp32_lvgl/lvgl/src/others/translation/lv_translation_private.h create mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/lv_xml_load.c create mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/lv_xml_load.h rename lib/libesp32_lvgl/lvgl/src/{libs/gif/lv_gif_private.h => others/xml/lv_xml_load_private.h} (51%) create mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/lv_xml_test.c create mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/lv_xml_test.h create mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/lv_xml_translation.c create mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/lv_xml_translation.h delete mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/parsers/lv_xml_event_parser.c create mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/parsers/lv_xml_qrcode_parser.c create mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/parsers/lv_xml_qrcode_parser.h create mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/parsers/lv_xml_spinbox_parser.c create mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/parsers/lv_xml_spinbox_parser.h create mode 100644 lib/libesp32_lvgl/lvgl/src/others/xml/parsers/lv_xml_switch_parser.c rename lib/libesp32_lvgl/lvgl/src/others/xml/parsers/{lv_xml_event_parser.h => lv_xml_switch_parser.h} (58%) create mode 100644 lib/libesp32_lvgl/lvgl/src/widgets/arclabel/lv_arclabel.c create mode 100644 lib/libesp32_lvgl/lvgl/src/widgets/arclabel/lv_arclabel.h create mode 100644 lib/libesp32_lvgl/lvgl/src/widgets/arclabel/lv_arclabel_private.h diff --git a/CHANGELOG.md b/CHANGELOG.md index a6b7d6e71..d8921aa78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file. ### Changed - Refactored library UDisplay (#24007) +- LVGL library from v9.3.0 to v9.4.0 ### Fixed - TLS fix ECDSA and add `SetOption165 1` to enable ECDSA in addition to RSA (#24000) diff --git a/lib/libesp32_lvgl/lv_binding_berry/generate/LVGL_API_Reference.md b/lib/libesp32_lvgl/lv_binding_berry/generate/LVGL_API_Reference.md index 0e3c31e0f..739c968b8 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/generate/LVGL_API_Reference.md +++ b/lib/libesp32_lvgl/lv_binding_berry/generate/LVGL_API_Reference.md @@ -19,6 +19,29 @@ anim_resolve_speed|int, int, int|int|[lv_anim_resolve_speed](https://docs.lvgl.i anim_speed|int|int|[lv_anim_speed](https://docs.lvgl.io/9.0/search.html?q=lv_anim_speed) anim_speed_clamped|int, int, int|int|[lv_anim_speed_clamped](https://docs.lvgl.io/9.0/search.html?q=lv_anim_speed_clamped) anim_speed_to_time|int, int, int|int|[lv_anim_speed_to_time](https://docs.lvgl.io/9.0/search.html?q=lv_anim_speed_to_time) +arclabel_create|lv.obj|lv.obj|[lv_arclabel_create](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_create) +arclabel_get_angle_size|lv.obj|int|[lv_arclabel_get_angle_size](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_get_angle_size) +arclabel_get_angle_start|lv.obj|int|[lv_arclabel_get_angle_start](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_get_angle_start) +arclabel_get_center_offset_x|lv.obj|int|[lv_arclabel_get_center_offset_x](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_get_center_offset_x) +arclabel_get_center_offset_y|lv.obj|int|[lv_arclabel_get_center_offset_y](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_get_center_offset_y) +arclabel_get_dir|lv.obj|int|[lv_arclabel_get_dir](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_get_dir) +arclabel_get_radius|lv.obj|int|[lv_arclabel_get_radius](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_get_radius) +arclabel_get_recolor|lv.obj|bool|[lv_arclabel_get_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_get_recolor) +arclabel_get_text_horizontal_align|lv.obj|int|[lv_arclabel_get_text_horizontal_align](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_get_text_horizontal_align) +arclabel_get_text_vertical_align|lv.obj|int|[lv_arclabel_get_text_vertical_align](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_get_text_vertical_align) +arclabel_set_angle_size|lv.obj, int||[lv_arclabel_set_angle_size](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_angle_size) +arclabel_set_angle_start|lv.obj, int||[lv_arclabel_set_angle_start](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_angle_start) +arclabel_set_center_offset_x|lv.obj, int||[lv_arclabel_set_center_offset_x](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_center_offset_x) +arclabel_set_center_offset_y|lv.obj, int||[lv_arclabel_set_center_offset_y](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_center_offset_y) +arclabel_set_dir|lv.obj, int||[lv_arclabel_set_dir](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_dir) +arclabel_set_offset|lv.obj, int||[lv_arclabel_set_offset](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_offset) +arclabel_set_radius|lv.obj, int||[lv_arclabel_set_radius](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_radius) +arclabel_set_recolor|lv.obj, bool||[lv_arclabel_set_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_recolor) +arclabel_set_text|lv.obj, string||[lv_arclabel_set_text](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_text) +arclabel_set_text_fmt|lv.obj, string, [\]||[lv_arclabel_set_text_fmt](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_text_fmt) +arclabel_set_text_horizontal_align|lv.obj, int||[lv_arclabel_set_text_horizontal_align](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_text_horizontal_align) +arclabel_set_text_static|lv.obj, string||[lv_arclabel_set_text_static](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_text_static) +arclabel_set_text_vertical_align|lv.obj, int||[lv_arclabel_set_text_vertical_align](https://docs.lvgl.io/9.0/search.html?q=lv_arclabel_set_text_vertical_align) area_align|lv.area, lv.area, int, int, int||[lv_area_align](https://docs.lvgl.io/9.0/search.html?q=lv_area_align) area_copy|lv.area, lv.area||[lv_area_copy](https://docs.lvgl.io/9.0/search.html?q=lv_area_copy) area_get_height|lv.area|int|[lv_area_get_height](https://docs.lvgl.io/9.0/search.html?q=lv_area_get_height) @@ -46,6 +69,7 @@ color_format_has_alpha|int|bool|[lv_color_format_has_alpha](https://docs.lvgl.io color_hex|int|lv.color|[lv_color_hex](https://docs.lvgl.io/9.0/search.html?q=lv_color_hex) color_hex3|int|lv.color|[lv_color_hex3](https://docs.lvgl.io/9.0/search.html?q=lv_color_hex3) color_hsv_to_rgb|int, int, int|lv.color|[lv_color_hsv_to_rgb](https://docs.lvgl.io/9.0/search.html?q=lv_color_hsv_to_rgb) +color_is_in_range|lv.color, lv.color, lv.color|bool|[lv_color_is_in_range](https://docs.lvgl.io/9.0/search.html?q=lv_color_is_in_range) color_lighten|lv.color, int|lv.color|[lv_color_lighten](https://docs.lvgl.io/9.0/search.html?q=lv_color_lighten) color_luminance|lv.color|int|[lv_color_luminance](https://docs.lvgl.io/9.0/search.html?q=lv_color_luminance) color_make|int, int, int|lv.color|[lv_color_make](https://docs.lvgl.io/9.0/search.html?q=lv_color_make) @@ -89,6 +113,7 @@ draw_line|lv.layer, lv.draw_line_dsc||[lv_draw_line](https://docs.lvgl.io/9.0/se draw_line_dsc_init|lv.draw_line_dsc||[lv_draw_line_dsc_init](https://docs.lvgl.io/9.0/search.html?q=lv_draw_line_dsc_init) draw_rect|lv.layer, lv.draw_rect_dsc, lv.area||[lv_draw_rect](https://docs.lvgl.io/9.0/search.html?q=lv_draw_rect) draw_rect_dsc_init|lv.draw_rect_dsc||[lv_draw_rect_dsc_init](https://docs.lvgl.io/9.0/search.html?q=lv_draw_rect_dsc_init) +draw_unit_send_event|string, int, \||[lv_draw_unit_send_event](https://docs.lvgl.io/9.0/search.html?q=lv_draw_unit_send_event) draw_wait_for_finish|||[lv_draw_wait_for_finish](https://docs.lvgl.io/9.0/search.html?q=lv_draw_wait_for_finish) event_code_get_name|int|string|[lv_event_code_get_name](https://docs.lvgl.io/9.0/search.html?q=lv_event_code_get_name) event_dsc_get_cb|lv.event_dsc|lv.event_cb|[lv_event_dsc_get_cb](https://docs.lvgl.io/9.0/search.html?q=lv_event_dsc_get_cb) @@ -158,9 +183,6 @@ style_prop_lookup_flags|int|int|[lv_style_prop_lookup_flags](https://docs.lvgl.i style_register_prop|int|int|[lv_style_register_prop](https://docs.lvgl.io/9.0/search.html?q=lv_style_register_prop) task_handler||int|[lv_task_handler](https://docs.lvgl.io/9.0/search.html?q=lv_task_handler) text_get_size|comptr, string, lv.font, int, int, int, int||[lv_text_get_size](https://docs.lvgl.io/9.0/search.html?q=lv_text_get_size) -text_get_width|string, int, lv.font, int|int|[lv_text_get_width](https://docs.lvgl.io/9.0/search.html?q=lv_text_get_width) -text_get_width_with_flags|string, int, lv.font, int, int|int|[lv_text_get_width_with_flags](https://docs.lvgl.io/9.0/search.html?q=lv_text_get_width_with_flags) -text_is_cmd|comptr, int|bool|[lv_text_is_cmd](https://docs.lvgl.io/9.0/search.html?q=lv_text_is_cmd) theme_apply|lv.obj||[lv_theme_apply](https://docs.lvgl.io/9.0/search.html?q=lv_theme_apply) theme_get_color_primary|lv.obj|lv.color|[lv_theme_get_color_primary](https://docs.lvgl.io/9.0/search.html?q=lv_theme_get_color_primary) theme_get_color_secondary|lv.obj|lv.color|[lv_theme_get_color_secondary](https://docs.lvgl.io/9.0/search.html?q=lv_theme_get_color_secondary) @@ -274,6 +296,7 @@ get_rotation||int|[lv_display_get_rotation](https://docs.lvgl.io/9.0/search.html get_scr_act||lv.obj|[lv_display_get_screen_active](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_screen_active) get_scr_prev||lv.obj|[lv_display_get_screen_prev](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_screen_prev) get_screen_active||lv.obj|[lv_display_get_screen_active](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_screen_active) +get_screen_loading||lv.obj|[lv_display_get_screen_loading](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_screen_loading) get_screen_prev||lv.obj|[lv_display_get_screen_prev](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_screen_prev) get_theme||lv.theme|[lv_display_get_theme](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_theme) get_theme||lv.theme|[lv_display_get_theme](https://docs.lvgl.io/9.0/search.html?q=lv_display_get_theme) @@ -319,6 +342,7 @@ unregister_vsync_event|\, \|bool|[lv_display_unregister_vsync_ev Method|Arguments|Return type|LVGL equivalent :---|:---|:---|:--- +free_user_data_cb|||[lv_event_free_user_data_cb](https://docs.lvgl.io/9.0/search.html?q=lv_event_free_user_data_cb) get_code||int|[lv_event_get_code](https://docs.lvgl.io/9.0/search.html?q=lv_event_get_code) get_cover_area||lv.area|[lv_event_get_cover_area](https://docs.lvgl.io/9.0/search.html?q=lv_event_get_cover_area) get_current_target||comptr|[lv_event_get_current_target](https://docs.lvgl.io/9.0/search.html?q=lv_event_get_current_target) @@ -340,6 +364,7 @@ set_cover_res|int||[lv_event_set_cover_res](https://docs.lvgl.io/9.0/search.html set_ext_draw_size|int||[lv_event_set_ext_draw_size](https://docs.lvgl.io/9.0/search.html?q=lv_event_set_ext_draw_size) stop_bubbling|||[lv_event_stop_bubbling](https://docs.lvgl.io/9.0/search.html?q=lv_event_stop_bubbling) stop_processing|||[lv_event_stop_processing](https://docs.lvgl.io/9.0/search.html?q=lv_event_stop_processing) +stop_trickling|||[lv_event_stop_trickling](https://docs.lvgl.io/9.0/search.html?q=lv_event_stop_trickling) ### class `lv.group` @@ -433,6 +458,7 @@ Method|Arguments|Return type|LVGL equivalent copy|lv.style||[lv_style_copy](https://docs.lvgl.io/9.0/search.html?q=lv_style_copy) is_const||bool|[lv_style_is_const](https://docs.lvgl.io/9.0/search.html?q=lv_style_is_const) is_empty||bool|[lv_style_is_empty](https://docs.lvgl.io/9.0/search.html?q=lv_style_is_empty) +merge|lv.style||[lv_style_merge](https://docs.lvgl.io/9.0/search.html?q=lv_style_merge) remove_prop|int|bool|[lv_style_remove_prop](https://docs.lvgl.io/9.0/search.html?q=lv_style_remove_prop) reset|||[lv_style_reset](https://docs.lvgl.io/9.0/search.html?q=lv_style_reset) set_align|int||[lv_style_set_align](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_align) @@ -490,6 +516,7 @@ set_grid_column_dsc_array|lv.int_arr||[lv_style_set_grid_column_dsc_array](https set_grid_row_align|int||[lv_style_set_grid_row_align](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_grid_row_align) set_grid_row_dsc_array|lv.int_arr||[lv_style_set_grid_row_dsc_array](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_grid_row_dsc_array) set_height|int||[lv_style_set_height](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_height) +set_image_colorkey|comptr||[lv_style_set_image_colorkey](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_image_colorkey) set_image_opa|int||[lv_style_set_image_opa](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_image_opa) set_image_recolor|lv.color||[lv_style_set_image_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_image_recolor) set_image_recolor_opa|int||[lv_style_set_image_recolor_opa](https://docs.lvgl.io/9.0/search.html?q=lv_style_set_image_recolor_opa) @@ -606,6 +633,8 @@ Method|Arguments|Return type|LVGL equivalent :---|:---|:---|:--- add_event_cb|\, int, \|lv.event_dsc|[lv_obj_add_event_cb](https://docs.lvgl.io/9.0/search.html?q=lv_obj_add_event_cb) add_flag|int||[lv_obj_add_flag](https://docs.lvgl.io/9.0/search.html?q=lv_obj_add_flag) +add_play_timeline_event|int, lv.anim_timeline_dsc, int, bool||[lv_obj_add_play_timeline_event](https://docs.lvgl.io/9.0/search.html?q=lv_obj_add_play_timeline_event) +add_screen_load_event|int, lv.obj, int, int, int||[lv_obj_add_screen_load_event](https://docs.lvgl.io/9.0/search.html?q=lv_obj_add_screen_load_event) add_state|int||[lv_obj_add_state](https://docs.lvgl.io/9.0/search.html?q=lv_obj_add_state) add_style|lv.style, int||[lv_obj_add_style](https://docs.lvgl.io/9.0/search.html?q=lv_obj_add_style) align|int, int, int||[lv_obj_align](https://docs.lvgl.io/9.0/search.html?q=lv_obj_align) @@ -724,6 +753,7 @@ get_style_grid_column_dsc_array|int|lv.int_arr|[lv_obj_get_style_grid_column_dsc get_style_grid_row_align|int|int|[lv_obj_get_style_grid_row_align](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_grid_row_align) get_style_grid_row_dsc_array|int|lv.int_arr|[lv_obj_get_style_grid_row_dsc_array](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_grid_row_dsc_array) get_style_height|int|int|[lv_obj_get_style_height](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_height) +get_style_image_colorkey|int|comptr|[lv_obj_get_style_image_colorkey](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_image_colorkey) get_style_image_opa|int|int|[lv_obj_get_style_image_opa](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_image_opa) get_style_image_recolor|int|lv.color|[lv_obj_get_style_image_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_image_recolor) get_style_image_recolor_filtered|int|lv.color|[lv_obj_get_style_image_recolor_filtered](https://docs.lvgl.io/9.0/search.html?q=lv_obj_get_style_image_recolor_filtered) @@ -951,6 +981,7 @@ set_style_grid_column_dsc_array|lv.int_arr, int||[lv_obj_set_style_grid_column_d set_style_grid_row_align|int, int||[lv_obj_set_style_grid_row_align](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_grid_row_align) set_style_grid_row_dsc_array|lv.int_arr, int||[lv_obj_set_style_grid_row_dsc_array](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_grid_row_dsc_array) set_style_height|int, int||[lv_obj_set_style_height](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_height) +set_style_image_colorkey|comptr, int||[lv_obj_set_style_image_colorkey](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_image_colorkey) set_style_image_opa|int, int||[lv_obj_set_style_image_opa](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_image_opa) set_style_image_recolor|lv.color, int||[lv_obj_set_style_image_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_image_recolor) set_style_image_recolor_opa|int, int||[lv_obj_set_style_image_recolor_opa](https://docs.lvgl.io/9.0/search.html?q=lv_obj_set_style_image_recolor_opa) @@ -1044,6 +1075,8 @@ stop_scroll_anim|||[lv_obj_stop_scroll_anim](https://docs.lvgl.io/9.0/search.htm stringify_id|comptr, int|string|[lv_obj_stringify_id](https://docs.lvgl.io/9.0/search.html?q=lv_obj_stringify_id) style_apply_color_filter|int, int|int|[lv_obj_style_apply_color_filter](https://docs.lvgl.io/9.0/search.html?q=lv_obj_style_apply_color_filter) style_apply_recolor|int, int|int|[lv_obj_style_apply_recolor](https://docs.lvgl.io/9.0/search.html?q=lv_obj_style_apply_recolor) +style_get_disabled|lv.style, int|bool|[lv_obj_style_get_disabled](https://docs.lvgl.io/9.0/search.html?q=lv_obj_style_get_disabled) +style_set_disabled|lv.style, int, bool||[lv_obj_style_set_disabled](https://docs.lvgl.io/9.0/search.html?q=lv_obj_style_set_disabled) swap|lv.obj||[lv_obj_swap](https://docs.lvgl.io/9.0/search.html?q=lv_obj_swap) transform_point|comptr, int||[lv_obj_transform_point](https://docs.lvgl.io/9.0/search.html?q=lv_obj_transform_point) transform_point_array|lv.point_arr, int, int||[lv_obj_transform_point_array](https://docs.lvgl.io/9.0/search.html?q=lv_obj_transform_point_array) @@ -1076,6 +1109,8 @@ set_bg_start_angle|int||[lv_arc_set_bg_start_angle](https://docs.lvgl.io/9.0/sea set_change_rate|int||[lv_arc_set_change_rate](https://docs.lvgl.io/9.0/search.html?q=lv_arc_set_change_rate) set_end_angle|int||[lv_arc_set_end_angle](https://docs.lvgl.io/9.0/search.html?q=lv_arc_set_end_angle) set_knob_offset|int||[lv_arc_set_knob_offset](https://docs.lvgl.io/9.0/search.html?q=lv_arc_set_knob_offset) +set_max_value|int||[lv_arc_set_max_value](https://docs.lvgl.io/9.0/search.html?q=lv_arc_set_max_value) +set_min_value|int||[lv_arc_set_min_value](https://docs.lvgl.io/9.0/search.html?q=lv_arc_set_min_value) set_mode|int||[lv_arc_set_mode](https://docs.lvgl.io/9.0/search.html?q=lv_arc_set_mode) set_range|int, int||[lv_arc_set_range](https://docs.lvgl.io/9.0/search.html?q=lv_arc_set_range) set_rotation|int||[lv_arc_set_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_arc_set_rotation) @@ -1095,6 +1130,8 @@ get_orientation||int|[lv_bar_get_orientation](https://docs.lvgl.io/9.0/search.ht get_start_value||int|[lv_bar_get_start_value](https://docs.lvgl.io/9.0/search.html?q=lv_bar_get_start_value) get_value||int|[lv_bar_get_value](https://docs.lvgl.io/9.0/search.html?q=lv_bar_get_value) is_symmetrical||bool|[lv_bar_is_symmetrical](https://docs.lvgl.io/9.0/search.html?q=lv_bar_is_symmetrical) +set_max_value|int||[lv_bar_set_max_value](https://docs.lvgl.io/9.0/search.html?q=lv_bar_set_max_value) +set_min_value|int||[lv_bar_set_min_value](https://docs.lvgl.io/9.0/search.html?q=lv_bar_set_min_value) set_mode|int||[lv_bar_set_mode](https://docs.lvgl.io/9.0/search.html?q=lv_bar_set_mode) set_orientation|int||[lv_bar_set_orientation](https://docs.lvgl.io/9.0/search.html?q=lv_bar_set_orientation) set_range|int, int||[lv_bar_set_range](https://docs.lvgl.io/9.0/search.html?q=lv_bar_set_range) @@ -1208,6 +1245,8 @@ set_inner_align|int||[lv_image_set_inner_align](https://docs.lvgl.io/9.0/search. set_offset_x|int||[lv_image_set_offset_x](https://docs.lvgl.io/9.0/search.html?q=lv_image_set_offset_x) set_offset_y|int||[lv_image_set_offset_y](https://docs.lvgl.io/9.0/search.html?q=lv_image_set_offset_y) set_pivot|int, int||[lv_image_set_pivot](https://docs.lvgl.io/9.0/search.html?q=lv_image_set_pivot) +set_pivot_x|int||[lv_image_set_pivot_x](https://docs.lvgl.io/9.0/search.html?q=lv_image_set_pivot_x) +set_pivot_y|int||[lv_image_set_pivot_y](https://docs.lvgl.io/9.0/search.html?q=lv_image_set_pivot_y) set_rotation|int||[lv_image_set_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_image_set_rotation) set_rotation|int||[lv_image_set_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_image_set_rotation) set_scale|int||[lv_image_set_scale](https://docs.lvgl.io/9.0/search.html?q=lv_image_set_scale) @@ -1259,6 +1298,7 @@ Method|Arguments|Return type|LVGL equivalent :---|:---|:---|:--- get_option_cnt||int|[lv_roller_get_option_count](https://docs.lvgl.io/9.0/search.html?q=lv_roller_get_option_count) get_option_count||int|[lv_roller_get_option_count](https://docs.lvgl.io/9.0/search.html?q=lv_roller_get_option_count) +get_option_str|int, comptr, int|int|[lv_roller_get_option_str](https://docs.lvgl.io/9.0/search.html?q=lv_roller_get_option_str) get_options||string|[lv_roller_get_options](https://docs.lvgl.io/9.0/search.html?q=lv_roller_get_options) get_selected||int|[lv_roller_get_selected](https://docs.lvgl.io/9.0/search.html?q=lv_roller_get_selected) get_selected_str|comptr, int||[lv_roller_get_selected_str](https://docs.lvgl.io/9.0/search.html?q=lv_roller_get_selected_str) @@ -1280,6 +1320,8 @@ get_orientation||int|[lv_slider_get_orientation](https://docs.lvgl.io/9.0/search get_value||int|[lv_slider_get_value](https://docs.lvgl.io/9.0/search.html?q=lv_slider_get_value) is_dragged||bool|[lv_slider_is_dragged](https://docs.lvgl.io/9.0/search.html?q=lv_slider_is_dragged) is_symmetrical||bool|[lv_slider_is_symmetrical](https://docs.lvgl.io/9.0/search.html?q=lv_slider_is_symmetrical) +set_max_value|int||[lv_slider_set_max_value](https://docs.lvgl.io/9.0/search.html?q=lv_slider_set_max_value) +set_min_value|int||[lv_slider_set_min_value](https://docs.lvgl.io/9.0/search.html?q=lv_slider_set_min_value) set_mode|int||[lv_slider_set_mode](https://docs.lvgl.io/9.0/search.html?q=lv_slider_set_mode) set_orientation|int||[lv_slider_set_orientation](https://docs.lvgl.io/9.0/search.html?q=lv_slider_set_orientation) set_range|int, int||[lv_slider_set_range](https://docs.lvgl.io/9.0/search.html?q=lv_slider_set_range) @@ -1387,6 +1429,7 @@ set_mode|int||[lv_spangroup_set_mode](https://docs.lvgl.io/9.0/search.html?q=lv_ set_overflow|int||[lv_spangroup_set_overflow](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_overflow) set_span_style|lv.span, lv.style||[lv_spangroup_set_span_style](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_span_style) set_span_text|lv.span, string||[lv_spangroup_set_span_text](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_span_text) +set_span_text_fmt|lv.span, string, [\]||[lv_spangroup_set_span_text_fmt](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_span_text_fmt) set_span_text_static|lv.span, string||[lv_spangroup_set_span_text_static](https://docs.lvgl.io/9.0/search.html?q=lv_spangroup_set_span_text_static) ### widget `lv.span` @@ -1396,6 +1439,7 @@ Method|Arguments|Return type|LVGL equivalent get_style||lv.style|[lv_span_get_style](https://docs.lvgl.io/9.0/search.html?q=lv_span_get_style) get_text||string|[lv_span_get_text](https://docs.lvgl.io/9.0/search.html?q=lv_span_get_text) set_text|string||[lv_span_set_text](https://docs.lvgl.io/9.0/search.html?q=lv_span_set_text) +set_text_fmt|string, [\]||[lv_span_set_text_fmt](https://docs.lvgl.io/9.0/search.html?q=lv_span_set_text_fmt) set_text_static|string||[lv_span_set_text_static](https://docs.lvgl.io/9.0/search.html?q=lv_span_set_text_static) set_text_static|string||[lv_span_set_text_static](https://docs.lvgl.io/9.0/search.html?q=lv_span_set_text_static) @@ -1428,11 +1472,15 @@ set_image_needle_value|lv.obj, int||[lv_scale_set_image_needle_value](https://do set_label_show|bool||[lv_scale_set_label_show](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_label_show) set_line_needle_value|lv.obj, int, int||[lv_scale_set_line_needle_value](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_line_needle_value) set_major_tick_every|int||[lv_scale_set_major_tick_every](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_major_tick_every) +set_max_value|int||[lv_scale_set_max_value](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_max_value) +set_min_value|int||[lv_scale_set_min_value](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_min_value) set_mode|int||[lv_scale_set_mode](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_mode) set_post_draw|bool||[lv_scale_set_post_draw](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_post_draw) set_range|int, int||[lv_scale_set_range](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_range) set_rotation|int||[lv_scale_set_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_rotation) set_rotation|int||[lv_scale_set_rotation](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_rotation) +set_section_max_value|lv.scale_section, int||[lv_scale_set_section_max_value](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_section_max_value) +set_section_min_value|lv.scale_section, int||[lv_scale_set_section_min_value](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_section_min_value) set_section_range|lv.scale_section, int, int||[lv_scale_set_section_range](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_section_range) set_section_style_indicator|lv.scale_section, lv.style||[lv_scale_set_section_style_indicator](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_section_style_indicator) set_section_style_items|lv.scale_section, lv.style||[lv_scale_set_section_style_items](https://docs.lvgl.io/9.0/search.html?q=lv_scale_set_section_style_items) @@ -1459,14 +1507,18 @@ get_type||int|[lv_chart_get_type](https://docs.lvgl.io/9.0/search.html?q=lv_char get_x_start_point|lv.chart_series|int|[lv_chart_get_x_start_point](https://docs.lvgl.io/9.0/search.html?q=lv_chart_get_x_start_point) hide_series|lv.chart_series, bool||[lv_chart_hide_series](https://docs.lvgl.io/9.0/search.html?q=lv_chart_hide_series) refresh|||[lv_chart_refresh](https://docs.lvgl.io/9.0/search.html?q=lv_chart_refresh) +remove_cursor|lv.chart_cursor||[lv_chart_remove_cursor](https://docs.lvgl.io/9.0/search.html?q=lv_chart_remove_cursor) remove_series|lv.chart_series||[lv_chart_remove_series](https://docs.lvgl.io/9.0/search.html?q=lv_chart_remove_series) set_all_values|lv.chart_series, int||[lv_chart_set_all_values](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_all_values) +set_axis_max_value|int, int||[lv_chart_set_axis_max_value](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_axis_max_value) +set_axis_min_value|int, int||[lv_chart_set_axis_min_value](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_axis_min_value) set_axis_range|int, int, int||[lv_chart_set_axis_range](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_axis_range) set_cursor_point|lv.chart_cursor, lv.chart_series, int||[lv_chart_set_cursor_point](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_cursor_point) set_cursor_pos|lv.chart_cursor, comptr||[lv_chart_set_cursor_pos](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_cursor_pos) set_cursor_pos_x|lv.chart_cursor, int||[lv_chart_set_cursor_pos_x](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_cursor_pos_x) set_cursor_pos_y|lv.chart_cursor, int||[lv_chart_set_cursor_pos_y](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_cursor_pos_y) set_div_line_count|int, int||[lv_chart_set_div_line_count](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_div_line_count) +set_hor_div_line_count|int||[lv_chart_set_hor_div_line_count](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_hor_div_line_count) set_next_value|lv.chart_series, int||[lv_chart_set_next_value](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_next_value) set_next_value2|lv.chart_series, int, int||[lv_chart_set_next_value2](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_next_value2) set_point_count|int||[lv_chart_set_point_count](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_point_count) @@ -1480,6 +1532,7 @@ set_series_values|lv.chart_series, lv.int_arr, int||[lv_chart_set_series_values] set_series_values2|lv.chart_series, lv.int_arr, lv.int_arr, int||[lv_chart_set_series_values2](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_series_values2) set_type|int||[lv_chart_set_type](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_type) set_update_mode|int||[lv_chart_set_update_mode](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_update_mode) +set_ver_div_line_count|int||[lv_chart_set_ver_div_line_count](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_ver_div_line_count) set_x_start_point|lv.chart_series, int||[lv_chart_set_x_start_point](https://docs.lvgl.io/9.0/search.html?q=lv_chart_set_x_start_point) ### widget `lv.imagebutton` @@ -1526,8 +1579,12 @@ get_step||int|[lv_spinbox_get_step](https://docs.lvgl.io/9.0/search.html?q=lv_sp get_value||int|[lv_spinbox_get_value](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_get_value) increment|||[lv_spinbox_increment](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_increment) set_cursor_pos|int||[lv_spinbox_set_cursor_pos](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_set_cursor_pos) +set_dec_point_pos|int||[lv_spinbox_set_dec_point_pos](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_set_dec_point_pos) +set_digit_count|int||[lv_spinbox_set_digit_count](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_set_digit_count) set_digit_format|int, int||[lv_spinbox_set_digit_format](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_set_digit_format) set_digit_step_direction|int||[lv_spinbox_set_digit_step_direction](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_set_digit_step_direction) +set_max_value|int||[lv_spinbox_set_max_value](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_set_max_value) +set_min_value|int||[lv_spinbox_set_min_value](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_set_min_value) set_range|int, int||[lv_spinbox_set_range](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_set_range) set_rollover|bool||[lv_spinbox_set_rollover](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_set_rollover) set_step|int||[lv_spinbox_set_step](https://docs.lvgl.io/9.0/search.html?q=lv_spinbox_set_step) @@ -1566,6 +1623,7 @@ get_tab_act||int|[lv_tabview_get_tab_active](https://docs.lvgl.io/9.0/search.htm get_tab_active||int|[lv_tabview_get_tab_active](https://docs.lvgl.io/9.0/search.html?q=lv_tabview_get_tab_active) get_tab_bar||lv.obj|[lv_tabview_get_tab_bar](https://docs.lvgl.io/9.0/search.html?q=lv_tabview_get_tab_bar) get_tab_btns||lv.obj|[lv_tabview_get_tab_bar](https://docs.lvgl.io/9.0/search.html?q=lv_tabview_get_tab_bar) +get_tab_button|int|lv.obj|[lv_tabview_get_tab_button](https://docs.lvgl.io/9.0/search.html?q=lv_tabview_get_tab_button) get_tab_count||int|[lv_tabview_get_tab_count](https://docs.lvgl.io/9.0/search.html?q=lv_tabview_get_tab_count) rename_tab|int, string||[lv_tabview_rename_tab](https://docs.lvgl.io/9.0/search.html?q=lv_tabview_rename_tab) set_act|int, int||[lv_tabview_set_active](https://docs.lvgl.io/9.0/search.html?q=lv_tabview_set_active) @@ -1630,7 +1688,12 @@ header_dropdown_set_year_list|string||[lv_calendar_header_dropdown_set_year_list set_chinese_mode|bool||[lv_calendar_set_chinese_mode](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_chinese_mode) set_day_names|comptr||[lv_calendar_set_day_names](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_day_names) set_month_shown|int, int||[lv_calendar_set_month_shown](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_month_shown) +set_shown_month|int||[lv_calendar_set_shown_month](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_shown_month) +set_shown_year|int||[lv_calendar_set_shown_year](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_shown_year) set_today_date|int, int, int||[lv_calendar_set_today_date](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_today_date) +set_today_day|int||[lv_calendar_set_today_day](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_today_day) +set_today_month|int||[lv_calendar_set_today_month](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_today_month) +set_today_year|int||[lv_calendar_set_today_year](https://docs.lvgl.io/9.0/search.html?q=lv_calendar_set_today_year) ### widget `lv.menu_page` @@ -1677,7 +1740,9 @@ set_sidebar_page|lv.obj||[lv_menu_set_sidebar_page](https://docs.lvgl.io/9.0/sea Method|Arguments|Return type|LVGL equivalent :---|:---|:---|:--- set_dark_color|lv.color||[lv_qrcode_set_dark_color](https://docs.lvgl.io/9.0/search.html?q=lv_qrcode_set_dark_color) +set_data|string||[lv_qrcode_set_data](https://docs.lvgl.io/9.0/search.html?q=lv_qrcode_set_data) set_light_color|lv.color||[lv_qrcode_set_light_color](https://docs.lvgl.io/9.0/search.html?q=lv_qrcode_set_light_color) +set_quiet_zone|bool||[lv_qrcode_set_quiet_zone](https://docs.lvgl.io/9.0/search.html?q=lv_qrcode_set_quiet_zone) set_size|int||[lv_qrcode_set_size](https://docs.lvgl.io/9.0/search.html?q=lv_qrcode_set_size) update|\, int|int|[lv_qrcode_update](https://docs.lvgl.io/9.0/search.html?q=lv_qrcode_update) diff --git a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h index 4a2ca9498..65a71cbcc 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h +++ b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lv_c_mapping.h @@ -16,6 +16,7 @@ const be_ntv_func_def_t lv_style_func[] = { { "copy", { (const void*) &lv_style_copy, "", "(lv.style)(lv.style)" } }, { "is_const", { (const void*) &lv_style_is_const, "b", "(lv.style)" } }, { "is_empty", { (const void*) &lv_style_is_empty, "b", "(lv.style)" } }, + { "merge", { (const void*) &lv_style_merge, "", "(lv.style)(lv.style)" } }, { "remove_prop", { (const void*) &lv_style_remove_prop, "b", "(lv.style)i" } }, { "reset", { (const void*) &lv_style_reset, "", "(lv.style)" } }, { "set_align", { (const void*) &lv_style_set_align, "", "(lv.style)i" } }, @@ -73,6 +74,7 @@ const be_ntv_func_def_t lv_style_func[] = { { "set_grid_row_align", { (const void*) &lv_style_set_grid_row_align, "", "(lv.style)i" } }, { "set_grid_row_dsc_array", { (const void*) &lv_style_set_grid_row_dsc_array, "", "(lv.style)(lv.int_arr)" } }, { "set_height", { (const void*) &lv_style_set_height, "", "(lv.style)i" } }, + { "set_image_colorkey", { (const void*) &lv_style_set_image_colorkey, "", "(lv.style)c" } }, { "set_image_opa", { (const void*) &lv_style_set_image_opa, "", "(lv.style)i" } }, { "set_image_recolor", { (const void*) &lv_style_set_image_recolor, "", "(lv.style)(lv.color)" } }, { "set_image_recolor_opa", { (const void*) &lv_style_set_image_recolor_opa, "", "(lv.style)i" } }, @@ -206,6 +208,8 @@ const be_ntv_func_def_t lv_group_func[] = { const be_ntv_func_def_t lv_obj_func[] = { { "add_event_cb", { (const void*) &lv_obj_add_event_cb, "lv.event_dsc", "(lv.obj)^lv_event_cb^i." } }, { "add_flag", { (const void*) &lv_obj_add_flag, "", "(lv.obj)i" } }, + { "add_play_timeline_event", { (const void*) &lv_obj_add_play_timeline_event, "", "(lv.obj)i(lv.anim_timeline_dsc)ib" } }, + { "add_screen_load_event", { (const void*) &lv_obj_add_screen_load_event, "", "(lv.obj)i(lv.obj)iii" } }, { "add_state", { (const void*) &lv_obj_add_state, "", "(lv.obj)i" } }, { "add_style", { (const void*) &lv_obj_add_style, "", "(lv.obj)(lv.style)i" } }, { "align", { (const void*) &lv_obj_align, "", "(lv.obj)iii" } }, @@ -324,6 +328,7 @@ const be_ntv_func_def_t lv_obj_func[] = { { "get_style_grid_row_align", { (const void*) &lv_obj_get_style_grid_row_align, "i", "(lv.obj)i" } }, { "get_style_grid_row_dsc_array", { (const void*) &lv_obj_get_style_grid_row_dsc_array, "lv.int_arr", "(lv.obj)i" } }, { "get_style_height", { (const void*) &lv_obj_get_style_height, "i", "(lv.obj)i" } }, + { "get_style_image_colorkey", { (const void*) &lv_obj_get_style_image_colorkey, "c", "(lv.obj)i" } }, { "get_style_image_opa", { (const void*) &lv_obj_get_style_image_opa, "i", "(lv.obj)i" } }, { "get_style_image_recolor", { (const void*) &lv_obj_get_style_image_recolor, "lv.color", "(lv.obj)i" } }, { "get_style_image_recolor_filtered", { (const void*) &lv_obj_get_style_image_recolor_filtered, "lv.color", "(lv.obj)i" } }, @@ -549,6 +554,7 @@ const be_ntv_func_def_t lv_obj_func[] = { { "set_style_grid_row_align", { (const void*) &lv_obj_set_style_grid_row_align, "", "(lv.obj)ii" } }, { "set_style_grid_row_dsc_array", { (const void*) &lv_obj_set_style_grid_row_dsc_array, "", "(lv.obj)(lv.int_arr)i" } }, { "set_style_height", { (const void*) &lv_obj_set_style_height, "", "(lv.obj)ii" } }, + { "set_style_image_colorkey", { (const void*) &lv_obj_set_style_image_colorkey, "", "(lv.obj)ci" } }, { "set_style_image_opa", { (const void*) &lv_obj_set_style_image_opa, "", "(lv.obj)ii" } }, { "set_style_image_recolor", { (const void*) &lv_obj_set_style_image_recolor, "", "(lv.obj)(lv.color)i" } }, { "set_style_image_recolor_opa", { (const void*) &lv_obj_set_style_image_recolor_opa, "", "(lv.obj)ii" } }, @@ -642,6 +648,8 @@ const be_ntv_func_def_t lv_obj_func[] = { { "stringify_id", { (const void*) &lv_obj_stringify_id, "s", "(lv.obj)ci" } }, { "style_apply_color_filter", { (const void*) &lv_obj_style_apply_color_filter, "i", "(lv.obj)ii" } }, { "style_apply_recolor", { (const void*) &lv_obj_style_apply_recolor, "i", "(lv.obj)ii" } }, + { "style_get_disabled", { (const void*) &lv_obj_style_get_disabled, "b", "(lv.obj)(lv.style)i" } }, + { "style_set_disabled", { (const void*) &lv_obj_style_set_disabled, "", "(lv.obj)(lv.style)ib" } }, { "swap", { (const void*) &lv_obj_swap, "", "(lv.obj)(lv.obj)" } }, { "transform_point", { (const void*) &lv_obj_transform_point, "", "(lv.obj)ci" } }, { "transform_point_array", { (const void*) &lv_obj_transform_point_array, "", "(lv.obj)(lv.point_arr)ii" } }, @@ -652,6 +660,7 @@ const be_ntv_func_def_t lv_obj_func[] = { /* `lv_event` methods */ const be_ntv_func_def_t lv_event_func[] = { + { "free_user_data_cb", { (const void*) &lv_event_free_user_data_cb, "", "(lv.event)" } }, { "get_code", { (const void*) &lv_event_get_code, "i", "(lv.event)" } }, { "get_cover_area", { (const void*) &lv_event_get_cover_area, "lv.area", "(lv.event)" } }, { "get_current_target", { (const void*) &lv_event_get_current_target, "c", "(lv.event)" } }, @@ -673,6 +682,7 @@ const be_ntv_func_def_t lv_event_func[] = { { "set_ext_draw_size", { (const void*) &lv_event_set_ext_draw_size, "", "(lv.event)i" } }, { "stop_bubbling", { (const void*) &lv_event_stop_bubbling, "", "(lv.event)" } }, { "stop_processing", { (const void*) &lv_event_stop_processing, "", "(lv.event)" } }, + { "stop_trickling", { (const void*) &lv_event_stop_trickling, "", "(lv.event)" } }, }; /* `lv_display` methods */ @@ -714,6 +724,7 @@ const be_ntv_func_def_t lv_display_func[] = { { "get_scr_act", { (const void*) &lv_display_get_screen_active, "lv.obj", "(lv.display)" } }, { "get_scr_prev", { (const void*) &lv_display_get_screen_prev, "lv.obj", "(lv.display)" } }, { "get_screen_active", { (const void*) &lv_display_get_screen_active, "lv.obj", "(lv.display)" } }, + { "get_screen_loading", { (const void*) &lv_display_get_screen_loading, "lv.obj", "(lv.display)" } }, { "get_screen_prev", { (const void*) &lv_display_get_screen_prev, "lv.obj", "(lv.display)" } }, { "get_theme", { (const void*) &lv_display_get_theme, "lv.theme", "(lv.display)" } }, { "get_tile_cnt", { (const void*) &lv_display_get_tile_cnt, "i", "(lv.display)" } }, @@ -806,7 +817,9 @@ const be_ntv_func_def_t lv_indev_func[] = { #ifdef BE_LV_WIDGET_QRCODE const be_ntv_func_def_t lv_qrcode_func[] = { { "set_dark_color", { (const void*) &lv_qrcode_set_dark_color, "", "(lv.obj)(lv.color)" } }, + { "set_data", { (const void*) &lv_qrcode_set_data, "", "(lv.obj)s" } }, { "set_light_color", { (const void*) &lv_qrcode_set_light_color, "", "(lv.obj)(lv.color)" } }, + { "set_quiet_zone", { (const void*) &lv_qrcode_set_quiet_zone, "", "(lv.obj)b" } }, { "set_size", { (const void*) &lv_qrcode_set_size, "", "(lv.obj)i" } }, { "update", { (const void*) &lv_qrcode_update, "i", "(lv.obj).i" } }, }; @@ -914,6 +927,8 @@ const be_ntv_func_def_t lv_arc_func[] = { { "set_change_rate", { (const void*) &lv_arc_set_change_rate, "", "(lv.obj)i" } }, { "set_end_angle", { (const void*) &lv_arc_set_end_angle, "", "(lv.obj)i" } }, { "set_knob_offset", { (const void*) &lv_arc_set_knob_offset, "", "(lv.obj)i" } }, + { "set_max_value", { (const void*) &lv_arc_set_max_value, "", "(lv.obj)i" } }, + { "set_min_value", { (const void*) &lv_arc_set_min_value, "", "(lv.obj)i" } }, { "set_mode", { (const void*) &lv_arc_set_mode, "", "(lv.obj)i" } }, { "set_range", { (const void*) &lv_arc_set_range, "", "(lv.obj)ii" } }, { "set_rotation", { (const void*) &lv_arc_set_rotation, "", "(lv.obj)i" } }, @@ -933,6 +948,8 @@ const be_ntv_func_def_t lv_bar_func[] = { { "get_start_value", { (const void*) &lv_bar_get_start_value, "i", "(lv.obj)" } }, { "get_value", { (const void*) &lv_bar_get_value, "i", "(lv.obj)" } }, { "is_symmetrical", { (const void*) &lv_bar_is_symmetrical, "b", "(lv.obj)" } }, + { "set_max_value", { (const void*) &lv_bar_set_max_value, "", "(lv.obj)i" } }, + { "set_min_value", { (const void*) &lv_bar_set_min_value, "", "(lv.obj)i" } }, { "set_mode", { (const void*) &lv_bar_set_mode, "", "(lv.obj)i" } }, { "set_orientation", { (const void*) &lv_bar_set_orientation, "", "(lv.obj)i" } }, { "set_range", { (const void*) &lv_bar_set_range, "", "(lv.obj)ii" } }, @@ -978,7 +995,12 @@ const be_ntv_func_def_t lv_calendar_func[] = { { "set_chinese_mode", { (const void*) &lv_calendar_set_chinese_mode, "", "(lv.obj)b" } }, { "set_day_names", { (const void*) &lv_calendar_set_day_names, "", "(lv.obj)c" } }, { "set_month_shown", { (const void*) &lv_calendar_set_month_shown, "", "(lv.obj)ii" } }, + { "set_shown_month", { (const void*) &lv_calendar_set_shown_month, "", "(lv.obj)i" } }, + { "set_shown_year", { (const void*) &lv_calendar_set_shown_year, "", "(lv.obj)i" } }, { "set_today_date", { (const void*) &lv_calendar_set_today_date, "", "(lv.obj)iii" } }, + { "set_today_day", { (const void*) &lv_calendar_set_today_day, "", "(lv.obj)i" } }, + { "set_today_month", { (const void*) &lv_calendar_set_today_month, "", "(lv.obj)i" } }, + { "set_today_year", { (const void*) &lv_calendar_set_today_year, "", "(lv.obj)i" } }, }; #endif // BE_LV_WIDGET_CALENDAR @@ -1015,14 +1037,18 @@ const be_ntv_func_def_t lv_chart_func[] = { { "get_x_start_point", { (const void*) &lv_chart_get_x_start_point, "i", "(lv.obj)(lv.chart_series)" } }, { "hide_series", { (const void*) &lv_chart_hide_series, "", "(lv.obj)(lv.chart_series)b" } }, { "refresh", { (const void*) &lv_chart_refresh, "", "(lv.obj)" } }, + { "remove_cursor", { (const void*) &lv_chart_remove_cursor, "", "(lv.obj)(lv.chart_cursor)" } }, { "remove_series", { (const void*) &lv_chart_remove_series, "", "(lv.obj)(lv.chart_series)" } }, { "set_all_values", { (const void*) &lv_chart_set_all_values, "", "(lv.obj)(lv.chart_series)i" } }, + { "set_axis_max_value", { (const void*) &lv_chart_set_axis_max_value, "", "(lv.obj)ii" } }, + { "set_axis_min_value", { (const void*) &lv_chart_set_axis_min_value, "", "(lv.obj)ii" } }, { "set_axis_range", { (const void*) &lv_chart_set_axis_range, "", "(lv.obj)iii" } }, { "set_cursor_point", { (const void*) &lv_chart_set_cursor_point, "", "(lv.obj)(lv.chart_cursor)(lv.chart_series)i" } }, { "set_cursor_pos", { (const void*) &lv_chart_set_cursor_pos, "", "(lv.obj)(lv.chart_cursor)c" } }, { "set_cursor_pos_x", { (const void*) &lv_chart_set_cursor_pos_x, "", "(lv.obj)(lv.chart_cursor)i" } }, { "set_cursor_pos_y", { (const void*) &lv_chart_set_cursor_pos_y, "", "(lv.obj)(lv.chart_cursor)i" } }, { "set_div_line_count", { (const void*) &lv_chart_set_div_line_count, "", "(lv.obj)ii" } }, + { "set_hor_div_line_count", { (const void*) &lv_chart_set_hor_div_line_count, "", "(lv.obj)i" } }, { "set_next_value", { (const void*) &lv_chart_set_next_value, "", "(lv.obj)(lv.chart_series)i" } }, { "set_next_value2", { (const void*) &lv_chart_set_next_value2, "", "(lv.obj)(lv.chart_series)ii" } }, { "set_point_count", { (const void*) &lv_chart_set_point_count, "", "(lv.obj)i" } }, @@ -1036,6 +1062,7 @@ const be_ntv_func_def_t lv_chart_func[] = { { "set_series_values2", { (const void*) &lv_chart_set_series_values2, "", "(lv.obj)(lv.chart_series)(lv.int_arr)(lv.int_arr)i" } }, { "set_type", { (const void*) &lv_chart_set_type, "", "(lv.obj)i" } }, { "set_update_mode", { (const void*) &lv_chart_set_update_mode, "", "(lv.obj)i" } }, + { "set_ver_div_line_count", { (const void*) &lv_chart_set_ver_div_line_count, "", "(lv.obj)i" } }, { "set_x_start_point", { (const void*) &lv_chart_set_x_start_point, "", "(lv.obj)(lv.chart_series)i" } }, }; #endif // BE_LV_WIDGET_CHART @@ -1107,6 +1134,8 @@ const be_ntv_func_def_t lv_image_func[] = { { "set_offset_x", { (const void*) &lv_image_set_offset_x, "", "(lv.obj)i" } }, { "set_offset_y", { (const void*) &lv_image_set_offset_y, "", "(lv.obj)i" } }, { "set_pivot", { (const void*) &lv_image_set_pivot, "", "(lv.obj)ii" } }, + { "set_pivot_x", { (const void*) &lv_image_set_pivot_x, "", "(lv.obj)i" } }, + { "set_pivot_y", { (const void*) &lv_image_set_pivot_y, "", "(lv.obj)i" } }, { "set_rotation", { (const void*) &lv_image_set_rotation, "", "(lv.obj)i" } }, { "set_scale", { (const void*) &lv_image_set_scale, "", "(lv.obj)i" } }, { "set_scale_x", { (const void*) &lv_image_set_scale_x, "", "(lv.obj)i" } }, @@ -1271,6 +1300,7 @@ const be_ntv_func_def_t lv_msgbox_func[] = { const be_ntv_func_def_t lv_roller_func[] = { { "get_option_cnt", { (const void*) &lv_roller_get_option_count, "i", "(lv.obj)" } }, { "get_option_count", { (const void*) &lv_roller_get_option_count, "i", "(lv.obj)" } }, + { "get_option_str", { (const void*) &lv_roller_get_option_str, "i", "(lv.obj)ici" } }, { "get_options", { (const void*) &lv_roller_get_options, "s", "(lv.obj)" } }, { "get_selected", { (const void*) &lv_roller_get_selected, "i", "(lv.obj)" } }, { "get_selected_str", { (const void*) &lv_roller_get_selected_str, "", "(lv.obj)ci" } }, @@ -1302,10 +1332,14 @@ const be_ntv_func_def_t lv_scale_func[] = { { "set_label_show", { (const void*) &lv_scale_set_label_show, "", "(lv.obj)b" } }, { "set_line_needle_value", { (const void*) &lv_scale_set_line_needle_value, "", "(lv.obj)(lv.obj)ii" } }, { "set_major_tick_every", { (const void*) &lv_scale_set_major_tick_every, "", "(lv.obj)i" } }, + { "set_max_value", { (const void*) &lv_scale_set_max_value, "", "(lv.obj)i" } }, + { "set_min_value", { (const void*) &lv_scale_set_min_value, "", "(lv.obj)i" } }, { "set_mode", { (const void*) &lv_scale_set_mode, "", "(lv.obj)i" } }, { "set_post_draw", { (const void*) &lv_scale_set_post_draw, "", "(lv.obj)b" } }, { "set_range", { (const void*) &lv_scale_set_range, "", "(lv.obj)ii" } }, { "set_rotation", { (const void*) &lv_scale_set_rotation, "", "(lv.obj)i" } }, + { "set_section_max_value", { (const void*) &lv_scale_set_section_max_value, "", "(lv.obj)(lv.scale_section)i" } }, + { "set_section_min_value", { (const void*) &lv_scale_set_section_min_value, "", "(lv.obj)(lv.scale_section)i" } }, { "set_section_range", { (const void*) &lv_scale_set_section_range, "", "(lv.obj)(lv.scale_section)ii" } }, { "set_section_style_indicator", { (const void*) &lv_scale_set_section_style_indicator, "", "(lv.obj)(lv.scale_section)(lv.style)" } }, { "set_section_style_items", { (const void*) &lv_scale_set_section_style_items, "", "(lv.obj)(lv.scale_section)(lv.style)" } }, @@ -1334,6 +1368,8 @@ const be_ntv_func_def_t lv_slider_func[] = { { "get_value", { (const void*) &lv_slider_get_value, "i", "(lv.obj)" } }, { "is_dragged", { (const void*) &lv_slider_is_dragged, "b", "(lv.obj)" } }, { "is_symmetrical", { (const void*) &lv_slider_is_symmetrical, "b", "(lv.obj)" } }, + { "set_max_value", { (const void*) &lv_slider_set_max_value, "", "(lv.obj)i" } }, + { "set_min_value", { (const void*) &lv_slider_set_min_value, "", "(lv.obj)i" } }, { "set_mode", { (const void*) &lv_slider_set_mode, "", "(lv.obj)i" } }, { "set_orientation", { (const void*) &lv_slider_set_orientation, "", "(lv.obj)i" } }, { "set_range", { (const void*) &lv_slider_set_range, "", "(lv.obj)ii" } }, @@ -1348,6 +1384,7 @@ const be_ntv_func_def_t lv_span_func[] = { { "get_style", { (const void*) &lv_span_get_style, "lv.style", "(lv.span)" } }, { "get_text", { (const void*) &lv_span_get_text, "s", "(lv.span)" } }, { "set_text", { (const void*) &lv_span_set_text, "", "(lv.span)s" } }, + { "set_text_fmt", { (const void*) &lv_span_set_text_fmt, "", "(lv.span)s[......]" } }, { "set_text_static", { (const void*) &lv_span_set_text_static, "", "(lv.span)s" } }, }; #endif // BE_LV_WIDGET_SPAN @@ -1377,6 +1414,7 @@ const be_ntv_func_def_t lv_spangroup_func[] = { { "set_overflow", { (const void*) &lv_spangroup_set_overflow, "", "(lv.obj)i" } }, { "set_span_style", { (const void*) &lv_spangroup_set_span_style, "", "(lv.obj)(lv.span)(lv.style)" } }, { "set_span_text", { (const void*) &lv_spangroup_set_span_text, "", "(lv.obj)(lv.span)s" } }, + { "set_span_text_fmt", { (const void*) &lv_spangroup_set_span_text_fmt, "", "(lv.obj)(lv.span)s[......]" } }, { "set_span_text_static", { (const void*) &lv_spangroup_set_span_text_static, "", "(lv.obj)(lv.span)s" } }, }; #endif // BE_LV_WIDGET_SPANGROUP @@ -1390,8 +1428,12 @@ const be_ntv_func_def_t lv_spinbox_func[] = { { "get_value", { (const void*) &lv_spinbox_get_value, "i", "(lv.obj)" } }, { "increment", { (const void*) &lv_spinbox_increment, "", "(lv.obj)" } }, { "set_cursor_pos", { (const void*) &lv_spinbox_set_cursor_pos, "", "(lv.obj)i" } }, + { "set_dec_point_pos", { (const void*) &lv_spinbox_set_dec_point_pos, "", "(lv.obj)i" } }, + { "set_digit_count", { (const void*) &lv_spinbox_set_digit_count, "", "(lv.obj)i" } }, { "set_digit_format", { (const void*) &lv_spinbox_set_digit_format, "", "(lv.obj)ii" } }, { "set_digit_step_direction", { (const void*) &lv_spinbox_set_digit_step_direction, "", "(lv.obj)i" } }, + { "set_max_value", { (const void*) &lv_spinbox_set_max_value, "", "(lv.obj)i" } }, + { "set_min_value", { (const void*) &lv_spinbox_set_min_value, "", "(lv.obj)i" } }, { "set_range", { (const void*) &lv_spinbox_set_range, "", "(lv.obj)ii" } }, { "set_rollover", { (const void*) &lv_spinbox_set_rollover, "", "(lv.obj)b" } }, { "set_step", { (const void*) &lv_spinbox_set_step, "", "(lv.obj)i" } }, @@ -1453,6 +1495,7 @@ const be_ntv_func_def_t lv_tabview_func[] = { { "get_tab_active", { (const void*) &lv_tabview_get_tab_active, "i", "(lv.obj)" } }, { "get_tab_bar", { (const void*) &lv_tabview_get_tab_bar, "lv.obj", "(lv.obj)" } }, { "get_tab_btns", { (const void*) &lv_tabview_get_tab_bar, "lv.obj", "(lv.obj)" } }, + { "get_tab_button", { (const void*) &lv_tabview_get_tab_button, "lv.obj", "(lv.obj)i" } }, { "get_tab_count", { (const void*) &lv_tabview_get_tab_count, "i", "(lv.obj)" } }, { "rename_tab", { (const void*) &lv_tabview_rename_tab, "", "(lv.obj)is" } }, { "set_act", { (const void*) &lv_tabview_set_active, "", "(lv.obj)ii" } }, diff --git a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c index 201969a06..54e20f17e 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c +++ b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c @@ -41,6 +41,29 @@ const be_ntv_func_def_t lv_func[] = { { "anim_speed", { (const void*) &lv_anim_speed, "i", "i" } }, { "anim_speed_clamped", { (const void*) &lv_anim_speed_clamped, "i", "iii" } }, { "anim_speed_to_time", { (const void*) &lv_anim_speed_to_time, "i", "iii" } }, + { "arclabel_create", { (const void*) &lv_arclabel_create, "lv.obj", "(lv.obj)" } }, + { "arclabel_get_angle_size", { (const void*) &lv_arclabel_get_angle_size, "i", "(lv.obj)" } }, + { "arclabel_get_angle_start", { (const void*) &lv_arclabel_get_angle_start, "i", "(lv.obj)" } }, + { "arclabel_get_center_offset_x", { (const void*) &lv_arclabel_get_center_offset_x, "i", "(lv.obj)" } }, + { "arclabel_get_center_offset_y", { (const void*) &lv_arclabel_get_center_offset_y, "i", "(lv.obj)" } }, + { "arclabel_get_dir", { (const void*) &lv_arclabel_get_dir, "i", "(lv.obj)" } }, + { "arclabel_get_radius", { (const void*) &lv_arclabel_get_radius, "i", "(lv.obj)" } }, + { "arclabel_get_recolor", { (const void*) &lv_arclabel_get_recolor, "b", "(lv.obj)" } }, + { "arclabel_get_text_horizontal_align", { (const void*) &lv_arclabel_get_text_horizontal_align, "i", "(lv.obj)" } }, + { "arclabel_get_text_vertical_align", { (const void*) &lv_arclabel_get_text_vertical_align, "i", "(lv.obj)" } }, + { "arclabel_set_angle_size", { (const void*) &lv_arclabel_set_angle_size, "", "(lv.obj)i" } }, + { "arclabel_set_angle_start", { (const void*) &lv_arclabel_set_angle_start, "", "(lv.obj)i" } }, + { "arclabel_set_center_offset_x", { (const void*) &lv_arclabel_set_center_offset_x, "", "(lv.obj)i" } }, + { "arclabel_set_center_offset_y", { (const void*) &lv_arclabel_set_center_offset_y, "", "(lv.obj)i" } }, + { "arclabel_set_dir", { (const void*) &lv_arclabel_set_dir, "", "(lv.obj)i" } }, + { "arclabel_set_offset", { (const void*) &lv_arclabel_set_offset, "", "(lv.obj)i" } }, + { "arclabel_set_radius", { (const void*) &lv_arclabel_set_radius, "", "(lv.obj)i" } }, + { "arclabel_set_recolor", { (const void*) &lv_arclabel_set_recolor, "", "(lv.obj)b" } }, + { "arclabel_set_text", { (const void*) &lv_arclabel_set_text, "", "(lv.obj)s" } }, + { "arclabel_set_text_fmt", { (const void*) &lv_arclabel_set_text_fmt, "", "(lv.obj)s[......]" } }, + { "arclabel_set_text_horizontal_align", { (const void*) &lv_arclabel_set_text_horizontal_align, "", "(lv.obj)i" } }, + { "arclabel_set_text_static", { (const void*) &lv_arclabel_set_text_static, "", "(lv.obj)s" } }, + { "arclabel_set_text_vertical_align", { (const void*) &lv_arclabel_set_text_vertical_align, "", "(lv.obj)i" } }, { "area_align", { (const void*) &lv_area_align, "", "(lv.area)(lv.area)iii" } }, { "area_copy", { (const void*) &lv_area_copy, "", "(lv.area)(lv.area)" } }, { "area_get_height", { (const void*) &lv_area_get_height, "i", "(lv.area)" } }, @@ -68,6 +91,7 @@ const be_ntv_func_def_t lv_func[] = { { "color_hex", { (const void*) &lv_color_hex, "lv.color", "i" } }, { "color_hex3", { (const void*) &lv_color_hex3, "lv.color", "i" } }, { "color_hsv_to_rgb", { (const void*) &lv_color_hsv_to_rgb, "lv.color", "iii" } }, + { "color_is_in_range", { (const void*) &lv_color_is_in_range, "b", "(lv.color)(lv.color)(lv.color)" } }, { "color_lighten", { (const void*) &lv_color_lighten, "lv.color", "(lv.color)i" } }, { "color_luminance", { (const void*) &lv_color_luminance, "i", "(lv.color)" } }, { "color_make", { (const void*) &lv_color_make, "lv.color", "iii" } }, @@ -111,6 +135,7 @@ const be_ntv_func_def_t lv_func[] = { { "draw_line_dsc_init", { (const void*) &lv_draw_line_dsc_init, "", "(lv.draw_line_dsc)" } }, { "draw_rect", { (const void*) &lv_draw_rect, "", "(lv.layer)(lv.draw_rect_dsc)(lv.area)" } }, { "draw_rect_dsc_init", { (const void*) &lv_draw_rect_dsc_init, "", "(lv.draw_rect_dsc)" } }, + { "draw_unit_send_event", { (const void*) &lv_draw_unit_send_event, "", "si." } }, { "draw_wait_for_finish", { (const void*) &lv_draw_wait_for_finish, "", "" } }, { "event_code_get_name", { (const void*) &lv_event_code_get_name, "s", "i" } }, { "event_dsc_get_cb", { (const void*) &lv_event_dsc_get_cb, "lv.event_cb", "(lv.event_dsc)" } }, @@ -180,9 +205,6 @@ const be_ntv_func_def_t lv_func[] = { { "style_register_prop", { (const void*) &lv_style_register_prop, "i", "i" } }, { "task_handler", { (const void*) &lv_task_handler, "i", "" } }, { "text_get_size", { (const void*) &lv_text_get_size, "", "cs(lv.font)iiii" } }, - { "text_get_width", { (const void*) &lv_text_get_width, "i", "si(lv.font)i" } }, - { "text_get_width_with_flags", { (const void*) &lv_text_get_width_with_flags, "i", "si(lv.font)ii" } }, - { "text_is_cmd", { (const void*) &lv_text_is_cmd, "b", "ci" } }, { "theme_apply", { (const void*) &lv_theme_apply, "", "(lv.obj)" } }, { "theme_get_color_primary", { (const void*) &lv_theme_get_color_primary, "lv.color", "(lv.obj)" } }, { "theme_get_color_secondary", { (const void*) &lv_theme_get_color_secondary, "lv.color", "(lv.obj)" } }, @@ -241,6 +263,12 @@ const be_const_member_t lv0_constants[] = { { "ANIM_ON", be_cconst_int(LV_ANIM_ON) }, { "ANIM_PLAYTIME_INFINITE", be_cconst_int(LV_ANIM_PLAYTIME_INFINITE) }, { "ANIM_REPEAT_INFINITE", be_cconst_int(LV_ANIM_REPEAT_INFINITE) }, + { "ARCLABEL_DIR_CLOCKWISE", be_cconst_int(LV_ARCLABEL_DIR_CLOCKWISE) }, + { "ARCLABEL_DIR_COUNTER_CLOCKWISE", be_cconst_int(LV_ARCLABEL_DIR_COUNTER_CLOCKWISE) }, + { "ARCLABEL_TEXT_ALIGN_CENTER", be_cconst_int(LV_ARCLABEL_TEXT_ALIGN_CENTER) }, + { "ARCLABEL_TEXT_ALIGN_DEFAULT", be_cconst_int(LV_ARCLABEL_TEXT_ALIGN_DEFAULT) }, + { "ARCLABEL_TEXT_ALIGN_LEADING", be_cconst_int(LV_ARCLABEL_TEXT_ALIGN_LEADING) }, + { "ARCLABEL_TEXT_ALIGN_TRAILING", be_cconst_int(LV_ARCLABEL_TEXT_ALIGN_TRAILING) }, { "ARC_MODE_NORMAL", be_cconst_int(LV_ARC_MODE_NORMAL) }, { "ARC_MODE_REVERSE", be_cconst_int(LV_ARC_MODE_REVERSE) }, { "ARC_MODE_SYMMETRICAL", be_cconst_int(LV_ARC_MODE_SYMMETRICAL) }, @@ -316,6 +344,7 @@ const be_const_member_t lv0_constants[] = { { "CHART_TYPE_LINE", be_cconst_int(LV_CHART_TYPE_LINE) }, { "CHART_TYPE_NONE", be_cconst_int(LV_CHART_TYPE_NONE) }, { "CHART_TYPE_SCATTER", be_cconst_int(LV_CHART_TYPE_SCATTER) }, + { "CHART_TYPE_STACKED", be_cconst_int(LV_CHART_TYPE_STACKED) }, { "CHART_UPDATE_MODE_CIRCULAR", be_cconst_int(LV_CHART_UPDATE_MODE_CIRCULAR) }, { "CHART_UPDATE_MODE_SHIFT", be_cconst_int(LV_CHART_UPDATE_MODE_SHIFT) }, { "COLOR_AQUA", be_cconst_int(0x00FFFF) }, @@ -433,9 +462,10 @@ const be_const_member_t lv0_constants[] = { { "DISP_ROTATION_180", be_cconst_int(LV_DISPLAY_ROTATION_180) }, { "DISP_ROTATION_270", be_cconst_int(LV_DISPLAY_ROTATION_270) }, { "DISP_ROTATION_90", be_cconst_int(LV_DISPLAY_ROTATION_90) }, + { "DRAW_TASK_STATE_BLOCKED", be_cconst_int(LV_DRAW_TASK_STATE_BLOCKED) }, + { "DRAW_TASK_STATE_FINISHED", be_cconst_int(LV_DRAW_TASK_STATE_FINISHED) }, { "DRAW_TASK_STATE_IN_PROGRESS", be_cconst_int(LV_DRAW_TASK_STATE_IN_PROGRESS) }, { "DRAW_TASK_STATE_QUEUED", be_cconst_int(LV_DRAW_TASK_STATE_QUEUED) }, - { "DRAW_TASK_STATE_READY", be_cconst_int(LV_DRAW_TASK_STATE_READY) }, { "DRAW_TASK_STATE_WAITING", be_cconst_int(LV_DRAW_TASK_STATE_WAITING) }, { "DRAW_TASK_TYPE_ARC", be_cconst_int(LV_DRAW_TASK_TYPE_ARC) }, { "DRAW_TASK_TYPE_BORDER", be_cconst_int(LV_DRAW_TASK_TYPE_BORDER) }, @@ -584,7 +614,6 @@ const be_const_member_t lv0_constants[] = { { "IMAGEBUTTON_STATE_NUM", be_cconst_int(LV_IMAGEBUTTON_STATE_NUM) }, { "IMAGEBUTTON_STATE_PRESSED", be_cconst_int(LV_IMAGEBUTTON_STATE_PRESSED) }, { "IMAGEBUTTON_STATE_RELEASED", be_cconst_int(LV_IMAGEBUTTON_STATE_RELEASED) }, - { "IMAGE_ALIGN_AUTO_TRANSFORM", be_cconst_int(LV_IMAGE_ALIGN_AUTO_TRANSFORM) }, { "IMAGE_ALIGN_BOTTOM_LEFT", be_cconst_int(LV_IMAGE_ALIGN_BOTTOM_LEFT) }, { "IMAGE_ALIGN_BOTTOM_MID", be_cconst_int(LV_IMAGE_ALIGN_BOTTOM_MID) }, { "IMAGE_ALIGN_BOTTOM_RIGHT", be_cconst_int(LV_IMAGE_ALIGN_BOTTOM_RIGHT) }, @@ -686,6 +715,7 @@ const be_const_member_t lv0_constants[] = { { "OBJ_FLAG_CLICKABLE", be_cconst_int(LV_OBJ_FLAG_CLICKABLE) }, { "OBJ_FLAG_CLICK_FOCUSABLE", be_cconst_int(LV_OBJ_FLAG_CLICK_FOCUSABLE) }, { "OBJ_FLAG_EVENT_BUBBLE", be_cconst_int(LV_OBJ_FLAG_EVENT_BUBBLE) }, + { "OBJ_FLAG_EVENT_TRICKLE", be_cconst_int(LV_OBJ_FLAG_EVENT_TRICKLE) }, { "OBJ_FLAG_FLEX_IN_NEW_TRACK", be_cconst_int(LV_OBJ_FLAG_FLEX_IN_NEW_TRACK) }, { "OBJ_FLAG_FLOATING", be_cconst_int(LV_OBJ_FLAG_FLOATING) }, { "OBJ_FLAG_GESTURE_BUBBLE", be_cconst_int(LV_OBJ_FLAG_GESTURE_BUBBLE) }, @@ -706,6 +736,7 @@ const be_const_member_t lv0_constants[] = { { "OBJ_FLAG_SCROLL_WITH_ARROW", be_cconst_int(LV_OBJ_FLAG_SCROLL_WITH_ARROW) }, { "OBJ_FLAG_SEND_DRAW_TASK_EVENTS", be_cconst_int(LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS) }, { "OBJ_FLAG_SNAPPABLE", be_cconst_int(LV_OBJ_FLAG_SNAPPABLE) }, + { "OBJ_FLAG_STATE_TRICKLE", be_cconst_int(LV_OBJ_FLAG_STATE_TRICKLE) }, { "OBJ_FLAG_USER_1", be_cconst_int(LV_OBJ_FLAG_USER_1) }, { "OBJ_FLAG_USER_2", be_cconst_int(LV_OBJ_FLAG_USER_2) }, { "OBJ_FLAG_USER_3", be_cconst_int(LV_OBJ_FLAG_USER_3) }, @@ -786,6 +817,22 @@ const be_const_member_t lv0_constants[] = { { "SCALE_NONE", be_cconst_int(LV_SCALE_NONE) }, { "SCALE_ROTATION_ANGLE_MASK", be_cconst_int(LV_SCALE_ROTATION_ANGLE_MASK) }, { "SCALE_TOTAL_TICK_COUNT_DEFAULT", be_cconst_int(LV_SCALE_TOTAL_TICK_COUNT_DEFAULT) }, + { "SCREEN_LOAD_ANIM_FADE_IN", be_cconst_int(LV_SCREEN_LOAD_ANIM_FADE_IN) }, + { "SCREEN_LOAD_ANIM_FADE_ON", be_cconst_int(LV_SCREEN_LOAD_ANIM_FADE_ON) }, + { "SCREEN_LOAD_ANIM_FADE_OUT", be_cconst_int(LV_SCREEN_LOAD_ANIM_FADE_OUT) }, + { "SCREEN_LOAD_ANIM_MOVE_BOTTOM", be_cconst_int(LV_SCREEN_LOAD_ANIM_MOVE_BOTTOM) }, + { "SCREEN_LOAD_ANIM_MOVE_LEFT", be_cconst_int(LV_SCREEN_LOAD_ANIM_MOVE_LEFT) }, + { "SCREEN_LOAD_ANIM_MOVE_RIGHT", be_cconst_int(LV_SCREEN_LOAD_ANIM_MOVE_RIGHT) }, + { "SCREEN_LOAD_ANIM_MOVE_TOP", be_cconst_int(LV_SCREEN_LOAD_ANIM_MOVE_TOP) }, + { "SCREEN_LOAD_ANIM_NONE", be_cconst_int(LV_SCREEN_LOAD_ANIM_NONE) }, + { "SCREEN_LOAD_ANIM_OUT_BOTTOM", be_cconst_int(LV_SCREEN_LOAD_ANIM_OUT_BOTTOM) }, + { "SCREEN_LOAD_ANIM_OUT_LEFT", be_cconst_int(LV_SCREEN_LOAD_ANIM_OUT_LEFT) }, + { "SCREEN_LOAD_ANIM_OUT_RIGHT", be_cconst_int(LV_SCREEN_LOAD_ANIM_OUT_RIGHT) }, + { "SCREEN_LOAD_ANIM_OUT_TOP", be_cconst_int(LV_SCREEN_LOAD_ANIM_OUT_TOP) }, + { "SCREEN_LOAD_ANIM_OVER_BOTTOM", be_cconst_int(LV_SCREEN_LOAD_ANIM_OVER_BOTTOM) }, + { "SCREEN_LOAD_ANIM_OVER_LEFT", be_cconst_int(LV_SCREEN_LOAD_ANIM_OVER_LEFT) }, + { "SCREEN_LOAD_ANIM_OVER_RIGHT", be_cconst_int(LV_SCREEN_LOAD_ANIM_OVER_RIGHT) }, + { "SCREEN_LOAD_ANIM_OVER_TOP", be_cconst_int(LV_SCREEN_LOAD_ANIM_OVER_TOP) }, { "SCROLLBAR_MODE_ACTIVE", be_cconst_int(LV_SCROLLBAR_MODE_ACTIVE) }, { "SCROLLBAR_MODE_AUTO", be_cconst_int(LV_SCROLLBAR_MODE_AUTO) }, { "SCROLLBAR_MODE_OFF", be_cconst_int(LV_SCROLLBAR_MODE_OFF) }, @@ -794,22 +841,6 @@ const be_const_member_t lv0_constants[] = { { "SCROLL_SNAP_END", be_cconst_int(LV_SCROLL_SNAP_END) }, { "SCROLL_SNAP_NONE", be_cconst_int(LV_SCROLL_SNAP_NONE) }, { "SCROLL_SNAP_START", be_cconst_int(LV_SCROLL_SNAP_START) }, - { "SCR_LOAD_ANIM_FADE_IN", be_cconst_int(LV_SCR_LOAD_ANIM_FADE_IN) }, - { "SCR_LOAD_ANIM_FADE_ON", be_cconst_int(LV_SCR_LOAD_ANIM_FADE_ON) }, - { "SCR_LOAD_ANIM_FADE_OUT", be_cconst_int(LV_SCR_LOAD_ANIM_FADE_OUT) }, - { "SCR_LOAD_ANIM_MOVE_BOTTOM", be_cconst_int(LV_SCR_LOAD_ANIM_MOVE_BOTTOM) }, - { "SCR_LOAD_ANIM_MOVE_LEFT", be_cconst_int(LV_SCR_LOAD_ANIM_MOVE_LEFT) }, - { "SCR_LOAD_ANIM_MOVE_RIGHT", be_cconst_int(LV_SCR_LOAD_ANIM_MOVE_RIGHT) }, - { "SCR_LOAD_ANIM_MOVE_TOP", be_cconst_int(LV_SCR_LOAD_ANIM_MOVE_TOP) }, - { "SCR_LOAD_ANIM_NONE", be_cconst_int(LV_SCR_LOAD_ANIM_NONE) }, - { "SCR_LOAD_ANIM_OUT_BOTTOM", be_cconst_int(LV_SCR_LOAD_ANIM_OUT_BOTTOM) }, - { "SCR_LOAD_ANIM_OUT_LEFT", be_cconst_int(LV_SCR_LOAD_ANIM_OUT_LEFT) }, - { "SCR_LOAD_ANIM_OUT_RIGHT", be_cconst_int(LV_SCR_LOAD_ANIM_OUT_RIGHT) }, - { "SCR_LOAD_ANIM_OUT_TOP", be_cconst_int(LV_SCR_LOAD_ANIM_OUT_TOP) }, - { "SCR_LOAD_ANIM_OVER_BOTTOM", be_cconst_int(LV_SCR_LOAD_ANIM_OVER_BOTTOM) }, - { "SCR_LOAD_ANIM_OVER_LEFT", be_cconst_int(LV_SCR_LOAD_ANIM_OVER_LEFT) }, - { "SCR_LOAD_ANIM_OVER_RIGHT", be_cconst_int(LV_SCR_LOAD_ANIM_OVER_RIGHT) }, - { "SCR_LOAD_ANIM_OVER_TOP", be_cconst_int(LV_SCR_LOAD_ANIM_OVER_TOP) }, { "SIZE_CONTENT", be_cconst_int(LV_SIZE_CONTENT) }, { "SLIDER_MODE_NORMAL", be_cconst_int(LV_SLIDER_MODE_NORMAL) }, { "SLIDER_MODE_RANGE", be_cconst_int(LV_SLIDER_MODE_RANGE) }, @@ -889,6 +920,7 @@ const be_const_member_t lv0_constants[] = { { "STYLE_GRID_ROW_ALIGN", be_cconst_int(LV_STYLE_GRID_ROW_ALIGN) }, { "STYLE_GRID_ROW_DSC_ARRAY", be_cconst_int(LV_STYLE_GRID_ROW_DSC_ARRAY) }, { "STYLE_HEIGHT", be_cconst_int(LV_STYLE_HEIGHT) }, + { "STYLE_IMAGE_COLORKEY", be_cconst_int(LV_STYLE_IMAGE_COLORKEY) }, { "STYLE_IMAGE_OPA", be_cconst_int(LV_STYLE_IMAGE_OPA) }, { "STYLE_IMAGE_RECOLOR", be_cconst_int(LV_STYLE_IMAGE_RECOLOR) }, { "STYLE_IMAGE_RECOLOR_OPA", be_cconst_int(LV_STYLE_IMAGE_RECOLOR_OPA) }, @@ -1050,9 +1082,6 @@ const be_const_member_t lv0_constants[] = { { "TEXT_ALIGN_CENTER", be_cconst_int(LV_TEXT_ALIGN_CENTER) }, { "TEXT_ALIGN_LEFT", be_cconst_int(LV_TEXT_ALIGN_LEFT) }, { "TEXT_ALIGN_RIGHT", be_cconst_int(LV_TEXT_ALIGN_RIGHT) }, - { "TEXT_CMD_STATE_IN", be_cconst_int(LV_TEXT_CMD_STATE_IN) }, - { "TEXT_CMD_STATE_PAR", be_cconst_int(LV_TEXT_CMD_STATE_PAR) }, - { "TEXT_CMD_STATE_WAIT", be_cconst_int(LV_TEXT_CMD_STATE_WAIT) }, { "TEXT_DECOR_NONE", be_cconst_int(LV_TEXT_DECOR_NONE) }, { "TEXT_DECOR_STRIKETHROUGH", be_cconst_int(LV_TEXT_DECOR_STRIKETHROUGH) }, { "TEXT_DECOR_UNDERLINE", be_cconst_int(LV_TEXT_DECOR_UNDERLINE) }, diff --git a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_enum.h b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_enum.h index f9aa9be14..372abd662 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_enum.h +++ b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_enum.h @@ -213,6 +213,7 @@ LV_OBJ_FLAG_CHECKABLE LV_OBJ_FLAG_CLICKABLE LV_OBJ_FLAG_CLICK_FOCUSABLE LV_OBJ_FLAG_EVENT_BUBBLE +LV_OBJ_FLAG_EVENT_TRICKLE LV_OBJ_FLAG_FLEX_IN_NEW_TRACK LV_OBJ_FLAG_FLOATING LV_OBJ_FLAG_GESTURE_BUBBLE @@ -233,35 +234,13 @@ LV_OBJ_FLAG_SCROLL_ON_FOCUS LV_OBJ_FLAG_SCROLL_WITH_ARROW LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS LV_OBJ_FLAG_SNAPPABLE +LV_OBJ_FLAG_STATE_TRICKLE LV_OBJ_FLAG_USER_1 LV_OBJ_FLAG_USER_2 LV_OBJ_FLAG_USER_3 LV_OBJ_FLAG_USER_4 LV_OBJ_FLAG_WIDGET_1 LV_OBJ_FLAG_WIDGET_2 -LV_PART_ANY -LV_PART_CURSOR -LV_PART_CUSTOM_FIRST -LV_PART_INDICATOR -LV_PART_ITEMS -LV_PART_KNOB -LV_PART_MAIN -LV_PART_SCROLLBAR -LV_PART_SELECTED -LV_STATE_ANY -LV_STATE_CHECKED -LV_STATE_DEFAULT -LV_STATE_DISABLED -LV_STATE_EDITED -LV_STATE_FOCUSED -LV_STATE_FOCUS_KEY -LV_STATE_HOVERED -LV_STATE_PRESSED -LV_STATE_SCROLLED -LV_STATE_USER_1 -LV_STATE_USER_2 -LV_STATE_USER_3 -LV_STATE_USER_4 // File: ../../lvgl/src/core/lv_obj_class.h LV_OBJ_CLASS_EDITABLE_FALSE @@ -300,6 +279,29 @@ LV_SCROLL_SNAP_NONE LV_SCROLL_SNAP_START // File: ../../lvgl/src/core/lv_obj_style.h +LV_PART_ANY +LV_PART_CURSOR +LV_PART_CUSTOM_FIRST +LV_PART_INDICATOR +LV_PART_ITEMS +LV_PART_KNOB +LV_PART_MAIN +LV_PART_SCROLLBAR +LV_PART_SELECTED +LV_STATE_ANY +LV_STATE_CHECKED +LV_STATE_DEFAULT +LV_STATE_DISABLED +LV_STATE_EDITED +LV_STATE_FOCUSED +LV_STATE_FOCUS_KEY +LV_STATE_HOVERED +LV_STATE_PRESSED +LV_STATE_SCROLLED +LV_STATE_USER_1 +LV_STATE_USER_2 +LV_STATE_USER_3 +LV_STATE_USER_4 LV_STYLE_STATE_CMP_DIFF_DRAW_PAD LV_STYLE_STATE_CMP_DIFF_LAYOUT LV_STYLE_STATE_CMP_DIFF_REDRAW @@ -322,27 +324,28 @@ LV_DISPLAY_ROTATION_0 LV_DISPLAY_ROTATION_180 LV_DISPLAY_ROTATION_270 LV_DISPLAY_ROTATION_90 -LV_SCR_LOAD_ANIM_FADE_IN -LV_SCR_LOAD_ANIM_FADE_ON -LV_SCR_LOAD_ANIM_FADE_OUT -LV_SCR_LOAD_ANIM_MOVE_BOTTOM -LV_SCR_LOAD_ANIM_MOVE_LEFT -LV_SCR_LOAD_ANIM_MOVE_RIGHT -LV_SCR_LOAD_ANIM_MOVE_TOP -LV_SCR_LOAD_ANIM_NONE -LV_SCR_LOAD_ANIM_OUT_BOTTOM -LV_SCR_LOAD_ANIM_OUT_LEFT -LV_SCR_LOAD_ANIM_OUT_RIGHT -LV_SCR_LOAD_ANIM_OUT_TOP -LV_SCR_LOAD_ANIM_OVER_BOTTOM -LV_SCR_LOAD_ANIM_OVER_LEFT -LV_SCR_LOAD_ANIM_OVER_RIGHT -LV_SCR_LOAD_ANIM_OVER_TOP +LV_SCREEN_LOAD_ANIM_FADE_IN +LV_SCREEN_LOAD_ANIM_FADE_ON +LV_SCREEN_LOAD_ANIM_FADE_OUT +LV_SCREEN_LOAD_ANIM_MOVE_BOTTOM +LV_SCREEN_LOAD_ANIM_MOVE_LEFT +LV_SCREEN_LOAD_ANIM_MOVE_RIGHT +LV_SCREEN_LOAD_ANIM_MOVE_TOP +LV_SCREEN_LOAD_ANIM_NONE +LV_SCREEN_LOAD_ANIM_OUT_BOTTOM +LV_SCREEN_LOAD_ANIM_OUT_LEFT +LV_SCREEN_LOAD_ANIM_OUT_RIGHT +LV_SCREEN_LOAD_ANIM_OUT_TOP +LV_SCREEN_LOAD_ANIM_OVER_BOTTOM +LV_SCREEN_LOAD_ANIM_OVER_LEFT +LV_SCREEN_LOAD_ANIM_OVER_RIGHT +LV_SCREEN_LOAD_ANIM_OVER_TOP // File: ../../lvgl/src/draw/lv_draw.h +LV_DRAW_TASK_STATE_BLOCKED +LV_DRAW_TASK_STATE_FINISHED LV_DRAW_TASK_STATE_IN_PROGRESS LV_DRAW_TASK_STATE_QUEUED -LV_DRAW_TASK_STATE_READY LV_DRAW_TASK_STATE_WAITING LV_DRAW_TASK_TYPE_ARC LV_DRAW_TASK_TYPE_BORDER @@ -772,6 +775,7 @@ LV_STYLE_GRID_COLUMN_DSC_ARRAY LV_STYLE_GRID_ROW_ALIGN LV_STYLE_GRID_ROW_DSC_ARRAY LV_STYLE_HEIGHT +LV_STYLE_IMAGE_COLORKEY LV_STYLE_IMAGE_OPA LV_STYLE_IMAGE_RECOLOR LV_STYLE_IMAGE_RECOLOR_OPA @@ -861,9 +865,6 @@ LV_TEXT_ALIGN_AUTO LV_TEXT_ALIGN_CENTER LV_TEXT_ALIGN_LEFT LV_TEXT_ALIGN_RIGHT -LV_TEXT_CMD_STATE_IN -LV_TEXT_CMD_STATE_PAR -LV_TEXT_CMD_STATE_WAIT LV_TEXT_FLAG_BREAK_ALL LV_TEXT_FLAG_EXPAND LV_TEXT_FLAG_FIT @@ -892,6 +893,14 @@ LV_ARC_MODE_NORMAL LV_ARC_MODE_REVERSE LV_ARC_MODE_SYMMETRICAL +// File: ../../lvgl/src/widgets/arclabel/lv_arclabel.h +LV_ARCLABEL_DIR_CLOCKWISE +LV_ARCLABEL_DIR_COUNTER_CLOCKWISE +LV_ARCLABEL_TEXT_ALIGN_CENTER +LV_ARCLABEL_TEXT_ALIGN_DEFAULT +LV_ARCLABEL_TEXT_ALIGN_LEADING +LV_ARCLABEL_TEXT_ALIGN_TRAILING + // File: ../../lvgl/src/widgets/bar/lv_bar.h LV_BAR_MODE_NORMAL LV_BAR_MODE_RANGE @@ -954,6 +963,7 @@ LV_CHART_TYPE_BAR LV_CHART_TYPE_LINE LV_CHART_TYPE_NONE LV_CHART_TYPE_SCATTER +LV_CHART_TYPE_STACKED LV_CHART_UPDATE_MODE_CIRCULAR LV_CHART_UPDATE_MODE_SHIFT @@ -963,7 +973,6 @@ LV_CHART_UPDATE_MODE_SHIFT LV_DROPDOWN_POS_LAST // File: ../../lvgl/src/widgets/image/lv_image.h -LV_IMAGE_ALIGN_AUTO_TRANSFORM LV_IMAGE_ALIGN_BOTTOM_LEFT LV_IMAGE_ALIGN_BOTTOM_MID LV_IMAGE_ALIGN_BOTTOM_RIGHT diff --git a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h index 24b7e2b77..b75b0f532 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h +++ b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h @@ -76,6 +76,9 @@ bool lv_obj_has_class(const lv_obj_t * obj, const lv_obj_class_t * class_p) const lv_obj_class_t * lv_obj_get_class(const lv_obj_t * obj) bool lv_obj_is_valid(const lv_obj_t * obj) void lv_obj_null_on_delete(lv_obj_t ** obj_ptr) +void lv_obj_add_screen_load_event(lv_obj_t * obj, lv_event_code_t trigger, lv_obj_t * screen, lv_screen_load_anim_t anim_type, uint32_t duration, uint32_t delay) +void lv_obj_add_screen_create_event(lv_obj_t * obj, lv_event_code_t trigger, lv_screen_create_cb_t screen_create_cb, lv_screen_load_anim_t anim_type, uint32_t duration, uint32_t delay) +void lv_obj_add_play_timeline_event(lv_obj_t * obj, lv_event_code_t trigger, lv_anim_timeline_t * at, uint32_t delay, bool reverse) void lv_obj_set_id(lv_obj_t * obj, void * id) void * lv_obj_get_id(const lv_obj_t * obj) lv_obj_t * lv_obj_find_by_id(const lv_obj_t * obj, const void * id) @@ -214,6 +217,8 @@ void lv_obj_remove_style(lv_obj_t * obj, const lv_style_t * style, lv_style_sele void lv_obj_remove_style_all(lv_obj_t * obj) void lv_obj_report_style_change(lv_style_t * style) void lv_obj_refresh_style(lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop) +void lv_obj_style_set_disabled(lv_obj_t * obj, const lv_style_t * style, lv_style_selector_t selector, bool dis) +bool lv_obj_style_get_disabled(lv_obj_t * obj, const lv_style_t * style, lv_style_selector_t selector) void lv_obj_enable_style_refresh(bool en) lv_style_value_t lv_obj_get_style_prop(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop) bool lv_obj_has_style_prop(const lv_obj_t * obj, lv_style_selector_t selector, lv_style_prop_t prop) @@ -318,6 +323,7 @@ static inline lv_opa_t lv_obj_get_style_image_opa(const lv_obj_t * obj, lv_part_ static inline lv_color_t lv_obj_get_style_image_recolor(const lv_obj_t * obj, lv_part_t part) static inline lv_color_t lv_obj_get_style_image_recolor_filtered(const lv_obj_t * obj, lv_part_t part) static inline lv_opa_t lv_obj_get_style_image_recolor_opa(const lv_obj_t * obj, lv_part_t part) +static inline const lv_image_colorkey_t * lv_obj_get_style_image_colorkey(const lv_obj_t * obj, lv_part_t part) static inline int32_t lv_obj_get_style_line_width(const lv_obj_t * obj, lv_part_t part) static inline int32_t lv_obj_get_style_line_dash_width(const lv_obj_t * obj, lv_part_t part) static inline int32_t lv_obj_get_style_line_dash_gap(const lv_obj_t * obj, lv_part_t part) @@ -440,6 +446,7 @@ void lv_obj_set_style_shadow_opa(lv_obj_t * obj, lv_opa_t value, lv_style_select void lv_obj_set_style_image_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) void lv_obj_set_style_image_recolor(lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector) void lv_obj_set_style_image_recolor_opa(lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector) +void lv_obj_set_style_image_colorkey(lv_obj_t * obj, const lv_image_colorkey_t * value, lv_style_selector_t selector) void lv_obj_set_style_line_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) void lv_obj_set_style_line_dash_width(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) void lv_obj_set_style_line_dash_gap(lv_obj_t * obj, int32_t value, lv_style_selector_t selector) @@ -561,6 +568,7 @@ bool lv_display_get_antialiasing(lv_display_t * disp) bool lv_display_is_double_buffered(lv_display_t * disp) lv_obj_t * lv_display_get_screen_active(lv_display_t * disp) lv_obj_t * lv_display_get_screen_prev(lv_display_t * disp) +lv_obj_t * lv_display_get_screen_loading(lv_display_t * disp) lv_obj_t * lv_display_get_layer_top(lv_display_t * disp) lv_obj_t * lv_display_get_layer_sys(lv_display_t * disp) lv_obj_t * lv_display_get_layer_bottom(lv_display_t * disp) @@ -614,6 +622,7 @@ uint32_t lv_draw_get_unit_count(void) lv_draw_task_t * lv_draw_get_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id) lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_task_t * t_prev, uint8_t draw_unit_id) uint32_t lv_draw_get_dependent_count(lv_draw_task_t * t_check) +void lv_draw_unit_send_event(const char * name, lv_event_code_t code, void * param) void lv_layer_init(lv_layer_t * layer) void lv_layer_reset(lv_layer_t * layer) lv_layer_t * lv_draw_layer_create(lv_layer_t * parent_layer, lv_color_format_t color_format, const lv_area_t * area) @@ -752,6 +761,8 @@ void lv_qrcode_set_size(lv_obj_t * obj, int32_t size) void lv_qrcode_set_dark_color(lv_obj_t * obj, lv_color_t color) void lv_qrcode_set_light_color(lv_obj_t * obj, lv_color_t color) lv_result_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len) +void lv_qrcode_set_data(lv_obj_t * obj, const char * data) +void lv_qrcode_set_quiet_zone(lv_obj_t * obj, bool enable) // ../../lvgl/src/lv_api_map_v8.h static inline uint32_t lv_task_handler(void) @@ -762,6 +773,10 @@ static inline void lv_obj_move_background(lv_obj_t * obj) // ../../lvgl/src/lv_api_map_v9_1.h +// ../../lvgl/src/lv_api_map_v9_2.h + +// ../../lvgl/src/lv_api_map_v9_3.h + // ../../lvgl/src/misc/lv_anim.h void lv_anim_init(lv_anim_t * a) void lv_anim_set_var(lv_anim_t * a, void * var) @@ -840,6 +855,8 @@ lv_color_t lv_color_hex(uint32_t c) lv_color_t lv_color_make(uint8_t r, uint8_t g, uint8_t b) lv_color32_t lv_color32_make(uint8_t r, uint8_t g, uint8_t b, uint8_t a) lv_color_t lv_color_hex3(uint32_t c) +static inline bool lv_color_is_in_range(lv_color_t color, lv_color_t l_color, lv_color_t h_color) +static inline lv_color_t lv_color16_to_color(lv_color16_t c) uint16_t lv_color_to_u16(lv_color_t color) uint32_t lv_color_to_u32(lv_color_t color) uint16_t lv_color_16_16_mix(uint16_t c1, uint16_t c2, uint8_t mix) @@ -882,7 +899,9 @@ lv_event_code_t lv_event_get_code(lv_event_t * e) void * lv_event_get_param(lv_event_t * e) void * lv_event_get_user_data(lv_event_t * e) void lv_event_stop_bubbling(lv_event_t * e) +void lv_event_stop_trickling(lv_event_t * e) void lv_event_stop_processing(lv_event_t * e) +void lv_event_free_user_data_cb(lv_event_t * e) uint32_t lv_event_register_id(void) const char * lv_event_code_get_name(lv_event_code_t code) @@ -895,6 +914,7 @@ lv_color_t lv_palette_darken(lv_palette_t p, uint8_t lvl) void lv_style_init(lv_style_t * style) void lv_style_reset(lv_style_t * style) void lv_style_copy(lv_style_t * dst, const lv_style_t * src) +void lv_style_merge(lv_style_t * dst, const lv_style_t * src) static inline bool lv_style_is_const(const lv_style_t * style) lv_style_prop_t lv_style_register_prop(uint8_t flag) lv_style_prop_t lv_style_get_num_custom_props(void) @@ -984,6 +1004,7 @@ void lv_style_set_shadow_opa(lv_style_t * style, lv_opa_t value) void lv_style_set_image_opa(lv_style_t * style, lv_opa_t value) void lv_style_set_image_recolor(lv_style_t * style, lv_color_t value) void lv_style_set_image_recolor_opa(lv_style_t * style, lv_opa_t value) +void lv_style_set_image_colorkey(lv_style_t * style, const lv_image_colorkey_t * value) void lv_style_set_line_width(lv_style_t * style, int32_t value) void lv_style_set_line_dash_width(lv_style_t * style, int32_t value) void lv_style_set_line_dash_gap(lv_style_t * style, int32_t value) @@ -1040,9 +1061,6 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value) // ../../lvgl/src/misc/lv_text.h void lv_text_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, int32_t letter_space, int32_t line_space, int32_t max_width, lv_text_flag_t flag) -int32_t lv_text_get_width(const char * txt, uint32_t length, const lv_font_t * font, int32_t letter_space) -int32_t lv_text_get_width_with_flags(const char * txt, uint32_t length, const lv_font_t * font, int32_t letter_space, lv_text_flag_t flags) -bool lv_text_is_cmd(lv_text_cmd_state_t * state, uint32_t c) // ../../lvgl/src/misc/lv_timer.h uint32_t lv_timer_handler(void) @@ -1109,6 +1127,8 @@ void lv_arc_set_rotation(lv_obj_t * obj, int32_t rotation) void lv_arc_set_mode(lv_obj_t * obj, lv_arc_mode_t type) void lv_arc_set_value(lv_obj_t * obj, int32_t value) void lv_arc_set_range(lv_obj_t * obj, int32_t min, int32_t max) +void lv_arc_set_min_value(lv_obj_t * obj, int32_t min) +void lv_arc_set_max_value(lv_obj_t * obj, int32_t max) void lv_arc_set_change_rate(lv_obj_t * obj, uint32_t rate) void lv_arc_set_knob_offset(lv_obj_t * obj, int32_t offset) lv_value_precise_t lv_arc_get_angle_start(lv_obj_t * obj) @@ -1124,11 +1144,38 @@ int32_t lv_arc_get_knob_offset(const lv_obj_t * obj) void lv_arc_align_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_align, int32_t r_offset) void lv_arc_rotate_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_rotate, int32_t r_offset) +// ../../lvgl/src/widgets/arclabel/lv_arclabel.h +lv_obj_t * lv_arclabel_create(lv_obj_t * parent) +void lv_arclabel_set_text(lv_obj_t * obj, const char * text) +void lv_arclabel_set_text_fmt(lv_obj_t * obj, const char * fmt, ...) LV_FORMAT_ATTRIBUTE(2, 3) +void lv_arclabel_set_text_static(lv_obj_t * obj, const char * text) +void lv_arclabel_set_angle_start(lv_obj_t * obj, lv_value_precise_t start) +void lv_arclabel_set_angle_size(lv_obj_t * obj, lv_value_precise_t size) +void lv_arclabel_set_offset(lv_obj_t * obj, int32_t offset) +void lv_arclabel_set_dir(lv_obj_t * obj, lv_arclabel_dir_t dir) +void lv_arclabel_set_recolor(lv_obj_t * obj, bool en) +void lv_arclabel_set_radius(lv_obj_t * obj, uint32_t radius) +void lv_arclabel_set_center_offset_x(lv_obj_t * obj, uint32_t x) +void lv_arclabel_set_center_offset_y(lv_obj_t * obj, uint32_t y) +void lv_arclabel_set_text_vertical_align(lv_obj_t * obj, lv_arclabel_text_align_t align) +void lv_arclabel_set_text_horizontal_align(lv_obj_t * obj, lv_arclabel_text_align_t align) +lv_value_precise_t lv_arclabel_get_angle_start(lv_obj_t * obj) +lv_value_precise_t lv_arclabel_get_angle_size(lv_obj_t * obj) +lv_arclabel_dir_t lv_arclabel_get_dir(const lv_obj_t * obj) +bool lv_arclabel_get_recolor(lv_obj_t * obj) +uint32_t lv_arclabel_get_radius(lv_obj_t * obj) +uint32_t lv_arclabel_get_center_offset_x(lv_obj_t * obj) +uint32_t lv_arclabel_get_center_offset_y(lv_obj_t * obj) +lv_arclabel_text_align_t lv_arclabel_get_text_vertical_align(lv_obj_t * obj) +lv_arclabel_text_align_t lv_arclabel_get_text_horizontal_align(lv_obj_t * obj) + // ../../lvgl/src/widgets/bar/lv_bar.h lv_obj_t * lv_bar_create(lv_obj_t * parent) void lv_bar_set_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim) void lv_bar_set_start_value(lv_obj_t * obj, int32_t start_value, lv_anim_enable_t anim) void lv_bar_set_range(lv_obj_t * obj, int32_t min, int32_t max) +void lv_bar_set_min_value(lv_obj_t * obj, int32_t min) +void lv_bar_set_max_value(lv_obj_t * obj, int32_t max) void lv_bar_set_mode(lv_obj_t * obj, lv_bar_mode_t mode) void lv_bar_set_orientation(lv_obj_t * obj, lv_bar_orientation_t orientation) int32_t lv_bar_get_value(const lv_obj_t * obj) @@ -1162,7 +1209,12 @@ bool lv_buttonmatrix_get_one_checked(const lv_obj_t * obj) // ../../lvgl/src/widgets/calendar/lv_calendar.h lv_obj_t * lv_calendar_create(lv_obj_t * parent) void lv_calendar_set_today_date(lv_obj_t * obj, uint32_t year, uint32_t month, uint32_t day) +void lv_calendar_set_today_year(lv_obj_t * obj, uint32_t year) +void lv_calendar_set_today_month(lv_obj_t * obj, uint32_t month) +void lv_calendar_set_today_day(lv_obj_t * obj, uint32_t day) void lv_calendar_set_month_shown(lv_obj_t * obj, uint32_t year, uint32_t month) +void lv_calendar_set_shown_year(lv_obj_t * obj, uint32_t year) +void lv_calendar_set_shown_month(lv_obj_t * obj, uint32_t month) void lv_calendar_set_highlighted_dates(lv_obj_t * obj, lv_calendar_date_t highlighted[], size_t date_num) void lv_calendar_set_day_names(lv_obj_t * obj, const char ** day_names) lv_obj_t * lv_calendar_get_btnmatrix(const lv_obj_t * obj) @@ -1205,8 +1257,12 @@ lv_obj_t * lv_chart_create(lv_obj_t * parent) void lv_chart_set_type(lv_obj_t * obj, lv_chart_type_t type) void lv_chart_set_point_count(lv_obj_t * obj, uint32_t cnt) void lv_chart_set_axis_range(lv_obj_t * obj, lv_chart_axis_t axis, int32_t min, int32_t max) +void lv_chart_set_axis_min_value(lv_obj_t * obj, lv_chart_axis_t axis, int32_t min) +void lv_chart_set_axis_max_value(lv_obj_t * obj, lv_chart_axis_t axis, int32_t max) void lv_chart_set_update_mode(lv_obj_t * obj, lv_chart_update_mode_t update_mode) -void lv_chart_set_div_line_count(lv_obj_t * obj, uint8_t hdiv, uint8_t vdiv) +void lv_chart_set_div_line_count(lv_obj_t * obj, uint32_t hdiv, uint32_t vdiv) +void lv_chart_set_hor_div_line_count(lv_obj_t * obj, uint32_t cnt) +void lv_chart_set_ver_div_line_count(lv_obj_t * obj, uint32_t cnt) lv_chart_type_t lv_chart_get_type(const lv_obj_t * obj) uint32_t lv_chart_get_point_count(const lv_obj_t * obj) uint32_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * ser) @@ -1220,6 +1276,7 @@ lv_color_t lv_chart_get_series_color(lv_obj_t * chart, const lv_chart_series_t * void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t id) lv_chart_series_t * lv_chart_get_series_next(const lv_obj_t * chart, const lv_chart_series_t * ser) lv_chart_cursor_t * lv_chart_add_cursor(lv_obj_t * obj, lv_color_t color, lv_dir_t dir) +void lv_chart_remove_cursor(lv_obj_t * obj, lv_chart_cursor_t * cursor) void lv_chart_set_cursor_pos(lv_obj_t * chart, lv_chart_cursor_t * cursor, lv_point_t * pos) void lv_chart_set_cursor_pos_x(lv_obj_t * chart, lv_chart_cursor_t * cursor, int32_t x) void lv_chart_set_cursor_pos_y(lv_obj_t * chart, lv_chart_cursor_t * cursor, int32_t y) @@ -1277,6 +1334,8 @@ void lv_image_set_offset_x(lv_obj_t * obj, int32_t x) void lv_image_set_offset_y(lv_obj_t * obj, int32_t y) void lv_image_set_rotation(lv_obj_t * obj, int32_t angle) void lv_image_set_pivot(lv_obj_t * obj, int32_t x, int32_t y) +void lv_image_set_pivot_x(lv_obj_t * obj, int32_t x) +void lv_image_set_pivot_y(lv_obj_t * obj, int32_t y) void lv_image_set_scale(lv_obj_t * obj, uint32_t zoom) void lv_image_set_scale_x(lv_obj_t * obj, uint32_t zoom) void lv_image_set_scale_y(lv_obj_t * obj, uint32_t zoom) @@ -1323,6 +1382,7 @@ const char * lv_keyboard_get_button_text(const lv_obj_t * obj, uint32_t btn_id) lv_obj_t * lv_label_create(lv_obj_t * parent) void lv_label_set_text(lv_obj_t * obj, const char * text) void lv_label_set_text_fmt(lv_obj_t * obj, const char * fmt, ...) LV_FORMAT_ATTRIBUTE(2, 3) +void lv_label_set_text_vfmt(lv_obj_t * obj, const char * fmt, va_list args) void lv_label_set_text_static(lv_obj_t * obj, const char * text) void lv_label_set_long_mode(lv_obj_t * obj, lv_label_long_mode_t long_mode) void lv_label_set_text_selection_start(lv_obj_t * obj, uint32_t index) @@ -1414,6 +1474,7 @@ uint32_t lv_roller_get_selected(const lv_obj_t * obj) void lv_roller_get_selected_str(const lv_obj_t * obj, char * buf, uint32_t buf_size) const char * lv_roller_get_options(const lv_obj_t * obj) uint32_t lv_roller_get_option_count(const lv_obj_t * obj) +lv_result_t lv_roller_get_option_str(const lv_obj_t * obj, uint32_t option, char * buf, uint32_t buf_size) // ../../lvgl/src/widgets/scale/lv_scale.h lv_obj_t * lv_scale_create(lv_obj_t * parent) @@ -1422,6 +1483,8 @@ void lv_scale_set_total_tick_count(lv_obj_t * obj, uint32_t total_tick_count) void lv_scale_set_major_tick_every(lv_obj_t * obj, uint32_t major_tick_every) void lv_scale_set_label_show(lv_obj_t * obj, bool show_label) void lv_scale_set_range(lv_obj_t * obj, int32_t min, int32_t max) +void lv_scale_set_min_value(lv_obj_t * obj, int32_t min) +void lv_scale_set_max_value(lv_obj_t * obj, int32_t max) void lv_scale_set_angle_range(lv_obj_t * obj, uint32_t angle_range) void lv_scale_set_rotation(lv_obj_t * obj, int32_t rotation) void lv_scale_set_line_needle_value(lv_obj_t * obj, lv_obj_t * needle_line, int32_t needle_length, int32_t value) @@ -1432,6 +1495,8 @@ void lv_scale_set_draw_ticks_on_top(lv_obj_t * obj, bool en) lv_scale_section_t * lv_scale_add_section(lv_obj_t * obj) void lv_scale_section_set_range(lv_scale_section_t * section, int32_t min, int32_t max) void lv_scale_set_section_range(lv_obj_t * scale, lv_scale_section_t * section, int32_t min, int32_t max) +void lv_scale_set_section_min_value(lv_obj_t * scale, lv_scale_section_t * section, int32_t min) +void lv_scale_set_section_max_value(lv_obj_t * scale, lv_scale_section_t * section, int32_t max) void lv_scale_section_set_style(lv_scale_section_t * section, lv_part_t part, lv_style_t * section_part_style) void lv_scale_set_section_style_main(lv_obj_t * scale, lv_scale_section_t * section, const lv_style_t * style) void lv_scale_set_section_style_indicator(lv_obj_t * scale, lv_scale_section_t * section, const lv_style_t * style) @@ -1450,6 +1515,8 @@ lv_obj_t * lv_slider_create(lv_obj_t * parent) void lv_slider_set_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim) void lv_slider_set_start_value(lv_obj_t * obj, int32_t value, lv_anim_enable_t anim) void lv_slider_set_range(lv_obj_t * obj, int32_t min, int32_t max) +void lv_slider_set_min_value(lv_obj_t * obj, int32_t min) +void lv_slider_set_max_value(lv_obj_t * obj, int32_t max) void lv_slider_set_mode(lv_obj_t * obj, lv_slider_mode_t mode) void lv_slider_set_orientation(lv_obj_t * obj, lv_slider_orientation_t orientation) int32_t lv_slider_get_value(const lv_obj_t * obj) @@ -1468,9 +1535,11 @@ lv_obj_t * lv_spangroup_create(lv_obj_t * parent) lv_span_t * lv_spangroup_add_span(lv_obj_t * obj) void lv_spangroup_delete_span(lv_obj_t * obj, lv_span_t * span) void lv_span_set_text(lv_span_t * span, const char * text) +void lv_span_set_text_fmt(lv_span_t * span, const char * fmt, ...) LV_FORMAT_ATTRIBUTE(2, 3) void lv_span_set_text_static(lv_span_t * span, const char * text) void lv_spangroup_set_span_text(lv_obj_t * obj, lv_span_t * span, const char * text) void lv_spangroup_set_span_text_static(lv_obj_t * obj, lv_span_t * span, const char * text) +void lv_spangroup_set_span_text_fmt(lv_obj_t * obj, lv_span_t * span, const char * fmt, ...) LV_FORMAT_ATTRIBUTE(3, 4) void lv_span_set_text_static(lv_span_t * span, const char * text) void lv_spangroup_set_span_style(lv_obj_t * obj, lv_span_t * span, const lv_style_t * style) void lv_spangroup_set_align(lv_obj_t * obj, lv_text_align_t align) @@ -1499,8 +1568,12 @@ lv_obj_t * lv_spinbox_create(lv_obj_t * parent) void lv_spinbox_set_value(lv_obj_t * obj, int32_t v) void lv_spinbox_set_rollover(lv_obj_t * obj, bool rollover) void lv_spinbox_set_digit_format(lv_obj_t * obj, uint32_t digit_count, uint32_t sep_pos) +void lv_spinbox_set_digit_count(lv_obj_t * obj, uint32_t digit_count) +void lv_spinbox_set_dec_point_pos(lv_obj_t * obj, uint32_t dec_point_pos) void lv_spinbox_set_step(lv_obj_t * obj, uint32_t step) -void lv_spinbox_set_range(lv_obj_t * obj, int32_t range_min, int32_t range_max) +void lv_spinbox_set_range(lv_obj_t * obj, int32_t min_value, int32_t max_value) +void lv_spinbox_set_min_value(lv_obj_t * obj, int32_t min_value) +void lv_spinbox_set_max_value(lv_obj_t * obj, int32_t max_value) void lv_spinbox_set_cursor_pos(lv_obj_t * obj, uint32_t pos) void lv_spinbox_set_digit_step_direction(lv_obj_t * obj, lv_dir_t direction) bool lv_spinbox_get_rollover(lv_obj_t * obj) @@ -1548,6 +1621,7 @@ void lv_tabview_set_tab_bar_position(lv_obj_t * obj, lv_dir_t dir) void lv_tabview_set_tab_bar_size(lv_obj_t * obj, int32_t size) uint32_t lv_tabview_get_tab_count(lv_obj_t * obj) uint32_t lv_tabview_get_tab_active(lv_obj_t * obj) +lv_obj_t * lv_tabview_get_tab_button(lv_obj_t * obj, int32_t idx) lv_obj_t * lv_tabview_get_content(lv_obj_t * obj) lv_obj_t * lv_tabview_get_tab_bar(lv_obj_t * obj) diff --git a/lib/libesp32_lvgl/lv_binding_berry/src/be_lvgl_ctypes_definitions.c b/lib/libesp32_lvgl/lv_binding_berry/src/be_lvgl_ctypes_definitions.c index c4fdb10fb..7163ea0a4 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/src/be_lvgl_ctypes_definitions.c +++ b/lib/libesp32_lvgl/lv_binding_berry/src/be_lvgl_ctypes_definitions.c @@ -51,16 +51,6 @@ const be_ctypes_structure_t be_lv_grad_stop = { { "opa", 3, 0, 0, ctypes_u8, 0 }, }}; -const be_ctypes_structure_t be_lv_gradient_stop = { - 8, /* size in bytes */ - 3, /* number of elements */ - be_ctypes_instance_mappings, - (const be_ctypes_structure_item_t[3]) { - { "color", 0, 0, 0, ctypes_u24, 1 }, - { "frac", 4, 0, 0, ctypes_u8, 0 }, - { "opa", 3, 0, 0, ctypes_u8, 0 }, -}}; - const be_ctypes_structure_t be_lv_grad_dsc = { 12, /* size in bytes */ 9, /* number of elements */ @@ -93,9 +83,9 @@ const be_ctypes_structure_t be_lv_draw_dsc_base = { const be_ctypes_structure_t be_lv_draw_rect_dsc = { 112, /* size in bytes */ - 40, /* number of elements */ + 41, /* number of elements */ be_ctypes_instance_mappings, - (const be_ctypes_structure_item_t[40]) { + (const be_ctypes_structure_item_t[41]) { { "base_dsc_size", 20, 0, 0, ctypes_u32, 0 }, { "base_id1", 8, 0, 0, ctypes_u32, 0 }, { "base_id2", 12, 0, 0, ctypes_u32, 0 }, @@ -103,39 +93,40 @@ const be_ctypes_structure_t be_lv_draw_rect_dsc = { { "base_obj", 0, 0, 0, ctypes_ptr32, 0 }, { "base_part", 4, 0, 0, ctypes_u32, 0 }, { "base_user_data", 24, 0, 0, ctypes_ptr32, 0 }, - { "bg_color", 33, 0, 0, ctypes_u24, 1 }, - { "bg_grad_dir", 47, 0, 4, ctypes_bf, 0 }, - { "bg_grad_extend", 47, 4, 3, ctypes_bf, 0 }, - { "bg_grad_stops_0_color", 36, 0, 0, ctypes_u24, 1 }, - { "bg_grad_stops_0_frac", 40, 0, 0, ctypes_u8, 0 }, - { "bg_grad_stops_0_opa", 39, 0, 0, ctypes_u8, 0 }, - { "bg_grad_stops_1_color", 41, 0, 0, ctypes_u24, 1 }, - { "bg_grad_stops_1_frac", 45, 0, 0, ctypes_u8, 0 }, - { "bg_grad_stops_1_opa", 44, 0, 0, ctypes_u8, 0 }, - { "bg_grad_stops_count", 46, 0, 0, ctypes_u8, 0 }, - { "bg_img_opa", 59, 0, 0, ctypes_u8, 0 }, - { "bg_img_recolor", 56, 0, 0, ctypes_u24, 1 }, - { "bg_img_recolor_opa", 60, 0, 0, ctypes_u8, 0 }, - { "bg_img_src", 48, 0, 0, ctypes_ptr32, 0 }, - { "bg_img_symbol_font", 52, 0, 0, ctypes_ptr32, 0 }, - { "bg_img_tiled", 61, 0, 0, ctypes_u8, 0 }, - { "bg_opa", 32, 0, 0, ctypes_u8, 0 }, - { "border_color", 62, 0, 0, ctypes_u24, 1 }, - { "border_opa", 72, 0, 0, ctypes_u8, 0 }, - { "border_post", 73, 5, 1, ctypes_bf, 0 }, - { "border_side", 73, 0, 5, ctypes_bf, 0 }, - { "border_width", 68, 0, 0, ctypes_i32, 0 }, - { "outline_color", 74, 0, 0, ctypes_u24, 1 }, - { "outline_opa", 88, 0, 0, ctypes_u8, 0 }, - { "outline_pad", 84, 0, 0, ctypes_i32, 0 }, - { "outline_width", 80, 0, 0, ctypes_i32, 0 }, + { "bg_color", 56, 0, 0, ctypes_u24, 1 }, + { "bg_grad_dir", 71, 0, 4, ctypes_bf, 0 }, + { "bg_grad_extend", 71, 4, 3, ctypes_bf, 0 }, + { "bg_grad_stops_0_color", 60, 0, 0, ctypes_u24, 1 }, + { "bg_grad_stops_0_frac", 64, 0, 0, ctypes_u8, 0 }, + { "bg_grad_stops_0_opa", 63, 0, 0, ctypes_u8, 0 }, + { "bg_grad_stops_1_color", 65, 0, 0, ctypes_u24, 1 }, + { "bg_grad_stops_1_frac", 69, 0, 0, ctypes_u8, 0 }, + { "bg_grad_stops_1_opa", 68, 0, 0, ctypes_u8, 0 }, + { "bg_grad_stops_count", 70, 0, 0, ctypes_u8, 0 }, + { "bg_image_colorkey", 52, 0, 0, ctypes_ptr32, 0 }, + { "bg_img_opa", 43, 0, 0, ctypes_u8, 0 }, + { "bg_img_recolor", 40, 0, 0, ctypes_u24, 1 }, + { "bg_img_recolor_opa", 44, 0, 0, ctypes_u8, 0 }, + { "bg_img_src", 32, 0, 0, ctypes_ptr32, 0 }, + { "bg_img_symbol_font", 36, 0, 0, ctypes_ptr32, 0 }, + { "bg_img_tiled", 45, 0, 0, ctypes_u8, 0 }, + { "bg_opa", 46, 0, 0, ctypes_u8, 0 }, + { "border_color", 72, 0, 0, ctypes_u24, 1 }, + { "border_opa", 47, 0, 0, ctypes_u8, 0 }, + { "border_post", 80, 5, 1, ctypes_bf, 0 }, + { "border_side", 80, 0, 5, ctypes_bf, 0 }, + { "border_width", 76, 0, 0, ctypes_i32, 0 }, + { "outline_color", 81, 0, 0, ctypes_u24, 1 }, + { "outline_opa", 48, 0, 0, ctypes_u8, 0 }, + { "outline_pad", 88, 0, 0, ctypes_i32, 0 }, + { "outline_width", 84, 0, 0, ctypes_i32, 0 }, { "radius", 28, 0, 0, ctypes_i32, 0 }, - { "shadow_color", 89, 0, 0, ctypes_u24, 1 }, - { "shadow_ofs_x", 96, 0, 0, ctypes_i32, 0 }, - { "shadow_ofs_y", 100, 0, 0, ctypes_i32, 0 }, - { "shadow_opa", 108, 0, 0, ctypes_u8, 0 }, - { "shadow_spread", 104, 0, 0, ctypes_i32, 0 }, - { "shadow_width", 92, 0, 0, ctypes_i32, 0 }, + { "shadow_color", 92, 0, 0, ctypes_u24, 1 }, + { "shadow_ofs_x", 100, 0, 0, ctypes_i32, 0 }, + { "shadow_ofs_y", 104, 0, 0, ctypes_i32, 0 }, + { "shadow_opa", 49, 0, 0, ctypes_u8, 0 }, + { "shadow_spread", 108, 0, 0, ctypes_i32, 0 }, + { "shadow_width", 96, 0, 0, ctypes_i32, 0 }, }}; const be_ctypes_structure_t be_lv_draw_line_dsc = { @@ -165,7 +156,7 @@ const be_ctypes_structure_t be_lv_draw_line_dsc = { }}; const be_ctypes_structure_t be_lv_draw_arc_dsc = { - 64, /* size in bytes */ + 60, /* size in bytes */ 17, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[17]) { @@ -180,10 +171,10 @@ const be_ctypes_structure_t be_lv_draw_arc_dsc = { { "center_y", 48, 0, 0, ctypes_i32, 0 }, { "color", 28, 0, 0, ctypes_u24, 1 }, { "end_angle", 40, 0, 0, ctypes_i32, 0 }, - { "img_src", 56, 0, 0, ctypes_ptr32, 0 }, - { "opa", 60, 0, 0, ctypes_u8, 0 }, - { "radius", 52, 0, 0, ctypes_u16, 0 }, - { "rounded", 61, 0, 1, ctypes_bf, 0 }, + { "img_src", 52, 0, 0, ctypes_ptr32, 0 }, + { "opa", 58, 0, 0, ctypes_u8, 0 }, + { "radius", 56, 0, 0, ctypes_u16, 0 }, + { "rounded", 59, 0, 1, ctypes_bf, 0 }, { "start_angle", 36, 0, 0, ctypes_i32, 0 }, { "width", 32, 0, 0, ctypes_i32, 0 }, }}; @@ -203,10 +194,10 @@ const be_ctypes_structure_t be_lv_image_header = { }}; const be_ctypes_structure_t be_lv_draw_image_dsc = { - 108, /* size in bytes */ - 35, /* number of elements */ + 112, /* size in bytes */ + 36, /* number of elements */ be_ctypes_instance_mappings, - (const be_ctypes_structure_item_t[35]) { + (const be_ctypes_structure_item_t[36]) { { "antialias", 81, 4, 1, ctypes_bf, 0 }, { "base_dsc_size", 20, 0, 0, ctypes_u32, 0 }, { "base_id1", 8, 0, 0, ctypes_u32, 0 }, @@ -215,7 +206,7 @@ const be_ctypes_structure_t be_lv_draw_image_dsc = { { "base_obj", 0, 0, 0, ctypes_ptr32, 0 }, { "base_part", 4, 0, 0, ctypes_u32, 0 }, { "base_user_data", 24, 0, 0, ctypes_ptr32, 0 }, - { "bitmap_mask_src", 104, 0, 0, ctypes_ptr32, 0 }, + { "bitmap_mask_src", 108, 0, 0, ctypes_ptr32, 0 }, { "blend_mode", 81, 0, 4, ctypes_bf, 0 }, { "clip_radius", 44, 0, 0, ctypes_i32, 0 }, { "header_cf", 33, 0, 0, ctypes_u8, 0 }, @@ -225,10 +216,11 @@ const be_ctypes_structure_t be_lv_draw_image_dsc = { { "header_reserved_2", 42, 0, 0, ctypes_u16, 0 }, { "header_stride", 40, 0, 0, ctypes_u16, 0 }, { "header_w", 36, 0, 0, ctypes_u16, 0 }, - { "image_area_x1", 88, 0, 0, ctypes_i32, 0 }, - { "image_area_x2", 96, 0, 0, ctypes_i32, 0 }, - { "image_area_y1", 92, 0, 0, ctypes_i32, 0 }, - { "image_area_y2", 100, 0, 0, ctypes_i32, 0 }, + { "image_area_x1", 92, 0, 0, ctypes_i32, 0 }, + { "image_area_x2", 100, 0, 0, ctypes_i32, 0 }, + { "image_area_y1", 96, 0, 0, ctypes_i32, 0 }, + { "image_area_y2", 104, 0, 0, ctypes_i32, 0 }, + { "lv_image_colorkey_t", 84, 0, 0, ctypes_ptr32, 0 }, { "opa", 80, 0, 0, ctypes_u8, 0 }, { "pivot_x", 68, 0, 0, ctypes_i32, 0 }, { "pivot_y", 72, 0, 0, ctypes_i32, 0 }, @@ -240,7 +232,7 @@ const be_ctypes_structure_t be_lv_draw_image_dsc = { { "skew_x", 60, 0, 0, ctypes_i32, 0 }, { "skew_y", 64, 0, 0, ctypes_i32, 0 }, { "src", 28, 0, 0, ctypes_ptr32, 0 }, - { "sup", 84, 0, 0, ctypes_ptr32, 0 }, + { "sup", 88, 0, 0, ctypes_ptr32, 0 }, { "tile", 81, 5, 1, ctypes_bf, 0 }, }}; @@ -249,7 +241,7 @@ const be_ctypes_structure_t be_lv_draw_label_dsc = { 35, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[35]) { - { "align", 89, 0, 0, ctypes_u8, 0 }, + { "align", 88, 0, 0, ctypes_u8, 0 }, { "base_dsc_size", 20, 0, 0, ctypes_u32, 0 }, { "base_id1", 8, 0, 0, ctypes_u32, 0 }, { "base_id2", 12, 0, 0, ctypes_u32, 0 }, @@ -257,21 +249,21 @@ const be_ctypes_structure_t be_lv_draw_label_dsc = { { "base_obj", 0, 0, 0, ctypes_ptr32, 0 }, { "base_part", 4, 0, 0, ctypes_u32, 0 }, { "base_user_data", 24, 0, 0, ctypes_ptr32, 0 }, - { "bidi_dir", 90, 0, 0, ctypes_u8, 0 }, - { "blend_mode", 93, 0, 3, ctypes_bf, 0 }, + { "bidi_dir", 89, 0, 0, ctypes_u8, 0 }, + { "blend_mode", 94, 0, 3, ctypes_bf, 0 }, { "color", 44, 0, 0, ctypes_u24, 1 }, - { "decor", 92, 0, 3, ctypes_bf, 0 }, - { "flag", 92, 3, 5, ctypes_bf, 0 }, + { "decor", 93, 0, 3, ctypes_bf, 0 }, + { "flag", 93, 3, 5, ctypes_bf, 0 }, { "font", 40, 0, 0, ctypes_ptr32, 0 }, - { "has_bided", 93, 5, 1, ctypes_bf, 0 }, + { "has_bided", 94, 5, 1, ctypes_bf, 0 }, { "hint", 96, 0, 0, ctypes_ptr32, 0 }, { "letter_space", 52, 0, 0, ctypes_i32, 0 }, { "line_space", 48, 0, 0, ctypes_i32, 0 }, { "ofs_x", 56, 0, 0, ctypes_i32, 0 }, { "ofs_y", 60, 0, 0, ctypes_i32, 0 }, - { "opa", 88, 0, 0, ctypes_u8, 0 }, - { "outline_stroke_color", 101, 0, 0, ctypes_u24, 1 }, - { "outline_stroke_opa", 100, 0, 0, ctypes_u8, 0 }, + { "opa", 90, 0, 0, ctypes_u8, 0 }, + { "outline_stroke_color", 100, 0, 0, ctypes_u24, 1 }, + { "outline_stroke_opa", 91, 0, 0, ctypes_u8, 0 }, { "outline_stroke_width", 104, 0, 0, ctypes_i32, 0 }, { "rotation", 64, 0, 0, ctypes_i32, 0 }, { "sel_bg_color", 79, 0, 0, ctypes_u24, 1 }, @@ -280,10 +272,10 @@ const be_ctypes_structure_t be_lv_draw_label_dsc = { { "sel_start", 68, 0, 0, ctypes_u32, 0 }, { "text", 28, 0, 0, ctypes_ptr32, 0 }, { "text_length", 84, 0, 0, ctypes_u32, 0 }, - { "text_local", 93, 3, 1, ctypes_bf, 0 }, + { "text_local", 94, 3, 1, ctypes_bf, 0 }, { "text_size_x", 32, 0, 0, ctypes_i32, 0 }, { "text_size_y", 36, 0, 0, ctypes_i32, 0 }, - { "text_static", 93, 4, 1, ctypes_bf, 0 }, + { "text_static", 94, 4, 1, ctypes_bf, 0 }, }}; const be_ctypes_structure_t be_lv_chart_series = { @@ -337,9 +329,9 @@ const be_ctypes_structure_t be_lv_obj_class = { const be_ctypes_structure_t be_lv_event = { 28, /* size in bytes */ - 9, /* number of elements */ + 10, /* number of elements */ be_ctypes_instance_mappings, - (const be_ctypes_structure_item_t[9]) { + (const be_ctypes_structure_item_t[10]) { { "code", 8, 0, 0, ctypes_i32, 0 }, { "current_target", 0, 0, 0, ctypes_ptr32, 0 }, { "deleted", 24, 0, 1, ctypes_bf, 0 }, @@ -348,6 +340,7 @@ const be_ctypes_structure_t be_lv_event = { { "prev", 20, 0, 0, ctypes_ptr32, 0 }, { "stop_bubbling", 24, 2, 1, ctypes_bf, 0 }, { "stop_processing", 24, 1, 1, ctypes_bf, 0 }, + { "stop_trickling", 24, 3, 1, ctypes_bf, 0 }, { "user_data", 12, 0, 0, ctypes_ptr32, 0 }, }}; @@ -381,32 +374,46 @@ const be_ctypes_structure_t be_lv_style_transition_dsc = { { "user_data", 4, 0, 0, ctypes_ptr32, 0 }, }}; +const be_ctypes_structure_t be_lv_anim_timeline_dsc = { + 28, /* size in bytes */ + 7, /* number of elements */ + be_ctypes_instance_mappings, + (const be_ctypes_structure_item_t[7]) { + { "act_time", 8, 0, 0, ctypes_u32, 0 }, + { "anim_dsc", 0, 0, 0, ctypes_ptr32, 0 }, + { "anim_dsc_cnt", 4, 0, 0, ctypes_u32, 0 }, + { "delay", 12, 0, 0, ctypes_u32, 0 }, + { "repeat_count", 16, 0, 0, ctypes_u32, 0 }, + { "repeat_delay", 20, 0, 0, ctypes_u32, 0 }, + { "user_data", 24, 0, 0, ctypes_ptr32, 0 }, +}}; + const be_ctypes_structure_t be_lv_layer = { 84, /* size in bytes */ 21, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[21]) { - { "_clip_area_x1", 24, 0, 0, ctypes_i32, 0 }, - { "_clip_area_x2", 32, 0, 0, ctypes_i32, 0 }, - { "_clip_area_y1", 28, 0, 0, ctypes_i32, 0 }, - { "_clip_area_y2", 36, 0, 0, ctypes_i32, 0 }, - { "buf_area_x1", 4, 0, 0, ctypes_i32, 0 }, - { "buf_area_x2", 12, 0, 0, ctypes_i32, 0 }, - { "buf_area_y1", 8, 0, 0, ctypes_i32, 0 }, - { "buf_area_y2", 16, 0, 0, ctypes_i32, 0 }, - { "color_format", 20, 0, 0, ctypes_u32, 0 }, + { "_clip_area_x1", 52, 0, 0, ctypes_i32, 0 }, + { "_clip_area_x2", 60, 0, 0, ctypes_i32, 0 }, + { "_clip_area_y1", 56, 0, 0, ctypes_i32, 0 }, + { "_clip_area_y2", 64, 0, 0, ctypes_i32, 0 }, + { "buf_area_x1", 20, 0, 0, ctypes_i32, 0 }, + { "buf_area_x2", 28, 0, 0, ctypes_i32, 0 }, + { "buf_area_y1", 24, 0, 0, ctypes_i32, 0 }, + { "buf_area_y2", 32, 0, 0, ctypes_i32, 0 }, + { "color_format", 76, 0, 0, ctypes_u32, 0 }, { "draw_buf", 0, 0, 0, ctypes_ptr32, 0 }, - { "draw_task_head", 68, 0, 0, ctypes_ptr32, 0 }, - { "next", 76, 0, 0, ctypes_ptr32, 0 }, - { "opa", 56, 0, 0, ctypes_u8, 0 }, - { "parent", 72, 0, 0, ctypes_ptr32, 0 }, - { "partial_y_offset", 64, 0, 0, ctypes_i32, 0 }, - { "phy_clip_area_x1", 40, 0, 0, ctypes_i32, 0 }, - { "phy_clip_area_x2", 48, 0, 0, ctypes_i32, 0 }, - { "phy_clip_area_y1", 44, 0, 0, ctypes_i32, 0 }, - { "phy_clip_area_y2", 52, 0, 0, ctypes_i32, 0 }, - { "recolor", 60, 0, 0, ctypes_u32, 0 }, - { "user_data", 80, 0, 0, ctypes_ptr32, 0 }, + { "draw_task_head", 4, 0, 0, ctypes_ptr32, 0 }, + { "next", 12, 0, 0, ctypes_ptr32, 0 }, + { "opa", 80, 0, 0, ctypes_u8, 0 }, + { "parent", 8, 0, 0, ctypes_ptr32, 0 }, + { "partial_y_offset", 68, 0, 0, ctypes_i32, 0 }, + { "phy_clip_area_x1", 36, 0, 0, ctypes_i32, 0 }, + { "phy_clip_area_x2", 44, 0, 0, ctypes_i32, 0 }, + { "phy_clip_area_y1", 40, 0, 0, ctypes_i32, 0 }, + { "phy_clip_area_y2", 48, 0, 0, ctypes_i32, 0 }, + { "recolor", 72, 0, 0, ctypes_u32, 0 }, + { "user_data", 16, 0, 0, ctypes_ptr32, 0 }, }}; const be_ctypes_structure_t be_lv_color_filter_dsc = { @@ -419,13 +426,13 @@ const be_ctypes_structure_t be_lv_color_filter_dsc = { }}; const be_ctypes_structure_t be_lv_timer_ntv = { - 24, /* size in bytes */ + 28, /* size in bytes */ 7, /* number of elements */ be_ctypes_instance_mappings, (const be_ctypes_structure_item_t[7]) { - { "auto_delete", 20, 1, 1, ctypes_bf, 0 }, + { "auto_delete", 24, 0, 1, ctypes_bf, 0 }, { "last_run", 4, 0, 0, ctypes_u32, 0 }, - { "paused", 20, 0, 1, ctypes_bf, 0 }, + { "paused", 20, 0, 0, ctypes_i32, 0 }, { "period", 0, 0, 0, ctypes_u32, 0 }, { "repeat_count", 16, 0, 0, ctypes_i32, 0 }, { "timer_cb", 8, 0, 0, ctypes_ptr32, 0 }, @@ -498,7 +505,7 @@ const be_ctypes_structure_t be_lv_draw_letter_dsc = { { "base_obj", 0, 0, 0, ctypes_ptr32, 0 }, { "base_part", 4, 0, 0, ctypes_u32, 0 }, { "base_user_data", 24, 0, 0, ctypes_ptr32, 0 }, - { "blend_mode", 69, 3, 3, ctypes_bf, 0 }, + { "blend_mode", 69, 3, 4, ctypes_bf, 0 }, { "color", 36, 0, 0, ctypes_u24, 1 }, { "decor", 69, 0, 3, ctypes_bf, 0 }, { "font", 32, 0, 0, ctypes_ptr32, 0 }, @@ -521,6 +528,7 @@ static const char * be_ctypes_instance_mappings[] = { NULL }; +static be_define_ctypes_class(lv_anim_timeline_dsc, &be_lv_anim_timeline_dsc, &be_class_ctypes_bytes, "lv_anim_timeline_dsc"); static be_define_ctypes_class(lv_area, &be_lv_area, &be_class_ctypes_bytes, "lv_area"); static be_define_ctypes_class(lv_chart_cursor, &be_lv_chart_cursor, &be_class_ctypes_bytes, "lv_chart_cursor"); static be_define_ctypes_class(lv_chart_series, &be_lv_chart_series, &be_class_ctypes_bytes, "lv_chart_series"); @@ -537,7 +545,6 @@ static be_define_ctypes_class(lv_event_dsc, &be_lv_event_dsc, &be_class_ctypes_b static be_define_ctypes_class(lv_font_info, &be_lv_font_info, &be_class_ctypes_bytes, "lv_font_info"); static be_define_ctypes_class(lv_grad_dsc, &be_lv_grad_dsc, &be_class_ctypes_bytes, "lv_grad_dsc"); static be_define_ctypes_class(lv_grad_stop, &be_lv_grad_stop, &be_class_ctypes_bytes, "lv_grad_stop"); -static be_define_ctypes_class(lv_gradient_stop, &be_lv_gradient_stop, &be_class_ctypes_bytes, "lv_gradient_stop"); static be_define_ctypes_class(lv_image_dsc, &be_lv_image_dsc, &be_class_ctypes_bytes, "lv_image_dsc"); static be_define_ctypes_class(lv_image_header, &be_lv_image_header, &be_class_ctypes_bytes, "lv_image_header"); static be_define_ctypes_class(lv_layer, &be_lv_layer, &be_class_ctypes_bytes, "lv_layer"); @@ -550,6 +557,7 @@ static be_define_ctypes_class(lv_timer_ntv, &be_lv_timer_ntv, &be_class_ctypes_b static be_define_ctypes_class(lv_ts_calibration, &be_lv_ts_calibration, &be_class_ctypes_bytes, "lv_ts_calibration"); be_ctypes_class_by_name_t be_ctypes_lvgl_classes[] = { + { "lv_anim_timeline_dsc", &be_class_lv_anim_timeline_dsc }, { "lv_area", &be_class_lv_area }, { "lv_chart_cursor", &be_class_lv_chart_cursor }, { "lv_chart_series", &be_class_lv_chart_series }, @@ -566,7 +574,6 @@ be_ctypes_class_by_name_t be_ctypes_lvgl_classes[] = { { "lv_font_info", &be_class_lv_font_info }, { "lv_grad_dsc", &be_class_lv_grad_dsc }, { "lv_grad_stop", &be_class_lv_grad_stop }, - { "lv_gradient_stop", &be_class_lv_gradient_stop }, { "lv_image_dsc", &be_class_lv_image_dsc }, { "lv_image_header", &be_class_lv_image_header }, { "lv_layer", &be_class_lv_layer }, diff --git a/lib/libesp32_lvgl/lv_binding_berry/src/embedded/lvgl_ctypes.py b/lib/libesp32_lvgl/lv_binding_berry/src/embedded/lvgl_ctypes.py index 148ab33d5..c10ffa39c 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/src/embedded/lvgl_ctypes.py +++ b/lib/libesp32_lvgl/lv_binding_berry/src/embedded/lvgl_ctypes.py @@ -52,7 +52,7 @@ int32_t = ct.i32 size_t = ct.u32 ptr = ct.ptr32 -lv_point = [ # valid LVGL93 +lv_point = [ # valid LVGL94 [int32_t, "x"], [int32_t, "y"], ] @@ -62,13 +62,13 @@ lv_point = ct.structure(lv_point, "lv_point") # lv_value_precise_t x; # lv_value_precise_t y; # } lv_point_precise_t; -lv_point_precise = [ # valid LVGL93 +lv_point_precise = [ # valid LVGL94 [lv_value_precise, "x"], [lv_value_precise, "y"], ] lv_point_precise = ct.structure(lv_point_precise, "lv_point_precise") -lv_area = [ # valid LVGL93 +lv_area = [ # valid LVGL94 [int32_t, "x1"], [int32_t, "y1"], [int32_t, "x2"], @@ -83,13 +83,12 @@ lv_area = ct.structure(lv_area, "lv_area") # lv_opa_t opa; /**< The opacity of the color*/ # uint8_t frac; /**< The stop position in 1/255 unit */ # } lv_grad_stop_t; -lv_gradient_stop = [ # valid LVGL93 +lv_grad_stop = [ # valid LVGL94 [lv_color, "color"], [lv_opa, "opa"], [uint8_t, "frac"], ] -lv_grad_stop = ct.structure(lv_gradient_stop, "lv_grad_stop") -lv_gradient_stop = ct.structure(lv_gradient_stop, "lv_gradient_stop") +lv_grad_stop = ct.structure(lv_grad_stop, "lv_grad_stop") # typedef struct { # lv_grad_stop_t stops[LV_GRADIENT_MAX_STOPS]; /**< A gradient stop array */ @@ -124,7 +123,7 @@ lv_gradient_stop = ct.structure(lv_gradient_stop, "lv_gradient_stop") # void * state; # #endif # } lv_grad_dsc_t; -lv_grad_dsc = [ # valid LVGL93 +lv_grad_dsc = [ # valid LVGL94 # since it's an array and not two structures, we need to explicitly unroll it here or the alignment is wrong # [lv_gradient_stop, "stops_0"], [lv_color, "stops_0_color"], @@ -164,7 +163,7 @@ lv_grad_dsc = ct.structure(lv_grad_dsc, "lv_grad_dsc") # /**Any custom user data*/ # void * user_data; # } lv_draw_dsc_base_t; -lv_draw_dsc_base = [ # valid LVGL93 +lv_draw_dsc_base = [ # valid LVGL94 [ptr, "obj"], [uint32_t, "part"], [uint32_t, "id1"], @@ -180,11 +179,6 @@ lv_draw_dsc_base = ct.structure(lv_draw_dsc_base, "lv_draw_dsc_base") # int32_t radius; -# /*Background*/ -# lv_opa_t bg_opa; -# lv_color_t bg_color; /**< First element of a gradient is a color, so it maps well here*/ -# lv_grad_dsc_t bg_grad; - # /*Background img*/ # const void * bg_image_src; # const void * bg_image_symbol_font; @@ -192,11 +186,24 @@ lv_draw_dsc_base = ct.structure(lv_draw_dsc_base, "lv_draw_dsc_base") # lv_opa_t bg_image_opa; # lv_opa_t bg_image_recolor_opa; # uint8_t bg_image_tiled; +# /*Background*/ +# lv_opa_t bg_opa; +# /*Border*/ +# lv_opa_t border_opa; +# /*Outline */ +# lv_opa_t outline_opa; +# /*Shadow*/ +# lv_opa_t shadow_opa; + +# /*Background*/ +# lv_color_t bg_color; /**< First element of a gradient is a color, so it maps well here*/ +# lv_grad_dsc_t bg_grad; + +# const lv_image_colorkey_t * bg_image_colorkey; # /*Border*/ # lv_color_t border_color; # int32_t border_width; -# lv_opa_t border_opa; # lv_border_side_t border_side : 5; # uint8_t border_post : 1; /*The border will be drawn later*/ @@ -204,7 +211,6 @@ lv_draw_dsc_base = ct.structure(lv_draw_dsc_base, "lv_draw_dsc_base") # lv_color_t outline_color; # int32_t outline_width; # int32_t outline_pad; -# lv_opa_t outline_opa; # /*Shadow*/ # lv_color_t shadow_color; @@ -212,18 +218,12 @@ lv_draw_dsc_base = ct.structure(lv_draw_dsc_base, "lv_draw_dsc_base") # int32_t shadow_offset_x; # int32_t shadow_offset_y; # int32_t shadow_spread; -# lv_opa_t shadow_opa; # } lv_draw_rect_dsc_t; -lv_draw_rect_dsc = [ # valid LVGL93 +lv_draw_rect_dsc = [ # valid LVGL94 [lv_draw_dsc_base, "base"], [int32_t, "radius"], - #/*Background*/ - [lv_opa, "bg_opa"], - [lv_color, "bg_color"], - [lv_grad_dsc, "bg_grad"], - #/*Background img*/ [ptr, "bg_img_src"], [ptr, "bg_img_symbol_font"], @@ -232,10 +232,20 @@ lv_draw_rect_dsc = [ # valid LVGL93 [lv_opa, "bg_img_recolor_opa"], [uint8_t, "bg_img_tiled"], + #/*Background*/ + [lv_opa, "bg_opa"], + [lv_opa, "border_opa"], + [lv_opa, "outline_opa"], + [lv_opa, "shadow_opa"], + + [ptr, "bg_image_colorkey"], + + [lv_color, "bg_color"], + [lv_grad_dsc, "bg_grad"], + #/*Border*/ [lv_color, "border_color"], [int32_t, "border_width"], - [lv_opa, "border_opa"], [uint8_t_5, "border_side"], [uint8_t_1, "border_post"], @@ -243,7 +253,6 @@ lv_draw_rect_dsc = [ # valid LVGL93 [lv_color, "outline_color"], [int32_t, "outline_width"], [int32_t, "outline_pad"], - [lv_opa, "outline_opa"], #/*Shadow*/ [lv_color, "shadow_color"], @@ -251,7 +260,6 @@ lv_draw_rect_dsc = [ # valid LVGL93 [int32_t, "shadow_ofs_x"], [int32_t, "shadow_ofs_y"], [int32_t, "shadow_spread"], - [lv_opa, "shadow_opa"], ] lv_draw_rect_dsc = ct.structure(lv_draw_rect_dsc, "lv_draw_rect_dsc") @@ -289,7 +297,7 @@ lv_draw_rect_dsc = ct.structure(lv_draw_rect_dsc, "lv_draw_rect_dsc") # /**1: Do not bother with line ending (if it's not visible for any reason) */ # uint8_t raw_end : 1; # } lv_draw_line_dsc_t; -lv_draw_line_dsc = [ # valid LVGL93 +lv_draw_line_dsc = [ # valid LVGL94 [lv_draw_dsc_base, "base"], [lv_point_precise, "p1"], @@ -324,12 +332,12 @@ lv_draw_line_dsc = ct.structure(lv_draw_line_dsc, "lv_draw_line_dsc") # /**The center point of the arc. */ # lv_point_t center; -# /**The outer radius of the arc*/ -# uint16_t radius; - # /**An image source to be used instead of `color`. `NULL` if unused*/ # const void * img_src; +# /**The outer radius of the arc*/ +# uint16_t radius; + # /**Opacity of the arc in 0...255 range. # * LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/ # lv_opa_t opa; @@ -337,7 +345,7 @@ lv_draw_line_dsc = ct.structure(lv_draw_line_dsc, "lv_draw_line_dsc") # /**1: Make the arc ends rounded*/ # uint8_t rounded : 1; # } lv_draw_arc_dsc_t; -lv_draw_arc_dsc = [ # valid LVGL93 +lv_draw_arc_dsc = [ # valid LVGL94 [lv_draw_dsc_base, "base"], [lv_color, "color"], @@ -345,8 +353,8 @@ lv_draw_arc_dsc = [ # valid LVGL93 [lv_value_precise, "start_angle"], [lv_value_precise, "end_angle"], [lv_point, "center"], - [uint16_t, "radius"], [ptr, "img_src"], + [uint16_t, "radius"], [lv_opa, "opa"], [uint8_t_1, "rounded"], ] @@ -363,7 +371,7 @@ lv_draw_arc_dsc = ct.structure(lv_draw_arc_dsc, "lv_draw_arc_dsc") # uint32_t stride: 16; /**< Number of bytes in a row*/ # uint32_t reserved_2: 16; /**< Reserved to be used later*/ # } lv_image_header_t; -lv_image_header = [ # valid LVGL93 +lv_image_header = [ # valid LVGL94 [uint8_t, "magic"], [uint8_t, "cf"], [uint16_t, "flags"], @@ -422,7 +430,7 @@ lv_image_header = ct.structure(lv_image_header, "lv_image_header") # */ # lv_blend_mode_t blend_mode : 4; -# /**1: perform the transformation with anti-alaising */ +# /**1: perform the transformation with anti-aliasing */ # uint16_t antialias : 1; # /**If the image is smaller than the `image_area` field of `lv_draw_image_dsc_t` @@ -430,6 +438,8 @@ lv_image_header = ct.structure(lv_image_header, "lv_image_header") # * `image_area` area*/ # uint16_t tile : 1; +# const lv_image_colorkey_t * colorkey; + # /**Used internally to store some information about the palette or the color of A8 images*/ # lv_draw_image_sup_t * sup; @@ -445,7 +455,7 @@ lv_image_header = ct.structure(lv_image_header, "lv_image_header") # * The mask is always center aligned. */ # const lv_image_dsc_t * bitmap_mask_src; # }; -lv_draw_image_dsc = [ # valid LVGL93 +lv_draw_image_dsc = [ # valid LVGL94 [lv_draw_dsc_base, "base"], [ptr, "src"], @@ -466,6 +476,7 @@ lv_draw_image_dsc = [ # valid LVGL93 [uint8_t_4, "blend_mode"], [uint8_t_1, "antialias"], [uint8_t_1, "tile"], + [ptr, "lv_image_colorkey_t"], [ptr, "sup"], [lv_area, "image_area"], @@ -519,16 +530,19 @@ lv_draw_image_dsc = ct.structure(lv_draw_image_dsc, "lv_draw_image_dsc") # /**The number of characters to render. 0: means render until reaching the `\0` termination.*/ # uint32_t text_length; -# /**Opacity of the text in 0...255 range. -# * LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/ -# lv_opa_t opa; - # /**The alignment of the text `LV_TEXT_ALIGN_LEFT/RIGHT/CENTER`*/ # lv_text_align_t align; # /**The base direction. Used when type setting Right-to-left (e.g. Arabic) texts*/ # lv_base_dir_t bidi_dir; +# /**Opacity of the text in 0...255 range. +# * LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well*/ +# lv_opa_t opa; + +# /**Letter outline stroke opacity */ +# lv_opa_t outline_stroke_opa; + # /**Text decoration, e.g. underline*/ # lv_text_decor_t decor : 3; @@ -550,12 +564,11 @@ lv_draw_image_dsc = ct.structure(lv_draw_image_dsc, "lv_draw_image_dsc") # lv_draw_label_hint_t * hint; # /* Properties of the letter outlines */ -# lv_opa_t outline_stroke_opa; # lv_color_t outline_stroke_color; # int32_t outline_stroke_width; # } lv_draw_label_dsc_t; -lv_draw_label_dsc = [ # valid LVGL93 +lv_draw_label_dsc = [ # valid LVGL94 [lv_draw_dsc_base, "base"], [ptr, "text"], [lv_point, "text_size"], @@ -571,9 +584,10 @@ lv_draw_label_dsc = [ # valid LVGL93 [lv_color, "sel_color"], [lv_color, "sel_bg_color"], [uint32_t, "text_length"], - [lv_opa, "opa"], [lv_text_align, "align"], [lv_base_dir, "bidi_dir"], + [lv_opa, "opa"], + [lv_opa, "outline_stroke_opa"], [lv_text_flag, "flag"], [uint8_t_3, "decor"], [uint8_t_5, "flag"], @@ -582,7 +596,6 @@ lv_draw_label_dsc = [ # valid LVGL93 [uint8_t_1, "text_static"], [uint8_t_1, "has_bided"], [ptr, "hint"], - [lv_opa, "outline_stroke_opa"], [lv_color, "outline_stroke_color"], [int32_t, "outline_stroke_width"], ] @@ -599,7 +612,7 @@ lv_draw_label_dsc = ct.structure(lv_draw_label_dsc, "lv_draw_label_dsc") # uint32_t x_axis_sec : 1; # uint32_t y_axis_sec : 1; # }; -lv_chart_series = [ # valid LVGL93 +lv_chart_series = [ # valid LVGL94 [ptr, "x_points"], [ptr, "y_points"], [lv_color, "color"], @@ -620,7 +633,7 @@ lv_chart_series = ct.structure(lv_chart_series, "lv_chart_series") # lv_dir_t dir; # uint32_t pos_set: 1; /**< 1: pos is set; 0: point_id is set */ # }; -lv_chart_cursor = [ # valid LVGL93 +lv_chart_cursor = [ # valid LVGL94 [lv_point, "pos"], [int32_t, "point_id"], [lv_color, "color"], @@ -671,7 +684,7 @@ lv_event_code = ct.i32 # uint32_t instance_size : 16; # uint32_t theme_inheritable : 1; /**< Value from ::lv_obj_class_theme_inheritable_t*/ # }; -lv_obj_class = [ # valid LVGL93 +lv_obj_class = [ # valid LVGL94 [lv_obj_class_ptr, "base_class"], [constructor_cb, "constructor_cb"], [destructor_cb, "destructor_cb"], @@ -697,8 +710,9 @@ lv_obj_class = ct.structure(lv_obj_class, "lv_obj_class") # uint8_t deleted : 1; # uint8_t stop_processing : 1; # uint8_t stop_bubbling : 1; +# uint8_t stop_trickling : 1; # }; -lv_event = [ # valid LVGL93 +lv_event = [ # valid LVGL94 [lv_obj_ptr, "current_target"], [lv_obj_ptr, "original_target"], [lv_event_code, "code"], @@ -708,6 +722,7 @@ lv_event = [ # valid LVGL93 [uint8_t_1, "deleted"], [uint8_t_1, "stop_processing"], [uint8_t_1, "stop_bubbling"], + [uint8_t_1, "stop_trickling"], ] lv_event = ct.structure(lv_event, "lv_event") @@ -721,7 +736,7 @@ lv_event = ct.structure(lv_event, "lv_event") # const void * reserved; /**< A reserved field to make it has same size as lv_draw_buf_t*/ # const void * reserved_2; /**< A reserved field to make it has same size as lv_draw_buf_t*/ # } lv_image_dsc_t; -lv_image_dsc = [ # valid LVGL93 +lv_image_dsc = [ # valid LVGL94 [lv_image_header, "header"], [uint32_t, "data_size"], [ptr, "data"], @@ -740,7 +755,7 @@ lv_image_dsc = ct.structure(lv_image_dsc, "lv_image_dsc") # uint32_t time; /**< Duration of the transition in [ms]*/ # uint32_t delay; /**< Delay before the transition in [ms]*/ # } lv_style_transition_dsc_t; -lv_style_transition_dsc = [ # valid LVGL93 +lv_style_transition_dsc = [ # valid LVGL94 [ptr, "props"], [ptr, "user_data"], [ptr, "path_xcb"], @@ -749,17 +764,53 @@ lv_style_transition_dsc = [ # valid LVGL93 ] lv_style_transition_dsc = ct.structure(lv_style_transition_dsc, "lv_style_transition_dsc") +####################################################################### +# lv_anim_timeline + +# /*Data of anim_timeline*/ +# struct _lv_anim_timeline_t { +# struct _lv_anim_timeline_dsc_t * anim_dsc; +# uint32_t anim_dsc_cnt; +# uint32_t act_time; +# bool reverse; +# uint32_t delay; +# uint32_t repeat_count; +# uint32_t repeat_delay; +# void * user_data; +# }; +lv_anim_timeline_dsc = [ # valid LVGL94 + [ptr, "anim_dsc"], + [uint32_t, "anim_dsc_cnt"], + [uint32_t, "act_time"], + [bool, "reverse"], + [uint32_t, "delay"], + [uint32_t, "repeat_count"], + [uint32_t, "repeat_delay"], + [ptr, "user_data"], +] +lv_anim_timeline_dsc = ct.structure(lv_anim_timeline_dsc, "lv_anim_timeline_dsc") # struct _lv_layer_t { - -# /** Target draw buffer of the layer*/ +# /** Target draw buffer of the layer */ # lv_draw_buf_t * draw_buf; +# /** Linked list of draw tasks */ +# lv_draw_task_t * draw_task_head; + +# /** Parent layer */ +# lv_layer_t * parent; + +# /** Next layer */ +# lv_layer_t * next; + +# /** User data */ +# void * user_data; + # /** The absolute coordinates of the buffer */ # lv_area_t buf_area; -# /** The color format of the layer. LV_COLOR_FORMAT_... */ -# lv_color_format_t color_format; +# /** The physical clipping area relative to the display */ +# lv_area_t phy_clip_area; # /** # * NEVER USE IT DRAW UNITS. USED INTERNALLY DURING DRAW TASK CREATION. @@ -771,47 +822,43 @@ lv_style_transition_dsc = ct.structure(lv_style_transition_dsc, "lv_style_transi # */ # lv_area_t _clip_area; -# /** -# * The physical clipping area relative to the display. -# */ -# lv_area_t phy_clip_area; - # #if LV_DRAW_TRANSFORM_USE_MATRIX # /** Transform matrix to be applied when rendering the layer */ # lv_matrix_t matrix; # #endif -# /** Opacity of the layer */ -# lv_opa_t opa; - -# /*Recolor of the layer*/ -# lv_color32_t recolor; - # /** Partial y offset */ # int32_t partial_y_offset; -# /** Linked list of draw tasks */ -# lv_draw_task_t * draw_task_head; +# /** Recolor of the layer */ +# lv_color32_t recolor; -# lv_layer_t * parent; -# lv_layer_t * next; +# /** The color format of the layer. LV_COLOR_FORMAT_... */ +# lv_color_format_t color_format; + +# /** Flag indicating all tasks are added */ # bool all_tasks_added; -# void * user_data; + +# /** Opacity of the layer */ +# lv_opa_t opa; # }; -lv_layer = [ # valid LVGL93 +lv_layer = [ # valid LVGL94 [ptr, "draw_buf"], - [lv_area, "buf_area"], - [uint32_t, "color_format"], - [lv_area, "_clip_area"], - [lv_area, "phy_clip_area"], - [lv_opa, "opa"], - [lv_color32, "recolor"], - [int32_t, "partial_y_offset"], + [ptr, "draw_task_head"], [ptr, "parent"], [ptr, "next"], - [bool, "all_tasks_added"], [ptr, "user_data"], + + [lv_area, "buf_area"], + [lv_area, "phy_clip_area"], + [lv_area, "_clip_area"], + + [int32_t, "partial_y_offset"], + [lv_color32, "recolor"], + [uint32_t, "color_format"], + [bool, "all_tasks_added"], + [lv_opa, "opa"], ] lv_layer = ct.structure(lv_layer, "lv_layer") @@ -822,7 +869,7 @@ lv_layer = ct.structure(lv_layer, "lv_layer") # lv_color_filter_cb_t filter_cb; # void * user_data; # }; -lv_color_filter_dsc = [ # valid LVGL93 +lv_color_filter_dsc = [ # valid LVGL94 [ptr, "filter_cb"], [ptr, "user_data"], ] @@ -837,16 +884,16 @@ lv_color_filter_dsc = ct.structure(lv_color_filter_dsc, "lv_color_filter_dsc") # lv_timer_cb_t timer_cb; /**< Timer function */ # void * user_data; /**< Custom user data */ # int32_t repeat_count; /**< 1: One time; -1 : infinity; n>0: residual times */ -# uint32_t paused : 1; +# volatile int paused; # uint32_t auto_delete : 1; # }; -lv_timer_ntv = [ # valid LVGL93 +lv_timer_ntv = [ # valid LVGL94 [uint32_t, "period"], [uint32_t, "last_run"], [ptr, "timer_cb"], [ptr, "user_data"], [int32_t, "repeat_count"], - [uint8_t_1, "paused"], + [int32_t, "paused"], [uint8_t_1, "auto_delete"], ] lv_timer_ntv = ct.structure(lv_timer_ntv, "lv_timer_ntv") @@ -859,7 +906,7 @@ lv_timer_ntv = ct.structure(lv_timer_ntv, "lv_timer_ntv") # void * user_data; # uint32_t filter; # }; -lv_event_dsc = [ # valid LVGL93 +lv_event_dsc = [ # valid LVGL94 [ptr, "cb"], [ptr, "user_data"], [uint32_t, "filter"], @@ -869,7 +916,7 @@ lv_event_dsc = ct.structure(lv_event_dsc, "lv_event_dsc") ####################################################################### # Special structure used to calibrate resistive touchscreens ####################################################################### -lv_ts_calibration = [ # valid LVGL93 +lv_ts_calibration = [ # valid LVGL94 [lv_coord_t, "raw_x"], [lv_coord_t, "raw_y"], [lv_coord_t, "x"], @@ -887,7 +934,7 @@ lv_ts_calibration = ct.structure(lv_ts_calibration, "lv_ts_calibration") # lv_area_t middle; # lv_area_t trailing; # } lv_span_coords_t; -lv_span_coords = [ +lv_span_coords = [ # valid LVGL94 [lv_area, "heading"], [lv_area, "middle"], [lv_area, "trailing"], @@ -906,7 +953,7 @@ lv_span_coords = ct.structure(lv_span_coords, "lv_span_coords") # uint32_t style; /**< Font style, see `lv_freetype_font_style_t`*/ # lv_font_kerning_t kerning; /**< Font kerning, see `lv_font_kerning_t`*/ # }; -lv_font_info = [ # valid LVGL92 +lv_font_info = [ # valid LVGL94 [ptr, "name"], [ptr, "class_p"], [uint32_t, "size"], @@ -936,7 +983,7 @@ lv_font_info = ct.structure(lv_font_info, "lv_font_info") # lv_opa_t opa; # lv_text_decor_t decor : 3; -# lv_blend_mode_t blend_mode : 3; +# lv_blend_mode_t blend_mode : 4; # /* Properties of the letter outlines */ # lv_opa_t outline_stroke_opa; @@ -957,7 +1004,7 @@ lv_draw_letter_dsc = [ # valid LVGL93 [lv_point, "pivot"], [lv_opa, "opa"], [uint8_t_3, "decor"], - [uint8_t_3, "blend_mode"], + [uint8_t_4, "blend_mode"], [lv_opa, "outline_stroke_opa"], [int32_t, "outline_stroke_width"], [lv_color, "outline_stroke_color"], diff --git a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py index 639a42c84..a4e92b6ed 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py +++ b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py @@ -279,6 +279,7 @@ class type_mapper_class: "lv_anim_deleted_cb_t", "lv_timer_handler_resume_cb_t", "lv_theme_apply_cb_t", + "lv_screen_create_cb_t", # new in 9.4.0 "lv_color32_t *", "lv_color16_t *", "lv_color_filter_cb_t", @@ -465,11 +466,16 @@ class type_mapper_class: "void * []": "c", # treat as a simple pointer, decoding needs to be done at Berry level "constchar * *": "c", # new in 9.3.0 - "lv_text_cmd_state_t *": "c", + # "lv_text_cmd_state_t *": "c", # not used anymore in 9.4.0 "lv_font_info_t *": "lv_font_info", "lv_switch_orientation_t": "i", "lv_slider_orientation_t": "i", "lv_draw_letter_dsc_t *": "lv_draw_letter_dsc", + # new in 9.4.0 + "lv_image_colorkey_t *": "c", + "lv_arclabel_dir_t": "i", + "lv_arclabel_text_align_t": "i", + "lv_anim_timeline_t *": "lv_anim_timeline_dsc", # callbacks "lv_group_focus_cb_t": "lv_group_focus_cb", diff --git a/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py b/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py index a1870147f..c69524803 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py +++ b/lib/libesp32_lvgl/lv_binding_berry/tools/preprocessor.py @@ -57,6 +57,9 @@ class LVGLPreprocessor: r"^lv_obj_get_property", r"^lv_win_", r"^lv_obj.*name", # we don't enable #if LV_USE_OBJ_NAME + r".*_bind_.*", # 9.4.0 remove observer methods + r".*_get_.*_by_name", # 9.4.0 + r".*_translation_", # 9.4.0 ] # Enum exclusion patterns @@ -65,6 +68,7 @@ class LVGLPreprocessor: "LV_TASK_PRIO_", "LV_THEME_", "LV_LRU_", "LV_VECTOR_", "LV_KEYBOARD_MODE_TEXT_ARABIC", "LV_DRAW_TASK_TYPE_3D", "LV_DRAW_TASK_TYPE_VECTOR", + "LV_EVENT_TRANSLATION_" } def comment_remover(self, text: str) -> str: diff --git a/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_1_constants.be b/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_1_constants.be index c614cbb3f..885ef4ed7 100644 --- a/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_1_constants.be +++ b/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_1_constants.be @@ -1,5 +1,5 @@ # LVGL integer constants -# LVGL version 9.3.0 +# LVGL version 9.4.0 lv.ALIGN_BOTTOM_LEFT = 4 lv.ALIGN_BOTTOM_MID = 5 @@ -28,6 +28,12 @@ lv.ANIM_OFF = 0 lv.ANIM_ON = 1 lv.ANIM_PLAYTIME_INFINITE = -1 lv.ANIM_REPEAT_INFINITE = -1 +lv.ARCLABEL_DIR_CLOCKWISE = 0 +lv.ARCLABEL_DIR_COUNTER_CLOCKWISE = 1 +lv.ARCLABEL_TEXT_ALIGN_CENTER = 2 +lv.ARCLABEL_TEXT_ALIGN_DEFAULT = 0 +lv.ARCLABEL_TEXT_ALIGN_LEADING = 1 +lv.ARCLABEL_TEXT_ALIGN_TRAILING = 3 lv.ARC_MODE_NORMAL = 0 lv.ARC_MODE_REVERSE = 2 lv.ARC_MODE_SYMMETRICAL = 1 @@ -102,7 +108,8 @@ lv.CHART_POINT_NONE = 2147483647 lv.CHART_TYPE_BAR = 2 lv.CHART_TYPE_LINE = 1 lv.CHART_TYPE_NONE = 0 -lv.CHART_TYPE_SCATTER = 3 +lv.CHART_TYPE_SCATTER = 4 +lv.CHART_TYPE_STACKED = 3 lv.CHART_UPDATE_MODE_CIRCULAR = 1 lv.CHART_UPDATE_MODE_SHIFT = 0 lv.COLOR_AQUA = 65535 @@ -220,10 +227,11 @@ lv.DISP_ROTATION_0 = 0 lv.DISP_ROTATION_180 = 2 lv.DISP_ROTATION_270 = 3 lv.DISP_ROTATION_90 = 1 -lv.DRAW_TASK_STATE_IN_PROGRESS = 2 -lv.DRAW_TASK_STATE_QUEUED = 1 -lv.DRAW_TASK_STATE_READY = 3 -lv.DRAW_TASK_STATE_WAITING = 0 +lv.DRAW_TASK_STATE_BLOCKED = 0 +lv.DRAW_TASK_STATE_FINISHED = 4 +lv.DRAW_TASK_STATE_IN_PROGRESS = 3 +lv.DRAW_TASK_STATE_QUEUED = 2 +lv.DRAW_TASK_STATE_WAITING = 1 lv.DRAW_TASK_TYPE_ARC = 9 lv.DRAW_TASK_TYPE_BORDER = 2 lv.DRAW_TASK_TYPE_BOX_SHADOW = 3 @@ -371,7 +379,6 @@ lv.IMAGEBUTTON_STATE_DISABLED = 2 lv.IMAGEBUTTON_STATE_NUM = 6 lv.IMAGEBUTTON_STATE_PRESSED = 1 lv.IMAGEBUTTON_STATE_RELEASED = 0 -lv.IMAGE_ALIGN_AUTO_TRANSFORM = 10 lv.IMAGE_ALIGN_BOTTOM_LEFT = 4 lv.IMAGE_ALIGN_BOTTOM_MID = 5 lv.IMAGE_ALIGN_BOTTOM_RIGHT = 6 @@ -473,7 +480,8 @@ lv.OBJ_FLAG_CHECKABLE = 8 lv.OBJ_FLAG_CLICKABLE = 2 lv.OBJ_FLAG_CLICK_FOCUSABLE = 4 lv.OBJ_FLAG_EVENT_BUBBLE = 16384 -lv.OBJ_FLAG_FLEX_IN_NEW_TRACK = 2097152 +lv.OBJ_FLAG_EVENT_TRICKLE = 2097152 +lv.OBJ_FLAG_FLEX_IN_NEW_TRACK = 8388608 lv.OBJ_FLAG_FLOATING = 262144 lv.OBJ_FLAG_GESTURE_BUBBLE = 32768 lv.OBJ_FLAG_HIDDEN = 1 @@ -493,6 +501,7 @@ lv.OBJ_FLAG_SCROLL_ON_FOCUS = 1024 lv.OBJ_FLAG_SCROLL_WITH_ARROW = 2048 lv.OBJ_FLAG_SEND_DRAW_TASK_EVENTS = 524288 lv.OBJ_FLAG_SNAPPABLE = 4096 +lv.OBJ_FLAG_STATE_TRICKLE = 4194304 lv.OBJ_FLAG_USER_1 = 134217728 lv.OBJ_FLAG_USER_2 = 268435456 lv.OBJ_FLAG_USER_3 = 536870912 @@ -573,6 +582,22 @@ lv.SCALE_MODE_VERTICAL_RIGHT = 4 lv.SCALE_NONE = 256 lv.SCALE_ROTATION_ANGLE_MASK = 524287 lv.SCALE_TOTAL_TICK_COUNT_DEFAULT = 11 +lv.SCREEN_LOAD_ANIM_FADE_IN = 9 +lv.SCREEN_LOAD_ANIM_FADE_ON = 9 +lv.SCREEN_LOAD_ANIM_FADE_OUT = 10 +lv.SCREEN_LOAD_ANIM_MOVE_BOTTOM = 8 +lv.SCREEN_LOAD_ANIM_MOVE_LEFT = 5 +lv.SCREEN_LOAD_ANIM_MOVE_RIGHT = 6 +lv.SCREEN_LOAD_ANIM_MOVE_TOP = 7 +lv.SCREEN_LOAD_ANIM_NONE = 0 +lv.SCREEN_LOAD_ANIM_OUT_BOTTOM = 14 +lv.SCREEN_LOAD_ANIM_OUT_LEFT = 11 +lv.SCREEN_LOAD_ANIM_OUT_RIGHT = 12 +lv.SCREEN_LOAD_ANIM_OUT_TOP = 13 +lv.SCREEN_LOAD_ANIM_OVER_BOTTOM = 4 +lv.SCREEN_LOAD_ANIM_OVER_LEFT = 1 +lv.SCREEN_LOAD_ANIM_OVER_RIGHT = 2 +lv.SCREEN_LOAD_ANIM_OVER_TOP = 3 lv.SCROLLBAR_MODE_ACTIVE = 2 lv.SCROLLBAR_MODE_AUTO = 3 lv.SCROLLBAR_MODE_OFF = 0 @@ -581,22 +606,6 @@ lv.SCROLL_SNAP_CENTER = 3 lv.SCROLL_SNAP_END = 2 lv.SCROLL_SNAP_NONE = 0 lv.SCROLL_SNAP_START = 1 -lv.SCR_LOAD_ANIM_FADE_IN = 9 -lv.SCR_LOAD_ANIM_FADE_ON = 9 -lv.SCR_LOAD_ANIM_FADE_OUT = 10 -lv.SCR_LOAD_ANIM_MOVE_BOTTOM = 8 -lv.SCR_LOAD_ANIM_MOVE_LEFT = 5 -lv.SCR_LOAD_ANIM_MOVE_RIGHT = 6 -lv.SCR_LOAD_ANIM_MOVE_TOP = 7 -lv.SCR_LOAD_ANIM_NONE = 0 -lv.SCR_LOAD_ANIM_OUT_BOTTOM = 14 -lv.SCR_LOAD_ANIM_OUT_LEFT = 11 -lv.SCR_LOAD_ANIM_OUT_RIGHT = 12 -lv.SCR_LOAD_ANIM_OUT_TOP = 13 -lv.SCR_LOAD_ANIM_OVER_BOTTOM = 4 -lv.SCR_LOAD_ANIM_OVER_LEFT = 1 -lv.SCR_LOAD_ANIM_OVER_RIGHT = 2 -lv.SCR_LOAD_ANIM_OVER_TOP = 3 lv.SIZE_CONTENT = 1073741823 lv.SLIDER_MODE_NORMAL = 0 lv.SLIDER_MODE_RANGE = 2 @@ -676,13 +685,14 @@ lv.STYLE_GRID_COLUMN_DSC_ARRAY = 130 lv.STYLE_GRID_ROW_ALIGN = 128 lv.STYLE_GRID_ROW_DSC_ARRAY = 129 lv.STYLE_HEIGHT = 2 +lv.STYLE_IMAGE_COLORKEY = 137 lv.STYLE_IMAGE_OPA = 68 lv.STYLE_IMAGE_RECOLOR = 69 lv.STYLE_IMAGE_RECOLOR_OPA = 70 lv.STYLE_IMG_OPA = 68 lv.STYLE_IMG_RECOLOR = 69 lv.STYLE_IMG_RECOLOR_OPA = 70 -lv.STYLE_LAST_BUILT_IN_PROP = 137 +lv.STYLE_LAST_BUILT_IN_PROP = 138 lv.STYLE_LAYOUT = 22 lv.STYLE_LENGTH = 3 lv.STYLE_LINE_COLOR = 76 @@ -699,7 +709,7 @@ lv.STYLE_MAX_HEIGHT = 7 lv.STYLE_MAX_WIDTH = 5 lv.STYLE_MIN_HEIGHT = 6 lv.STYLE_MIN_WIDTH = 4 -lv.STYLE_NUM_BUILT_IN_PROPS = 138 +lv.STYLE_NUM_BUILT_IN_PROPS = 139 lv.STYLE_OPA = 98 lv.STYLE_OPA_LAYERED = 99 lv.STYLE_OUTLINE_COLOR = 57 @@ -778,9 +788,6 @@ lv.TEXT_ALIGN_AUTO = 0 lv.TEXT_ALIGN_CENTER = 2 lv.TEXT_ALIGN_LEFT = 1 lv.TEXT_ALIGN_RIGHT = 3 -lv.TEXT_CMD_STATE_IN = 2 -lv.TEXT_CMD_STATE_PAR = 1 -lv.TEXT_CMD_STATE_WAIT = 0 lv.TEXT_DECOR_NONE = 0 lv.TEXT_DECOR_STRIKETHROUGH = 2 lv.TEXT_DECOR_UNDERLINE = 1 diff --git a/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be b/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be index 10167ce54..278161735 100644 --- a/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be +++ b/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be @@ -2698,7 +2698,7 @@ end # Encapsulates a `lv_screen` which is `lv.obj(0)` object ################################################################################# # -# ex of transition: lv.scr_load_anim(scr, lv.SCR_LOAD_ANIM_MOVE_RIGHT, 500, 0, false) +# ex of transition: lv.scr_load_anim(scr, lv.SCREEN_LOAD_ANIM_MOVE_RIGHT, 500, 0, false) #@ solidify:lvh_page,weak class lvh_page var _obj_id # (map) of `lvh_obj` objects by id numbers @@ -2867,11 +2867,11 @@ class lvh_page # show this page, with animation #==================================================================== static show_anim = { - 1: lv.SCR_LOAD_ANIM_MOVE_LEFT, - -1: lv.SCR_LOAD_ANIM_MOVE_RIGHT, - -2: lv.SCR_LOAD_ANIM_MOVE_TOP, - 2: lv.SCR_LOAD_ANIM_MOVE_BOTTOM, - 0: lv.SCR_LOAD_ANIM_NONE, + 1: lv.SCREEN_LOAD_ANIM_MOVE_LEFT, + -1: lv.SCREEN_LOAD_ANIM_MOVE_RIGHT, + -2: lv.SCREEN_LOAD_ANIM_MOVE_TOP, + 2: lv.SCREEN_LOAD_ANIM_MOVE_BOTTOM, + 0: lv.SCREEN_LOAD_ANIM_NONE, } def show(anim, duration) # ignore if the page does not contain a screen, like when id==0 @@ -2901,7 +2901,7 @@ class lvh_page if (anim == 0) lv.screen_load(self._lv_scr) else # animation - var anim_lvgl = self.show_anim.find(anim, lv.SCR_LOAD_ANIM_NONE) + var anim_lvgl = self.show_anim.find(anim, lv.SCREEN_LOAD_ANIM_NONE) # load new screen with animation, no delay, 500ms transition time, no auto-delete lv.screen_load_anim(self._lv_scr, anim_lvgl, duration, 0, false) end diff --git a/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h b/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h index 6058b6542..11dd9a73a 100644 --- a/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h +++ b/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h @@ -12000,7 +12000,7 @@ static const bvalue be_ktab_class_lvh_page[45] = { /* K39 */ be_nested_str_weak(_X7B_X22hasp_X22_X3A_X7B_X22p_X25i_X22_X3A_X22in_X22_X7D_X7D), /* K40 */ be_nested_str_weak(screen_load), /* K41 */ be_nested_str_weak(show_anim), - /* K42 */ be_nested_str_weak(SCR_LOAD_ANIM_NONE), + /* K42 */ be_nested_str_weak(SCREEN_LOAD_ANIM_NONE), /* K43 */ be_nested_str_weak(screen_load_anim), /* K44 */ be_nested_str_weak(_remove_page), }; diff --git a/lib/libesp32_lvgl/lvgl/README.md b/lib/libesp32_lvgl/lvgl/README.md index cc3c1a903..e02ca5f4b 100644 --- a/lib/libesp32_lvgl/lvgl/README.md +++ b/lib/libesp32_lvgl/lvgl/README.md @@ -1,8 +1,5 @@ - - -

- English | 中文 | Português do Brasil | 日本語 + English | 中文 | Português do Brasil | 日本語 | עברית


@@ -11,87 +8,85 @@  

Light and Versatile Graphics Library


+

Light and Versatile Graphics Library

+ +
+
   
-
+ +
+

-Website | -Docs | -Forum | -Demos | + Website | + LVGL Pro Editor | + Docs | + Forum | + Demos | Services

-
-## :ledger: Overview +
-**Mature and Well-known**
-LVGL is the most popular free and open source embedded graphics library to create beautiful UIs for any MCU, MPU and display type. It's supported by industry leading vendors and projects like  Arm, STM32, NXP, Espressif, Nuvoton, Arduino, RT-Thread, Zephyr, NuttX, Adafruit and many more. +### Table of Contents +

+ Overview
+ Features
+ Platform Support
+ LVGL Pro Editor
+ Commercial Services
+ Integrating LVGL
+ Examples
+ Contributing +

-**Feature Rich**
-It has all the features to create modern and beautiful GUIs: 30+ built-in widgets, a powerful style system, web inspired layout managers, and a typography system supporting many languages. To integrate LVGL into your platform, all you need is at least 32kB RAM and 128 kB Flash, a C compiler, a frame buffer, and at least an 1/10 screen sized buffer for rendering. +
-**Services**
-Our team is ready to help you with graphics design, UI implementation and consulting services. Contact us if you need some support during the development of your next GUI project. +## 📒 Overview -## :rocket: Features +**LVGL** is a free and open-source UI library that enables you to create graphical user interfaces +for any MCUs and MPUs from any vendor on any platform. + +**Requirements**: LVGL has no external dependencies, which makes it easy to compile for any modern target, +from small MCUs to multi-core Linux-based MPUs with 3D support. For a simple UI, you need only ~100kB RAM, +~200–300kB flash, and a buffer size of 1/10 of the screen for rendering. + +**To get started**, pick a ready-to-use VSCode, Eclipse, or any other project and try out LVGL +on your PC. The LVGL UI code is fully platform-independent, so you can use the same UI code +on embedded targets too. + +**LVGL Pro** is a complete toolkit to help you build, test, share, and ship UIs faster. +It comes with an XML Editor where you can quickly create and test reusable components, +export C code, or load the XMLs at runtime. Learn more here. + +## 💡 Features **Free and Portable** - A fully portable C (C++ compatible) library with no external dependencies. - - Can be compiled to any MCU or MPU, with any (RT)OS. - - Supports monochrome, ePaper, OLED or TFT displays, or even monitors. [Displays](https://docs.lvgl.io/master/details/main-modules/display/index.html) + - Can be compiled for any MCU or MPU, with any (RT)OS. Make, CMake, and simple globbing are all supported. + - Supports monochrome, ePaper, OLED, or TFT displays, or even monitors. [Displays](https://docs.lvgl.io/master/details/main-modules/display/index.html) - Distributed under the MIT license, so you can easily use it in commercial projects too. - - Needs only 32kB RAM and 128 kB Flash, a frame buffer, and at least an 1/10 screen sized buffer for rendering. - - OS, External memory and GPU are supported but not required. + - Needs only 32kB RAM and 128kB Flash, a frame buffer, and at least a 1/10 screen-sized buffer for rendering. + - OS, external memory, and GPU are supported but not required. -**Widgets, Styles, Layouts and more** - - 30+ built-in [Widgets](https://docs.lvgl.io/master/details/widgets/index.html):  Button, Label, Slider, Chart, Keyboard, Meter, Arc, Table and many more. - - Flexible [Style system](https://docs.lvgl.io/master/details/common-widget-features/styles/style.html) with  ~100 style properties to customize any part of the widgets in any state. - - [Flexbox](https://docs.lvgl.io/master/details/common-widget-features/layouts/flex.html) and [Grid](https://docs.lvgl.io/master/details/common-widget-features/layouts/grid.html)-like layouts engines to automatically size and position the widgets in a responsive way. - - Texts are rendered with UTF-8 encoding supporting CJK, Thai, Hindi, Arabic, Persian writing systems. - - Word wrapping, kerning, text scrolling, sub-pixel rendering, Pinyin-IME Chinese input, Emojis in texts. - - Rendering engine supporting animations, anti-aliasing, opacity, smooth scrolling, shadows, image transformation, etc   +**Widgets, Styles, Layouts, and More** + - 30+ built-in [Widgets](https://docs.lvgl.io/master/details/widgets/index.html): Button, Label, Slider, Chart, Keyboard, Meter, Arc, Table, and many more. + - Flexible [Style system](https://docs.lvgl.io/master/details/common-widget-features/styles/index.html) with ~100 style properties to customize any part of the widgets in any state. + - [Flexbox](https://docs.lvgl.io/master/details/common-widget-features/layouts/flex.html) and [Grid](https://docs.lvgl.io/master/details/common-widget-features/layouts/grid.html)-like layout engines to automatically size and position the widgets responsively. + - Text is rendered with UTF-8 encoding, supporting CJK, Thai, Hindi, Arabic, and Persian writing systems. + - [Data bindings](https://docs.lvgl.io/master/details/auxiliary-modules/observer/index.html) to easily connect the UI with the application. + - Rendering engine supports animations, anti-aliasing, opacity, smooth scrolling, shadows, image transformation, etc. + - [Powerful 3D rendering engine](https://docs.lvgl.io/master/details/libs/gltf.html) to show [glTF models](https://sketchfab.com/) with OpenGL. - Supports Mouse, Touchpad, Keypad, Keyboard, External buttons, Encoder [Input devices](https://docs.lvgl.io/master/details/main-modules/indev.html). - [Multiple display](https://docs.lvgl.io/master/details/main-modules/display/overview.html#how-many-displays-can-lvgl-use) support. -**Binding and Build Support** - - [MicroPython Binding](https://blog.lvgl.io/2019-02-20/micropython-bindings) exposes LVGL API - - [PikaScript Binding](https://blog.lvgl.io/2022-08-24/pikascript-and-lvgl) python on MCU lighter and easier. - - No custom build system is used. You can build LVGL as you build the other files of your project. - - Support for Make and [CMake](https://docs.lvgl.io/master/details/integration/building/cmake.html) is included out of the box. - - [Develop on PC](https://docs.lvgl.io/master/details/integration/ide/pc-simulator.html) and use the same UI code on embedded hardware. - - Convert the C UI code to HTML file with our [Emscripten port](https://github.com/lvgl/lv_web_emscripten). +## 📦️ Platform Support -**Docs, Tools, and Services** - - Detailed [Documentation](https://docs.lvgl.io/) with [100+ simple examples](https://docs.lvgl.io/master/examples.html) - - [Services](https://lvgl.io/services) such as User interface design, Implementation and Consulting to make UI development simpler and faster. +LVGL has no external dependencies, so it can be easily compiled for any devices and it's also available in many package managers and RTOSes: -## :heart: Sponsor - -If LVGL saved you a lot of time and money or you just had fun using it, consider [Supporting its Development](https://github.com/sponsors/lvgl). - -**How do we spend the donations?**
-Our goal is to provide financial compensation for people who do the most for LVGL. It means not only the maintainers but anyone who implements a great feature should get a payment from the accumulated money. We use the donations to cover our operational costs like servers and related services. - -**How to donate?**
-We use [GitHub Sponsors](https://github.com/sponsors/lvgl) where you can easily send one time or recurring donations. You can also see all of our expenses in a transparent way. - -**How to get paid for your contribution?**
-If someone implements or fixes an issue labeled as [Sponsored](https://github.com/lvgl/lvgl/labels/Sponsored) he or she will get a payment for that work. We estimate the required time, complexity and importance of the issue and set a price accordingly. To jump in just comment on a [Sponsored](https://github.com/lvgl/lvgl/labels/Sponsored) issue saying "Hi, I'd like to deal with it. This is how I'm planning to fix/implement it...". A work is considered ready when it's approved and merged by a maintainer. After that you can submit and expense at [opencollective.com](https://opencollective.com/lvgl) and you will receive the payment in a few days. - -**Organizations supporting LVGL**
-[![Sponsors of LVGL](https://opencollective.com/lvgl/organizations.svg?width=600)](https://opencollective.com/lvgl) - -**Individuals supporting LVGL**
-[![Backers of LVGL](https://contrib.rocks/image?repo=lvgl/lvgl&max=48)](https://opencollective.com/lvgl) - -## :package: Packages -LVGL is available as: - [Arduino library](https://docs.lvgl.io/master/details/integration/framework/arduino.html) - [PlatformIO package](https://registry.platformio.org/libraries/lvgl/lvgl) - [Zephyr library](https://docs.lvgl.io/master/details/integration/os/zephyr.html) @@ -102,367 +97,287 @@ LVGL is available as: - CMSIS-Pack - [RIOT OS package](https://doc.riot-os.org/group__pkg__lvgl.html#details) +## 🚀 LVGL Pro Editor -## :robot: Examples +LVGL Pro is a complete toolkit to build, test, share, and ship embedded UIs efficiently. -See some examples of creating widgets, using layouts and applying styles. You will find C and MicroPython code, and links to try out or edit the examples in an online MicroPython editor. +It consists of four tightly related tools: -For more examples check out the [Examples](https://github.com/lvgl/lvgl/tree/master/examples) folder. +1. **XML Editor**: The heart of LVGL Pro. A desktop app to build components and screens in XML, manage data bindings, translations, animations, tests, and more. Learn more about the [XML Format](https://docs.lvgl.io/master/details/xml/xml/index.html) and the [Editor](https://docs.lvgl.io/master/details/xml/editor/index.html). +2. **Online Viewer**: Run the Editor in your browser, open GitHub projects, and share easily without setting up a developer environment. Visit [https://viewer.lvgl.io](https://viewer.lvgl.io). +3. **CLI Tool**: Generate C code and run tests in CI/CD. See the details [here](https://docs.lvgl.io/master/details/xml/tools/cli.html). +4. **Figma Plugin**: Sync and extract styles directly from Figma. See how it works [here](https://docs.lvgl.io/master/details/xml/tools/figma.html). +Together, these tools let developers build UIs efficiently, test them reliably, and collaborate with team members and customers. -### Hello world label +Learn more at https://pro.lvgl.io -![Simple Hello world label example in LVGL](https://github.com/kisvegabor/test/raw/master/readme_example_1.png) +## 🤝 Commercial Services -
- C code +LVGL LLC provides several types of commercial services to help you with UI development. With 15+ years of experience in the user interface and graphics industry, we can help bring your UI to the next level. + +- **Graphics design**: Our in-house graphic designers are experts in creating beautiful modern designs that fit your product and the capabilities of your hardware. +- **UI implementation**: We can implement your UI based on the design you or we have created. You can be sure that we will make the most of your hardware and LVGL. If a feature or widget is missing from LVGL, don't worry, we will implement it for you. +- **Consulting and Support**: We also offer consulting to help you avoid costly and time-consuming mistakes during UI development. +- **Board certification**: For companies offering development boards or production-ready kits, we provide board certification to show how the board can run LVGL. + +Check out our [Demos](https://lvgl.io/demos) as references. For more information, take a look at the [Services page](https://lvgl.io/services). + +[Contact us](https://lvgl.io/#contact) and tell us how we can help. + +## 🧑‍💻 Integrating LVGL + +Integrating LVGL is very simple. Just drop it into any project and compile it as you would compile other files. +To configure LVGL, copy `lv_conf_template.h` as `lv_conf.h`, enable the first `#if 0`, and adjust the configs as needed. +(The default config is usually fine.) If available, LVGL can also be used with Kconfig. + +Once in the project, you can initialize LVGL and create display and input devices as follows: ```c -/*Change the active screen's background color*/ -lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x003a57), LV_PART_MAIN); +#include "lvgl/lvgl.h" /*Define LV_LVGL_H_INCLUDE_SIMPLE to include as "lvgl.h"*/ -/*Create a white label, set its text and align it to the center*/ -lv_obj_t * label = lv_label_create(lv_screen_active()); -lv_label_set_text(label, "Hello world"); -lv_obj_set_style_text_color(label, lv_color_hex(0xffffff), LV_PART_MAIN); -lv_obj_align(label, LV_ALIGN_CENTER, 0, 0); -``` -
+#define TFT_HOR_RES 320 +#define TFT_VER_RES 240 -
- MicroPython code | Online Simulator - -```python -# Change the active screen's background color -scr = lv.screen_active() -scr.set_style_bg_color(lv.color_hex(0x003a57), lv.PART.MAIN) - -# Create a white label, set its text and align it to the center -label = lv.label(lv.screen_active()) -label.set_text("Hello world") -label.set_style_text_color(lv.color_hex(0xffffff), lv.PART.MAIN) -label.align(lv.ALIGN.CENTER, 0, 0) -``` -
-
- -### Button with Click Event - -![LVGL button with label example](https://github.com/kisvegabor/test/raw/master/readme_example_2.gif) - -
- C code - -```c -lv_obj_t * button = lv_button_create(lv_screen_active());                   /*Add a button to the current screen*/ -lv_obj_center(button);                                     /*Set its position*/ -lv_obj_set_size(button, 100, 50);                                  /*Set its size*/ -lv_obj_add_event_cb(button, button_event_cb, LV_EVENT_CLICKED, NULL); /*Assign a callback to the button*/ - -lv_obj_t * label = lv_label_create(button);                        /*Add a label to the button*/ -lv_label_set_text(label, "Button");                             /*Set the labels text*/ -lv_obj_center(label);                                           /*Align the label to the center*/ -... - -void button_event_cb(lv_event_t * e) +static uint32_t my_tick_cb(void) { -  printf("Clicked\n"); + return my_get_millisec(); +} + +static void my_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map) +{ + /*Write px_map to the area->x1, area->x2, area->y1, area->y2 area of the + *frame buffer or external display controller. */ +} + +static void my_touch_read_cb(lv_indev_t * indev, lv_indev_data_t * data) +{ + if(my_touch_is_pressed()) { + data->point.x = touchpad_x; + data->point.y = touchpad_y; + data->state = LV_INDEV_STATE_PRESSED; + } else { + data->state = LV_INDEV_STATE_RELEASED; + } +} + +void main(void) +{ + my_hardware_init(); + + /*Initialize LVGL*/ + lv_init(); + + /*Set millisecond-based tick source for LVGL so that it can track time.*/ + lv_tick_set_cb(my_tick_cb); + + /*Create a display where screens and widgets can be added*/ + lv_display_t * display = lv_display_create(TFT_HOR_RES, TFT_VER_RES); + + /*Add rendering buffers to the screen. + *Here adding a smaller partial buffer assuming 16-bit (RGB565 color format)*/ + static uint8_t buf[TFT_HOR_RES * TFT_VER_RES / 10 * 2]; /* x2 because of 16-bit color depth */ + lv_display_set_buffers(display, buf, NULL, sizeof(buf), LV_DISPLAY_RENDER_MODE_PARTIAL); + + /*Add a callback that can flush the content from `buf` when it has been rendered*/ + lv_display_set_flush_cb(display, my_flush_cb); + + /*Create an input device for touch handling*/ + lv_indev_t * indev = lv_indev_create(); + lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER); + lv_indev_set_read_cb(indev, my_touch_read_cb); + + /*The drivers are in place; now we can create the UI*/ + lv_obj_t * label = lv_label_create(lv_screen_active()); + lv_label_set_text(label, "Hello world"); + lv_obj_center(label); + + /*Execute the LVGL-related tasks in a loop*/ + while(1) { + lv_timer_handler(); + my_sleep_ms(5); /*Wait a little to let the system breathe*/ + } } ``` + +## 🤖 Examples + +You can check out more than 100 examples at https://docs.lvgl.io/master/examples.html + +The Online Viewer also contains tutorials to easily learn XML: https://viewer.lvgl.io/ + + +### Hello World Button with an Event + +image + +
+ C code + + ```c +static void button_clicked_cb(lv_event_t * e) +{ + printf("Clicked\n"); +} + +[...] + + lv_obj_t * button = lv_button_create(lv_screen_active()); + lv_obj_center(button); + lv_obj_add_event_cb(button, button_clicked_cb, LV_EVENT_CLICKED, NULL); + + lv_obj_t * label = lv_label_create(button); + lv_label_set_text(label, "Hello from LVGL!"); +```
- MicroPython code | Online Simulator + In XML with LVGL Pro -```python -def button_event_cb(e): -  print("Clicked") - -# Create a Button and a Label -button = lv.button(lv.screen_active()) -button.center() -button.set_size(100, 50) -button.add_event_cb(button_event_cb, lv.EVENT.CLICKED, None) - -label = lv.label(button) -label.set_text("Button") -label.center() +```xml + + + + + + + + ``` -
-
-### Checkboxes with Layout -![Checkboxes with layout in LVGL](https://github.com/kisvegabor/test/raw/master/readme_example_3.gif) +
+ +### Styled Slider with Data-binding + +image
C code ```c +static void my_observer_cb(lv_observer_t * observer, lv_subject_t * subject) +{ + printf("Slider value: %d\n", lv_subject_get_int(subject)); +} -lv_obj_set_flex_flow(lv_screen_active(), LV_FLEX_FLOW_COLUMN); -lv_obj_set_flex_align(lv_screen_active(), LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER); +[...] -lv_obj_t * cb; -cb = lv_checkbox_create(lv_screen_active()); -lv_checkbox_set_text(cb, "Apple"); -lv_obj_add_event_cb(cb, event_handler, LV_EVENT_ALL, NULL); +static lv_subject_t subject_value; +lv_subject_init_int(&subject_value, 35); +lv_subject_add_observer(&subject_value, my_observer_cb, NULL); -cb = lv_checkbox_create(lv_screen_active()); -lv_checkbox_set_text(cb, "Banana"); -lv_obj_add_state(cb, LV_STATE_CHECKED); -lv_obj_add_event_cb(cb, event_handler, LV_EVENT_ALL, NULL); +lv_style_t style_base; +lv_style_init(&style_base); +lv_style_set_bg_color(&style_base, lv_color_hex(0xff8800)); +lv_style_set_bg_opa(&style_base, 255); +lv_style_set_radius(&style_base, 4); -cb = lv_checkbox_create(lv_screen_active()); -lv_checkbox_set_text(cb, "Lemon"); -lv_obj_add_state(cb, LV_STATE_DISABLED); -lv_obj_add_event_cb(cb, event_handler, LV_EVENT_ALL, NULL); - -cb = lv_checkbox_create(lv_screen_active()); -lv_obj_add_state(cb, LV_STATE_CHECKED | LV_STATE_DISABLED); -lv_checkbox_set_text(cb, "Melon\nand a new line"); -lv_obj_add_event_cb(cb, event_handler, LV_EVENT_ALL, NULL); -``` - -
- -
- MicroPython code | Online Simulator - -```python -def event_handler(e): - code = e.get_code() - obj = e.get_target_obj() - if code == lv.EVENT.VALUE_CHANGED: - txt = obj.get_text() - if obj.get_state() & lv.STATE.CHECKED: - state = "Checked" - else: - state = "Unchecked" - print(txt + ":" + state) - - -lv.screen_active().set_flex_flow(lv.FLEX_FLOW.COLUMN) -lv.screen_active().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.START, lv.FLEX_ALIGN.CENTER) - -cb = lv.checkbox(lv.screen_active()) -cb.set_text("Apple") -cb.add_event_cb(event_handler, lv.EVENT.ALL, None) - -cb = lv.checkbox(lv.screen_active()) -cb.set_text("Banana") -cb.add_state(lv.STATE.CHECKED) -cb.add_event_cb(event_handler, lv.EVENT.ALL, None) - -cb = lv.checkbox(lv.screen_active()) -cb.set_text("Lemon") -cb.add_state(lv.STATE.DISABLED) -cb.add_event_cb(event_handler, lv.EVENT.ALL, None) - -cb = lv.checkbox(lv.screen_active()) -cb.add_state(lv.STATE.CHECKED | lv.STATE.DISABLED) -cb.set_text("Melon") -cb.add_event_cb(event_handler, lv.EVENT.ALL, None) -``` - -
-
- -### Styling a Slider -![Styling a slider with LVGL](https://github.com/kisvegabor/test/raw/master/readme_example_4.gif) - - -
- C code - -```c lv_obj_t * slider = lv_slider_create(lv_screen_active()); -lv_slider_set_value(slider, 70, LV_ANIM_OFF); -lv_obj_set_size(slider, 300, 20); lv_obj_center(slider); +lv_obj_set_size(slider, lv_pct(80), 16); +lv_obj_add_style(slider, &style_base, LV_PART_INDICATOR); +lv_obj_add_style(slider, &style_base, LV_PART_KNOB); +lv_obj_add_style(slider, &style_base, 0); +lv_obj_set_style_bg_opa(slider, LV_OPA_50, 0); +lv_obj_set_style_border_width(slider, 3, LV_PART_KNOB); +lv_obj_set_style_border_color(slider, lv_color_hex3(0xfff), LV_PART_KNOB); +lv_slider_bind_value(slider, &subject_value); -/*Add local styles to MAIN part (background rectangle)*/ -lv_obj_set_style_bg_color(slider, lv_color_hex(0x0F1215), LV_PART_MAIN); -lv_obj_set_style_bg_opa(slider, 255, LV_PART_MAIN); -lv_obj_set_style_border_color(slider, lv_color_hex(0x333943), LV_PART_MAIN); -lv_obj_set_style_border_width(slider, 5, LV_PART_MAIN); -lv_obj_set_style_pad_all(slider, 5, LV_PART_MAIN); - -/*Create a reusable style sheet for the INDICATOR part*/ -static lv_style_t style_indicator; -lv_style_init(&style_indicator); -lv_style_set_bg_color(&style_indicator, lv_color_hex(0x37B9F5)); -lv_style_set_bg_grad_color(&style_indicator, lv_color_hex(0x1464F0)); -lv_style_set_bg_grad_dir(&style_indicator, LV_GRAD_DIR_HOR); -lv_style_set_shadow_color(&style_indicator, lv_color_hex(0x37B9F5)); -lv_style_set_shadow_width(&style_indicator, 15); -lv_style_set_shadow_spread(&style_indicator, 5); -4 -/*Add the style sheet to the slider's INDICATOR part*/ -lv_obj_add_style(slider, &style_indicator, LV_PART_INDICATOR); - -/*Add the same style to the KNOB part too and locally overwrite some properties*/ -lv_obj_add_style(slider, &style_indicator, LV_PART_KNOB); - -lv_obj_set_style_outline_color(slider, lv_color_hex(0x0096FF), LV_PART_KNOB); -lv_obj_set_style_outline_width(slider, 3, LV_PART_KNOB); -lv_obj_set_style_outline_pad(slider, -5, LV_PART_KNOB); -lv_obj_set_style_shadow_spread(slider, 2, LV_PART_KNOB); +lv_obj_t * label = lv_label_create(lv_screen_active()); +lv_obj_align(label, LV_ALIGN_CENTER, 0, -30); +lv_label_bind_text(label, &subject_value, "Temperature: %d °C"); ```
- MicroPython code | -Online Simulator - + In XML with LVGL Pro +```xml + + +