[core] Use term "family" instead of "platform"
This commit is contained in:
@@ -29,7 +29,7 @@ build_flags =
|
||||
|
||||
The following options enable library-specific debugging messages. They are only effective if `LT_LOGLEVEL` is set below INFO. All of them are disabled by default.
|
||||
|
||||
Platforms should generally call i.e. WiFiClient debugging for client-related code, even if the `WiFiClient.cpp` file is physically absent.
|
||||
Families should generally call i.e. WiFiClient debugging for client-related code, even if the `WiFiClient.cpp` file is physically absent.
|
||||
|
||||
- LT_DEBUG_WIFI - `WiFi.cpp`
|
||||
- LT_DEBUG_WIFI_CLIENT - `WiFiClient.cpp`
|
||||
@@ -37,7 +37,7 @@ Platforms should generally call i.e. WiFiClient debugging for client-related cod
|
||||
- LT_DEBUG_WIFI_STA - `WiFiSTA.cpp`
|
||||
- LT_DEBUG_WIFI_AP - `WiFiAP.cpp`
|
||||
|
||||
## Platform options
|
||||
## Family options
|
||||
|
||||
- LT_HAS_LWIP - whether platform SDK has LwIP. This causes `LwIPRxBuffer.cpp` to be compiled for platform libraries to use.
|
||||
- LT_HAS_LWIP2 - whether platform has LwIP v2.0.0 or newer. This causes `LwIPmDNS.cpp` to be compiled.
|
||||
- LT_HAS_LWIP - whether family SDK has LwIP. This causes `LwIPRxBuffer.cpp` to be compiled for family libraries to use.
|
||||
- LT_HAS_LWIP2 - whether family has LwIP v2.0.0 or newer. This causes `LwIPmDNS.cpp` to be compiled.
|
||||
|
||||
18
docs/families.md
Normal file
18
docs/families.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Families
|
||||
|
||||
A list of families currently available in 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 following list corresponds to UF2 OTA format family names, and is also [available as JSON](../uf2families.json). The IDs are also present in [uf2ota/models.py](../tools/uf2ota/models.py) and [ChipType.h](../arduino/libretuya/core/ChipType.h).
|
||||
|
||||
Full name | Code | Short name & ID | Supported MCU(s) | Arduino Core | Source SDK
|
||||
-----------------------------------------------------------------------|--------|-------------------------|------------------|--------------|--------------------------------------------------------------------------
|
||||
Realtek Ameba1 | `-` | `RTL8710A` (0x9FFFD543) | - | ❌ | -
|
||||
[Realtek AmebaZ](https://www.amebaiot.com/en/amebaz/) (`realtek-ambz`) | `ambz` | `RTL8710B` (0x22E0D6FC) | RTL87xxB | ✔️ | `framework-realtek-amb1` ([amb1_sdk](https://github.com/ambiot/amb1_sdk))
|
||||
Realtek AmebaZ2 | `-` | `RTL8720C` (0xE08F7564) | - | ❌ | -
|
||||
Realtek AmebaD | `-` | `RTL8720D` (0x3379CFE2) | - | ❌ | -
|
||||
Beken 7231T | `-` | `BK7231T` (0x675A40B0) | - | ❌ | -
|
||||
Beken 7231N | `-` | `BK7231N` (0x7B3EF230) | - | ❌ | -
|
||||
Boufallo 602 | `-` | `BL602` (0xDE1270B7) | - | ❌ | -
|
||||
Xradiotech 809 | `-` | `XR809` (0x51E903A8) | - | ❌ | -
|
||||
@@ -4,9 +4,11 @@ import json
|
||||
from os.path import dirname, isdir, join
|
||||
|
||||
HEADER = """\
|
||||
# Platforms
|
||||
# Families
|
||||
|
||||
A list of platforms currently available in this project.
|
||||
A list of families currently available in 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 following list corresponds to UF2 OTA format family names, and is also [available as JSON](../uf2families.json). The IDs are also present in [uf2ota/models.py](../tools/uf2ota/models.py) and [ChipType.h](../arduino/libretuya/core/ChipType.h).
|
||||
"""
|
||||
@@ -18,8 +20,8 @@ def format_row(row: list, lengths: list) -> str:
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
data = join(dirname(__file__), "..", "uf2families.json")
|
||||
out = join(dirname(__file__), "platforms.md")
|
||||
data = join(dirname(__file__), "..", "families.json")
|
||||
out = join(dirname(__file__), "families.md")
|
||||
with open(data, "r") as f:
|
||||
data = json.load(f)
|
||||
|
||||
@@ -27,9 +29,9 @@ if __name__ == "__main__":
|
||||
|
||||
lengths = [0, 0, 0, 0, 0, 0]
|
||||
header = [
|
||||
"Platform name",
|
||||
"Platform code",
|
||||
"Family name & ID",
|
||||
"Full name",
|
||||
"Code",
|
||||
"Short name & ID",
|
||||
"Supported MCU(s)",
|
||||
"Arduino Core",
|
||||
"Source SDK",
|
||||
@@ -40,29 +42,23 @@ if __name__ == "__main__":
|
||||
id = family["id"]
|
||||
short_name = family["short_name"]
|
||||
description = family["description"]
|
||||
platform = family.get("platform", "")
|
||||
platform_code = family.get("platform_code", "-")
|
||||
platform_url = family.get("platform_url", "-")
|
||||
platform_sdk = family.get("platform_sdk", "-")
|
||||
platform_framework = family.get("platform_framework", "-")
|
||||
name = family.get("name", "")
|
||||
code = family.get("code", "-")
|
||||
url = family.get("url", "-")
|
||||
sdk = family.get("sdk", "-")
|
||||
framework = family.get("framework", "-")
|
||||
mcus = family.get("mcus", "-")
|
||||
platform_sdk_name = platform_sdk.rpartition("/")[2]
|
||||
sdk_name = sdk.rpartition("/")[2]
|
||||
arduino = (
|
||||
isdir(join(dirname(__file__), "..", "arduino", platform))
|
||||
if platform
|
||||
else False
|
||||
isdir(join(dirname(__file__), "..", "arduino", name)) if name else False
|
||||
)
|
||||
row = [
|
||||
f"[{description}]({platform_url}) (`{platform}`)"
|
||||
if platform
|
||||
else description,
|
||||
f"`{platform_code}`",
|
||||
f"[{description}]({url}) (`{name}`)" if name else description,
|
||||
f"`{code}`",
|
||||
f"`{short_name}` ({id})",
|
||||
", ".join(mcus),
|
||||
"✔️" if arduino else "❌",
|
||||
f"`{platform_framework}` ([{platform_sdk_name}]({platform_sdk}))"
|
||||
if platform
|
||||
else "-",
|
||||
f"`{framework}` ([{sdk_name}]({sdk}))" if name else "-",
|
||||
]
|
||||
rows.append(row)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# Platforms
|
||||
|
||||
A list of platforms currently available in this project.
|
||||
|
||||
The following list corresponds to UF2 OTA format family names, and is also [available as JSON](../uf2families.json). The IDs are also present in [uf2ota/models.py](../tools/uf2ota/models.py) and [ChipType.h](../arduino/libretuya/core/ChipType.h).
|
||||
|
||||
Platform name | Platform code | Family name & ID | Supported MCU(s) | Arduino Core | Source SDK
|
||||
-----------------------------------------------------------------------|---------------|-------------------------|------------------|--------------|--------------------------------------------------------------------------
|
||||
Realtek Ameba1 | `-` | `RTL8710A` (0x9FFFD543) | - | ❌ | -
|
||||
[Realtek AmebaZ](https://www.amebaiot.com/en/amebaz/) (`realtek-ambz`) | `ambz` | `RTL8710B` (0x22E0D6FC) | RTL87xxB | ✔️ | `framework-realtek-amb1` ([amb1_sdk](https://github.com/ambiot/amb1_sdk))
|
||||
Realtek AmebaZ2 | `-` | `RTL8720C` (0xE08F7564) | - | ❌ | -
|
||||
Realtek AmebaD | `-` | `RTL8720D` (0x3379CFE2) | - | ❌ | -
|
||||
Beken 7231T | `-` | `BK7231T` (0x675A40B0) | - | ❌ | -
|
||||
Beken 7231N | `-` | `BK7231N` (0x7B3EF230) | - | ❌ | -
|
||||
Boufallo 602 | `-` | `BL602` (0xDE1270B7) | - | ❌ | -
|
||||
Xradiotech 809 | `-` | `XR809` (0x51E903A8) | - | ❌ | -
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
```
|
||||
arduino/
|
||||
├─ <platform name>/ Arduino Core for specific SoC
|
||||
├─ <family name>/ Arduino Core for specific SoC
|
||||
│ ├─ cores/ Wiring core files
|
||||
│ ├─ libraries/ Supported built-in platform libraries
|
||||
│ ├─ libraries/ Supported built-in family libraries
|
||||
├─ libretuya/
|
||||
│ ├─ api/ Library interfaces
|
||||
│ ├─ common/ Units common to all platforms
|
||||
│ ├─ common/ Units common to all families
|
||||
│ ├─ compat/ Fixes for compatibility with ESP32 framework
|
||||
│ ├─ core/ LibreTuya API for Arduino cores
|
||||
│ ├─ libraries/ Built-in platform-independent libraries
|
||||
│ ├─ libraries/ Built-in family-independent libraries
|
||||
boards/
|
||||
├─ <board name>/ Board-specific code
|
||||
│ ├─ variant.cpp Arduino variant initialization
|
||||
@@ -18,20 +18,21 @@ boards/
|
||||
├─ <board name>.json PlatformIO board description
|
||||
builder/
|
||||
├─ frameworks/ Framework builders for PlatformIO
|
||||
│ ├─ <platform name>-sdk.py Vanilla SDK build system
|
||||
│ ├─ <platform name>-arduino.py Arduino Core build system
|
||||
│ ├─ <family name>-sdk.py Vanilla SDK build system
|
||||
│ ├─ <family name>-arduino.py Arduino Core build system
|
||||
├─ arduino-common.py Builder to provide ArduinoCore-API and LibreTuya APIs
|
||||
├─ main.py Main PlatformIO builder
|
||||
├─ utils.py SCons utils used during the build
|
||||
docs/ Project documentation, guides, tips, etc.
|
||||
platform/
|
||||
├─ <platform name>/ Platform-specific configurations
|
||||
├─ <family name>/ Family-specific configurations
|
||||
│ ├─ bin/ Binary blobs (bootloaders, etc.)
|
||||
│ ├─ fixups/ Code fix-ups to replace SDK parts
|
||||
│ ├─ ld/ Linker scripts
|
||||
│ ├─ openocd/ OpenOCD configuration files
|
||||
tools/
|
||||
├─ <tool name>/ Tools used during the build
|
||||
families.json List of supported device families
|
||||
platform.json PlatformIO manifest
|
||||
platform.py Custom PlatformIO script
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user