diff --git a/README.md b/README.md index dfc11ad..dd0fad6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# LibreTuya +# LibreTiny
@@ -20,9 +20,9 @@ PlatformIO development platform for IoT modules manufactured by Tuya Inc. The main goal of this project is to provide a usable build environment for IoT developers. While also providing vendor SDKs as PlatformIO cores, the project focuses on developing working Arduino-compatible cores for supported families. The cores are inspired by Espressif's official core for ESP32, -which should make it easier to port/run existing ESP apps on Tuya IoT (and 3-rd party) modules. +which should make it easier to port/run existing ESP apps on less-common, unsupported IoT modules. -**There's an [ESPHome port](https://docs.libretuya.ml/docs/projects/esphome/) based on LibreTuya, which supports BK7231 and RTL8710B chips.** +**There's an [ESPHome port](https://docs.libretuya.ml/docs/projects/esphome/) based on LibreTiny, which supports BK7231 and RTL8710B chips.** **Note:** this project is work-in-progress. diff --git a/SUMMARY.md b/SUMMARY.md index ec94dd2..fbe2623 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -18,7 +18,7 @@ * 🧑 Programmer's manual * [⚠️ Migration guide](docs/dev/migration_v1.0.0.md) * [🔋 PlatformIO Examples](examples/) - * [📖 LibreTuya API](docs/dev/lt-api.md) + * [📖 LibreTiny API](docs/dev/lt-api.md) * [C API](ltapi/dir_c7e317b16142bccc961a83c0babf0065.md) * [C++ API](ltapi/dir_930634efd5dc4a957bbb6e685a3ccda1.md) * 📚 Arduino Libraries diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index 0912981..3d150e1 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -68,6 +68,7 @@ queue.AddLibrary( queue.AppendPublic( CPPDEFINES=[ ("LIBRETUYA_ARDUINO", 1), + ("LIBRETINY_ARDUINO", 1), ("ARDUINO", 10812), ("ARDUINO_SDK", 1), ], diff --git a/builder/frameworks/base.py b/builder/frameworks/base.py index c9b3b71..bf1eaa6 100644 --- a/builder/frameworks/base.py +++ b/builder/frameworks/base.py @@ -121,6 +121,7 @@ queue.AppendPublic( ], CPPDEFINES=[ ("LIBRETUYA", 1), + ("LIBRETINY", 1), ("LT_VERSION", env["LT_VERSION"]), ("LT_BOARD", "${VARIANT}"), ("LT_VARIANT_H", r"\"${VARIANT}.h\""), diff --git a/builder/utils/env.py b/builder/utils/env.py index f56db6a..43fa200 100644 --- a/builder/utils/env.py +++ b/builder/utils/env.py @@ -112,7 +112,7 @@ def env_print_info( # Print information about installed core versions print("PLATFORM VERSIONS:") - print(" - libretuya @", env["LT_VERSION"]) + print(" - libretiny @", env["LT_VERSION"]) print(" - ltchiptool @", get_version()) # Print custom platformio.ini options if platform.custom_opts: diff --git a/cores/beken-72xx/base/fixups/clock_rtos.c b/cores/beken-72xx/base/fixups/clock_rtos.c index 2926cb4..fb7596a 100644 --- a/cores/beken-72xx/base/fixups/clock_rtos.c +++ b/cores/beken-72xx/base/fixups/clock_rtos.c @@ -11,7 +11,7 @@ #include "sys_rtos.h" #include "uart_pub.h" -// from LibreTuyaConfig.h +// from lt_config.h #ifndef LT_MICROS_HIGH_RES #define LT_MICROS_HIGH_RES 1 #endif diff --git a/cores/beken-72xx/base/lt_api.c b/cores/beken-72xx/base/lt_api.c index 45dd9cb..c8994e9 100644 --- a/cores/beken-72xx/base/lt_api.c +++ b/cores/beken-72xx/base/lt_api.c @@ -1,6 +1,6 @@ /* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ -#include +#include #include // can't include as it collides with on Windows -_- diff --git a/cores/beken-72xx/base/port/fal_flash_bk72xx_port.c b/cores/beken-72xx/base/port/fal_flash_bk72xx_port.c index 6487e67..d8b723a 100644 --- a/cores/beken-72xx/base/port/fal_flash_bk72xx_port.c +++ b/cores/beken-72xx/base/port/fal_flash_bk72xx_port.c @@ -1,6 +1,6 @@ /* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ -#include +#include #include #include diff --git a/cores/beken-72xx/base/port/printf.c b/cores/beken-72xx/base/port/printf.c index 61685e9..4967136 100644 --- a/cores/beken-72xx/base/port/printf.c +++ b/cores/beken-72xx/base/port/printf.c @@ -1,6 +1,6 @@ /* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ -#include +#include #include diff --git a/cores/common/arduino/libraries/common/Update/Update.h b/cores/common/arduino/libraries/common/Update/Update.h index dad3ebb..7e81790 100644 --- a/cores/common/arduino/libraries/common/Update/Update.h +++ b/cores/common/arduino/libraries/common/Update/Update.h @@ -71,7 +71,7 @@ class UpdateClass { const char *errorString(); const char *getFirmwareName(); const char *getFirmwareVersion(); - const char *getLibreTuyaVersion(); + const char *getLibreTinyVersion(); const char *getBoardName(); private: /* UpdateUtil.cpp */ diff --git a/cores/common/arduino/libraries/common/Update/UpdateUtil.cpp b/cores/common/arduino/libraries/common/Update/UpdateUtil.cpp index 3d6ac9f..d355c7a 100644 --- a/cores/common/arduino/libraries/common/Update/UpdateUtil.cpp +++ b/cores/common/arduino/libraries/common/Update/UpdateUtil.cpp @@ -161,9 +161,9 @@ const char *UpdateClass::getFirmwareVersion() { } /** - * @brief Get LibreTuya version from UF2 info. + * @brief Get LibreTiny version from UF2 info. */ -const char *UpdateClass::getLibreTuyaVersion() { +const char *UpdateClass::getLibreTinyVersion() { if (info) return info->lt_version; return NULL; diff --git a/cores/common/arduino/libraries/inline/ESP/ESP.h b/cores/common/arduino/libraries/inline/ESP/ESP.h index 03a202c..b36820a 100644 --- a/cores/common/arduino/libraries/inline/ESP/ESP.h +++ b/cores/common/arduino/libraries/inline/ESP/ESP.h @@ -8,7 +8,7 @@ * @brief ESP Arduino Core compatibility class. * * This class only consists of inline functions, which - * wrap the LibreTuya C API (lt_api.h). Refer to the docs of the C API + * wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API * for more information. * * The class is accessible using the `ESP` global object. diff --git a/cores/common/arduino/libraries/inline/LT/LT.h b/cores/common/arduino/libraries/inline/LT/LT.h index 258a94a..950117a 100644 --- a/cores/common/arduino/libraries/inline/LT/LT.h +++ b/cores/common/arduino/libraries/inline/LT/LT.h @@ -15,15 +15,15 @@ #define FlashId lt_flash_id_t /** - * @brief Main LibreTuya API class. + * @brief Main LibreTiny API class. * * Since v1.0.0, this class only consists of inline functions, which - * wrap the LibreTuya C API (lt_api.h). Refer to the docs of the C API + * wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API * for more information. * * The class is accessible using the `LT` global object. */ -class LibreTuya { +class LibreTiny { public: /* lt_cpu.h */ /** @copydoc lt_cpu_get_family() */ inline ChipFamily getChipFamily() { return lt_cpu_get_family(); } @@ -109,6 +109,6 @@ class LibreTuya { inline uint32_t getMaxFreeBlockSize() { return lt_heap_get_max_alloc(); } }; -extern LibreTuya LT; +extern LibreTiny LT; #endif diff --git a/cores/common/arduino/libraries/inline/OTA/OTA.h b/cores/common/arduino/libraries/inline/OTA/OTA.h index b646e72..e6bb234 100644 --- a/cores/common/arduino/libraries/inline/OTA/OTA.h +++ b/cores/common/arduino/libraries/inline/OTA/OTA.h @@ -10,12 +10,12 @@ * @brief Over-the-Air updates helper class. * * This class only consists of inline functions, which - * wrap the LibreTuya C API (lt_api.h). Refer to the docs of the C API + * wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API * for more information. * * The class is accessible using the `OTA` global object. */ -class LibreTuyaOTA { +class LibreTinyOTA { public: /* lt_ota.h */ /** @copydoc lt_ota_get_type() */ inline lt_ota_type_t getType() { return lt_ota_get_type(); } @@ -39,6 +39,6 @@ class LibreTuyaOTA { inline bool switchImage(bool revert = false) { return lt_ota_switch(revert); } }; -extern LibreTuyaOTA OTA; +extern LibreTinyOTA OTA; #endif diff --git a/cores/common/arduino/libraries/inline/Singletons.cpp b/cores/common/arduino/libraries/inline/Singletons.cpp index 7ea51ee..1d0d2d6 100644 --- a/cores/common/arduino/libraries/inline/Singletons.cpp +++ b/cores/common/arduino/libraries/inline/Singletons.cpp @@ -4,8 +4,8 @@ #include -LibreTuya LT; -LibreTuyaOTA OTA; -LibreTuyaWDT WDT; +LibreTiny LT; +LibreTinyOTA OTA; +LibreTinyWDT WDT; EspClass ESP; FlashClass Flash; diff --git a/cores/common/arduino/libraries/inline/WDT/WDT.h b/cores/common/arduino/libraries/inline/WDT/WDT.h index 4875799..0cc45e0 100644 --- a/cores/common/arduino/libraries/inline/WDT/WDT.h +++ b/cores/common/arduino/libraries/inline/WDT/WDT.h @@ -10,12 +10,12 @@ * @brief Watchdog control class. * * This class only consists of inline functions, which - * wrap the LibreTuya C API (lt_api.h). Refer to the docs of the C API + * wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API * for more information. * * The class is accessible using the `WDT` global object. */ -class LibreTuyaWDT { +class LibreTinyWDT { public: /* lt_wdt.h */ /** @copydoc lt_wdt_enable() */ inline bool enable(uint32_t timeout = 10000) { return lt_wdt_enable(timeout); } @@ -27,6 +27,6 @@ class LibreTuyaWDT { inline void feed() { lt_wdt_feed(); } }; -extern LibreTuyaWDT WDT; +extern LibreTinyWDT WDT; #endif diff --git a/cores/common/arduino/src/Arduino.h b/cores/common/arduino/src/Arduino.h index e0e9aeb..dec3c7e 100644 --- a/cores/common/arduino/src/Arduino.h +++ b/cores/common/arduino/src/Arduino.h @@ -2,8 +2,8 @@ #pragma once -// LibreTuya C API (with C standard libraries) -#include +// LibreTiny C API (with C standard libraries) +#include // Additional C libraries #include diff --git a/cores/common/base/api/lt_cpu.h b/cores/common/base/api/lt_cpu.h index 9be523c..7feb523 100644 --- a/cores/common/base/api/lt_cpu.h +++ b/cores/common/base/api/lt_cpu.h @@ -2,7 +2,7 @@ #pragma once -#include +#include /** * @brief Get CPU family ID (as lt_cpu_family_t enum member). diff --git a/cores/common/base/api/lt_device.h b/cores/common/base/api/lt_device.h index 73dbd92..d57560e 100644 --- a/cores/common/base/api/lt_device.h +++ b/cores/common/base/api/lt_device.h @@ -2,10 +2,10 @@ #pragma once -#include +#include /** - * @brief Get LibreTuya version string. + * @brief Get LibreTiny version string. */ const char *lt_get_version(); diff --git a/cores/common/base/api/lt_flash.h b/cores/common/base/api/lt_flash.h index 7876d5c..549d6cb 100644 --- a/cores/common/base/api/lt_flash.h +++ b/cores/common/base/api/lt_flash.h @@ -2,7 +2,7 @@ #pragma once -#include +#include /** * @brief Read flash chip ID and return a lt_flash_id_t struct. diff --git a/cores/common/base/api/lt_init.h b/cores/common/base/api/lt_init.h index 0ef8c80..0782779 100644 --- a/cores/common/base/api/lt_init.h +++ b/cores/common/base/api/lt_init.h @@ -2,7 +2,7 @@ #pragma once -#include +#include /** * @brief Initialize the family core (optional). diff --git a/cores/common/base/api/lt_mem.h b/cores/common/base/api/lt_mem.h index f07fafb..b198382 100644 --- a/cores/common/base/api/lt_mem.h +++ b/cores/common/base/api/lt_mem.h @@ -2,7 +2,7 @@ #pragma once -#include +#include /** * @brief Get total RAM size. diff --git a/cores/common/base/api/lt_ota.h b/cores/common/base/api/lt_ota.h index 4f93feb..ef0ffca 100644 --- a/cores/common/base/api/lt_ota.h +++ b/cores/common/base/api/lt_ota.h @@ -2,7 +2,7 @@ #pragma once -#include +#include #include /** diff --git a/cores/common/base/api/lt_utils.h b/cores/common/base/api/lt_utils.h index 26d94d4..be13c95 100644 --- a/cores/common/base/api/lt_utils.h +++ b/cores/common/base/api/lt_utils.h @@ -2,7 +2,7 @@ #pragma once -#include +#include // https://stackoverflow.com/a/3437484 #define MAX(a, b) \ diff --git a/cores/common/base/api/lt_wdt.h b/cores/common/base/api/lt_wdt.h index dc6970d..af48fd4 100644 --- a/cores/common/base/api/lt_wdt.h +++ b/cores/common/base/api/lt_wdt.h @@ -2,7 +2,7 @@ #pragma once -#include +#include /** * @brief Enable the hardware watchdog. diff --git a/cores/common/base/config/fdb_cfg.h b/cores/common/base/config/fdb_cfg.h index 1009280..680428a 100644 --- a/cores/common/base/config/fdb_cfg.h +++ b/cores/common/base/config/fdb_cfg.h @@ -37,7 +37,7 @@ // #define FDB_BIG_ENDIAN #if LT_DEBUG_FDB -#include +#include #include #define FDB_PRINT(...) __wrap_printf(__VA_ARGS__) #define FDB_DEBUG_ENABLE diff --git a/cores/common/base/libretuya.h b/cores/common/base/libretuya.h index 0cf8b50..22a133a 100644 --- a/cores/common/base/libretuya.h +++ b/cores/common/base/libretuya.h @@ -14,7 +14,7 @@ #include #include -// LibreTuya version macros +// LibreTiny version macros #ifndef LT_VERSION #define LT_VERSION 1.0.0 #endif @@ -28,7 +28,7 @@ #define GCC_VERSION_STR \ STRINGIFY_MACRO(__GNUC__) "." STRINGIFY_MACRO(__GNUC_MINOR__) "." STRINGIFY_MACRO(__GNUC_PATCHLEVEL__) #define LT_BANNER_STR \ - "LibreTuya v" LT_VERSION_STR " on " LT_BOARD_STR ", compiled at " __DATE__ " " __TIME__ ", GCC " GCC_VERSION_STR \ + "LibreTiny v" LT_VERSION_STR " on " LT_BOARD_STR ", compiled at " __DATE__ " " __TIME__ ", GCC " GCC_VERSION_STR \ " (-O" STRINGIFY_MACRO(__OPTIMIZE_LEVEL__) ")" // Functional macros diff --git a/cores/common/base/lt_api.h b/cores/common/base/lt_api.h index e7a33bf..8564dbd 100644 --- a/cores/common/base/lt_api.h +++ b/cores/common/base/lt_api.h @@ -2,7 +2,7 @@ #pragma once -// This file collects all LibreTuya C API includes. +// This file collects all LibreTiny C API includes. // The functions are implemented in lt_api.c, which is located // in the common core, and in the family cores. diff --git a/cores/common/base/lt_logger.c b/cores/common/base/lt_logger.c index 8678ead..bec2361 100644 --- a/cores/common/base/lt_logger.c +++ b/cores/common/base/lt_logger.c @@ -47,7 +47,7 @@ static const uint8_t colors[] = { }; #endif -#if LIBRETUYA_ARDUINO +#if LIBRETINY_ARDUINO unsigned long millis(void); #endif @@ -61,7 +61,7 @@ void lt_log(const uint8_t level, const char *format, ...) { return; #if LT_LOGGER_TIMESTAMP -#if LIBRETUYA_ARDUINO +#if LIBRETINY_ARDUINO float seconds = millis() / 1000.0f; #elif LT_HAS_FREERTOS float seconds = xTaskGetTickCount() * portTICK_PERIOD_MS / 1000.0f; diff --git a/cores/common/base/lt_logger.h b/cores/common/base/lt_logger.h index 7948c52..0af8f5f 100644 --- a/cores/common/base/lt_logger.h +++ b/cores/common/base/lt_logger.h @@ -2,7 +2,7 @@ #pragma once -#include +#include #ifdef __cplusplus extern "C" { diff --git a/cores/common/base/lt_main.c b/cores/common/base/lt_main.c index 3dd1209..92a4bd0 100644 --- a/cores/common/base/lt_main.c +++ b/cores/common/base/lt_main.c @@ -1,6 +1,6 @@ /* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ -#include +#include #include diff --git a/cores/realtek-amb/base/lt_api.c b/cores/realtek-amb/base/lt_api.c index ac132e2..a225a14 100644 --- a/cores/realtek-amb/base/lt_api.c +++ b/cores/realtek-amb/base/lt_api.c @@ -1,6 +1,6 @@ /* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ -#include +#include #include extern uint32_t GlobalDebugEnable; diff --git a/cores/realtek-amb/base/port/fal_flash_ambz_port.c b/cores/realtek-amb/base/port/fal_flash_ambz_port.c index 42ba53b..cea509b 100644 --- a/cores/realtek-amb/base/port/fal_flash_ambz_port.c +++ b/cores/realtek-amb/base/port/fal_flash_ambz_port.c @@ -1,6 +1,6 @@ /* Copyright (c) Kuba Szczodrzyński 2022-05-24. */ -#include +#include #include #include diff --git a/cores/realtek-amb/base/port/printf.c b/cores/realtek-amb/base/port/printf.c index f6112e1..01815cc 100644 --- a/cores/realtek-amb/base/port/printf.c +++ b/cores/realtek-amb/base/port/printf.c @@ -1,6 +1,6 @@ /* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ -#include +#include #include diff --git a/docs/dev/config.md b/docs/dev/config.md index ce60808..ac64f39 100644 --- a/docs/dev/config.md +++ b/docs/dev/config.md @@ -31,7 +31,7 @@ custom_versions.lwip = 2.1.3 custom_versions.beken_bdk = 2021.06.07 ``` -## LibreTuya options +## LibreTiny options !!! note See [lt_config.h](../../ltapi/lt__config_8h.md) for most options and their defaults. @@ -48,7 +48,7 @@ build_flags = ### Logger -- `LT_LOGGER` (1) - enable/disable LibreTuya logger globally; disabling this sets the loglevel to `LT_LEVEL_NONE` - the logger can't be enabled even by using `lt_log_set_port()` +- `LT_LOGGER` (1) - enable/disable LibreTiny logger globally; disabling this sets the loglevel to `LT_LEVEL_NONE` - the logger can't be enabled even by using `lt_log_set_port()` - `LT_LOGLEVEL` - global LT loglevel: - `LT_LEVEL_VERBOSE` diff --git a/docs/dev/libs-3rd-party.md b/docs/dev/libs-3rd-party.md index bb28472..06640ed 100644 --- a/docs/dev/libs-3rd-party.md +++ b/docs/dev/libs-3rd-party.md @@ -1,6 +1,6 @@ # Libraries -A page outlining 3-rd some party libraries compatible with LibreTuya. +A page outlining 3-rd some party libraries compatible with LibreTiny. !!! note To use some (most? (all?)) of these, a flag in `platformio.ini` is required to disable compatibility checks (because most libs are meant for ESP32/Arduino official framework): diff --git a/docs/dev/lt-api.md b/docs/dev/lt-api.md index 8f50b9d..95bf1b2 100644 --- a/docs/dev/lt-api.md +++ b/docs/dev/lt-api.md @@ -1,6 +1,6 @@ -# LibreTuya API +# LibreTiny API -The LibreTuya API is divided in two parts: +The LibreTiny API is divided in two parts: - the C API, available in all families and frameworks - the C++ API, available in the Arduino framework only. @@ -13,7 +13,7 @@ It's recommended to use the C API wherever possible. This API is available using: -- `#include ` +- `#include ` - `#include ` ### CPU @@ -96,44 +96,44 @@ This API is available using: - `#include ` -### LibreTuya +### LibreTiny {% - include-markdown "../../ltapi/class_libre_tuya.md" + include-markdown "../../ltapi/class_libre_tiny.md" start="# Detailed Description\n" end="## Public Functions Documentation" %} {% - include-markdown "../../ltapi/class_libre_tuya.md" + include-markdown "../../ltapi/class_libre_tiny.md" start="## Public Functions\n" end="# Detailed Description" %} -### LibreTuyaOTA +### LibreTinyOTA {% - include-markdown "../../ltapi/class_libre_tuya_o_t_a.md" + include-markdown "../../ltapi/class_libre_tiny_o_t_a.md" start="# Detailed Description\n" end="## Public Functions Documentation" %} {% - include-markdown "../../ltapi/class_libre_tuya_o_t_a.md" + include-markdown "../../ltapi/class_libre_tiny_o_t_a.md" start="## Public Functions\n" end="# Detailed Description" %} -### LibreTuyaWDT +### LibreTinyWDT {% - include-markdown "../../ltapi/class_libre_tuya_w_d_t.md" + include-markdown "../../ltapi/class_libre_tiny_w_d_t.md" start="# Detailed Description\n" end="## Public Functions Documentation" %} {% - include-markdown "../../ltapi/class_libre_tuya_w_d_t.md" + include-markdown "../../ltapi/class_libre_tiny_w_d_t.md" start="## Public Functions\n" end="# Detailed Description" %} diff --git a/docs/dev/ota/README.md b/docs/dev/ota/README.md index 84dac21..2a8821f 100644 --- a/docs/dev/ota/README.md +++ b/docs/dev/ota/README.md @@ -1,6 +1,6 @@ # UF2-based OTA -LibreTuya's OTA updating is based on [Microsoft's UF2 specification](https://microsoft.github.io/uf2/). Some aspects of the process, such as OTA1/2 support and target partition selection, have been customized with extension tags. +LibreTiny's OTA updating is based on [Microsoft's UF2 specification](https://microsoft.github.io/uf2/). Some aspects of the process, such as OTA1/2 support and target partition selection, have been customized with extension tags. !!! note Just like in UF2, all values in this format are little-endian. diff --git a/docs/dev/ota/library.md b/docs/dev/ota/library.md index c7f3126..5a0c63b 100644 --- a/docs/dev/ota/library.md +++ b/docs/dev/ota/library.md @@ -1,6 +1,6 @@ # uf2ota library -uf2ota library allows to write a LibreTuya UF2 file to the flash, while parsing all the necessary tags. It manages the target partitions, compatibility checks, and works on top of the FAL provided by FlashDB. +uf2ota library allows to write a LibreTiny UF2 file to the flash, while parsing all the necessary tags. It manages the target partitions, compatibility checks, and works on top of the FAL provided by FlashDB. ## Usage example diff --git a/docs/dev/ota/uf2ota.md b/docs/dev/ota/uf2ota.md index e8a4519..09b33ad 100644 --- a/docs/dev/ota/uf2ota.md +++ b/docs/dev/ota/uf2ota.md @@ -1,6 +1,6 @@ # uf2ota.py -This is a tool for converting LibreTuya firmware images to UF2 format for OTA updates. +This is a tool for converting LibreTiny firmware images to UF2 format for OTA updates. ```console $ python uf2ota.py @@ -51,7 +51,7 @@ Tags: - FIRMWARE: esphome - VERSION: 2022.6.0-dev - OTA_VERSION: 01 - - DEVICE: LibreTuya + - DEVICE: LibreTiny - LT_HAS_OTA1: 01 - LT_HAS_OTA2: 01 - LT_PART_1: ota1 @@ -63,7 +63,7 @@ Total binary size: 302448 # dump -Dump UF2 file (only LibreTuya format) into separate firmware binaries. +Dump UF2 file (only LibreTiny format) into separate firmware binaries. ```console $ python uf2ota.py dump out.uf2 diff --git a/docs/dev/project-structure.md b/docs/dev/project-structure.md index 8da2480..edf8a4e 100644 --- a/docs/dev/project-structure.md +++ b/docs/dev/project-structure.md @@ -6,11 +6,11 @@ arduino/ │ ├─ cores/ Wiring core files │ ├─ libraries/ Supported built-in family libraries │ ├─ port/ External library port units -├─ libretuya/ +├─ libretiny/ │ ├─ api/ Library interfaces │ ├─ common/ Units common to all families │ ├─ compat/ Fixes for compatibility with ESP32 framework -│ ├─ core/ LibreTuya API for Arduino cores +│ ├─ core/ LibreTiny API for Arduino cores │ ├─ libraries/ Built-in family-independent libraries | ├─ port/ External library port units | ├─ posix/ POSIX-like C utility functions @@ -26,7 +26,7 @@ builder/ │ ├─ -arduino.py Arduino Core build system ├─ libs/ Builders for external libraries ├─ utils/ SCons utils used during the build -├─ arduino-common.py Builder to provide ArduinoCore-API and LibreTuya APIs +├─ arduino-common.py Builder to provide ArduinoCore-API and LibreTiny APIs ├─ main.py Main PlatformIO builder docs/ Project documentation, guides, tips, etc. platform/ diff --git a/docs/flashing/esphome.md b/docs/flashing/esphome.md index 48e3c49..d4958fa 100644 --- a/docs/flashing/esphome.md +++ b/docs/flashing/esphome.md @@ -13,7 +13,7 @@ ESPHome can be flashed in few different ways, depending on your needs. === "CLI" - The flasher program built-in LibreTuya is also available for ESPHome. + The flasher program built-in LibreTiny is also available for ESPHome. - use `python -m esphome run yourdevice.yml` to recompile AND upload the firmware - use `python -m esphome upload yourdevice.yml` to upload without recompiling diff --git a/docs/flashing/platformio.md b/docs/flashing/platformio.md index 09c561e..5dc6ef8 100644 --- a/docs/flashing/platformio.md +++ b/docs/flashing/platformio.md @@ -1,6 +1,6 @@ # Flashing PlatformIO projects -PlatformIO projects developed with LibreTuya can be flashed just like any other PIO project. +PlatformIO projects developed with LibreTiny can be flashed just like any other PIO project. !!! abstract All binary files generated by PlatformIO will be in `.pio/build//`. The methods described below may require you to get a file from that directory. @@ -9,7 +9,7 @@ PlatformIO projects developed with LibreTuya can be flashed just like any other ## Built-in flasher -LibreTuya has a built-in firmware uploader, based on [ltchiptool](tools/ltchiptool.md). Pressing `Upload` in PlatformIO IDE does all the work for you. +LibreTiny has a built-in firmware uploader, based on [ltchiptool](tools/ltchiptool.md). Pressing `Upload` in PlatformIO IDE does all the work for you. If you have more than one COM port, configure your PIO project first: diff --git a/docs/flashing/tools/adr.md b/docs/flashing/tools/adr.md index 357cadb..a976b67 100644 --- a/docs/flashing/tools/adr.md +++ b/docs/flashing/tools/adr.md @@ -7,7 +7,7 @@ This feature allows to upload code using UART, without needing to ground the CEN It is enabled by default (using the `LT_AUTO_DOWNLOAD_REBOOT` option). It works by listening to incoming UART data, and checking if it matches a command that the flashing program would send. If it does, a chip reboot is performed and the uploading process starts. !!! note - ADR will only work if there's already a recent build of LibreTuya flashed to the device (and if the device doesn't bootloop or freeze immediately). + ADR will only work if there's already a recent build of LibreTiny flashed to the device (and if the device doesn't bootloop or freeze immediately). ## Beken 72xx diff --git a/docs/flashing/tools/cloudcutter.md b/docs/flashing/tools/cloudcutter.md index 87969d4..3e1ae56 100644 --- a/docs/flashing/tools/cloudcutter.md +++ b/docs/flashing/tools/cloudcutter.md @@ -22,7 +22,7 @@ If your device doesn't have a profile yet, it will probably not work. You can co ### Firmware building -1. [Compile ESPHome](../../projects/esphome.md), or your custom firmware based on LibreTuya. +1. [Compile ESPHome](../../projects/esphome.md), or your custom firmware based on LibreTiny. 2. Get the firmware binary, named `bk7231x_app.ota.ug.bin` from the build directory (`.pio/build//` or `.esphome/build//.pioenvs//`). 3. Put it in the `custom-firmware` directory of tuya-cloudcutter. diff --git a/docs/flashing/tools/ltchiptool.md b/docs/flashing/tools/ltchiptool.md index cb1c8e9..0a157b8 100644 --- a/docs/flashing/tools/ltchiptool.md +++ b/docs/flashing/tools/ltchiptool.md @@ -62,7 +62,7 @@ It is a good idea to dump the stock firmware (full flash contents) of your devic If you want to flash custom firmware, or restore stock firmware from a previously dumped file, follow the steps below. !!! info - LibreTuya generates multiple firmware files in the build directory. **You usually want to flash the `.uf2` file**, but since ltchiptool can detect file types, you can choose a different firmware file and it'll tell you if that works. + LibreTiny generates multiple firmware files in the build directory. **You usually want to flash the `.uf2` file**, but since ltchiptool can detect file types, you can choose a different firmware file and it'll tell you if that works. 1. Choose `Write flash`. Click `Browse` and select a valid firmware file. The file type and chip type will be auto-detected, along with correct flash offset and length. No need to worry about overwriting the bootloader anymore! 2. Connect the chip to your PC, according to the [chip connection guides](../chip-connection/SUMMARY.md). Select the COM port that your UART adapter is using. @@ -135,7 +135,7 @@ Tags: - FIRMWARE: arduinotest - VERSION: 22.08.01 - OTA_VERSION: 01 - - DEVICE: LibreTuya + - DEVICE: LibreTiny - BUILD_DATE: 6d08e862 - LT_HAS_OTA1: 01 - LT_HAS_OTA2: 00 diff --git a/docs/getting-started/README.md b/docs/getting-started/README.md index 31e11dc..77e798f 100644 --- a/docs/getting-started/README.md +++ b/docs/getting-started/README.md @@ -1,6 +1,6 @@ # Getting started -Using LibreTuya is simple, just like every other PlatformIO development platform. +Using LibreTiny is simple, just like every other PlatformIO development platform. 1. [Install PlatformIO](https://platformio.org/platformio-ide) 2. `platformio platform install -f https://github.com/kuba2k2/libretuya` @@ -15,11 +15,11 @@ Using LibreTuya is simple, just like every other PlatformIO development platform ## Run community projects -LibreTuya was developed with popular community projects in mind. Currently, unofficial [ESPHome port](../projects/esphome.md) is available ([the PR](https://github.com/esphome/esphome/pull/3509) will hopefully be merged into upstream at some point). +LibreTiny was developed with popular community projects in mind. Currently, unofficial [ESPHome port](../projects/esphome.md) is available ([the PR](https://github.com/esphome/esphome/pull/3509) will hopefully be merged into upstream at some point). ## Develop your own project -If you're developing your own embedded software, and want it to run on LibreTuya-supported chips, create a project. +If you're developing your own embedded software, and want it to run on LibreTiny-supported chips, create a project. - use PlatformIO IDE (PIO Home -> Open -> New Project) - run `pio project init` in your desired project directory @@ -28,7 +28,7 @@ Next, read one of the [flashing guides](../flashing/SUMMARY.md) to run your proj ### LT configuration -LibreTuya has a few configuration options that change its behavior or features. Refer to [LT configuration](../dev/config.md) for details. +LibreTiny has a few configuration options that change its behavior or features. Refer to [LT configuration](../dev/config.md) for details. ### GPIO usage - important change diff --git a/docs/platform/beken-72xx/flashing.md b/docs/platform/beken-72xx/flashing.md index f8d6954..d712b9e 100644 --- a/docs/platform/beken-72xx/flashing.md +++ b/docs/platform/beken-72xx/flashing.md @@ -41,7 +41,7 @@ Note that the download mode can only be activated when the flasher is running (t ## Auto-download-reboot -If you have a recent version of LibreTuya installed on the chip, you can use [Auto-download-reboot](../../flashing/tools/adr.md) to reboot the chip automatically. This is enabled by default, so you don't have to change anything. +If you have a recent version of LibreTiny installed on the chip, you can use [Auto-download-reboot](../../flashing/tools/adr.md) to reboot the chip automatically. This is enabled by default, so you don't have to change anything. ## Single-adapter usage diff --git a/docs/platform/realtek-ambz/debugging.md b/docs/platform/realtek-ambz/debugging.md index 55ff768..4a81fd9 100644 --- a/docs/platform/realtek-ambz/debugging.md +++ b/docs/platform/realtek-ambz/debugging.md @@ -4,13 +4,13 @@ Debugging of Realtek Ameba chips is possible and was tested with OpenOCD running *(the following is applicable to Arduino framework, and was not tested with SDK framework)* -LibreTuya has ready-to-use OpenOCD config files: +LibreTiny has ready-to-use OpenOCD config files: - [platform/realtek-ambz/openocd/amebaz.cfg](../../../cores/realtek-ambz/misc/amebaz.cfg) ## Local debugger -It should be possible to use PlatformIO's built-in debugging capabilities directly, when plugging an OpenOCD-compatible debugger into your PC. As there are no debugger interfaces built into Tuya boards, you need to specify your interface of choice in `platformio.ini`: +It should be possible to use PlatformIO's built-in debugging capabilities directly, when plugging an OpenOCD-compatible debugger into your PC. As there are no debugger interfaces built into these IoT boards, you need to specify your interface of choice in `platformio.ini`: ```ini [env:my_board] openocd_interface = diff --git a/docs/projects/esphome.md b/docs/projects/esphome.md index 2429977..38be411 100644 --- a/docs/projects/esphome.md +++ b/docs/projects/esphome.md @@ -2,13 +2,13 @@ Because ESPHome does not natively support running on non-ESP chips, you need to use a fork of the project. -There are two basic ways to install and use LibreTuya-ESPHome. You can choose the option that best suits you: +There are two basic ways to install and use LibreTiny-ESPHome. You can choose the option that best suits you: - command line (CLI) - for more experienced users; compilation using CLI commands, somewhat easier to troubleshoot - ESPHome Dashboard (GUI) - for new users, might be an easy way to go; config management & compilation using web-based dashboard !!! tip - You can use LibreTuya-ESPHome for ESP32/ESP8266 compilation as well - the forked version *extends* the base, and doesn't remove any existing features. Keep in mind that you might not have latest ESPHome updates until the fork gets updated (which usually happens at most every few weeks). + You can use LibreTiny-ESPHome for ESP32/ESP8266 compilation as well - the forked version *extends* the base, and doesn't remove any existing features. Keep in mind that you might not have latest ESPHome updates until the fork gets updated (which usually happens at most every few weeks). ## Find your device's board @@ -23,7 +23,7 @@ If your board isn't listed, use one of the **Generic** boards, depending on the !!! important Read [Getting started](../getting-started/README.md) first - most importantly, the first part about installation. - **It is very important that you have the latest version of LibreTuya installed** (not `libretuya-esphome` - this is a different thing!) **so that you don't face issues that are already resolved**. + **It is very important that you have the latest version of LibreTiny installed** (not `libretiny-esphome` - this is a different thing!) **so that you don't face issues that are already resolved**. Assuming you have PlatformIO, git and Python installed: @@ -44,15 +44,15 @@ If your board isn't listed, use one of the **Generic** boards, depending on the 1. `git clone https://github.com/kuba2k2/libretuya-esphome` (or download the .ZIP and unpack it, not recommended) 2. Open a terminal/cmd.exe in the cloned directory (`libretuya-esphome`). - 3. `python docker/build.py --tag libretuya --arch amd64 --build-type docker build` - this will build the Docker image of ESPHome. Change `amd64` to something else if you're using a Raspberry Pi. + 3. `python docker/build.py --tag libretiny --arch amd64 --build-type docker build` - this will build the Docker image of ESPHome. Change `amd64` to something else if you're using a Raspberry Pi. 4. Create a `docker-compose.yml` file in the same directory: ```yaml title="docker-compose.yml" version: "3" services: esphome: - container_name: esphome-libretuya - image: esphome/esphome-amd64:libretuya # (2)! + container_name: esphome-libretiny + image: esphome/esphome-amd64:libretiny # (2)! volumes: - ./configs:/config:rw # (1)! - /etc/localtime:/etc/localtime:ro @@ -76,7 +76,7 @@ If your board isn't listed, use one of the **Generic** boards, depending on the esphome: name: yourdevice - libretuya: + libretiny: board: wr3 # THIS IS YOUR BOARD CODE framework: version: latest @@ -102,7 +102,7 @@ If your board isn't listed, use one of the **Generic** boards, depending on the - `New Device` - `Continue` - enter name and WiFi details - - choose `LibreTuya` + - choose `LibreTiny` - choose the board that you found before - select `Skip` 3. A new config file will be added. Press `Edit` and proceed to the next section. @@ -133,10 +133,10 @@ Now, refer to the [flashing guide](../flashing/esphome.md) to learn how to uploa !!! note This part is for advanced users. You'll probably be fine with the default options. -All options from [Options & config](../dev/config.md) can be customized in the `libretuya:` block: +All options from [Options & config](../dev/config.md) can be customized in the `libretiny:` block: ```yaml title="yourdevice.yml" -libretuya: +libretiny: framework: version: latest lt_config: @@ -149,7 +149,7 @@ libretuya: Additionally, few options have their dedicated keys: ```yaml title="yourdevice.yml" -libretuya: +libretiny: framework: version: latest # verbose/trace/debug/info/warn/error/fatal diff --git a/docs/status/supported.md b/docs/status/supported.md index 8e7c21f..a7ec757 100644 --- a/docs/status/supported.md +++ b/docs/status/supported.md @@ -24,7 +24,7 @@ If you have an unsupported chip, feel free to reach out using Issues or on the D A list of chip families currently supported by this project. !!! note - The term *family* was chosen over *platform*, in order to reduce possible confusion between LibreTuya supported "platforms" and PlatformIO's "platform", as an entire package. *Family* is also more compatible with the UF2 term. + The term *family* was chosen over *platform*, in order to reduce possible confusion between LibreTiny supported "platforms" and PlatformIO's "platform", as an entire package. *Family* is also more compatible with the UF2 term. The following list corresponds to UF2 OTA format family names, and is also [available as JSON](../../families.json). The IDs are also present in [lt_Types.h](../../ltapi/lt__types_8h.md). diff --git a/examples/PinScan/README.md b/examples/PinScan/README.md index 56cd313..d0e710e 100644 --- a/examples/PinScan/README.md +++ b/examples/PinScan/README.md @@ -9,7 +9,7 @@ By using a simple TUI (text user interface), you can check which I/O pins corres Uploading the example and opening up a terminal (e.g. PuTTY) presents this menu: ``` -LibreTuya v0.8.0, PinScan v1.0 +LibreTiny v0.8.0, PinScan v1.0 Board: cb2s I/O count: 11 Digital I/O count: 11 diff --git a/examples/PinScan/src/help.cpp b/examples/PinScan/src/help.cpp index 48e8e74..e7e6aa8 100644 --- a/examples/PinScan/src/help.cpp +++ b/examples/PinScan/src/help.cpp @@ -7,7 +7,7 @@ void printHelp(uint8_t mode) { switch (mode) { case '\0': stream->setTimeout(10000); - stream->println("LibreTuya v" LT_VERSION_STR ", PinScan v" EXAMPLE_VER); + stream->println("LibreTiny v" LT_VERSION_STR ", PinScan v" EXAMPLE_VER); stream->println("Board: " LT_BOARD_STR); stream->print("I/O count: "); stream->println(PINS_COUNT); diff --git a/mkdocs.yml b/mkdocs.yml index 7403359..dfaed7f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: LibreTuya +site_name: LibreTiny docs_dir: . site_url: https://docs.libretuya.ml/ diff --git a/platform.json b/platform.json index 4e21916..cea85bc 100644 --- a/platform.json +++ b/platform.json @@ -1,7 +1,7 @@ { "name": "libretuya", - "title": "LibreTuya", - "description": "Free your Tuya IoT modules.", + "title": "LibreTiny", + "description": "PlatformIO development platform for IoT modules", "repository": { "type": "git", "url": "https://github.com/kuba2k2/platformio-libretuya" diff --git a/platform.py b/platform.py index 854493a..59f204b 100644 --- a/platform.py +++ b/platform.py @@ -363,7 +363,7 @@ class LibretuyaPlatform(PlatformBase): if debug_tool == "custom": return exc = DebugInvalidOptionsError( - f"[LibreTuya] Debug tool {debug_tool} is not supported by board {board}." + f"[LibreTiny] Debug tool {debug_tool} is not supported by board {board}." ) exc.MESSAGE = "" raise exc