[boards] Add Tuya WBLC5 and CBLC5 boards

This commit is contained in:
Kuba Szczodrzyński
2023-06-18 00:13:05 +02:00
parent 1335b84391
commit 7ed48bf9fc
10 changed files with 732 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
{
"pcb": {
"test_pads": {
"TRST": "cblc5.back.rst.anchor",
"TRX1": "cblc5.back.r1.anchor",
"TTX1": "cblc5.back.t1.anchor",
"TRX2": "cblc5.back.r2.anchor",
"TTX2": "cblc5.back.t2.anchor",
"TCSN": "cblc5.back.csn.anchor"
},
"back": [
{
"name": "test_pad_1mm",
"pos": "1.1,1.1"
},
{
"id": "t1",
"name": "label_line_up",
"pos": "1.1,0.6",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 3.8,
"H": 1.4
}
},
{
"name": "test_pad_1mm",
"pos": "0.8,3.3"
},
{
"id": "r1",
"name": "label_line_up",
"pos": "0.8,2.8",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 4.1,
"H": 1.6
}
},
{
"name": "test_pad_1mm",
"pos": "2.4,4.1"
},
{
"id": "r2",
"name": "label_line_up",
"pos": "2.4,3.6",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 2.5,
"H": 0.4
}
},
{
"name": "test_pad_1mm",
"pos": "3.9,4.1"
},
{
"id": "t2",
"name": "label_line_down",
"pos": "3.9,4.6",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 1,
"H": 0.4
}
},
{
"name": "test_pad_1mm",
"pos": "1.2,4.9"
},
{
"name": "test_pad_1mm",
"pos": "1.7,7.0"
},
{
"id": "rst",
"name": "label_line_down",
"pos": "1.2,5.4",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 3.7,
"H": 1.6
}
},
{
"id": "csn",
"name": "label_line_down",
"pos": "1.7,7.5",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 3.2,
"H": 1.5
}
}
]
}
}

View File

@@ -0,0 +1,82 @@
{
"pcb": {
"templates": [
"tuyalc5"
],
"vars": {
"MASK_PRESET": "mask_white",
"TRACE_COLOR": "#E0E0E0",
"SILK_COLOR": "black"
},
"pinout_hidden": "I2S,JTAG,FLASH,SDA1",
"pinout": {
"1": {
"CTRL": "ANT"
},
"2": {
"GND": null
},
"3": {
"IC": 16,
"ARD": "D0"
},
"4": {
"IC": 15,
"ARD": "D2"
},
"5": {
"IC": 22,
"ARD": "D1"
},
"6": {
"PWR": 3.3
},
"TRST": {
"IC": 21
},
"TRX1": {
"IC": 26,
"ARD": "D4"
},
"TTX1": {
"IC": 27,
"ARD": "D3"
},
"TRX2": {
"IC": 28,
"ARD": "D5"
},
"TTX2": {
"IC": 29,
"ARD": "D6"
},
"TCSN": {
"IC": 19,
"ARD": "D7"
}
},
"front": [
{
"name": "chip",
"pos": "2.7,3.8",
"vars": {
"W": 5,
"POS": 1
}
},
{
"name": "osc",
"pos": "2.5,0.5"
},
{
"type": "text",
"pos": "0.7,4.2",
"text": "${SYMBOL}",
"font_size": 1.2,
"fill": {
"color": "${SILK_COLOR}"
}
}
]
}
}

View File

@@ -0,0 +1,152 @@
{
"pcb": {
"test_pads": {
"TRST": "wblc5.back.cen.anchor",
"TRX1": "wblc5.back.r1.anchor",
"TTX1": "wblc5.back.t1.anchor",
"TRX2": "wblc5.back.r2.anchor",
"TTX2": "wblc5.back.t2.anchor",
"TSCK": "wblc5.back.tck.anchor",
"TCSN": "wblc5.back.tms.anchor",
"TSI": "wblc5.back.tdi.anchor",
"TSO": "wblc5.back.tdo.anchor"
},
"back": [
{
"name": "test_pad_1mm",
"pos": "0.7,1.1"
},
{
"id": "r1",
"name": "label_line_up",
"pos": "0.7,0.6",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 7.2,
"H": 5.1
}
},
{
"name": "test_pad_1mm",
"pos": "1.9,0.9"
},
{
"id": "t1",
"name": "label_line_up",
"pos": "1.9,0.4",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 5.9,
"H": 2.9
}
},
{
"name": "test_pad_1mm",
"pos": "7.8,0.8"
},
{
"id": "r2",
"name": "label_line_up",
"pos": "7.8,0.3",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 0,
"H": 0.8
}
},
{
"name": "test_pad_1mm",
"pos": "7.8,2.4"
},
{
"id": "t2",
"name": "label_line_up",
"pos": "7.8,1.9",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 0,
"H": 0.4
}
},
{
"name": "test_pad_1mm",
"pos": "1.3,4.2"
},
{
"id": "cen",
"name": "label_line_up",
"pos": "2.1,4.3",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 5.7,
"H": 0
}
},
{
"name": "test_pad_1mm",
"pos": "1.6,5.3"
},
{
"name": "test_pad_1mm",
"pos": "1.3,6.3"
},
{
"name": "test_pad_1mm",
"pos": "4.5,7.6"
},
{
"name": "test_pad_1mm",
"pos": "3.8,8.7"
},
{
"id": "tck",
"name": "label_line_down",
"pos": "1.6,5.8",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 6.2,
"H": 0.3
}
},
{
"id": "tms",
"name": "label_line_down",
"pos": "1.3,6.8",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 6.5,
"H": 1.3
}
},
{
"id": "tdi",
"name": "label_line_down",
"pos": "4.5,8.1",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 3.3,
"H": 2.0
}
},
{
"id": "tdo",
"name": "label_line_down",
"pos": "3.8,9.2",
"vars": {
"DIR": "right",
"RASTER": 2,
"W": 4,
"H": 2.9
}
}
]
}
}

View File

@@ -0,0 +1,99 @@
{
"pcb": {
"templates": [
"tuyalc5"
],
"vars": {
"MASK_PRESET": "mask_white",
"TRACE_COLOR": "#E0E0E0",
"SILK_COLOR": "black"
},
"pinout_hidden": "I2S",
"pinout": {
"1": {
"CTRL": "ANT"
},
"2": {
"GND": null
},
"3": {
"IC": 16,
"ARD": "D0"
},
"4": {
"IC": 15,
"ARD": "D2"
},
"5": {
"IC": 22,
"ARD": "D1"
},
"6": {
"PWR": 3.3
},
"TRST": {
"IC": 21
},
"TRX1": {
"IC": 26,
"ARD": "D3"
},
"TTX1": {
"IC": 27,
"ARD": "D4"
},
"TRX2": {
"IC": 28,
"ARD": "D5"
},
"TTX2": {
"IC": 29,
"ARD": "D6"
},
"TSCK": {
"IC": 20,
"ARD": "D7"
},
"TCSN": {
"IC": 19,
"ARD": "D8"
},
"TSO": {
"IC": 17,
"ARD": [
"D10",
"A0"
]
},
"TSI": {
"IC": 18,
"ARD": "D9"
}
},
"front": [
{
"name": "chip",
"pos": "2.3,3.5",
"vars": {
"W": 5,
"POS": 1
}
},
{
"type": "text",
"pos": "3.5,2.2",
"text": "${SYMBOL}",
"font_size": 1.2,
"fill": {
"color": "${SILK_COLOR}"
}
}
],
"back": [
{
"name": "osc",
"pos": "2.6,1.3"
}
]
}
}

20
boards/cblc5.json Normal file
View File

@@ -0,0 +1,20 @@
{
"_base": [
"beken-72xx",
"beken-7231n",
"beken-7231n-tuya",
"ic/bk7231-qfn32",
"pcb/cblc5",
"pcb/cblc5-test"
],
"build": {
"mcu": "bk7231n",
"variant": "cblc5"
},
"name": "CBLC5 Wi-Fi Module",
"url": "https://developer.tuya.com/en/docs/iot/cblc5-module-datasheet?id=Ka07iqyusq1wm",
"vendor": "Tuya Inc.",
"pcb": {
"symbol": "CBLC5"
}
}

39
boards/variants/cblc5.c Normal file
View File

@@ -0,0 +1,39 @@
/* This file was auto-generated from cblc5.json using boardgen */
#include <Arduino.h>
#ifdef LT_VARIANT_INCLUDE
#include LT_VARIANT_INCLUDE
#endif
// clang-format off
PinInfo lt_arduino_pin_info_list[PINS_COUNT] = {
// D0: P24, PWM4
{GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D1: P6, PWM0
{GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D2: P26, PWM5, IRDA
{GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D3: P11, UART1_TX
{GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0},
// D4: P10, UART1_RX
{GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0},
// D5: P1, UART2_RX, I2C2_SDA
{GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0},
// D6: P0, UART2_TX, I2C2_SCL
{GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0},
// D7: P21, I2C1_SDA, TMS, MCLK, ^FCS
{GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0},
};
PinInfo *lt_arduino_pin_gpio_map[] = {
[0] = &(lt_arduino_pin_info_list[6]), // GPIO0 (D6)
[1] = &(lt_arduino_pin_info_list[5]), // GPIO1 (D5)
[6] = &(lt_arduino_pin_info_list[1]), // GPIO6 (D1)
[10] = &(lt_arduino_pin_info_list[4]), // GPIO10 (D4)
[11] = &(lt_arduino_pin_info_list[3]), // GPIO11 (D3)
[21] = &(lt_arduino_pin_info_list[7]), // GPIO21 (D7)
[24] = &(lt_arduino_pin_info_list[0]), // GPIO24 (D0)
[26] = &(lt_arduino_pin_info_list[2]), // GPIO26 (D2)
};
// clang-format on

76
boards/variants/cblc5.h Normal file
View File

@@ -0,0 +1,76 @@
/* This file was auto-generated from cblc5.json using boardgen */
#pragma once
// clang-format off
// Pins
// ----
#define PINS_COUNT 8 // Total GPIO count
#define NUM_DIGITAL_PINS 8 // Digital inputs/outputs
#define NUM_ANALOG_INPUTS 0 // ADC inputs
#define NUM_ANALOG_OUTPUTS 3 // PWM & DAC outputs
#define PINS_GPIO_MAX 26 // Last usable GPIO number
// Wire Interfaces
// ---------------
#define PIN_WIRE2_SCL 0u // GPIO0
#define PIN_WIRE2_SDA 1u // GPIO1
// Serial ports
// ------------
#define PIN_SERIAL1_RX 10u // GPIO10
#define PIN_SERIAL1_TX 11u // GPIO11
#define PIN_SERIAL2_RX 1u // GPIO1
#define PIN_SERIAL2_TX 0u // GPIO0
// Pin function macros
// -------------------
#define PIN_P0 0u // GPIO0
#define PIN_P1 1u // GPIO1
#define PIN_P6 6u // GPIO6
#define PIN_P10 10u // GPIO10
#define PIN_P11 11u // GPIO11
#define PIN_P21 21u // GPIO21
#define PIN_P24 24u // GPIO24
#define PIN_P26 26u // GPIO26
#define PIN_PWM0 6u // GPIO6
#define PIN_PWM4 24u // GPIO24
#define PIN_PWM5 26u // GPIO26
#define PIN_RX1 10u // GPIO10
#define PIN_RX2 1u // GPIO1
#define PIN_SCL2 0u // GPIO0
#define PIN_SDA1 21u // GPIO21
#define PIN_SDA2 1u // GPIO1
#define PIN_TX1 11u // GPIO11
#define PIN_TX2 0u // GPIO0
// Port availability
// -----------------
#define HAS_SERIAL1 1
#define HAS_SERIAL2 1
#define HAS_WIRE2 1
#define SERIAL_INTERFACES_COUNT 2
#define WIRE_INTERFACES_COUNT 1
// Arduino pin names
// -----------------
#define PIN_D0 24u // GPIO24
#define PIN_D1 6u // GPIO6
#define PIN_D2 26u // GPIO26
#define PIN_D3 11u // GPIO11
#define PIN_D4 10u // GPIO10
#define PIN_D5 1u // GPIO1
#define PIN_D6 0u // GPIO0
#define PIN_D7 21u // GPIO21
// Static pin names
// ----------------
static const unsigned char D0 = PIN_D0;
static const unsigned char D1 = PIN_D1;
static const unsigned char D2 = PIN_D2;
static const unsigned char D3 = PIN_D3;
static const unsigned char D4 = PIN_D4;
static const unsigned char D5 = PIN_D5;
static const unsigned char D6 = PIN_D6;
static const unsigned char D7 = PIN_D7;

48
boards/variants/wblc5.c Normal file
View File

@@ -0,0 +1,48 @@
/* This file was auto-generated from wblc5.json using boardgen */
#include <Arduino.h>
#ifdef LT_VARIANT_INCLUDE
#include LT_VARIANT_INCLUDE
#endif
// clang-format off
PinInfo lt_arduino_pin_info_list[PINS_COUNT] = {
// D0: P24, PWM4
{GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D1: P6, PWM0
{GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D2: P26, PWM5, IRDA
{GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0},
// D3: P10, UART1_RX
{GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0},
// D4: P11, UART1_TX
{GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0},
// D5: P1, UART2_RX, I2C2_SDA
{GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0},
// D6: P0, UART2_TX, I2C2_SCL
{GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0},
// D7: P20, I2C1_SCL, TCK, FSCK
{GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0},
// D8: P21, I2C1_SDA, TMS, MCLK, ^FCS
{GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0},
// D9: P22, TDI, FSI
{GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0},
// D10: P23, ADC3, TDO, FSO
{GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0},
};
PinInfo *lt_arduino_pin_gpio_map[] = {
[0] = &(lt_arduino_pin_info_list[6]), // GPIO0 (D6)
[1] = &(lt_arduino_pin_info_list[5]), // GPIO1 (D5)
[6] = &(lt_arduino_pin_info_list[1]), // GPIO6 (D1)
[10] = &(lt_arduino_pin_info_list[3]), // GPIO10 (D3)
[11] = &(lt_arduino_pin_info_list[4]), // GPIO11 (D4)
[20] = &(lt_arduino_pin_info_list[7]), // GPIO20 (D7)
[21] = &(lt_arduino_pin_info_list[8]), // GPIO21 (D8)
[22] = &(lt_arduino_pin_info_list[9]), // GPIO22 (D9)
[23] = &(lt_arduino_pin_info_list[10]), // GPIO23 (D10)
[24] = &(lt_arduino_pin_info_list[0]), // GPIO24 (D0)
[26] = &(lt_arduino_pin_info_list[2]), // GPIO26 (D2)
};
// clang-format on

92
boards/variants/wblc5.h Normal file
View File

@@ -0,0 +1,92 @@
/* This file was auto-generated from wblc5.json using boardgen */
#pragma once
// clang-format off
// Pins
// ----
#define PINS_COUNT 11 // Total GPIO count
#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs
#define NUM_ANALOG_INPUTS 1 // ADC inputs
#define NUM_ANALOG_OUTPUTS 3 // PWM & DAC outputs
#define PINS_GPIO_MAX 26 // Last usable GPIO number
// Wire Interfaces
// ---------------
#define PIN_WIRE1_SCL 20u // GPIO20
#define PIN_WIRE1_SDA 21u // GPIO21
#define PIN_WIRE2_SCL 0u // GPIO0
#define PIN_WIRE2_SDA 1u // GPIO1
// Serial ports
// ------------
#define PIN_SERIAL1_RX 10u // GPIO10
#define PIN_SERIAL1_TX 11u // GPIO11
#define PIN_SERIAL2_RX 1u // GPIO1
#define PIN_SERIAL2_TX 0u // GPIO0
// Pin function macros
// -------------------
#define PIN_ADC3 23u // GPIO23
#define PIN_P0 0u // GPIO0
#define PIN_P1 1u // GPIO1
#define PIN_P6 6u // GPIO6
#define PIN_P10 10u // GPIO10
#define PIN_P11 11u // GPIO11
#define PIN_P20 20u // GPIO20
#define PIN_P21 21u // GPIO21
#define PIN_P22 22u // GPIO22
#define PIN_P23 23u // GPIO23
#define PIN_P24 24u // GPIO24
#define PIN_P26 26u // GPIO26
#define PIN_PWM0 6u // GPIO6
#define PIN_PWM4 24u // GPIO24
#define PIN_PWM5 26u // GPIO26
#define PIN_RX1 10u // GPIO10
#define PIN_RX2 1u // GPIO1
#define PIN_SCL1 20u // GPIO20
#define PIN_SCL2 0u // GPIO0
#define PIN_SDA1 21u // GPIO21
#define PIN_SDA2 1u // GPIO1
#define PIN_TX1 11u // GPIO11
#define PIN_TX2 0u // GPIO0
// Port availability
// -----------------
#define HAS_SERIAL1 1
#define HAS_SERIAL2 1
#define HAS_WIRE1 1
#define HAS_WIRE2 1
#define SERIAL_INTERFACES_COUNT 2
#define WIRE_INTERFACES_COUNT 2
// Arduino pin names
// -----------------
#define PIN_D0 24u // GPIO24
#define PIN_D1 6u // GPIO6
#define PIN_D2 26u // GPIO26
#define PIN_D3 10u // GPIO10
#define PIN_D4 11u // GPIO11
#define PIN_D5 1u // GPIO1
#define PIN_D6 0u // GPIO0
#define PIN_D7 20u // GPIO20
#define PIN_D8 21u // GPIO21
#define PIN_D9 22u // GPIO22
#define PIN_D10 23u // GPIO23
#define PIN_A0 23u // GPIO23
// Static pin names
// ----------------
static const unsigned char A0 = PIN_A0;
static const unsigned char D0 = PIN_D0;
static const unsigned char D1 = PIN_D1;
static const unsigned char D2 = PIN_D2;
static const unsigned char D3 = PIN_D3;
static const unsigned char D4 = PIN_D4;
static const unsigned char D5 = PIN_D5;
static const unsigned char D6 = PIN_D6;
static const unsigned char D7 = PIN_D7;
static const unsigned char D8 = PIN_D8;
static const unsigned char D9 = PIN_D9;
static const unsigned char D10 = PIN_D10;

20
boards/wblc5.json Normal file
View File

@@ -0,0 +1,20 @@
{
"_base": [
"beken-72xx",
"beken-7231u",
"beken-7231t-tuya",
"ic/bk7231-qfn32",
"pcb/wblc5",
"pcb/wblc5-test"
],
"build": {
"mcu": "bk7231t",
"variant": "wblc5"
},
"name": "WBLC5 Wi-Fi Module",
"url": "https://developer.tuya.com/en/docs/iot/wblc5-module-datasheet?id=K9duilns1f3gi",
"vendor": "Tuya Inc.",
"pcb": {
"symbol": "WBLC5"
}
}