20 Commits

Author SHA1 Message Date
Kuba Szczodrzyński
376a4db4cb [release] v0.13.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
2023-04-11 19:34:24 +02:00
Kuba Szczodrzyński
24832d3277 [beken-72xx] Fix bootloop by aggressive GCC optimization 2023-03-15 23:19:26 +01:00
Kuba Szczodrzyński
8f338a6b30 [beken-72xx] Fix bootloop by undefined instruction on GCC 10 2023-03-15 17:26:09 +01:00
Kuba Szczodrzyński
eae64d34e2 [core] Update ltchiptool to v3.0.2 2023-03-14 11:34:09 +01:00
Kuba Szczodrzyński
a27e76bfa7 [realtek-ambz] Backport UART fix from structure-refactor 2023-03-13 22:30:02 +01:00
Kuba Szczodrzyński
a2de77ce30 [core] Use GCC 10.3.1 with -Os for all families 2023-03-13 16:50:13 +01:00
Kuba Szczodrzyński
5de98ed56c [realtek-ambz] Selectively update GCC to v10.3.1 2023-03-12 22:27:26 +01:00
Kuba Szczodrzyński
ff8ac6036c [realtek-ambz] Update GCC to v5.4.1 2023-03-12 14:12:04 +01:00
Kuba Szczodrzyński
c4a3e9e2ee [beken-72xx] Re-enable OTA encryption 2023-03-11 16:59:57 +01:00
Kuba Szczodrzyński
8f447a4a72 [release] v0.12.6
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-02-02 22:28:52 +01:00
Kuba Szczodrzyński
8ace11e462 [core] Fix Python lint 2023-02-02 22:28:10 +01:00
Kuba Szczodrzyński
949dfe7266 [core] Use PIO repackages of vendor frameworks 2023-02-02 22:21:12 +01:00
Kuba Szczodrzyński
f0d490aef9 [docs] Fix ESPHome sample config indent 2023-02-02 21:59:14 +01:00
Kuba Szczodrzyński
bdedae981a [beken-72xx] Fix UF2 RBL relative offset 2023-01-28 16:38:28 +01:00
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
20 changed files with 858 additions and 98 deletions

View File

@@ -9,6 +9,8 @@ extern "C" {
extern int uart_print_port;
void __sync_synchronize(void) {}
} // extern "C"
beken_thread_t mainThread;

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

@@ -45,6 +45,19 @@ void SerialClass::begin(unsigned long baudrate, uint16_t config) {
// RUART_STOP_BIT_1 / RUART_STOP_BIT_2
uint8_t stopBits = (config & SERIAL_STOP_BIT_MASK) == SERIAL_STOP_BIT_2;
switch ((uint32_t)data.uart) {
case UART0_REG_BASE:
RCC_PeriphClockCmd(APBPeriph_UART0, APBPeriph_UART0_CLOCK, ENABLE);
break;
case UART1_REG_BASE:
RCC_PeriphClockCmd(APBPeriph_UART1, APBPeriph_UART1_CLOCK, ENABLE);
break;
}
Pinmux_Config(pinInfo(this->rx)->gpio, PINMUX_FUNCTION_UART);
Pinmux_Config(pinInfo(this->tx)->gpio, PINMUX_FUNCTION_UART);
PAD_PullCtrl(pinInfo(this->rx)->gpio, GPIO_PuPd_UP);
UART_InitTypeDef cfg;
UART_StructInit(&cfg);
cfg.WordLen = dataWidth;
@@ -60,11 +73,12 @@ void SerialClass::begin(unsigned long baudrate, uint16_t config) {
data.buf = new RingBuffer();
}
Pinmux_Config(pinInfo(this->rx)->gpio, PINMUX_FUNCTION_UART);
Pinmux_Config(pinInfo(this->tx)->gpio, PINMUX_FUNCTION_UART);
VECTOR_IrqUnRegister(this->irq);
VECTOR_IrqRegister(callback, this->irq, (uint32_t)&data, 10);
VECTOR_IrqEn(this->irq, 10);
UART_RxCmd((UART_TypeDef *)data.uart, ENABLE);
UART_INTConfig((UART_TypeDef *)data.uart, RUART_IER_ERBI, ENABLE);
}
void SerialClass::end() {

View File

@@ -28,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)

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

@@ -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")
@@ -48,13 +43,16 @@ env.Append(
"-mthumb",
"-mthumb-interwork",
"-g",
"-O2",
# anything higher, like -O2 or -Os, causes random issues
# like bootlooping, missing (blank) strings, random lockups during boot
"-O1",
"-fdata-sections",
"-ffunction-sections",
"-fno-inline-functions",
"-fno-strict-aliasing",
"-fsigned-char",
"-fno-delete-null-pointer-checks",
"-Wno-comment",
"-Werror=implicit-function-declaration",
],
CFLAGS=[
"-std=gnu99",
@@ -62,6 +60,7 @@ env.Append(
"-Wall",
"-Wno-format",
"-Wno-unknown-pragmas",
"-Werror=implicit-function-declaration",
],
CXXFLAGS=[
"-std=gnu++11",
@@ -69,6 +68,8 @@ env.Append(
"-fno-exceptions",
"-fno-rtti",
"-Wno-literal-suffix",
"-Wno-psabi",
"-Wno-return-type",
],
CPPDEFINES=[
# LibreTuya configuration
@@ -369,6 +370,8 @@ env.AddLibrary(
CCFLAGS=[
"-Wno-unused-variable",
"-Wno-implicit-function-declaration",
"-Wno-incompatible-pointer-types",
"-Wno-int-conversion",
],
CFLAGS=["-<-Wall>"],
),
@@ -567,7 +570,7 @@ 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
rbl_offs = to_offset(app_size) - 102
env.Replace(FLASH_RBL_OFFSET=f"0x{app_offs + rbl_offs:06X}")
# Build all libraries

View File

@@ -16,14 +16,16 @@ env.Append(
"-mfpu=fpv4-sp-d16",
"-g2",
"-w",
"-O2",
"-Os",
"-fdata-sections",
"-ffunction-sections",
"-fno-inline-functions",
"-fmessage-length=0",
"-fno-common",
"-fno-short-enums",
"-fomit-frame-pointer",
"-fsigned-char",
"-fno-delete-null-pointer-checks",
],
CFLAGS=[
"-std=gnu99",
@@ -35,6 +37,7 @@ env.Append(
"-MMD",
"-fno-exceptions",
"-fno-rtti",
"-Wno-psabi",
],
CPPDEFINES=[
# LibreTuya configuration
@@ -49,6 +52,7 @@ env.Append(
("ERRNO", "1"), # for LwIP
"MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED", # enable PSK in mbedTLS
# "MBEDTLS_DEBUG_C",
"MBED_PERIPHERALNAMES_H", # see fixups/cmsis.h
],
LINKFLAGS=[
"-mcpu=cortex-m4",

View File

@@ -5,20 +5,35 @@ 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
The flasher program built-in LibreTuya is also available for ESPHome.
=== "CLI"
- 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 flasher program built-in LibreTuya is also available for ESPHome.
{%
include-markdown "inc/uart-info.md"
%}
- use `python -m esphome run yourdevice.yml` to recompile AND upload the firmware
- use `python -m esphome upload yourdevice.yml` to upload without recompiling
If your device is already running ESPHome, refer to the OTA guide below.
<!-- 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)

View File

@@ -1,55 +1,111 @@
# ESPHome
!!! important
Read [Getting started](../getting-started/README.md) first - most importantly, the first part about installation.
**It is very important that you have the latest version of LibreTuya installed** (not `libretuya-esphome` - this is a different thing!) **so that you don't face issues that are already resolved**.
## Download ESPHome
Because ESPHome does not natively support running on non-ESP chips, you need to use a fork of the project.
Assuming you have PlatformIO, git and Python installed:
There are two basic ways to install and use LibreTuya-ESPHome. You can choose the option that best suits you:
1. Open a terminal/cmd.exe, create `esphome` directory and `cd` into it.
2. `git clone https://github.com/kuba2k2/libretuya-esphome`
3. `cd` into the newly created `libretuya-esphome` directory.
4. Check if it works by typing `python -m esphome`
- command line (CLI) - for more experienced users; compilation using CLI commands, somewhat easier to troubleshoot
- ESPHome Dashboard (GUI) - for new users, might be an easy way to go; config management & compilation using web-based dashboard
!!! tip
For Linux users (or if `python -m esphome` doesn't work for you):
You can use LibreTuya-ESPHome for ESP32/ESP8266 compilation as well - the forked version *extends* the base, and doesn't remove any existing features. Keep in mind that you might not have latest ESPHome updates until the fork gets updated (which usually happens at most every few weeks).
- uninstall ESPHome first: `pip uninstall esphome`
- install the forked version: `pip install -e .`
## Find your device's board
Go to [Boards & CPU list](../status/supported/), find your board (chip model), click on it and remember the **`Board code`**. This will be used later, during config creation.
If your board isn't listed, use one of the **Generic** boards, depending on the chip type of your device.
## Download ESPHome
=== "CLI"
!!! important
Read [Getting started](../getting-started/README.md) first - most importantly, the first part about installation.
**It is very important that you have the latest version of LibreTuya installed** (not `libretuya-esphome` - this is a different thing!) **so that you don't face issues that are already resolved**.
Assuming you have PlatformIO, git and Python installed:
1. Open a terminal/cmd.exe, create `esphome` directory and `cd` into it.
2. `git clone https://github.com/kuba2k2/libretuya-esphome`
3. `cd` into the newly created `libretuya-esphome` directory.
4. Check if it works by typing `python -m esphome`
!!! tip
For Linux users (or if `python -m esphome` doesn't work for you):
- uninstall ESPHome first: `pip uninstall esphome`
- install the forked version: `pip install -e .`
=== "GUI"
For this, you need Docker, Docker Compose and Python installed. After running the commands, you'll have a running ESPHome Dashboard interface that you can connect to.
1. `git clone https://github.com/kuba2k2/libretuya-esphome` (or download the .ZIP and unpack it, not recommended)
2. Open a terminal/cmd.exe in the cloned directory (`libretuya-esphome`).
3. `python docker/build.py --tag libretuya --arch amd64 --build-type docker build` - this will build the Docker image of ESPHome. Change `amd64` to something else if you're using a Raspberry Pi.
4. Create a `docker-compose.yml` file in the same directory:
```yaml title="docker-compose.yml"
version: "3"
services:
esphome:
container_name: esphome-libretuya
image: esphome/esphome-amd64:libretuya # (2)!
volumes:
- ./configs:/config:rw # (1)!
- /etc/localtime:/etc/localtime:ro
restart: always
privileged: false
network_mode: host
```
1. You can change `./configs` to another path, in which your ESPHome configs will be stored.
2. Ensure the architecture (`amd64`) matches the one you selected in step 3.
5. Start the container - `docker-compose up`. You should be able to open the GUI on [http://localhost:6052/](http://localhost:6052/).
## Create your device config
1. Go to [Boards & CPU list](../status/supported/), click on your board and remember the **`Board code`**.
2. Create a YAML config file for your device. You can either:
- use `python -m esphome wizard yourdevice.yml` - type answers to the six questions the wizard asks, OR:
- write a config file manually:
```yaml title="yourdevice.yml"
esphome:
name: yourdevice
=== "CLI"
libretuya:
board: wr3 # THIS IS YOUR BOARD CODE
framework:
version: latest
1. Create a YAML config file for your device. You can either:
- use `python -m esphome wizard yourdevice.yml` - type answers to the six questions the wizard asks, OR:
- write a config file manually:
```yaml title="yourdevice.yml"
esphome:
name: yourdevice
logger:
api:
password: ""
ota:
password: ""
libretuya:
board: wr3 # THIS IS YOUR BOARD CODE
framework:
version: latest
wifi:
ssid: "YourWiFiSSID"
password: "SecretPa$$w0rd"
ap:
ssid: "Yourdevice Fallback Hotspot"
password: "Dv2hZMGZRUvy"
```
logger:
api:
password: ""
ota:
password: ""
wifi:
ssid: "YourWiFiSSID"
password: "SecretPa$$w0rd"
ap:
ssid: "Yourdevice Fallback Hotspot"
password: "Dv2hZMGZRUvy"
```
=== "GUI"
1. Open the GUI on [http://localhost:6052/](http://localhost:6052/) (or a different IP address if you're running on a Pi).
2. Go through the wizard steps:
- `New Device`
- `Continue`
- enter name and WiFi details
- choose `LibreTuya`
- choose the board that you found before
- select `Skip`
3. A new config file will be added. Press `Edit` and proceed to the next section.
## Add components
@@ -62,9 +118,15 @@ Now, just like with standard ESPHome on ESP32/ESP8266, you need to add component
## Build & upload
The command `python -m esphome compile yourdevice.yml` will compile ESPHome.
=== "CLI"
You probably want to refer to the [flashing guide](../flashing/esphome.md) to learn how to upload ESPHome to your device. There's also info on using `tuya-cloudcutter` in that guide.
The command `python -m esphome compile yourdevice.yml` will compile ESPHome.
=== "GUI"
Close the config editor. Press the three dots icon and select `Install`. Choose `Manual download` and `Modern format`. The firmware will be compiled and a UF2 file will be downloaded automatically.
Now, refer to the [flashing guide](../flashing/esphome.md) to learn how to upload ESPHome to your device. There's also info on using `tuya-cloudcutter` in that guide.
## Advanced: LT configuration
@@ -79,8 +141,8 @@ libretuya:
version: latest
lt_config:
LT_LOG_HEAP: 1
LT_UART_DEFAULT_PORT: 2
LT_UART_SILENT_ALL: 0
LT_UART_DEFAULT_PORT: 2
LT_UART_SILENT_ALL: 0
```
(this is only an example)

View File

@@ -34,5 +34,6 @@ Name | MCU
[WR3LE](../../boards/wr3le/README.md) | RTL8710BX | 2 MiB | 256 KiB | 16 (12 I/O) | ✔️ | ❌ | ❌ | `realtek-ambz`
**Unknown** | | | | | | | |
[LSC LMA35](../../boards/lsc-lma35/README.md) | BK7231N | 2 MiB | 256 KiB | 22 (15 I/O) | ✔️ | ✔️ | ❌ | `beken-7231n`
[LSC LMA35 T](../../boards/lsc-lma35-t/README.md) | BK7231T | 2 MiB | 256 KiB | 22 (15 I/O) | ✔️ | ✔️ | ❌ | `beken-7231u`
**N/A** | | | | | | | |
[Native](../../boards/generic-native/README.md) | NATIVE | 4 MiB | 4 MiB | - | ✔️ | ❌ | ❌ | `host-native`

View File

@@ -7,7 +7,9 @@ repo_url: https://github.com/kuba2k2/libretuya
theme:
name: material
features:
- content.code.annotate
- content.code.copy
- content.tabs.link
- navigation.instant
- navigation.tracking
- navigation.path
@@ -50,6 +52,8 @@ markdown_extensions:
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.tabbed:
alternate_style: true
- pymdownx.inlinehilite
- pymdownx.details
- pymdownx.superfences

View File

@@ -6,7 +6,7 @@
"type": "git",
"url": "https://github.com/kuba2k2/platformio-libretuya"
},
"version": "0.12.4",
"version": "0.13.0",
"frameworks": {
"arduino": {
"title": "Generic Arduino framework",
@@ -42,15 +42,10 @@
"framework-realtek-amb1": {
"type": "framework",
"optional": true,
"version": "https://github.com/ambiot/amb1_sdk#750b0bc",
"manifest": {
"description": "SDK for Ameba1"
},
"version": "https://github.com/libretuya/framework-realtek-amb1#v2022.06.21",
"toolchains": {
"x86_64": "gccarmnoneeabi@~1.50201.0",
"arm": "gccarmnoneeabi@~1.50401.211104",
"arm64": "gccarmnoneeabi@~1.50401.210715"
},
"any": "gccarmnoneeabi@~1.100301.0"
},
"libraries": {
"lwip": [
"v2.1.3-amb1"
@@ -60,28 +55,18 @@
"framework-realtek-ambz2": {
"type": "framework",
"optional": true,
"version": "https://github.com/ambiot/ambz2_sdk#f009272",
"manifest": {
"description": "SDK for AmebaZ2"
},
"version": "https://github.com/libretuya/framework-realtek-ambz2#v2022.11.17",
"toolchains": {
"x86_64": "gccarmnoneeabi@~1.100301.0",
"arm": "gccarmnoneeabi@~1.100301.0",
"arm64": "gccarmnoneeabi@~1.100301.0"
}
"any": "gccarmnoneeabi@~1.100301.0"
}
},
"framework-beken-bdk": {
"type": "framework",
"optional": true,
"version": "https://github.com/bekencorp/bdk_freertos#c3533e8",
"manifest": {
"description": "Beken Development Kit for FreeRTOS"
"version": "https://github.com/libretuya/framework-beken-bdk#v2021.06.07",
"toolchains": {
"any":"gccarmnoneeabi@~1.100301.0"
},
"toolchains": {
"x86_64":"gccarmnoneeabi@~1.40804.0",
"arm": "gccarmnoneeabi@~1.40803.0",
"arm64": "gccarmnoneeabi@~1.40803.0"
},
"libraries": {
"lwip": [
"v2.1.3-bdk"

View File

@@ -17,7 +17,8 @@ from platformio.platform.base import PlatformBase
from platformio.platform.board import PlatformBoardConfig
from semantic_version import SimpleSpec, Version
LTCHIPTOOL_VERSION = "^2.0.2"
LTCHIPTOOL_VERSION = "^3.0.2"
# Install & import tools
def check_ltchiptool(install: bool):
@@ -26,7 +27,7 @@ def check_ltchiptool(install: bool):
print("Installing/updating ltchiptool")
system(
f"{sys.executable} -m pip install -U --force-reinstall "
f'"ltchiptool >= {LTCHIPTOOL_VERSION}, < 3.0"'
f'"ltchiptool >= {LTCHIPTOOL_VERSION}, < 4.0"'
)
# unload all modules from the old version
@@ -72,7 +73,7 @@ if dirname(__file__) in sys.path:
sys.path.remove(dirname(__file__))
# Let ltchiptool know about LT's location
ltchiptool.util.lt_set_path(dirname(__file__))
ltchiptool.lt_set_path(dirname(__file__))
libretuya_packages = None
manifest_default = {"version": "0.0.0", "description": "", "keywords": []}
@@ -136,6 +137,33 @@ def find_pkg_root(self, path: str, spec: PackageSpec):
return path
def get_os_specifiers():
system = platform.system().lower()
arch = platform.machine().lower()
if not arch: # issue #4353
arch = "x86"
bits = platform.architecture()[0]
if "aarch64" in arch:
arch = "arm"
bits = 64
elif "arm" in arch:
arch = "arm"
bits = 32
elif "64" not in arch:
arch = "x86"
bits = 32
else:
arch = "x86"
bits = 64
return [
f"{system}_{arch}_{bits}", # linux_x86_64
f"{system}_{bits}", # linux_64
system, # windows
arch, # arm
"any",
]
class LibretuyaPlatform(PlatformBase):
boards_base: Dict[str, dict] = {}
custom_opts: Dict[str, object] = {}
@@ -175,12 +203,17 @@ class LibretuyaPlatform(PlatformBase):
# set specific compiler versions
if "toolchains" in package_obj:
toolchains = package_obj["toolchains"]
if "arm" in platform.machine():
(toolchain, version) = toolchains["arm"].split("@")
elif "aarch64" in platform.machine():
(toolchain, version) = toolchains["arm64"].split("@")
else:
(toolchain, version) = toolchains["x86_64"].split("@")
toolchain_version = None
specifiers = get_os_specifiers()
for spec in specifiers:
toolchain_version = toolchains.get(spec)
if toolchain_version:
break
if not toolchain_version:
raise RuntimeError(
f"Toolchain not found for the current platform: {specifiers}"
)
(toolchain, version) = toolchain_version.split("@")
self.packages[f"toolchain-{toolchain}"]["version"] = version
# mark framework SDK as required

View File

@@ -0,0 +1,50 @@
/* Copyright (c) Kuba Szczodrzyński 2023-03-12. */
// Fix for PeripheralNames.h producing errors on GCC newer than 5.x.x.
// The struct pointer casts are replaced with register addresses, which fixes compilation.
// On older versions, this change doesn't make any difference.
// MBED_PERIPHERALNAMES_H is defined in the SDK builder, to eliminate PeripheralNames.h completely.
#include_next "cmsis.h"
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
UART_0 = (int)UART0_REG_BASE,
UART_1 = (int)UART1_REG_BASE,
UART_2 = (int)UART2_REG_BASE,
} UARTName;
typedef enum {
ADC0_0 = 0,
ADC0_1,
ADC0_2,
ADC0_3
} ADCName;
typedef enum {
SPI_0 = (int)SPI0_REG_BASE,
SPI_1 = (int)SPI1_REG_BASE,
} SPIName;
typedef enum {
I2C_0 = (int)I2C0_REG_BASE,
I2C_1 = (int)I2C1_REG_BASE,
} I2CName;
typedef enum {
PWM_0 = 1,
PWM_1,
PWM_2,
PWM_3,
PWM_4,
PWM_5
} PWMName;
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,21 @@
/* Copyright (c) Kuba Szczodrzyński 2023-03-12. */
#include_next <machine/endian.h>
#pragma once
// GCC versions newer than 5.x.x specify the LITTLE_ENDIAN macro
// as an alias to _LITTLE_ENDIAN (which in turn holds the actual numeric value).
// Realtek's rtl8711b_crypto.h redefines _LITTLE_ENDIAN as a macro without
// any value, which makes comparisons like '#if BYTE_ORDER == LITTLE_ENDIAN' impossible.
#if __GNUC__ > 5
#undef _LITTLE_ENDIAN
#undef _BIG_ENDIAN
#undef LITTLE_ENDIAN
#undef BIG_ENDIAN
#undef BYTE_ORDER
#define LITTLE_ENDIAN 1234
#define BIG_ENDIAN 4321
#define BYTE_ORDER LITTLE_ENDIAN
#endif