45 Commits

Author SHA1 Message Date
Kuba Szczodrzyński
9e0750c9d3 [release] v0.12.5
Some checks failed
Lint check / Lint with clang-format (push) Has been cancelled
Lint check / Lint with black (push) Has been cancelled
PlatformIO Publish / publish (push) Has been cancelled
2023-01-28 13:00:10 +01:00
Kuba Szczodrzyński
9a3e512b1b [boards] Add LSC LMA35 T variant 2023-01-28 13:00:10 +01:00
Kuba Szczodrzyński
861e741030 [beken-72xx] Disable OTA encryption 2023-01-28 12:53:57 +01:00
Kuba Szczodrzyński
a3e7e21d45 [core] Migrate to ltchiptool v3.0.0 2023-01-28 12:53:57 +01:00
Matt Shepcar
86db2fcf61 [beken-72xx] Fix for flicker when PWM lights turn on/off on bk7231n (#68) 2023-01-28 12:52:01 +01:00
Kuba Szczodrzyński
fcd72e013a [docs] Add ESPHome Dashboard usage docs 2023-01-26 20:41:57 +01:00
Kuba Szczodrzyński
2450f8c64b [release] v0.12.4
Some checks failed
Lint check / Lint with clang-format (push) Has been cancelled
Lint check / Lint with black (push) Has been cancelled
PlatformIO Publish / publish (push) Has been cancelled
2023-01-26 11:28:25 +01:00
Kuba Szczodrzyński
676a9b1686 [core] Fix reinstalling ltchiptool 2023-01-26 11:28:09 +01:00
Kuba Szczodrzyński
b10db63c74 [realtek-ambz] Fix WiFi station BSSID retrieval 2023-01-19 17:38:45 +01:00
Kuba Szczodrzyński
4b25ef7516 [realtek-ambz] Fix resetting OTA switch when it reaches 0 2023-01-19 16:53:27 +01:00
Kuba Szczodrzyński
de0d19cda6 [docs] Update ltchiptool installation info 2023-01-19 12:29:59 +01:00
Kuba Szczodrzyński
c55386af0e [docs] Add icons to external links 2023-01-18 19:06:18 +01:00
Kuba Szczodrzyński
33fe1c7a54 Merge branch 'docs-refactor' 2023-01-18 18:39:11 +01:00
Kuba Szczodrzyński
bf6d05e92a [docs] Remove AmbZ doxygen build 2023-01-18 18:38:52 +01:00
Kuba Szczodrzyński
b6113d8d2b [docs] Configure MkDocs Material 2023-01-18 18:32:34 +01:00
Kuba Szczodrzyński
bc31154035 [docs] Add Tuya Pinout Config to resources 2023-01-18 17:59:51 +01:00
Kuba Szczodrzyński
edfe0329bf [docs] Update links in board docs 2023-01-18 17:59:19 +01:00
Kuba Szczodrzyński
1e11dd776a [docs] Move resources to chip family docs 2023-01-18 17:56:09 +01:00
Kuba Szczodrzyński
028526d22d [docs] Add ltchiptool GUI download button 2023-01-18 15:00:01 +01:00
Kuba Szczodrzyński
7ac2d854f2 [docs] Move tools docs to a subdirectory 2023-01-18 14:59:36 +01:00
Kuba Szczodrzyński
279c81e431 [docs] Update code block styles 2023-01-18 14:02:12 +01:00
Kuba Szczodrzyński
4e319b40ed [docs] Fix ltchiptool docs badges 2023-01-18 13:30:13 +01:00
Kuba Szczodrzyński
d082b39980 [docs] Add ltchiptool screenshot 2023-01-17 22:45:00 +01:00
Kuba Szczodrzyński
277402f577 [docs] Update chip flashing guides, fix mkdocs building 2023-01-17 22:33:57 +01:00
Kuba Szczodrzyński
9e95c507b1 [docs] Refactor docs structure, add project upload guides 2023-01-17 18:56:15 +01:00
Kuba Szczodrzyński
7440fc6f46 [core] Add parent_description key to families 2023-01-16 10:42:30 +01:00
Kuba Szczodrzyński
a24028f674 [beken-72xx] Fix RBL app size typo 2023-01-16 10:41:17 +01:00
Stroe Andrei Catalin
00913b013f [beken-72xx] Fix compilation on ARM systems (#58)
* Fix toolchain for BK7231 on ARM cpus

* Fix format

* PR comments

* PR Comments, part 2
2023-01-03 21:15:03 +01:00
Mihai Ambrosie
447d08d613 [realtek-ambz] Fix 4M/980k linker script name (#56) 2023-01-03 10:56:48 +01:00
Kuba Szczodrzyński
d4f7736b2d [release] v0.12.3
Some checks failed
Lint check / Lint with clang-format (push) Has been cancelled
Lint check / Lint with black (push) Has been cancelled
PlatformIO Publish / publish (push) Has been cancelled
2023-01-02 20:32:46 +01:00
Kuba Szczodrzyński
60f72fffdf [core] Fix installing ltchiptool, again 2023-01-02 20:32:29 +01:00
Kuba Szczodrzyński
77af9c1cba [release] v0.12.2
Some checks failed
Lint check / Lint with clang-format (push) Has been cancelled
Lint check / Lint with black (push) Has been cancelled
PlatformIO Publish / publish (push) Has been cancelled
2023-01-02 19:41:39 +01:00
Kuba Szczodrzyński
1b2414337f [core] Fix installing ltchiptool 2023-01-02 19:40:55 +01:00
Kuba Szczodrzyński
d41f1f2a4d [release] v0.12.1
Some checks failed
Lint check / Lint with clang-format (push) Has been cancelled
Lint check / Lint with black (push) Has been cancelled
PlatformIO Publish / publish (push) Has been cancelled
2023-01-02 17:06:16 +01:00
Kuba Szczodrzyński
f9967ff990 [core] Fix importing ltchiptool after updating 2023-01-02 17:05:35 +01:00
Kuba Szczodrzyński
db0ab41ea4 [realtek-ambz] Check SoftwareSerial before stopping 2023-01-02 16:03:49 +01:00
Kuba Szczodrzyński
da95cc30d3 [realtek-ambz] Move to GNU++11, update TODO.md 2023-01-02 16:02:57 +01:00
Ross Reedstrom
6b3001573e [docs] Fix link to supported boards (#53) 2023-01-01 14:05:57 +01:00
Kuba Szczodrzyński
b85f6f8c3f [release] v0.12.0
Some checks failed
Lint check / Lint with clang-format (push) Has been cancelled
Lint check / Lint with black (push) Has been cancelled
PlatformIO Publish / publish (push) Has been cancelled
2022-12-30 15:52:14 +01:00
Kuba Szczodrzyński
d036ac9fba [core] Migrate to ltchiptool v2.0.0 2022-12-30 15:51:32 +01:00
Kuba Szczodrzyński
f63a114371 [beken-72xx] Support compilation for BK7251 family 2022-12-08 20:16:44 +01:00
Kuba Szczodrzyński
8cb59661ac [boards] Add initial support for BK7252 2022-12-08 20:04:17 +01:00
Kuba Szczodrzyński
fc1da609f2 [beken-72xx] Add BL2028N to supported chips 2022-12-08 17:48:04 +01:00
Kuba Szczodrzyński
c6566323fd [boards] Move IC pinouts to separate directory 2022-12-08 17:26:46 +01:00
Kuba Szczodrzyński
30e1533ad9 [core] Rename BK7231T family to BK7231U 2022-12-08 17:19:42 +01:00
146 changed files with 3034 additions and 660 deletions

1
.gitignore vendored
View File

@@ -256,6 +256,5 @@ cython_debug/
# mkdocs
xml/
ltapi/
ltambz/
hashChanges.yaml
.piopm

View File

@@ -22,7 +22,7 @@ The main goal of this project is to provide a usable build environment for IoT d
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.
LibreTuya also provides a common interface for all family implementations. The interface is based on ESP32 official libraries.
**There's an [ESPHome port](https://docs.libretuya.ml/docs/projects/esphome/) based on LibreTuya, which supports BK7231 and RTL8710B chips.**
**Note:** this project is work-in-progress.
@@ -31,11 +31,7 @@ LibreTuya also provides a common interface for all family implementations. The i
1. [Install PlatformIO](https://platformio.org/platformio-ide)
2. `platformio platform install https://github.com/kuba2k2/libretuya`
3. Create a project, build it and upload!
4. See the [docs](https://kuba2k2.github.io/libretuya/) for any questions/problems.
## Board List
See [Boards & CPU list](https://kuba2k2.github.io/libretuya/docs/status/supported/).
4. See the [docs](https://docs.libretuya.ml/) for any questions/problems.
## Arduino Core support status

View File

@@ -1,40 +1,30 @@
* [Home](README.md)
* 😊 Getting started
* [Start here](docs/getting-started/README.md)
* [Uploading](docs/getting-started/uploading.md)
* [Options & config](docs/reference/config.md)
* Examples
* [PinScan](examples/PinScan/README.md)
* [ESPHome port](docs/projects/esphome.md)
* [Using tuya-cloudcutter](docs/getting-started/cloudcutter.md)
* [Auto-download-reboot](docs/getting-started/adr.md)
* [💻 Boards & CPU list](docs/status/supported.md)
* [✔️ Implementation status](docs/status/arduino.md)
* Supported chip families
* Beken BK72xx
* [General info](docs/platform/beken-72xx/README.md)
* [Flashing](docs/platform/beken-72xx/flashing.md)
* [Dumping](docs/platform/beken-72xx/dumping.md)
* Realtek AmebaZ Series
* [General info](docs/platform/realtek/README.md)
* [Flashing (AmebaZ)](docs/platform/realtek-ambz/flashing.md)
* [Dumping (AmebaZ)](docs/platform/realtek-ambz/dumping.md)
* [Debugging](docs/platform/realtek/debugging.md)
* [Exception decoder](docs/platform/realtek/exception-decoder.md)
* C library
* [Built-in functions](docs/platform/realtek-ambz/stdlib.md)
* [Memory management](docs/platform/realtek-ambz/memory-management.md)
* [All supported boards](boards/)
* API & libraries
* [Options & config](docs/reference/config.md)
* [LibreTuya API](docs/reference/lt-api.md)
* [😊 Getting started](docs/getting-started/README.md)
* [ESPHome](docs/projects/esphome.md)
* [📲 Flashing/dumping](docs/flashing/)
* [💻 Supported boards & chips](docs/status/supported.md)
* 📖 Reference
* Chip families
* [Beken BK72xx](docs/platform/beken-72xx/README.md)
* [Realtek Ameba - info](docs/platform/realtek-amb/README.md)
* [Realtek AmebaZ](docs/platform/realtek-ambz/README.md)
* [Debugging](docs/platform/realtek-ambz/debugging.md)
* [Exception decoder](docs/platform/realtek-ambz/exception-decoder.md)
* C library
* [Built-in functions](docs/platform/realtek-ambz/stdlib.md)
* [Memory management](docs/platform/realtek-ambz/memory-management.md)
* [🔧 LT configuration](docs/reference/config.md)
* [✔️ Implementation status](docs/status/arduino.md)
* [🔌 Boards documentation](boards/)
* [🔋 Examples](examples/)
* [📖 LibreTuya API](docs/reference/lt-api.md)
* [LT class reference](ltapi/class_libre_tuya.md)
* [Common methods](ltapi/_libre_tuya_a_p_i_8h.md)
* [Wiring custom methods](ltapi/_libre_tuya_custom_8h.md)
* [Logger](ltapi/lt__logger_8h.md)
* [Chip & family IDs](ltapi/_chip_type_8h_source.md)
* [POSIX utilities](ltapi/lt__posix__api_8h.md)
* Common API
* 📖 Common API
* [FS](ltapi/classfs_1_1_f_s.md)
* [Preferences](ltapi/class_i_preferences.md)
* [SoftwareSerial](ltapi/class_software_serial.md)
@@ -42,7 +32,7 @@
* [TCP Client](ltapi/class_i_wi_fi_client.md)
* [SSL Client](ltapi/class_i_wi_fi_client_secure.md)
* [TCP Server](ltapi/class_i_wi_fi_server.md)
* [LibreTuya libraries](docs/libs-built-in.md)
* [📖 LibreTuya libraries](docs/libs-built-in.md)
* [base64](ltapi/classbase64.md)
* [Flash](ltapi/class_flash_class.md)
* [HTTPClient](ltapi/class_h_t_t_p_client.md)
@@ -64,6 +54,5 @@
* [✈️ OTA format](docs/ota/README.md)
* [uf2ota.py tool](docs/ota/uf2ota.md)
* [uf2ota.h library](docs/ota/library.md)
* [uf2ota.h reference](ltapi/uf2ota_8h.md)
* [📓 TODO](TODO.md)
* [🔗 Resources](docs/resources.md)
* [📓 TODO](TODO.md)
* [🔗 Resources](docs/resources/)

14
TODO.md
View File

@@ -2,6 +2,16 @@
## General
### Environment stability
Do not publish *any* SDK functions, macros, defines and includes. Define only what's needed in LT's public headers (like `Arduino.h`). Everything else is taken from `sdk_extern.h` or `WVariant.h` (TODO decide whether to keep WV public / make both private / get rid of WV and use sdk_extern only). Private headers are included by LT's .cpp units (maybe a dedicated private header that would include sdk_extern + Arduino.h).
Developers wanting to use SDK functions need to include them.
Explicit is better than implicit.
- consider moving to C++17 (GNU)? or any newer than C++11
### New families
- BL602
@@ -10,6 +20,7 @@
- RTL8720D
- W600 and/or W800
- LN8825
- BK7231Q
- host-native family
### Tools
@@ -30,7 +41,6 @@
## BK7231
- implement OTA
- fix WiFi on BK7231N, test other functionality
- fix SSL (mbedTLS)
- I2C (Wire)
@@ -39,5 +49,5 @@
## RTL8710B
- move to GNU++11 (and verify that it works) - take all stdio functions from stdio.h
- take all stdio functions from stdio.h
- rewrite most of Wiring (it was copied from `ambd_arduino`, and is ugly)

View File

@@ -16,6 +16,7 @@ void delayMilliseconds(unsigned long ms) {
}
static uint32_t getTicksCount() {
// copied from bk_timer_ctrl(), for speeds
uint32_t timeout = 0;
REG_WRITE(TIMER0_2_READ_CTL, (BKTIMER0 << 2) | 1);
while (REG_READ(TIMER0_2_READ_CTL) & 1) {
@@ -58,9 +59,6 @@ unsigned long millis() {
}
unsigned long micros() {
// copied from bk_timer_ctrl(), for speeds
uint32_t timeout = 0;
#if (CFG_SOC_NAME == SOC_BK7231)
#error "Not implemented"
#endif
@@ -91,6 +89,7 @@ unsigned long micros() {
return correctedMillis * 1000 + nowTicks / (CFG_XTAL_FREQUENCE / 1000 / 1000);
#else
#if 0
uint32_t timeout = 0;
REG_WRITE(TIMER3_5_READ_CTL, (BKTIMER3 << 2) | 1);
while (REG_READ(TIMER3_5_READ_CTL) & 1) {
timeout++;

View File

@@ -106,7 +106,7 @@ void analogWrite(pin_size_t pinNumber, int value) {
pwm.duty_cycle3 = 0;
#endif
if (value) {
if (dutyCycle) {
if (!pinEnabled(pin, PIN_PWM)) {
// enable PWM and set its value
pwm.cfg.bits.en = PWM_ENABLE;
@@ -131,7 +131,6 @@ void analogWrite(pin_size_t pinNumber, int value) {
// disable PWM
pwm.cfg.bits.en = PWM_DISABLE;
__wrap_bk_printf_disable();
sddev_control(PWM_DEV_NAME, CMD_PWM_SET_DUTY_CYCLE, &pwm);
sddev_control(PWM_DEV_NAME, CMD_PWM_DEINIT_PARAM, &pwm);
__wrap_bk_printf_enable();
pin->enabled &= ~PIN_PWM;

View File

@@ -11,8 +11,9 @@ enum ChipFamily {
F_RTL8710B = 0x22E0D6FC, // Realtek AmebaZ (realtek-ambz)
F_RTL8720C = 0xE08F7564, // Realtek AmebaZ2
F_RTL8720D = 0x3379CFE2, // Realtek AmebaD
F_BK7231T = 0x675A40B0, // Beken 7231T
F_BK7231U = 0x675A40B0, // Beken 7231U/7231T
F_BK7231N = 0x7B3EF230, // Beken 7231N
F_BK7251 = 0x6A82CC42, // Beken 7251/7252
F_BL602 = 0xDE1270B7, // Boufallo 602
F_XR809 = 0x51E903A8, // Xradiotech 809
F_NATIVE = 0xDEADBEEF, // Host-native
@@ -29,6 +30,8 @@ enum ChipType {
RTL8711BN = CHIP_TYPE(F_RTL8710B, 0xFD), // CHIPID_8711BN / QFN48
RTL8711BU = CHIP_TYPE(F_RTL8710B, 0xFC), // CHIPID_8711BG / QFN68
// Beken 72XX
BK7231T = CHIP_TYPE(F_BK7231T, 0x1A), // *SCTRL_CHIP_ID = 0x7231a
BK7231T = CHIP_TYPE(F_BK7231U, 0x1A), // *SCTRL_CHIP_ID = 0x7231a
BK7231N = CHIP_TYPE(F_BK7231N, 0x1C), // *SCTRL_CHIP_ID = 0x7231c
BL2028N = CHIP_TYPE(F_BK7231N, 0x1C), // *SCTRL_CHIP_ID = 0x7231c
BK7252 = CHIP_TYPE(F_BK7251, 0x00), // TODO
};

View File

@@ -2,6 +2,8 @@
#include <LibreTuyaAPI.h>
#include <Flash.h>
extern "C" {
#include <flash_api.h>
#include <rtl8710b.h>
@@ -39,7 +41,7 @@ void LibreTuya::gpioRecover() {
ChipType LibreTuya::getChipType() {
uint8_t chipId;
EFUSE_OneByteReadROM(9902, 0xF8, &chipId, L25EOUTVOLTAGE);
return CHIP_TYPE_ENUM(F_RTL8710B, chipId);
return CHIP_TYPE_ENUM(FAMILY, chipId);
}
const char *LibreTuya::getChipModel() {
@@ -155,25 +157,24 @@ bool LibreTuya::otaSwitch(bool force) {
if (!force && otaGetRunning() != otaGetStoredIndex())
// OTA has already been switched
return true;
// this function does:
// - read OTA1 firmware magic from 0xB000
// - read OTA2 address from 0x9000
// - read OTA2 firmware magic from that address
// - read current OTA switch value from 0x9004
// - reset OTA switch to 0xFFFFFFFF if it's 0x0
// - check first non-zero bit of OTA switch
// - reset OTA switch to 0xFFFFFFFE if it's 0x0
// - else check first non-zero bit of OTA switch
// - write OTA switch with first non-zero bit cleared
// sys_clear_ota_signature();
// ok, this function is broken (crashes with HardFault)
if (!otaHasImage1() || !otaHasImage2())
return false;
uint32_t value = HAL_READ32(SPI_FLASH_BASE, FLASH_SYSTEM_OFFSET + 4);
if (value == 0) {
// TODO does this work at all?
FLASH_EreaseDwordsXIP(FLASH_SYSTEM_OFFSET + 4, 1);
uint8_t *system = (uint8_t *)malloc(64);
Flash.readBlock(FLASH_SYSTEM_OFFSET, system, 64);
// reset OTA switch
((uint32_t *)system)[1] = -2;
Flash.eraseSector(FLASH_SYSTEM_OFFSET);
return Flash.writeBlock(FLASH_SYSTEM_OFFSET, system, 64);
}
uint8_t i;
// find first non-zero bit
for (i = 0; i < 32; i++) {

View File

@@ -83,6 +83,8 @@ void SoftwareSerial::begin(unsigned long baudrate, uint16_t config) {
}
void SoftwareSerial::end() {
if (!(bool)this)
return;
gtimer_stop(OBJ);
gtimer_deinit(OBJ);
free(OBJ);

View File

@@ -201,9 +201,8 @@ const String WiFiClass::psk() {
}
uint8_t *WiFiClass::BSSID() {
uint8_t bssid[ETH_ALEN];
wext_get_bssid(NETNAME_STA, bssid);
return bssid;
wext_get_bssid(NETNAME_STA, wifi.bssid.octet);
return wifi.bssid.octet;
}
int8_t WiFiClass::RSSI() {

View File

@@ -2,6 +2,7 @@
- [Generic - BK7231N (Tuya QFN32)](../boards/generic-bk7231n-qfn32-tuya/README.md)
- [Generic - BK7231T (Tuya QFN32)](../boards/generic-bk7231t-qfn32-tuya/README.md)
- [Generic - BK7252](../boards/generic-bk7252/README.md)
- [Generic - RTL8710BN (2M/468k)](../boards/generic-rtl8710bn-2mb-468k/README.md)
- [Generic - RTL8710BN (2M/788k)](../boards/generic-rtl8710bn-2mb-788k/README.md)
- [Generic - RTL8710BX (4M/980k)](../boards/generic-rtl8710bx-4mb-980k/README.md)
@@ -27,4 +28,5 @@
- [WR3L](../boards/wr3l/README.md)
- [WR3LE](../boards/wr3le/README.md)
- [LSC LMA35](../boards/lsc-lma35/README.md)
- [LSC LMA35 T](../boards/lsc-lma35-t/README.md)
- [Generic - Host-native](../boards/generic-native/README.md)

View File

@@ -1,25 +1,6 @@
{
"build": {
"bkcrypt_coeffs": "510fb093a3cbeadc5993a17ec7adeb03",
"bkboot_version": "1.0.1-bk7231n",
"bkrbl_size_app": "0x107800"
},
"flash": {
"bootloader": "0x000000+0x11000",
"app": "0x011000+0x119000",
"download": "0x12A000+0xA6000",
"calibration": "0x1D0000+0x1000",
"net": "0x1D1000+0x1000",
"tlv": "0x1D2000+0x1000",
"kvs": "0x1D3000+0x8000",
"userdata": "0x1DB000+0x25000"
},
"upload": {
"maximum_size": 1083136
},
"doc": {
"extra": [
"Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes."
]
"bkboot_version": "1.0.1-bk7231n"
}
}

View File

@@ -2,11 +2,27 @@
"build": {
"family": "BK7231N",
"ldscript_sdk": "bk7231n_bsp.ld",
"ldscript_arduino": "bk7231n_bsp.ld"
"ldscript_arduino": "bk7231n_bsp.ld",
"bkboot_version": "1.0.1-bk7231n",
"bkrbl_size_app": "0x108700"
},
"flash": {
"bootloader": "0x000000+0x11000",
"app": "0x011000+0x119000",
"download": "0x12A000+0xA6000",
"calibration": "0x1D0000+0x1000",
"net": "0x1D1000+0x1000",
"tlv": "0x1D2000+0x1000",
"kvs": "0x1D3000+0x8000",
"userdata": "0x1DB000+0x25000"
},
"upload": {
"maximum_size": 1083136,
"speed": 460800
},
"connectivity": [
"ble"
],
"doc": {
"params": {
"extra": {

View File

@@ -1,25 +1,6 @@
{
"build": {
"bkcrypt_coeffs": "510fb093a3cbeadc5993a17ec7adeb03",
"bkboot_version": "1.0.5-bk7231s",
"bkrbl_size_app": "0x107800"
},
"flash": {
"bootloader": "0x000000+0x11000",
"app": "0x011000+0x121000",
"download": "0x132000+0xA6000",
"kvs": "0x1D8000+0x8000",
"calibration": "0x1E0000+0x1000",
"tlv": "0x1E1000+0x1000",
"net": "0x1E2000+0x1000",
"userdata": "0x1E3000+0x1D000"
},
"upload": {
"maximum_size": 1083136
},
"doc": {
"extra": [
"Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes."
]
"bkboot_version": "1.0.5-bk7231s"
}
}

View File

@@ -1,17 +0,0 @@
{
"build": {
"family": "BK7231T",
"ldscript_sdk": "bk7231_bsp.ld",
"ldscript_arduino": "bk7231_bsp.ld"
},
"upload": {
"speed": 921600
},
"doc": {
"params": {
"extra": {
"Bluetooth": "BLE v4.2"
}
}
}
}

View File

@@ -0,0 +1,33 @@
{
"build": {
"family": "BK7231U",
"ldscript_sdk": "bk7231_bsp.ld",
"ldscript_arduino": "bk7231_bsp.ld",
"bkboot_version": "1.0.8-bk7231u",
"bkrbl_size_app": "0x108700"
},
"flash": {
"bootloader": "0x000000+0x11000",
"app": "0x011000+0x121000",
"download": "0x132000+0xA6000",
"kvs": "0x1D8000+0x8000",
"calibration": "0x1E0000+0x1000",
"tlv": "0x1E1000+0x1000",
"net": "0x1E2000+0x1000",
"userdata": "0x1E3000+0x1D000"
},
"upload": {
"maximum_size": 1083136,
"speed": 921600
},
"connectivity": [
"ble"
],
"doc": {
"params": {
"extra": {
"Bluetooth": "BLE v4.2"
}
}
}
}

View File

@@ -0,0 +1,40 @@
{
"build": {
"family": "BK7251",
"f_cpu": "180000000L",
"ldscript_sdk": "bk7231_bsp.ld",
"ldscript_arduino": "bk7231_bsp.ld",
"bkboot_version": "0.1.3-bk7252",
"bkrbl_size_app": "0x1A0000"
},
"flash": {
"bootloader": "0x000000+0x11000",
"app": "0x011000+0x1BA000",
"filesystem": "0x1CB000+0x119000",
"kvs": "0x2E4000+0x8000",
"download": "0x2EC000+0x112000",
"calibration": "0x3FE000+0x1000",
"tlv": "0x3FF000+0x1000"
},
"debug": {
"gdb_init": [
"mem 0x200000 0x400000 ro"
]
},
"upload": {
"maximum_ram_size": 524288,
"flash_size": 4194304,
"maximum_size": 1703936,
"speed": 921600
},
"connectivity": [
"ble"
],
"doc": {
"params": {
"extra": {
"Bluetooth": "BLE v5.0"
}
}
}
}

View File

@@ -3,15 +3,12 @@
"f_cpu": "120000000L",
"prefix": "arm-none-eabi-",
"bkota": {
"encryption": "aes256",
"compression": "gzip",
"key": "0123456789ABCDEF0123456789ABCDEF",
"iv": "0123456789ABCDEF"
"encryption": "none",
"compression": "gzip"
}
},
"connectivity": [
"wifi",
"ble"
"wifi"
],
"debug": {
"protocol": "openocd",
@@ -47,8 +44,10 @@
},
"links": {
"General info": "../../docs/platform/beken-72xx/README.md",
"Flashing guide": "../../docs/platform/beken-72xx/flashing.md",
"BkWriter v1.6.0": "https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe"
}
"Flashing guide": "../../docs/platform/beken-72xx/flashing.md"
},
"extra": [
"Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes."
]
}
}

View File

@@ -0,0 +1,186 @@
{
"pcb": {
"ic": {
"10": {
"C_NAME": "GPIO25",
"GPIO": "P25",
"IRQ": null,
"USB": "DP"
},
"11": {
"C_NAME": "GPIO33",
"GPIO": "P33",
"IRQ": null,
"DVP": "PD1"
},
"12": {
"C_NAME": "GPIO32",
"GPIO": "P32",
"IRQ": null,
"DVP": "PD0"
},
"13": {
"C_NAME": "GPIO29",
"GPIO": "P29",
"IRQ": null,
"DVP": "PCLK"
},
"14": {
"C_NAME": "GPIO27",
"GPIO": "P27",
"IRQ": null,
"DVP": "MCLK"
},
"15": {
"C_NAME": "GPIO30",
"GPIO": "P30",
"IRQ": null,
"DVP": "HSYNC"
},
"16": {
"C_NAME": "GPIO31",
"GPIO": "P31",
"IRQ": null,
"DVP": "VSYNC"
},
"17": {
"C_NAME": "GPIO34",
"GPIO": "P34",
"IRQ": null,
"DVP": "PD2"
},
"18": {
"C_NAME": "GPIO35",
"GPIO": "P35",
"IRQ": null,
"DVP": "PD3"
},
"19": {
"C_NAME": "GPIO36",
"GPIO": "P36",
"IRQ": null,
"DVP": "PD4"
},
"20": {
"C_NAME": "GPIO37",
"GPIO": "P37",
"IRQ": null,
"DVP": "PD5"
},
"21": {
"C_NAME": "GPIO38",
"GPIO": "P38",
"IRQ": null,
"DVP": "PD6"
},
"22": {
"C_NAME": "GPIO39",
"GPIO": "P39",
"IRQ": null,
"DVP": "PD7"
},
"23": {
"C_NAME": "GPIO14",
"GPIO": "P14",
"IRQ": null,
"SD": "CLK",
"SPI": "SCK"
},
"24": {
"C_NAME": "GPIO16",
"GPIO": "P16",
"IRQ": null,
"SD": "D0",
"SPI": "MOSI"
},
"25": {
"C_NAME": "GPIO15",
"GPIO": "P15",
"IRQ": null,
"SD": "CMD",
"SPI": "CS"
},
"26": {
"C_NAME": "GPIO17",
"GPIO": "P17",
"IRQ": null,
"SD": "D1",
"SPI": "MISO"
},
"27": {
"C_NAME": "GPIO23",
"GPIO": "P23",
"IRQ": null,
"ADC": 3,
"JTAG": "TDO",
"FLASH": "FSO"
},
"28": {
"C_NAME": "GPIO22",
"GPIO": "P22",
"IRQ": null,
"JTAG": "TDI",
"FLASH": "FSI"
},
"29": {
"C_NAME": "GPIO21",
"GPIO": "P21",
"IRQ": null,
"I2C": "1_SDA",
"JTAG": "TMS",
"I2S": "MCLK",
"FLASH": "^FCS"
},
"30": {
"C_NAME": "GPIO20",
"GPIO": "P20",
"IRQ": null,
"I2C": "1_SCL",
"JTAG": "TCK",
"FLASH": "FSCK"
},
"31": {
"IO": "I",
"CTRL": "CEN"
},
"32": {
"C_NAME": "GPIO8",
"GPIO": "P8",
"IRQ": null,
"PWM": 2
},
"33": {
"C_NAME": "GPIO9",
"GPIO": "P9",
"IRQ": null,
"PWM": 3
},
"34": {
"C_NAME": "GPIO10",
"GPIO": "P10",
"IRQ": null,
"UART": "1_RX"
},
"35": {
"C_NAME": "GPIO11",
"GPIO": "P11",
"IRQ": null,
"UART": "1_TX"
},
"36": {
"C_NAME": "GPIO1",
"GPIO": "P1",
"IRQ": null,
"UART": "2_RX",
"I2C": "2_SDA"
},
"37": {
"C_NAME": "GPIO0",
"GPIO": "P0",
"IRQ": null,
"UART": "2_TX",
"I2C": "2_SCL"
}
}
}
}

View File

@@ -0,0 +1,259 @@
{
"pcb": {
"ic": {
"13": {
"C_NAME": "GPIO28",
"GPIO": "P28",
"IRQ": null,
"USB": "DN"
},
"14": {
"C_NAME": "GPIO25",
"GPIO": "P25",
"IRQ": null,
"USB": "DP"
},
"16": {
"C_NAME": "GPIO12",
"GPIO": "P12",
"IRQ": null,
"ADC": 6,
"UART": "1_CTS"
},
"17": {
"C_NAME": "GPIO13",
"GPIO": "P13",
"IRQ": null,
"ADC": 7,
"UART": "1_RTS"
},
"18": {
"C_NAME": "GPIO33",
"GPIO": "P33",
"IRQ": null,
"DVP": "PD1"
},
"19": {
"C_NAME": "GPIO32",
"GPIO": "P32",
"IRQ": null,
"DVP": "PD0"
},
"20": {
"C_NAME": "GPIO29",
"GPIO": "P29",
"IRQ": null,
"DVP": "PCLK"
},
"21": {
"C_NAME": "GPIO27",
"GPIO": "P27",
"IRQ": null,
"DVP": "MCLK"
},
"22": {
"C_NAME": "GPIO30",
"GPIO": "P30",
"IRQ": null,
"DVP": "HSYNC"
},
"23": {
"C_NAME": "GPIO31",
"GPIO": "P31",
"IRQ": null,
"DVP": "VSYNC"
},
"24": {
"C_NAME": "GPIO34",
"GPIO": "P34",
"IRQ": null,
"DVP": "PD2"
},
"25": {
"C_NAME": "GPIO35",
"GPIO": "P35",
"IRQ": null,
"DVP": "PD3"
},
"26": {
"C_NAME": "GPIO36",
"GPIO": "P36",
"IRQ": null,
"DVP": "PD4"
},
"27": {
"C_NAME": "GPIO37",
"GPIO": "P37",
"IRQ": null,
"DVP": "PD5"
},
"28": {
"C_NAME": "GPIO38",
"GPIO": "P38",
"IRQ": null,
"DVP": "PD6"
},
"29": {
"C_NAME": "GPIO39",
"GPIO": "P39",
"IRQ": null,
"DVP": "PD7"
},
"30": {
"C_NAME": "GPIO19",
"GPIO": "P19",
"IRQ": null,
"SD": "D1"
},
"31": {
"C_NAME": "GPIO17",
"GPIO": "P17",
"IRQ": null,
"SD": "D1",
"SPI": "MISO"
},
"32": {
"C_NAME": "GPIO14",
"GPIO": "P14",
"IRQ": null,
"SD": "CLK",
"SPI": "SCK"
},
"33": {
"C_NAME": "GPIO16",
"GPIO": "P16",
"IRQ": null,
"SD": "D0",
"SPI": "MOSI"
},
"34": {
"C_NAME": "GPIO15",
"GPIO": "P15",
"IRQ": null,
"SD": "CMD",
"SPI": "CS"
},
"35": {
"C_NAME": "GPIO18",
"GPIO": "P18",
"IRQ": null,
"SD": "D2"
},
"36": {
"C_NAME": "GPIO24",
"GPIO": "P24",
"IRQ": null,
"PWM": 4
},
"37": {
"C_NAME": "GPIO26",
"GPIO": "P26",
"IRQ": null,
"PWM": 5,
"IRDA": null
},
"38": {
"C_NAME": "GPIO23",
"GPIO": "P23",
"IRQ": null,
"ADC": 3,
"JTAG": "TDO",
"FLASH": "FSO"
},
"39": {
"C_NAME": "GPIO22",
"GPIO": "P22",
"IRQ": null,
"JTAG": "TDI",
"FLASH": "FSI"
},
"40": {
"C_NAME": "GPIO21",
"GPIO": "P21",
"IRQ": null,
"I2C": "1_SDA",
"JTAG": "TMS",
"I2S": "MCLK",
"FLASH": "^FCS"
},
"41": {
"C_NAME": "GPIO20",
"GPIO": "P20",
"IRQ": null,
"I2C": "1_SCL",
"JTAG": "TCK",
"FLASH": "FSCK"
},
"43": {
"IO": "I",
"CTRL": "CEN"
},
"45": {
"C_NAME": "GPIO5",
"GPIO": "P5",
"IRQ": null,
"ADC": 2,
"I2S": "DOUT"
},
"46": {
"C_NAME": "GPIO3",
"GPIO": "P3",
"IRQ": null,
"ADC": 5,
"I2S": "WS"
},
"47": {
"C_NAME": "GPIO4",
"GPIO": "P4",
"IRQ": null,
"ADC": 1,
"I2S": "DIN"
},
"48": {
"C_NAME": "GPIO2",
"GPIO": "P2",
"IRQ": null,
"ADC": 4,
"I2S": "SCK"
},
"49": {
"C_NAME": "GPIO6",
"GPIO": "P6",
"IRQ": null,
"PWM": 0
},
"50": {
"C_NAME": "GPIO7",
"GPIO": "P7",
"IRQ": null,
"PWM": 1
},
"62": {
"C_NAME": "GPIO10",
"GPIO": "P10",
"IRQ": null,
"UART": "1_RX"
},
"63": {
"C_NAME": "GPIO11",
"GPIO": "P11",
"IRQ": null,
"UART": "1_TX"
},
"64": {
"C_NAME": "GPIO1",
"GPIO": "P1",
"IRQ": null,
"UART": "2_RX",
"I2C": "2_SDA"
},
"65": {
"C_NAME": "GPIO0",
"GPIO": "P0",
"IRQ": null,
"UART": "2_TX",
"I2C": "2_SCL"
}
}
}
}

View File

@@ -1,7 +1,7 @@
{
"build": {
"ldscript_sdk": "rlx8711B-symbol-v02-img2_xip1_4M_cpp.ld",
"ldscript_arduino": "rlx8711B-symbol-v02-img2_xip1_4M_cpp.ld",
"ldscript_sdk": "rlx8711B-symbol-v02-img2_xip1_4M_980k_cpp.ld",
"ldscript_arduino": "rlx8711B-symbol-v02-img2_xip1_4M_980k_cpp.ld",
"amb_boot_all": "boot_all_C556.bin"
},
"flash": {

View File

@@ -47,10 +47,9 @@
}
},
"links": {
"General info": "../../docs/platform/realtek/README.md",
"Debugging": "../../docs/platform/realtek/debugging.md",
"General info": "../../docs/platform/realtek-amb/README.md",
"Flashing guide": "../../docs/platform/realtek-ambz/flashing.md",
"ImageTool (AmebaZ/AmebaD)": "https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip"
"Debugging": "../../docs/platform/realtek-ambz/debugging.md"
},
"extra": [
"RDP is most likely not used in Tuya firmwares, as the System Data partition contains an incorrect offset 0xFF000 for RDP, which is in the middle of OTA2 image.",

View File

@@ -29,7 +29,7 @@
"voltage": "3.0V - 3.6V"
},
"links": {
"General info": "../../docs/platform/realtek/README.md"
"General info": "../../docs/platform/realtek-amb/README.md"
}
}
}

View File

@@ -3,7 +3,7 @@
"realtek-ambz",
"realtek-ambz-2mb-468k",
"realtek-ambz-bx",
"pcb/ic-rtl8710bn",
"ic/rtl8710bn",
"pcb/bw12"
],
"build": {

View File

@@ -4,10 +4,9 @@
[Product page](http://www.ai-thinker.com/pro_view-13.html)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
- [Vendor datasheet](https://docs.ai-thinker.com/_media/rtl8710/hardware/bw12_datasheet_en.pdf)
Parameter | Value

View File

@@ -3,7 +3,7 @@
"realtek-ambz2",
"realtek-ambz2-8720",
"realtek-ambz2-2mb-992k",
"pcb/ic-rtl8720cf",
"ic/rtl8720cf",
"pcb/bw15"
],
"build": {

View File

@@ -4,7 +4,7 @@
[Product page](https://docs.ai-thinker.com/_media/rtl8710/docs/bw15_datasheet_en.pdf)
- [General info](../../docs/platform/realtek/README.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Vendor datasheet](https://docs.ai-thinker.com/_media/rtl8710/docs/bw15_datasheet_en.pdf)
Parameter | Value

View File

@@ -3,7 +3,7 @@
"beken-72xx",
"beken-7231n",
"beken-7231n-tuya",
"pcb/ic-bk7231-qfn32",
"ic/bk7231-qfn32",
"pcb/cb2l",
"pcb/cb2l-test"
],

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|------------------------------------------

View File

@@ -3,7 +3,7 @@
"beken-72xx",
"beken-7231n",
"beken-7231n-tuya",
"pcb/ic-bk7231-qfn32",
"ic/bk7231-qfn32",
"pcb/cb2s",
"pcb/cb2s-test"
],

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|------------------------------------------

View File

@@ -3,7 +3,7 @@
"beken-72xx",
"beken-7231n",
"beken-7231n-tuya",
"pcb/ic-bk7231-qfn32",
"ic/bk7231-qfn32",
"pcb/cb3l"
],
"build": {

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|------------------------------------------

View File

@@ -3,7 +3,7 @@
"beken-72xx",
"beken-7231n",
"beken-7231n-tuya",
"pcb/ic-bk7231-qfn32",
"ic/bk7231-qfn32",
"pcb/cb3s"
],
"build": {

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|------------------------------------------

View File

@@ -3,7 +3,7 @@
"beken-72xx",
"beken-7231n",
"beken-7231n-tuya",
"pcb/ic-bk7231-qfn32",
"ic/bk7231-qfn32",
"pcb/cb3se"
],
"build": {

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|--------------------------------------------

View File

@@ -4,7 +4,7 @@
"beken-72xx",
"beken-7231n",
"beken-7231n-tuya",
"pcb/ic-bk7231-qfn32"
"ic/bk7231-qfn32"
],
"build": {
"mcu": "bk7231n",

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|----------------------------------

View File

@@ -2,9 +2,9 @@
"_base": [
"generic",
"beken-72xx",
"beken-7231t",
"beken-7231u",
"beken-7231t-tuya",
"pcb/ic-bk7231-qfn32"
"ic/bk7231-qfn32"
],
"build": {
"mcu": "bk7231t",

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|----------------------------------

193
boards/generic-bk7252.json Normal file
View File

@@ -0,0 +1,193 @@
{
"_base": [
"generic",
"beken-72xx",
"beken-7252",
"ic/bk7252-qfn68"
],
"build": {
"mcu": "bk7252",
"variant": "generic-bk7252"
},
"name": "Generic - BK7252",
"symbol": "BK7252",
"url": "https://kuba2k2.github.io/libretuya/boards/generic-bk7252/",
"vendor": "Generic",
"pcb": {
"pinout": {
"1": {
"IC": 65,
"ARD": "D0"
},
"2": {
"IC": 64,
"ARD": "D1"
},
"3": {
"IC": 48,
"ARD": [
"D2",
"A5"
]
},
"4": {
"IC": 46,
"ARD": [
"D3",
"A4"
]
},
"5": {
"IC": 47,
"ARD": [
"D4",
"A1"
]
},
"6": {
"IC": 45,
"ARD": [
"D5",
"A2"
]
},
"7": {
"IC": 49,
"ARD": "D6"
},
"8": {
"IC": 50,
"ARD": "D7"
},
"9": {
"IC": 62,
"ARD": "D8"
},
"10": {
"IC": 63,
"ARD": "D9"
},
"11": {
"IC": 16,
"ARD": [
"D10",
"A6"
]
},
"12": {
"IC": 17,
"ARD": [
"D11",
"A7"
]
},
"13": {
"IC": 32,
"ARD": "D12"
},
"14": {
"IC": 34,
"ARD": "D13"
},
"15": {
"IC": 33,
"ARD": "D14"
},
"16": {
"IC": 31,
"ARD": "D15"
},
"17": {
"IC": 35,
"ARD": "D16"
},
"18": {
"IC": 30,
"ARD": "D17"
},
"19": {
"IC": 41,
"ARD": "D18"
},
"20": {
"IC": 40,
"ARD": "D19"
},
"21": {
"IC": 39,
"ARD": "D20"
},
"22": {
"IC": 38,
"ARD": [
"D21",
"A3"
]
},
"23": {
"IC": 36,
"ARD": "D22"
},
"24": {
"IC": 14,
"ARD": "D23"
},
"25": {
"IC": 37,
"ARD": "D24"
},
"26": {
"IC": 21,
"ARD": "D25"
},
"27": {
"IC": 13,
"ARD": "D26"
},
"28": {
"IC": 20,
"ARD": "D27"
},
"29": {
"IC": 22,
"ARD": "D28"
},
"30": {
"IC": 23,
"ARD": "D29"
},
"31": {
"IC": 19,
"ARD": "D30"
},
"32": {
"IC": 18,
"ARD": "D31"
},
"33": {
"IC": 24,
"ARD": "D32"
},
"34": {
"IC": 25,
"ARD": "D33"
},
"35": {
"IC": 26,
"ARD": "D34"
},
"36": {
"IC": 27,
"ARD": "D35"
},
"37": {
"IC": 28,
"ARD": "D36"
},
"38": {
"IC": 29,
"ARD": "D37"
}
}
}
}

View File

@@ -0,0 +1,112 @@
# Generic - BK7252
*by Generic*
[Product page](https://kuba2k2.github.io/libretuya/boards/generic-bk7252/)
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
Parameter | Value
-------------|----------------------------------
Board code | `generic-bk7252`
MCU | BK7252
Manufacturer | Beken
Series | BK72XX
Frequency | 180 MHz
Flash size | 4 MiB
RAM size | 512 KiB
Voltage | 3.0V - 3.6V
I/O | 38x GPIO, 4x PWM, 2x UART, 7x ADC
Wi-Fi | 802.11 b/g/n
Bluetooth | BLE v5.0
## Usage
**Board code:** `generic-bk7252`
In `platformio.ini`:
```ini
[env:generic-bk7252]
platform = libretuya
board = generic-bk7252
framework = arduino
```
In ESPHome YAML:
```yaml
libretuya:
board: generic-bk7252
framework:
version: dev
```
## Arduino Core pin mapping
No. | Pin | UART | I²C | SPI | PWM | Other
----|-----------|-----------|----------|------|------|----------
D0 | P0 | UART2_TX | I2C2_SCL | | |
D1 | P1 | UART2_RX | I2C2_SDA | | |
D2 | P2 | | | | |
D3 | P3 | | | | |
D4 | P4 | | | | |
D5 | P5 | | | | |
D6 | P6 | | | | PWM0 |
D7 | P7 | | | | PWM1 |
D8 | P10 | UART1_RX | | | |
D9 | P11 | UART1_TX | | | |
D10 | P12 | UART1_CTS | | | |
D11 | P13 | UART1_RTS | | | |
D12 | P14 | | | SCK | |
D13 | P15 | | | CS | |
D14 | P16 | | | MOSI | |
D15 | P17 | | | MISO | |
D16 | P18 | | | | |
D17 | P19 | | | | |
D18 | P20 | | I2C1_SCL | | | TCK
D19 | P21 | | I2C1_SDA | | | TMS
D20 | P22 | | | | | TDI
D21 | P23 | | | | | TDO
D22 | P24 | | | | PWM4 |
D23 | P25 | | | | |
D24 | P26 | | | | PWM5 |
D25 | P27 | | | | | DVP_MCLK
D26 | P28 | | | | |
D27 | P29 | | | | | DVP_PCLK
D28 | P30 | | | | | DVP_HSYNC
D29 | P31 | | | | | DVP_VSYNC
D30 | P32 | | | | | DVP_PD0
D31 | P33 | | | | | DVP_PD1
D32 | P34 | | | | | DVP_PD2
D33 | P35 | | | | | DVP_PD3
D34 | P36 | | | | | DVP_PD4
D35 | P37 | | | | | DVP_PD5
D36 | P38 | | | | | DVP_PD6
D37 | P39 | | | | | DVP_PD7
A1 | P4, ADC1 | | | | |
A2 | P5, ADC2 | | | | |
A3 | P23, ADC3 | | | | |
A4 | P3, ADC5 | | | | |
A5 | P2, ADC4 | | | | |
A6 | P12, ADC6 | | | | |
A7 | P13, ADC7 | | | | |
## Flash memory map
Flash size: 4 MiB / 4,194,304 B / 0x400000
Hex values are in bytes.
Name | Start | Length | End
----------------|----------|--------------------|---------
Bootloader | 0x000000 | 68 KiB / 0x11000 | 0x011000
App Image | 0x011000 | 1.7 MiB / 0x1BA000 | 0x1CB000
File System | 0x1CB000 | 1.1 MiB / 0x119000 | 0x2E4000
Key-Value Store | 0x2E4000 | 32 KiB / 0x8000 | 0x2EC000
OTA Image | 0x2EC000 | 1.1 MiB / 0x112000 | 0x3FE000
Calibration | 0x3FE000 | 4 KiB / 0x1000 | 0x3FF000
TLV Store | 0x3FF000 | 4 KiB / 0x1000 | 0x400000
Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

View File

@@ -0,0 +1 @@
#include "variant.h"

View File

@@ -0,0 +1,88 @@
/* This file was auto-generated from generic-bk7252.json using boardgen */
#include <Arduino.h>
extern "C" {
// clang-format off
PinInfo pinTable[PINS_COUNT] = {
// D0: P0, UART2_TX, I2C2_SCL
{GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0},
// D1: P1, UART2_RX, I2C2_SDA
{GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0},
// D2: P2, ADC4, SCK
{GPIO2, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2S, PIN_NONE, 0},
// D3: P3, ADC5, WS
{GPIO3, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2S, PIN_NONE, 0},
// D4: P4, ADC1, DIN
{GPIO4, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2S, PIN_NONE, 0},
// D5: P5, ADC2, DOUT
{GPIO5, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2S, PIN_NONE, 0},
// D6: P6, PWM0
{GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D7: P7, PWM1
{GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D8: P10, UART1_RX
{GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0},
// D9: P11, UART1_TX
{GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0},
// D10: P12, ADC6, UART1_CTS
{GPIO12, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_UART, PIN_NONE, 0},
// D11: P13, ADC7, UART1_RTS
{GPIO13, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_UART, PIN_NONE, 0},
// D12: P14, SD_CLK, SCK
{GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
// D13: P15, SD_CMD, CS
{GPIO15, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
// D14: P16, SD_D0, MOSI
{GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
// D15: P17, SD_D1, MISO
{GPIO17, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
// D16: P18, SD_D2
{GPIO18, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D17: P19, SD_D1
{GPIO19, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D18: P20, I2C1_SCL, TCK, FSCK
{GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0},
// D19: P21, I2C1_SDA, TMS, MCLK, ^FCS
{GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0},
// D20: P22, TDI, FSI
{GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0},
// D21: P23, ADC3, TDO, FSO
{GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0},
// D22: P24, PWM4
{GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D23: P25, DP
{GPIO25, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D24: P26, PWM5, IRDA
{GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D25: P27, DVP_MCLK
{GPIO27, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D26: P28, DN
{GPIO28, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D27: P29, DVP_PCLK
{GPIO29, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D28: P30, DVP_HSYNC
{GPIO30, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D29: P31, DVP_VSYNC
{GPIO31, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D30: P32, DVP_PD0
{GPIO32, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D31: P33, DVP_PD1
{GPIO33, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D32: P34, DVP_PD2
{GPIO34, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D33: P35, DVP_PD3
{GPIO35, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D34: P36, DVP_PD4
{GPIO36, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D35: P37, DVP_PD5
{GPIO37, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D36: P38, DVP_PD6
{GPIO38, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
// D37: P39, DVP_PD7
{GPIO39, PIN_GPIO | PIN_IRQ, PIN_NONE, 0},
};
// clang-format on
} // extern "C"

View File

@@ -0,0 +1,119 @@
/* This file was auto-generated from generic-bk7252.json using boardgen */
#pragma once
#include <WVariant.h>
// clang-format off
// Pins
// ----
#define PINS_COUNT 38
#define NUM_DIGITAL_PINS 38
#define NUM_ANALOG_INPUTS 7
#define NUM_ANALOG_OUTPUTS 0
// Analog pins
// -----------
#define PIN_A5 2u // GPIO2
#define PIN_A4 3u // GPIO3
#define PIN_A1 4u // GPIO4
#define PIN_A2 5u // GPIO5
#define PIN_A6 10u // GPIO12
#define PIN_A7 11u // GPIO13
#define PIN_A3 21u // GPIO23
#define A5 PIN_A5
#define A4 PIN_A4
#define A1 PIN_A1
#define A2 PIN_A2
#define A6 PIN_A6
#define A7 PIN_A7
#define A3 PIN_A3
// SPI Interfaces
// --------------
#define SPI_INTERFACES_COUNT 0
// Wire Interfaces
// ---------------
#define WIRE_INTERFACES_COUNT 2
#define PIN_WIRE1_SCL 18u // GPIO20
#define PIN_WIRE1_SDA 19u // GPIO21
#define PIN_WIRE2_SCL 0u // GPIO0
#define PIN_WIRE2_SDA 1u // GPIO1
// Serial ports
// ------------
#define SERIAL_INTERFACES_COUNT 2
#define PIN_SERIAL1_CTS 10u // GPIO12
#define PIN_SERIAL1_RTS 11u // GPIO13
#define PIN_SERIAL1_RX 8u // GPIO10
#define PIN_SERIAL1_TX 9u // GPIO11
#define PIN_SERIAL2_RX 1u // GPIO1
#define PIN_SERIAL2_TX 0u // GPIO0
// Pin function macros
// -------------------
#define PIN_FUNCTION_ADC1 4u // GPIO4
#define PIN_FUNCTION_ADC2 5u // GPIO5
#define PIN_FUNCTION_ADC3 21u // GPIO23
#define PIN_FUNCTION_ADC4 2u // GPIO2
#define PIN_FUNCTION_ADC5 3u // GPIO3
#define PIN_FUNCTION_ADC6 10u // GPIO12
#define PIN_FUNCTION_ADC7 11u // GPIO13
#define PIN_FUNCTION_CS 13u // GPIO15
#define PIN_FUNCTION_CTS1 10u // GPIO12
#define PIN_FUNCTION_MISO 15u // GPIO17
#define PIN_FUNCTION_MOSI 14u // GPIO16
#define PIN_FUNCTION_P0 0u // GPIO0
#define PIN_FUNCTION_P1 1u // GPIO1
#define PIN_FUNCTION_P2 2u // GPIO2
#define PIN_FUNCTION_P3 3u // GPIO3
#define PIN_FUNCTION_P4 4u // GPIO4
#define PIN_FUNCTION_P5 5u // GPIO5
#define PIN_FUNCTION_P6 6u // GPIO6
#define PIN_FUNCTION_P7 7u // GPIO7
#define PIN_FUNCTION_P10 8u // GPIO10
#define PIN_FUNCTION_P11 9u // GPIO11
#define PIN_FUNCTION_P12 10u // GPIO12
#define PIN_FUNCTION_P13 11u // GPIO13
#define PIN_FUNCTION_P14 12u // GPIO14
#define PIN_FUNCTION_P15 13u // GPIO15
#define PIN_FUNCTION_P16 14u // GPIO16
#define PIN_FUNCTION_P17 15u // GPIO17
#define PIN_FUNCTION_P18 16u // GPIO18
#define PIN_FUNCTION_P19 17u // GPIO19
#define PIN_FUNCTION_P20 18u // GPIO20
#define PIN_FUNCTION_P21 19u // GPIO21
#define PIN_FUNCTION_P22 20u // GPIO22
#define PIN_FUNCTION_P23 21u // GPIO23
#define PIN_FUNCTION_P24 22u // GPIO24
#define PIN_FUNCTION_P25 23u // GPIO25
#define PIN_FUNCTION_P26 24u // GPIO26
#define PIN_FUNCTION_P27 25u // GPIO27
#define PIN_FUNCTION_P28 26u // GPIO28
#define PIN_FUNCTION_P29 27u // GPIO29
#define PIN_FUNCTION_P30 28u // GPIO30
#define PIN_FUNCTION_P31 29u // GPIO31
#define PIN_FUNCTION_P32 30u // GPIO32
#define PIN_FUNCTION_P33 31u // GPIO33
#define PIN_FUNCTION_P34 32u // GPIO34
#define PIN_FUNCTION_P35 33u // GPIO35
#define PIN_FUNCTION_P36 34u // GPIO36
#define PIN_FUNCTION_P37 35u // GPIO37
#define PIN_FUNCTION_P38 36u // GPIO38
#define PIN_FUNCTION_P39 37u // GPIO39
#define PIN_FUNCTION_PWM0 6u // GPIO6
#define PIN_FUNCTION_PWM1 7u // GPIO7
#define PIN_FUNCTION_PWM4 22u // GPIO24
#define PIN_FUNCTION_PWM5 24u // GPIO26
#define PIN_FUNCTION_RTS1 11u // GPIO13
#define PIN_FUNCTION_RX1 8u // GPIO10
#define PIN_FUNCTION_RX2 1u // GPIO1
#define PIN_FUNCTION_SCK 12u // GPIO14
#define PIN_FUNCTION_SCL1 18u // GPIO20
#define PIN_FUNCTION_SCL2 0u // GPIO0
#define PIN_FUNCTION_SDA1 19u // GPIO21
#define PIN_FUNCTION_SDA2 1u // GPIO1
#define PIN_FUNCTION_TX1 9u // GPIO11
#define PIN_FUNCTION_TX2 0u // GPIO0

View File

@@ -3,7 +3,7 @@
"generic",
"realtek-ambz",
"realtek-ambz-2mb-468k",
"pcb/ic-rtl8710bn"
"ic/rtl8710bn"
],
"build": {
"mcu": "rtl8710bn",

View File

@@ -4,10 +4,9 @@
[Product page](https://kuba2k2.github.io/libretuya/boards/generic-rtl8710bn-2mb-468k/)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|----------------------------------

View File

@@ -3,7 +3,7 @@
"generic",
"realtek-ambz",
"realtek-ambz-2mb-788k",
"pcb/ic-rtl8710bn"
"ic/rtl8710bn"
],
"build": {
"mcu": "rtl8710bn",

View File

@@ -4,10 +4,9 @@
[Product page](https://kuba2k2.github.io/libretuya/boards/generic-rtl8710bn-2mb-788k/)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|----------------------------------

View File

@@ -4,7 +4,7 @@
"realtek-ambz",
"realtek-ambz-4mb-980k",
"realtek-ambz-bx",
"pcb/ic-rtl8710bn"
"ic/rtl8710bn"
],
"build": {
"mcu": "rtl8710bx",

View File

@@ -4,10 +4,9 @@
[Product page](https://kuba2k2.github.io/libretuya/boards/generic-rtl8710bx-4mb-980k/)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|----------------------------------

View File

@@ -4,7 +4,7 @@
"realtek-ambz2",
"realtek-ambz2-8720",
"realtek-ambz2-2mb-992k",
"pcb/ic-rtl8720cf"
"ic/rtl8720cf"
],
"build": {
"mcu": "rtl8720cf",

View File

@@ -4,7 +4,7 @@
[Product page](https://kuba2k2.github.io/libretuya/boards/generic-rtl8720cf-2mb-992k/)
- [General info](../../docs/platform/realtek/README.md)
- [General info](../../docs/platform/realtek-amb/README.md)
Parameter | Value
-------------|-----------------------------

29
boards/lsc-lma35-t.json Normal file
View File

@@ -0,0 +1,29 @@
{
"_base": [
"beken-72xx",
"beken-7231u",
"beken-7231t-tuya",
"ic/bk7231-qfn32",
"pcb/lsc-lma35"
],
"build": {
"mcu": "bk7231t",
"variant": "lsc-lma35-t"
},
"name": "LSC LMA35 BK7231T",
"symbol": "LSC LMA35 T",
"url": "https://www.action.com/de-at/p/lsc-smart-connect-outdoor-led-streifen/",
"vendor": "Unknown",
"pcb": {
"symbol": "LMA35"
},
"doc": {
"extra": [
"## Information",
"This board has no marking on the front side, only something that looks like PCB manufacturing info on the back; thus it was named based on these symbols.",
"It can be found in 'LSC Smart Connect Outdoor LED Strip', and is likely custom-made for this product.",
"The pinout was established by writing to and probing consecutive GPIOs, using the generic board definition.",
"Pins marked with '?' are currently unknown, with a possibility of being CEN. Pin 22 (P1/D14) is also not confirmed."
]
}
}

View File

@@ -0,0 +1,98 @@
# LSC LMA35 BK7231T
*by Unknown*
[Product page](https://www.action.com/de-at/p/lsc-smart-connect-outdoor-led-streifen/)
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
Parameter | Value
-------------|----------------------------------
Board code | `lsc-lma35-t`
MCU | BK7231T
Manufacturer | Beken
Series | BK72XX
Frequency | 120 MHz
Flash size | 2 MiB
RAM size | 256 KiB
Voltage | 3.0V - 3.6V
I/O | 15x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi | 802.11 b/g/n
Bluetooth | BLE v4.2
## Usage
**Board code:** `lsc-lma35-t`
In `platformio.ini`:
```ini
[env:lsc-lma35-t]
platform = libretuya
board = lsc-lma35-t
framework = arduino
```
In ESPHome YAML:
```yaml
libretuya:
board: lsc-lma35-t
framework:
version: dev
```
## Pinout
![Pinout](pinout_lsc-lma35-t.svg)
## Arduino Core pin mapping
No. | Pin | UART | I²C | SPI | PWM | Other
----|-----------|----------|----------|------|------|------
D0 | P26 | | | | PWM5 |
D1 | P14 | | | SCK | |
D2 | P16 | | | MOSI | |
D3 | P24 | | | | PWM4 |
D4 | P22 | | | | | TDI
D5 | P0 | UART2_TX | I2C2_SCL | | |
D6 | P23 | | | | | TDO
D7 | P8 | | | | PWM2 |
D8 | P9 | | | | PWM3 |
D9 | P21 | | I2C1_SDA | | | TMS
D10 | P6 | | | | PWM0 |
D11 | P7 | | | | PWM1 |
D12 | P10 | UART1_RX | | | |
D13 | P11 | UART1_TX | | | |
D14 | P1 | UART2_RX | I2C2_SDA | | |
A0 | P23, ADC3 | | | | |
## Flash memory map
Flash size: 2 MiB / 2,097,152 B / 0x200000
Hex values are in bytes.
Name | Start | Length | End
----------------|----------|--------------------|---------
Bootloader | 0x000000 | 68 KiB / 0x11000 | 0x011000
App Image | 0x011000 | 1.1 MiB / 0x121000 | 0x132000
OTA Image | 0x132000 | 664 KiB / 0xA6000 | 0x1D8000
Key-Value Store | 0x1D8000 | 32 KiB / 0x8000 | 0x1E0000
Calibration | 0x1E0000 | 4 KiB / 0x1000 | 0x1E1000
TLV Store | 0x1E1000 | 4 KiB / 0x1000 | 0x1E2000
Network Data | 0x1E2000 | 4 KiB / 0x1000 | 0x1E3000
User Data | 0x1E3000 | 116 KiB / 0x1D000 | 0x200000
Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.
## Information
This board has no marking on the front side, only something that looks like PCB manufacturing info on the back; thus it was named based on these symbols.
It can be found in 'LSC Smart Connect Outdoor LED Strip', and is likely custom-made for this product.
The pinout was established by writing to and probing consecutive GPIOs, using the generic board definition.
Pins marked with '?' are currently unknown, with a possibility of being CEN. Pin 22 (P1/D14) is also not confirmed.

View File

@@ -0,0 +1,325 @@
<?xml version="1.0" encoding="utf-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="full" height="500" version="1.1" viewBox="0,0,85.33333333333333,41.666666666666664" width="1024">
<defs/>
<rect fill="white" height="41.666666666666664" stroke="black" stroke-width="0.1" width="85.33333333333333" x="0" y="0"/>
<linearGradient gradientUnits="objectBoundingBox" id="id1" x1="1.0" x2="0.0" y1="0.0" y2="1.0">
<stop offset="0%" stop-color="#47a8cd"/>
<stop offset="100%" stop-color="#008fb5"/>
</linearGradient>
<rect fill="url(#id1) none" height="23.9" stroke="#b5a739" stroke-width="0.1" width="19.9" x="32.66666666666666" y="4.433333333333333"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.left.pin1.trace" width="0.7" x="32.61666666666666" y="12.133333333333333"/>
<circle cx="32.61666666666666" cy="12.733333333333333" fill="#fff" id="custom-20x24-22.front.left.pin1.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.left.pin2.trace" width="0.7" x="32.61666666666666" y="14.133333333333333"/>
<circle cx="32.61666666666666" cy="14.733333333333333" fill="#fff" id="custom-20x24-22.front.left.pin2.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.left.pin3.trace" width="0.7" x="32.61666666666666" y="16.133333333333333"/>
<circle cx="32.61666666666666" cy="16.733333333333334" fill="#fff" id="custom-20x24-22.front.left.pin3.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.left.pin4.trace" width="0.7" x="32.61666666666666" y="18.133333333333333"/>
<circle cx="32.61666666666666" cy="18.733333333333334" fill="#fff" id="custom-20x24-22.front.left.pin4.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.left.pin5.trace" width="0.7" x="32.61666666666666" y="20.133333333333333"/>
<circle cx="32.61666666666666" cy="20.733333333333334" fill="#fff" id="custom-20x24-22.front.left.pin5.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.left.pin6.trace" width="0.7" x="32.61666666666666" y="22.133333333333333"/>
<circle cx="32.61666666666666" cy="22.733333333333334" fill="#fff" id="custom-20x24-22.front.left.pin6.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.left.pin7.trace" width="0.7" x="32.61666666666666" y="24.133333333333333"/>
<circle cx="32.61666666666666" cy="24.733333333333334" fill="#fff" id="custom-20x24-22.front.left.pin7.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.right.pin1.trace" width="0.7" x="51.91666666666666" y="12.133333333333333"/>
<circle cx="52.61666666666666" cy="12.733333333333333" fill="#fff" id="custom-20x24-22.front.right.pin1.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.right.pin2.trace" width="0.7" x="51.91666666666666" y="14.133333333333333"/>
<circle cx="52.61666666666666" cy="14.733333333333333" fill="#fff" id="custom-20x24-22.front.right.pin2.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.right.pin3.trace" width="0.7" x="51.91666666666666" y="16.133333333333333"/>
<circle cx="52.61666666666666" cy="16.733333333333334" fill="#fff" id="custom-20x24-22.front.right.pin3.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.right.pin4.trace" width="0.7" x="51.91666666666666" y="18.133333333333333"/>
<circle cx="52.61666666666666" cy="18.733333333333334" fill="#fff" id="custom-20x24-22.front.right.pin4.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.right.pin5.trace" width="0.7" x="51.91666666666666" y="20.133333333333333"/>
<circle cx="52.61666666666666" cy="20.733333333333334" fill="#fff" id="custom-20x24-22.front.right.pin5.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.right.pin6.trace" width="0.7" x="51.91666666666666" y="22.133333333333333"/>
<circle cx="52.61666666666666" cy="22.733333333333334" fill="#fff" id="custom-20x24-22.front.right.pin6.cast" r="0.35"/>
<rect fill="#e5b472" height="1.2" id="custom-20x24-22.front.right.pin7.trace" width="0.7" x="51.91666666666666" y="24.133333333333333"/>
<circle cx="52.61666666666666" cy="24.733333333333334" fill="#fff" id="custom-20x24-22.front.right.pin7.cast" r="0.35"/>
<rect fill="#e5b472" height="0.7" id="pins_horz8_2mm_0.7mm.pin1.trace" width="1.2" x="35.06666666666666" y="27.683333333333334"/>
<circle cx="35.66666666666666" cy="28.383333333333333" fill="#fff" id="pins_horz8_2mm_0.7mm.pin1.cast" r="0.35"/>
<rect fill="#e5b472" height="0.7" id="pins_horz8_2mm_0.7mm.pin2.trace" width="1.2" x="37.06666666666666" y="27.683333333333334"/>
<circle cx="37.66666666666666" cy="28.383333333333333" fill="#fff" id="pins_horz8_2mm_0.7mm.pin2.cast" r="0.35"/>
<rect fill="#e5b472" height="0.7" id="pins_horz8_2mm_0.7mm.pin3.trace" width="1.2" x="39.06666666666666" y="27.683333333333334"/>
<circle cx="39.66666666666666" cy="28.383333333333333" fill="#fff" id="pins_horz8_2mm_0.7mm.pin3.cast" r="0.35"/>
<rect fill="#e5b472" height="0.7" id="pins_horz8_2mm_0.7mm.pin4.trace" width="1.2" x="41.06666666666666" y="27.683333333333334"/>
<circle cx="41.66666666666666" cy="28.383333333333333" fill="#fff" id="pins_horz8_2mm_0.7mm.pin4.cast" r="0.35"/>
<rect fill="#e5b472" height="0.7" id="pins_horz8_2mm_0.7mm.pin5.trace" width="1.2" x="43.06666666666666" y="27.683333333333334"/>
<circle cx="43.66666666666666" cy="28.383333333333333" fill="#fff" id="pins_horz8_2mm_0.7mm.pin5.cast" r="0.35"/>
<rect fill="#e5b472" height="0.7" id="pins_horz8_2mm_0.7mm.pin6.trace" width="1.2" x="45.06666666666666" y="27.683333333333334"/>
<circle cx="45.66666666666666" cy="28.383333333333333" fill="#fff" id="pins_horz8_2mm_0.7mm.pin6.cast" r="0.35"/>
<rect fill="#e5b472" height="0.7" id="pins_horz8_2mm_0.7mm.pin7.trace" width="1.2" x="47.06666666666666" y="27.683333333333334"/>
<circle cx="47.66666666666666" cy="28.383333333333333" fill="#fff" id="pins_horz8_2mm_0.7mm.pin7.cast" r="0.35"/>
<rect fill="#e5b472" height="0.7" id="pins_horz8_2mm_0.7mm.pin8.trace" width="1.2" x="49.06666666666666" y="27.683333333333334"/>
<circle cx="49.66666666666666" cy="28.383333333333333" fill="#fff" id="pins_horz8_2mm_0.7mm.pin8.cast" r="0.35"/>
<rect fill="#4e4c4c" height="2.0" width="0.2" x="35.56666666666666" y="28.583333333333332"/>
<rect fill="#4e4c4c" height="0.2" width="0.2" x="35.36666666666666" y="30.383333333333333"/>
<rect height="0.0" id="custom-20x24-22.front.down.label1.anchor" width="0.0" x="35.86666666666666" y="30.483333333333334"/>
<rect fill="#4e4c4c" height="4.0" width="0.2" x="37.56666666666666" y="28.583333333333332"/>
<rect fill="#4e4c4c" height="0.2" width="2.2" x="35.36666666666666" y="32.38333333333333"/>
<rect height="0.0" id="custom-20x24-22.front.down.label2.anchor" width="0.0" x="35.86666666666666" y="32.483333333333334"/>
<rect fill="#4e4c4c" height="6.0" width="0.2" x="39.56666666666666" y="28.583333333333332"/>
<rect fill="#4e4c4c" height="0.2" width="4.2" x="35.36666666666666" y="34.38333333333333"/>
<rect height="0.0" id="custom-20x24-22.front.down.label3.anchor" width="0.0" x="35.86666666666666" y="34.483333333333334"/>
<rect fill="#4e4c4c" height="8.0" width="0.2" x="41.56666666666666" y="28.583333333333332"/>
<rect fill="#4e4c4c" height="0.2" width="6.2" x="35.36666666666666" y="36.38333333333333"/>
<rect height="0.0" id="custom-20x24-22.front.down.label4.anchor" width="0.0" x="35.86666666666666" y="36.483333333333334"/>
<rect fill="#4e4c4c" height="8.0" width="0.2" x="43.56666666666666" y="28.583333333333332"/>
<rect fill="#4e4c4c" height="0.2" width="6.2" x="43.66666666666666" y="36.38333333333333"/>
<rect height="0.0" id="custom-20x24-22.front.down.label5.anchor" width="0.0" x="49.36666666666666" y="36.483333333333334"/>
<rect fill="#4e4c4c" height="6.0" width="0.2" x="45.56666666666666" y="28.583333333333332"/>
<rect fill="#4e4c4c" height="0.2" width="4.2" x="45.66666666666666" y="34.38333333333333"/>
<rect height="0.0" id="custom-20x24-22.front.down.label6.anchor" width="0.0" x="49.36666666666666" y="34.483333333333334"/>
<rect fill="#4e4c4c" height="4.0" width="0.2" x="47.56666666666666" y="28.583333333333332"/>
<rect fill="#4e4c4c" height="0.2" width="2.2" x="47.66666666666666" y="32.38333333333333"/>
<rect height="0.0" id="custom-20x24-22.front.down.label7.anchor" width="0.0" x="49.36666666666666" y="32.483333333333334"/>
<rect fill="#4e4c4c" height="2.0" width="0.2" x="49.56666666666666" y="28.583333333333332"/>
<rect fill="#4e4c4c" height="0.2" width="0.2" x="49.66666666666666" y="30.383333333333333"/>
<rect height="0.0" id="custom-20x24-22.front.down.label8.anchor" width="0.0" x="49.36666666666666" y="30.483333333333334"/>
<linearGradient gradientUnits="objectBoundingBox" id="id2" x1="1.0" x2="0.0" y1="0.0" y2="1.0">
<stop offset="0%" stop-color="whitesmoke"/>
<stop offset="100%" stop-color="#999"/>
</linearGradient>
<rect fill="url(#id2) none" height="15.8" rx="0.5" ry="0.5" width="17.6" x="33.81666666666666" y="11.333333333333332"/>
<rect fill="#58839b" height="5.2" width="0.5" x="35.71666666666666" y="5.183333333333333"/>
<rect fill="#58839b" height="0.5" width="4.6" x="35.71666666666666" y="5.183333333333333"/>
<rect fill="#58839b" height="5.2" width="0.5" x="37.91666666666666" y="5.183333333333333"/>
<rect fill="#58839b" height="3.0" width="0.5" x="39.81666666666666" y="5.183333333333333"/>
<rect fill="#58839b" height="0.5" width="3.0" x="39.81666666666666" y="7.683333333333333"/>
<rect fill="#58839b" height="3.0" width="0.5" x="42.31666666666666" y="5.183333333333333"/>
<rect fill="#58839b" height="0.5" width="2.7" x="42.31666666666666" y="5.183333333333333"/>
<rect fill="#58839b" height="3.0" width="0.5" x="44.51666666666666" y="5.183333333333333"/>
<rect fill="#58839b" height="0.5" width="3.0" x="44.51666666666666" y="7.683333333333333"/>
<rect fill="#58839b" height="3.0" width="0.5" x="47.01666666666666" y="5.183333333333333"/>
<rect fill="#58839b" height="0.5" width="2.5" x="47.01666666666666" y="5.183333333333333"/>
<rect fill="#58839b" height="4.4" width="0.5" x="49.01666666666666" y="5.183333333333333"/>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="29.51666666666666" y="12.633333333333333"/>
<g transform="translate(25.731026020611555,11.933333333333332)">
<rect fill="#cd3c24" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="27.216666666666658" y="12.733333333333333">3V3</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="29.51666666666666" y="14.633333333333333"/>
<g transform="translate(25.731026020611555,13.933333333333332)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="27.216666666666658" y="14.733333333333333">P26</text>
<g transform="translate(22.73102602061156,13.933333333333332)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="23.91666666666666" y="14.733333333333333">D0</text>
<g transform="translate(19.131026020611557,13.933333333333332)">
<rect fill="#aeafc1" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="20.61666666666666" y="14.733333333333333">IRDA</text>
<g transform="translate(15.531026020611561,13.933333333333332)">
<rect fill="#afa35e" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="17.016666666666662" y="14.733333333333333">PWM5</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="29.51666666666666" y="16.633333333333333"/>
<g transform="translate(25.731026020611555,15.933333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="27.216666666666658" y="16.733333333333334">P14</text>
<g transform="translate(22.73102602061156,15.933333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="23.91666666666666" y="16.733333333333334">D1</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="29.51666666666666" y="18.633333333333333"/>
<g transform="translate(25.731026020611555,17.933333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="27.216666666666658" y="18.733333333333334">P16</text>
<g transform="translate(22.73102602061156,17.933333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="23.91666666666666" y="18.733333333333334">D2</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="29.51666666666666" y="20.633333333333333"/>
<g transform="translate(25.731026020611555,19.933333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="27.216666666666658" y="20.733333333333334">P24</text>
<g transform="translate(22.73102602061156,19.933333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="23.91666666666666" y="20.733333333333334">D3</text>
<g transform="translate(19.131026020611557,19.933333333333334)">
<rect fill="#afa35e" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="20.61666666666666" y="20.733333333333334">PWM4</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="29.51666666666666" y="22.633333333333333"/>
<g transform="translate(25.731026020611555,21.933333333333334)">
<rect fill="#000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="27.216666666666658" y="22.733333333333334">GND</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="29.51666666666666" y="24.633333333333333"/>
<g transform="translate(25.731026020611555,23.933333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="27.216666666666658" y="24.733333333333334">P22</text>
<g transform="translate(22.73102602061156,23.933333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="23.91666666666666" y="24.733333333333334">D4</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="53.11666666666666" y="24.633333333333333"/>
<g transform="translate(56.53102602061156,23.933333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="58.016666666666666" y="24.733333333333334">P0</text>
<g transform="translate(60.131026020611564,23.933333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="61.31666666666666" y="24.733333333333334">D5</text>
<g transform="translate(63.131026020611564,23.933333333333334)">
<rect fill="#dcd4ee" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="64.61666666666666" y="24.733333333333334">TX2</text>
<g transform="translate(66.73102602061155,23.933333333333334)">
<rect fill="#f95" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="68.21666666666665" y="24.733333333333334">SCL2</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="53.11666666666666" y="22.633333333333333"/>
<g transform="translate(56.53102602061156,21.933333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="58.016666666666666" y="22.733333333333334">P23</text>
<g transform="translate(60.131026020611564,21.933333333333334)">
<rect fill="#8ad039" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="61.61666666666667" y="22.733333333333334">ADC3</text>
<g transform="translate(63.731026020611566,21.933333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="64.91666666666667" y="22.733333333333334">D6</text>
<g transform="translate(66.73102602061155,21.933333333333334)">
<rect fill="#16a352" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="67.91666666666666" y="22.733333333333334">A0</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="53.11666666666666" y="20.633333333333333"/>
<g transform="translate(56.53102602061156,19.933333333333334)">
<rect fill="#ed602e" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="58.016666666666666" y="20.733333333333334">?</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="53.11666666666666" y="18.633333333333333"/>
<g transform="translate(56.53102602061156,17.933333333333334)">
<rect fill="#000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="58.016666666666666" y="18.733333333333334">GND</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="53.11666666666666" y="16.633333333333333"/>
<g transform="translate(56.53102602061156,15.933333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="58.016666666666666" y="16.733333333333334">P8</text>
<g transform="translate(60.131026020611564,15.933333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="61.31666666666666" y="16.733333333333334">D7</text>
<g transform="translate(63.131026020611564,15.933333333333334)">
<rect fill="#afa35e" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="64.61666666666666" y="16.733333333333334">PWM2</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="53.11666666666666" y="14.633333333333333"/>
<g transform="translate(56.53102602061156,13.933333333333332)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="58.016666666666666" y="14.733333333333333">P9</text>
<g transform="translate(60.131026020611564,13.933333333333332)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="61.31666666666666" y="14.733333333333333">D8</text>
<g transform="translate(63.131026020611564,13.933333333333332)">
<rect fill="#afa35e" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="64.61666666666666" y="14.733333333333333">PWM3</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="53.11666666666666" y="12.633333333333333"/>
<g transform="translate(56.53102602061156,11.933333333333332)">
<rect fill="#000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="58.016666666666666" y="12.733333333333333">GND</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="32.76666666666666" y="30.383333333333333"/>
<g transform="translate(28.981026020611555,29.683333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="30.466666666666658" y="30.483333333333334">P21</text>
<g transform="translate(25.98102602061156,29.683333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="27.16666666666666" y="30.483333333333334">D9</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="32.76666666666666" y="32.38333333333333"/>
<g transform="translate(28.981026020611555,31.683333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="30.466666666666658" y="32.483333333333334">P6</text>
<g transform="translate(25.98102602061156,31.683333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="27.16666666666666" y="32.483333333333334">D10</text>
<g transform="translate(22.381026020611557,31.683333333333334)">
<rect fill="#afa35e" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="23.86666666666666" y="32.483333333333334">PWM0</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="32.76666666666666" y="34.38333333333333"/>
<g transform="translate(28.981026020611555,33.68333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="30.466666666666658" y="34.483333333333334">P7</text>
<g transform="translate(25.98102602061156,33.68333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="27.16666666666666" y="34.483333333333334">D11</text>
<g transform="translate(22.381026020611557,33.68333333333334)">
<rect fill="#afa35e" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="23.86666666666666" y="34.483333333333334">PWM1</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="32.76666666666666" y="36.38333333333333"/>
<g transform="translate(28.981026020611555,35.68333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="30.466666666666658" y="36.483333333333334">P10</text>
<g transform="translate(25.98102602061156,35.68333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="27.16666666666666" y="36.483333333333334">D12</text>
<g transform="translate(22.381026020611557,35.68333333333334)">
<rect fill="#dcd4ee" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="23.86666666666666" y="36.483333333333334">RX1</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="49.86666666666666" y="36.38333333333333"/>
<g transform="translate(53.28102602061156,35.68333333333334)">
<rect fill="#000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="54.766666666666666" y="36.483333333333334">GND</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="49.86666666666666" y="34.38333333333333"/>
<g transform="translate(53.28102602061156,33.68333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="54.766666666666666" y="34.483333333333334">P11</text>
<g transform="translate(56.881026020611564,33.68333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="58.06666666666666" y="34.483333333333334">D13</text>
<g transform="translate(59.881026020611564,33.68333333333334)">
<rect fill="#dcd4ee" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="61.36666666666667" y="34.483333333333334">TX1</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="49.86666666666666" y="32.38333333333333"/>
<g transform="translate(53.28102602061156,31.683333333333334)">
<rect fill="#ed602e" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="54.766666666666666" y="32.483333333333334">?</text>
<rect fill="#4e4c4c" height="0.2" width="2.6" x="49.86666666666666" y="30.383333333333333"/>
<g transform="translate(53.28102602061156,29.683333333333334)">
<rect fill="#800000" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="54.766666666666666" y="30.483333333333334">P1</text>
<g transform="translate(56.881026020611564,29.683333333333334)">
<rect fill="#99188d" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="2.8" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="white" font-family="Consolas" font-size="1.2" text-anchor="middle" x="58.06666666666666" y="30.483333333333334">D14</text>
<g transform="translate(59.881026020611564,29.683333333333334)">
<rect fill="#dcd4ee" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="61.36666666666667" y="30.483333333333334">RX2</text>
<g transform="translate(63.481026020611566,29.683333333333334)">
<rect fill="#f95" height="1.6" rx="0.3" ry="0.3" transform="skewX(-15)" width="3.4" x="0" y="0"/>
</g>
<text dominant-baseline="central" fill="#423F42" font-family="Consolas" font-size="1.2" text-anchor="middle" x="64.96666666666667" y="30.483333333333334">SDA2</text>
</svg>

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -0,0 +1 @@
#include "variant.h"

View File

@@ -0,0 +1,42 @@
/* This file was auto-generated from lsc-lma35-t.json using boardgen */
#include <Arduino.h>
extern "C" {
// clang-format off
PinInfo pinTable[PINS_COUNT] = {
// D0: P26, PWM5, IRDA
{GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D1: P14, SD_CLK, SCK
{GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
// D2: P16, SD_D0, MOSI
{GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0},
// D3: P24, PWM4
{GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D4: P22, TDI, FSI
{GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0},
// D5: P0, UART2_TX, I2C2_SCL
{GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0},
// D6: P23, ADC3, TDO, FSO
{GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0},
// D7: P8, PWM2
{GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D8: P9, PWM3
{GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D9: P21, I2C1_SDA, TMS, MCLK, ^FCS
{GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0},
// D10: P6, PWM0
{GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D11: P7, PWM1
{GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D12: P10, UART1_RX
{GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0},
// D13: P11, UART1_TX
{GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0},
// D14: P1, UART2_RX, I2C2_SDA
{GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0},
};
// clang-format on
} // extern "C"

View File

@@ -0,0 +1,71 @@
/* This file was auto-generated from lsc-lma35-t.json using boardgen */
#pragma once
#include <WVariant.h>
// clang-format off
// Pins
// ----
#define PINS_COUNT 15
#define NUM_DIGITAL_PINS 15
#define NUM_ANALOG_INPUTS 1
#define NUM_ANALOG_OUTPUTS 0
// Analog pins
// -----------
#define PIN_A0 6u // GPIO23
#define A0 PIN_A0
// SPI Interfaces
// --------------
#define SPI_INTERFACES_COUNT 0
// Wire Interfaces
// ---------------
#define WIRE_INTERFACES_COUNT 1
#define PIN_WIRE2_SCL 5u // GPIO0
#define PIN_WIRE2_SDA 14u // GPIO1
// Serial ports
// ------------
#define SERIAL_INTERFACES_COUNT 2
#define PIN_SERIAL1_RX 12u // GPIO10
#define PIN_SERIAL1_TX 13u // GPIO11
#define PIN_SERIAL2_RX 14u // GPIO1
#define PIN_SERIAL2_TX 5u // GPIO0
// Pin function macros
// -------------------
#define PIN_FUNCTION_ADC3 6u // GPIO23
#define PIN_FUNCTION_MOSI 2u // GPIO16
#define PIN_FUNCTION_P0 5u // GPIO0
#define PIN_FUNCTION_P1 14u // GPIO1
#define PIN_FUNCTION_P6 10u // GPIO6
#define PIN_FUNCTION_P7 11u // GPIO7
#define PIN_FUNCTION_P8 7u // GPIO8
#define PIN_FUNCTION_P9 8u // GPIO9
#define PIN_FUNCTION_P10 12u // GPIO10
#define PIN_FUNCTION_P11 13u // GPIO11
#define PIN_FUNCTION_P14 1u // GPIO14
#define PIN_FUNCTION_P16 2u // GPIO16
#define PIN_FUNCTION_P21 9u // GPIO21
#define PIN_FUNCTION_P22 4u // GPIO22
#define PIN_FUNCTION_P23 6u // GPIO23
#define PIN_FUNCTION_P24 3u // GPIO24
#define PIN_FUNCTION_P26 0u // GPIO26
#define PIN_FUNCTION_PWM0 10u // GPIO6
#define PIN_FUNCTION_PWM1 11u // GPIO7
#define PIN_FUNCTION_PWM2 7u // GPIO8
#define PIN_FUNCTION_PWM3 8u // GPIO9
#define PIN_FUNCTION_PWM4 3u // GPIO24
#define PIN_FUNCTION_PWM5 0u // GPIO26
#define PIN_FUNCTION_RX1 12u // GPIO10
#define PIN_FUNCTION_RX2 14u // GPIO1
#define PIN_FUNCTION_SCK 1u // GPIO14
#define PIN_FUNCTION_SCL2 5u // GPIO0
#define PIN_FUNCTION_SDA1 9u // GPIO21
#define PIN_FUNCTION_SDA2 14u // GPIO1
#define PIN_FUNCTION_TX1 13u // GPIO11
#define PIN_FUNCTION_TX2 5u // GPIO0

View File

@@ -3,7 +3,7 @@
"beken-72xx",
"beken-7231n",
"beken-7231n-tuya",
"pcb/ic-bk7231-qfn32",
"ic/bk7231-qfn32",
"pcb/lsc-lma35"
],
"build": {

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|----------------------------------

View File

@@ -1,9 +1,9 @@
{
"_base": [
"beken-72xx",
"beken-7231t",
"beken-7231u",
"beken-7231t-tuya",
"pcb/ic-bk7231-qfn32",
"ic/bk7231-qfn32",
"pcb/wb2l",
"pcb/wb2l-test"
],

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|------------------------------------------

View File

@@ -1,9 +1,9 @@
{
"_base": [
"beken-72xx",
"beken-7231t",
"beken-7231u",
"beken-7231t-tuya",
"pcb/ic-bk7231-qfn32",
"ic/bk7231-qfn32",
"pcb/wb2s",
"pcb/wb2s-test"
],

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|------------------------------------------

View File

@@ -1,9 +1,9 @@
{
"_base": [
"beken-72xx",
"beken-7231t",
"beken-7231u",
"beken-7231t-tuya",
"pcb/ic-bk7231-qfn32",
"ic/bk7231-qfn32",
"pcb/wb3l"
],
"build": {

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|------------------------------------------

View File

@@ -1,9 +1,9 @@
{
"_base": [
"beken-72xx",
"beken-7231t",
"beken-7231u",
"beken-7231t-tuya",
"pcb/ic-bk7231-qfn32",
"ic/bk7231-qfn32",
"pcb/wb3s"
],
"build": {

View File

@@ -6,7 +6,6 @@
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value
-------------|------------------------------------------

View File

@@ -2,7 +2,7 @@
"_base": [
"realtek-ambz",
"realtek-ambz-2mb-788k",
"pcb/ic-rtl8710bn",
"ic/rtl8710bn",
"pcb/wr2-base",
"pcb/wr2"
],

View File

@@ -4,10 +4,9 @@
[Product page](https://developer.tuya.com/en/docs/iot/wifiwr2module?id=K9605tko0juc3)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|----------------------------------------

View File

@@ -2,7 +2,7 @@
"_base": [
"realtek-ambz",
"realtek-ambz-2mb-788k",
"pcb/ic-rtl8710bn",
"ic/rtl8710bn",
"pcb/wr2-base",
"pcb/wr2e"
],

View File

@@ -4,10 +4,9 @@
[Product page](https://developer.tuya.com/en/docs/iot/wr2e?id=K97scnsjhue4h)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|------------------------------------------

View File

@@ -3,7 +3,7 @@
"realtek-ambz",
"realtek-ambz-2mb-788k",
"realtek-ambz-bx",
"pcb/ic-rtl8710bn",
"ic/rtl8710bn",
"pcb/wr2l-base",
"pcb/wr2l"
],

View File

@@ -4,10 +4,9 @@
[Product page](https://developer.tuya.com/en/docs/iot/wifiwr2lmodule?id=K9605tnbj7gva)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|------------------------------------------

View File

@@ -3,7 +3,7 @@
"realtek-ambz",
"realtek-ambz-2mb-788k",
"realtek-ambz-bx",
"pcb/ic-rtl8710bn",
"ic/rtl8710bn",
"pcb/wr2l-base",
"pcb/wr2le"
],

View File

@@ -4,10 +4,9 @@
[Product page](https://developer.tuya.com/en/docs/iot/wr2le?id=K9eio9y9e8i8c)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|-------------------------

View File

@@ -2,7 +2,7 @@
"_base": [
"realtek-ambz",
"realtek-ambz-2mb-788k",
"pcb/ic-rtl8710bn",
"ic/rtl8710bn",
"pcb/wr3-base",
"pcb/wr3"
],

View File

@@ -4,10 +4,9 @@
[Product page](https://developer.tuya.com/en/docs/iot/wr3-module-datasheet?id=K9g3ainzbj9z1)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|----------------------------------------

View File

@@ -2,7 +2,7 @@
"_base": [
"realtek-ambz",
"realtek-ambz-2mb-788k",
"pcb/ic-rtl8710bn",
"ic/rtl8710bn",
"pcb/wr3-base",
"pcb/wr3e"
],

View File

@@ -4,10 +4,9 @@
[Product page](https://developer.tuya.com/en/docs/iot/wr3e-module-datasheet?id=K9elwlqbfosbc)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|------------------------------------------

View File

@@ -3,7 +3,7 @@
"realtek-ambz",
"realtek-ambz-2mb-788k",
"realtek-ambz-bx",
"pcb/ic-rtl8710bn",
"ic/rtl8710bn",
"pcb/wr3l-base",
"pcb/wr3"
],

View File

@@ -4,10 +4,9 @@
[Product page](https://developer.tuya.com/en/docs/iot/wifiwr3lmodule?id=K9605tt0kveqm)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|------------------------------------------

View File

@@ -3,7 +3,7 @@
"realtek-ambz",
"realtek-ambz-2mb-788k",
"realtek-ambz-bx",
"pcb/ic-rtl8710bn",
"ic/rtl8710bn",
"pcb/wr3l-base",
"pcb/wr3e"
],

View File

@@ -4,10 +4,9 @@
[Product page](https://developer.tuya.com/en/docs/iot/wr3le?id=K986l7a1ha8tm)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|--------------------------------------------

View File

@@ -2,7 +2,7 @@
"_base": [
"realtek-ambz",
"realtek-ambz-2mb-788k",
"pcb/ic-rtl8710bn",
"ic/rtl8710bn",
"pcb/wr3-base",
"pcb/wr3n"
],

View File

@@ -4,10 +4,9 @@
[Product page](https://developer.tuya.com/en/docs/iot/wr3n-datasheet?id=K98zdx31ztdge)
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [General info](../../docs/platform/realtek-amb/README.md)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Debugging](../../docs/platform/realtek-ambz/debugging.md)
Parameter | Value
-------------|------------------------------------------

View File

@@ -2,17 +2,12 @@
from os.path import join
from ltchiptool.soc.bk72xx.binary import to_offset
from SCons.Script import Builder, DefaultEnvironment
env = DefaultEnvironment()
board = env.BoardConfig()
# Install PyCryptodome for OTA packaging with AES
try:
import Cryptodome
except ImportError:
env.Execute("$PYTHONEXE -m pip install pycryptodomex")
ROOT_DIR = join("$SDK_DIR", "beken378")
APP_DIR = join(ROOT_DIR, "app")
DRIVER_DIR = join(ROOT_DIR, "driver")
@@ -32,7 +27,7 @@ SOC_BK7236 = 6
SOC_NAMES = {
SOC_BK7231: "bk7231",
SOC_BK7231U: "bk7231u",
SOC_BK7221U: "bk7221u",
SOC_BK7251: "bk7251",
SOC_BK7271: "bk7271",
SOC_BK7231N: "bk7231n",
SOC_BK7236: "bk7236",
@@ -517,7 +512,7 @@ if env.Cfg("ATSVR_CFG"):
"+<*>",
],
)
if env.Cfg("CFG_USB"):
if env.Cfg("CFG_USB") or env.Cfg("CFG_USE_SDCARD_HOST"):
env.AddLibrary(
name="bdk_driver_usb",
base_dir=ROOT_DIR,
@@ -567,8 +562,8 @@ env.Replace(
# Calculate RBL header offset
app_offs = int(env["FLASH_APP_OFFSET"], 16)
app_size = int(board.get("build.bkrbl_size_app"), 16)
rbl_offs = int(app_size // 32 * 34) - 102
env.Replace(FLASH_RBL_OFFSET=f"0x{app_offs + rbl_offs:06X}")
rbl_offs = app_offs + to_offset(app_size) - 102
env.Replace(FLASH_RBL_OFFSET=f"0x{rbl_offs:06X}")
# Build all libraries
env.BuildLibraries()

View File

@@ -31,7 +31,7 @@ env.Append(
],
CXXFLAGS=[
# borrowed from RtlDuino/development/rtl87xx/platform.txt
"-std=c++11",
"-std=gnu++11",
"-MMD",
"-fno-exceptions",
"-fno-rtti",
@@ -100,7 +100,6 @@ env.AddLibrary(
"+<component/common/api/lwip_netconf.c>",
"+<component/common/drivers/wlan/realtek/src/osdep/lwip_intf.c>",
"+<component/common/network/dhcp/dhcps.c>",
"+<component/common/network/sntp/sntp.c>",
"+<component/common/network/ssl/ssl_ram_map/ssl_ram_map.c>",
"+<component/os/freertos/freertos_v8.1.2/Source/portable/MemMang/heap_5.c>",
"+<component/os/freertos/freertos_v8.1.2/Source/portable/GCC/ARM_CM4F/port.c>",

View File

@@ -16,7 +16,7 @@ env.SConscript("utils/config.py", exports="env")
env.SConscript("utils/env.py", exports="env")
env.SConscript("utils/flash.py", exports="env")
env.SConscript("utils/libs.py", exports="env")
env.SConscript("utils/uf2.py", exports="env")
env.SConscript("utils/ltchiptool.py", exports="env")
# Vendor-specific library ports
env.SConscript("libs/flashdb.py", exports="env")
env.SConscript("libs/lwip.py", exports="env")
@@ -69,7 +69,7 @@ targets = [target_elf]
if "UF2OTA" in env:
target_uf2 = env.BuildUF2OTA(target_elf)
targets.append(target_uf2)
env.AddUF2Uploader(target_uf2)
env.AddFlashWriter(target_uf2)
elif "IMG_FW" in env:
target_fw = env.subst("$IMG_FW")
env.AddPlatformTarget("upload", target_fw, env["UPLOAD_ACTIONS"], "Upload")

View File

@@ -74,8 +74,10 @@ def env_add_defaults(env, platform, board):
VARIANT=board.get("build.variant"),
LDSCRIPT_SDK=board.get("build.ldscript_sdk"),
LDSCRIPT_ARDUINO=board.get("build.ldscript_arduino"),
# ltchiptool variables
LTCHIPTOOL='"${PYTHONEXE}" -m ltchiptool',
# ltchiptool config:
# -r output raw log messages
# -i 1 indent log messages
LTCHIPTOOL='"${PYTHONEXE}" -m ltchiptool -r -i 1',
# Fix for link2bin to get tmpfile name in argv
LINKCOM="${LINK} ${LINKARGS}",
LINKARGS="${TEMPFILE('-o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS', '$LINKCOMSTR')}",

View File

@@ -53,7 +53,7 @@ def env_uf2ota(env, *args, **kwargs):
env.Execute(" ".join(cmd))
def env_uf2upload(env, target):
def env_flash_write(env, target):
protocol = env.subst("${UPLOAD_PROTOCOL}")
actions = []
# from platform-espressif32/builder/main.py
@@ -61,7 +61,7 @@ def env_uf2upload(env, target):
# upload via UART
env["UPLOADERFLAGS_UF2"] = [
"${UF2OUT}",
"uart",
"-d",
"${UPLOAD_PORT}",
"-b",
"${UPLOAD_SPEED}",
@@ -79,7 +79,7 @@ def env_uf2upload(env, target):
# add main upload target
env.Replace(
UPLOADER="${LTCHIPTOOL} uf2 upload",
UPLOADER="${LTCHIPTOOL} flash write",
UPLOADCMD="${UPLOADER} ${UPLOADERFLAGS_UF2} ${UPLOADERFLAGS}",
)
actions.append(env.VerboseAction("${UPLOADCMD}", "Uploading ${UF2OUT_BASE}"))
@@ -93,4 +93,4 @@ env.Append(
)
)
)
env.AddMethod(env_uf2upload, "AddUF2Uploader")
env.AddMethod(env_flash_write, "AddFlashWriter")

10
docs/flashing/SUMMARY.md Normal file
View File

@@ -0,0 +1,10 @@
# Flashing/dumping methods & guides
* [Flashing PlatformIO projects](platformio.md)
* [Flashing ESPHome](esphome.md)
* [Using ltchiptool GUI](tools/ltchiptool.md)
* [Converting with tuya-cloudcutter](tools/cloudcutter.md)
* 🔌 Chip connection guide
* [Beken BK72xx](../platform/beken-72xx/flashing.md)
* [Realtek RTL8710Bx](../platform/realtek-ambz/flashing.md)
* [Auto-download-reboot](tools/adr.md)

55
docs/flashing/esphome.md Normal file
View File

@@ -0,0 +1,55 @@
# Flashing ESPHome
ESPHome can be flashed in few different ways, depending on your needs.
!!! abstract
All binary files generated by ESPHome will be in `.esphome/build/<yourdevice>/.pioenvs/<yourdevice>/`. The methods described below may require you to get a file from that directory.
If you're using the GUI (ESPHome Dashboard) this path will be in your `configs/` directory.
This path will be referred to as **build directory**.
## Built-in flasher
=== "CLI"
The flasher program built-in LibreTuya 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
<!-- the line below needs to be indented by 4 spaces!!! -->
{%
include-markdown "inc/uart-info.md"
%}
If your device is already running ESPHome, refer to the OTA guide below.
=== "GUI"
The built-in flasher is not yet available in the GUI. Here are your options:
- OTA, using the downloaded UF2 file (if you're already running ESPHome)
- wired (also UF2), using ltchiptool
- wirelessly, using tuya-cloudcutter
Read below for more details on each of these methods.
## Over-the-Air (OTA)
This method requires having ESPHome already installed on your device.
- If you've added the Web Server component, navigate to the device's IP address (or `.local` name) in your web browser. Grab `firmware.uf2` from the build directory and drop it on the "OTA Update" field.
- You can also use ESPHome CLI to flash via OTA. Add a `--device` argument to the command, as such: `python -m esphome upload yourdevice.yml --device yourdevice.local`
{%
include-markdown "inc/uart-ltchiptool.md"
%}
{%
include-markdown "inc/ota-cloudcutter.md"
%}
{%
include-markdown "inc/ota-openbeken.md"
%}

View File

@@ -0,0 +1,8 @@
## Converting devices with tuya-cloudcutter
!!! note
This currently applies to BK7231T and BK7231N only. `tuya-cloudcutter` can't be used for other chips.
Grab the `bk7231x_app.ota.ug.bin` file from the build directory - take care to choose the correct file. It must have "OTA" and "UG" in its name.
Next, refer to [Using tuya-cloudcutter](../tools/cloudcutter.md) guide.

View File

@@ -0,0 +1,5 @@
## Migrating from OpenBeken (OTA)
[OpenBeken](https://github.com/openshwprojects/OpenBK7231T_App) is a custom, Tasmota-like firmware for non-ESP chips. Currently, this part of the guide applies to BK7231 only, as that's the only chip supported both by LT and OBK.
OBK is compatible with standard Beken OTA packages, but the web panel does a filename check to prevent chip type mismatch. Grab the `bk7231x_app.ota.bin` file from build directory (note: without "UG" in the name!), rename it to something like `OpenBK7231T_esphome.rbl` (change T to N depending on the chip type), and drop it on the OTA panel.

Some files were not shown because too many files have changed in this diff Show More