Skip to content

Commit e9977a2

Browse files
[boards] Add WB02A board (#332)
1 parent 1d97f0c commit e9977a2

File tree

5 files changed

+345
-0
lines changed

5 files changed

+345
-0
lines changed

boards/_base/pcb/wb02a-test.json

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"pcb": {
3+
"test_pads": {
4+
"TA9": "wb02a.back.a9.anchor",
5+
"TGND": "wb02a.back.gnd.anchor",
6+
"TRX1": "wb02a.back.rx1.anchor",
7+
"TTX1": "wb02a.back.tx1.anchor",
8+
},
9+
"back": [
10+
{
11+
"type": "text",
12+
"pos": "0.5,2.3",
13+
"text": "WB02A-0882H-1518D1",
14+
"font_size": 1.4,
15+
"fill": {
16+
"color": "${SILK_COLOR}"
17+
}
18+
},
19+
{
20+
"type": "circle",
21+
"pos": "11.6,6.4",
22+
"d": 4.5,
23+
"preset": "copper1"
24+
},
25+
{
26+
"type": "rect",
27+
"pos": "3.5,8.5",
28+
"size": "4.2,3.7",
29+
"preset": "copper1"
30+
},
31+
{
32+
"id": "a9",
33+
"name": "label_line_up",
34+
"pos": "1.9,12.3",
35+
"vars": {
36+
"DIR": "left",
37+
"W": 1.3,
38+
"H": 0
39+
}
40+
},
41+
{
42+
"name": "test_pad_1mm",
43+
"pos": "2.5,12.3"
44+
},
45+
{
46+
"id": "gnd",
47+
"name": "label_line_up",
48+
"pos": ".6,6.6",
49+
"vars": {
50+
"DIR": "left",
51+
"W": 0,
52+
"H": 0
53+
}
54+
},
55+
{
56+
"name": "test_pad_1mm",
57+
"pos": "1.2,6.6"
58+
},
59+
{
60+
"id": "rx1",
61+
"name": "label_line_up",
62+
"pos": "3.2,6",
63+
"vars": {
64+
"DIR": "left",
65+
"W": 2.6,
66+
"H": 1.4
67+
}
68+
},
69+
{
70+
"name": "test_pad_1mm",
71+
"pos": "3.2,6.6"
72+
},
73+
{
74+
"id": "tx1",
75+
"name": "label_line_up",
76+
"pos": "5.2,6",
77+
"vars": {
78+
"DIR": "left",
79+
"W": 4.6,
80+
"H": 3.4
81+
}
82+
},
83+
{
84+
"name": "test_pad_1mm",
85+
"pos": "5.2,6.6"
86+
},
87+
{
88+
"name": "test_pad_1mm",
89+
"pos": "8.5,12.3"
90+
}
91+
]
92+
}
93+
}

boards/_base/pcb/wb02a.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"pcb": {
3+
"templates": [
4+
"tuya2",
5+
"pcb-blue-light",
6+
"rf-type1"
7+
],
8+
"scale": 10.5,
9+
"pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SPI,I2C",
10+
"pinout": {
11+
"1": {
12+
"PWR": 3.3
13+
},
14+
"2": {
15+
"IC": 15,
16+
"ARD": "D0"
17+
},
18+
"3": {
19+
"GND": null
20+
},
21+
"4": {
22+
"IC": 13,
23+
"ARD": "D1"
24+
},
25+
"5": {
26+
"IC": 11,
27+
"ARD": "D2"
28+
},
29+
"6": {
30+
"IC": 21,
31+
"ARD": "D3"
32+
},
33+
"7": {
34+
"IC": 10,
35+
"ARD": "D4"
36+
},
37+
"8": {
38+
"IC": 9,
39+
"ARD": [
40+
"D5",
41+
"A0"
42+
]
43+
},
44+
"9": {
45+
"IC": 12,
46+
"ARD": [
47+
"D6",
48+
"A1"
49+
]
50+
},
51+
"10": {
52+
"IC": 7
53+
},
54+
"11": {
55+
"IC": 13,
56+
"ARD": "D1"
57+
},
58+
"TA9": {
59+
"IC": 17,
60+
"ARD": "D7"
61+
},
62+
"TGND": {
63+
"GND": null
64+
},
65+
"TRX1": {
66+
"IC": 29,
67+
"ARD": "D8"
68+
},
69+
"TTX1": {
70+
"IC": 30,
71+
"ARD": "D9"
72+
}
73+
}
74+
}
75+
}

boards/variants/wb02a.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* This file was auto-generated from wb02a.json using boardgen */
2+
3+
#include <Arduino.h>
4+
5+
#ifdef LT_VARIANT_INCLUDE
6+
#include LT_VARIANT_INCLUDE
7+
#endif
8+
9+
// clang-format off
10+
PinInfo lt_arduino_pin_info_list[PINS_COUNT] = {
11+
// D0: PA07, SD_D3, I2S0_RX, I2C0_SCL, I2C0_SDA
12+
{PA_7, , PIN_NONE, 0},
13+
// D1: PA05, I2C0_SCL, I2C0_SDA
14+
{PA_5, , PIN_NONE, 0},
15+
// D2: PA03, UART0_RX, I2C0_SCL, I2C0_SDA
16+
{PA_3, , PIN_NONE, 0},
17+
// D3: PA10, SD_D0, I2S0_TX, I2C0_SCL, I2C0_SDA
18+
{PA_10, , PIN_NONE, 0},
19+
// D4: PA02, UART0_TX, I2C0_SCL, I2C0_SDA
20+
{PA_2, , PIN_NONE, 0},
21+
// D5: PA01, ADC3, SWDIO, I2C0_SCL, I2C0_SDA
22+
{PA_1, , PIN_NONE, 0},
23+
// D6: PA04, ADC4, SWCLK, I2C0_SCL, I2C0_SDA
24+
{PA_4, , PIN_NONE, 0},
25+
// D7: PA09, BOOT1, SD_CLK, I2S0_SCLK, I2C0_SCL, I2C0_SDA
26+
{PA_9, , PIN_NONE, 0},
27+
// D8: PB08, UART1_RX, I2C0_SCL, I2C0_SDA
28+
{PB_8, , PIN_NONE, 0},
29+
// D9: PB09, UART1_TX, I2C0_SCL, I2C0_SDA
30+
{PB_9, , PIN_NONE, 0},
31+
};
32+
33+
PinInfo *lt_arduino_pin_gpio_map[] = {
34+
[1] = &(lt_arduino_pin_info_list[5]), // PA_1 (D5)
35+
[2] = &(lt_arduino_pin_info_list[4]), // PA_2 (D4)
36+
[3] = &(lt_arduino_pin_info_list[2]), // PA_3 (D2)
37+
[4] = &(lt_arduino_pin_info_list[6]), // PA_4 (D6)
38+
[5] = &(lt_arduino_pin_info_list[1]), // PA_5 (D1)
39+
[7] = &(lt_arduino_pin_info_list[0]), // PA_7 (D0)
40+
[9] = &(lt_arduino_pin_info_list[7]), // PA_9 (D7)
41+
[10] = &(lt_arduino_pin_info_list[3]), // PA_10 (D3)
42+
[24] = &(lt_arduino_pin_info_list[8]), // PB_8 (D8)
43+
[25] = &(lt_arduino_pin_info_list[9]), // PB_9 (D9)
44+
};
45+
// clang-format on

boards/variants/wb02a.h

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/* This file was auto-generated from wb02a.json using boardgen */
2+
3+
#pragma once
4+
5+
// clang-format off
6+
7+
// Pins
8+
// ----
9+
#define PINS_COUNT 10 // Total GPIO count
10+
#define NUM_DIGITAL_PINS 10 // Digital inputs/outputs
11+
#define NUM_ANALOG_INPUTS 2 // ADC inputs
12+
#define NUM_ANALOG_OUTPUTS 0 // PWM & DAC outputs
13+
#define PINS_GPIO_MAX 25 // Last usable GPIO number
14+
15+
// Wire Interfaces
16+
// ---------------
17+
#define PIN_WIRE0_SCL_0 7u // PA_7
18+
#define PIN_WIRE0_SCL_1 5u // PA_5
19+
#define PIN_WIRE0_SCL_2 3u // PA_3
20+
#define PIN_WIRE0_SCL_3 10u // PA_10
21+
#define PIN_WIRE0_SCL_4 2u // PA_2
22+
#define PIN_WIRE0_SCL_5 1u // PA_1
23+
#define PIN_WIRE0_SCL_6 4u // PA_4
24+
#define PIN_WIRE0_SCL_7 5u // PA_5
25+
#define PIN_WIRE0_SCL_8 9u // PA_9
26+
#define PIN_WIRE0_SCL_9 24u // PB_8
27+
#define PIN_WIRE0_SCL_10 25u // PB_9
28+
#define PIN_WIRE0_SDA_0 7u // PA_7
29+
#define PIN_WIRE0_SDA_1 5u // PA_5
30+
#define PIN_WIRE0_SDA_2 3u // PA_3
31+
#define PIN_WIRE0_SDA_3 10u // PA_10
32+
#define PIN_WIRE0_SDA_4 2u // PA_2
33+
#define PIN_WIRE0_SDA_5 1u // PA_1
34+
#define PIN_WIRE0_SDA_6 4u // PA_4
35+
#define PIN_WIRE0_SDA_7 5u // PA_5
36+
#define PIN_WIRE0_SDA_8 9u // PA_9
37+
#define PIN_WIRE0_SDA_9 24u // PB_8
38+
#define PIN_WIRE0_SDA_10 25u // PB_9
39+
#define PINS_WIRE0_SCL (pin_size_t[]){7u, 5u, 3u, 10u, 2u, 1u, 4u, 5u, 9u, 24u, 25u}
40+
#define PINS_WIRE0_SDA (pin_size_t[]){7u, 5u, 3u, 10u, 2u, 1u, 4u, 5u, 9u, 24u, 25u}
41+
42+
// Serial ports
43+
// ------------
44+
#define PIN_SERIAL0_RX 3u // PA_3
45+
#define PIN_SERIAL0_TX 2u // PA_2
46+
#define PIN_SERIAL1_RX 24u // PB_8
47+
#define PIN_SERIAL1_TX 25u // PB_9
48+
#define PINS_SERIAL0_RX (pin_size_t[]){3u}
49+
#define PINS_SERIAL0_TX (pin_size_t[]){2u}
50+
#define PINS_SERIAL1_RX (pin_size_t[]){24u}
51+
#define PINS_SERIAL1_TX (pin_size_t[]){25u}
52+
53+
// Pin function macros
54+
// -------------------
55+
#define PIN_ADC3 1u // PA_1
56+
#define PIN_ADC4 4u // PA_4
57+
#define PIN_PA01 1u // PA_1
58+
#define PIN_PA02 2u // PA_2
59+
#define PIN_PA03 3u // PA_3
60+
#define PIN_PA04 4u // PA_4
61+
#define PIN_PA05 5u // PA_5
62+
#define PIN_PA07 7u // PA_7
63+
#define PIN_PA09 9u // PA_9
64+
#define PIN_PA10 10u // PA_10
65+
#define PIN_PB08 24u // PB_8
66+
#define PIN_PB09 25u // PB_9
67+
#define PIN_RX0 3u // PA_3
68+
#define PIN_RX1 24u // PB_8
69+
#define PIN_SCL0 25u // PB_9
70+
#define PIN_SDA0 25u // PB_9
71+
#define PIN_TX0 2u // PA_2
72+
#define PIN_TX1 25u // PB_9
73+
74+
// Port availability
75+
// -----------------
76+
#define HAS_SERIAL0 1
77+
#define HAS_SERIAL1 1
78+
#define HAS_WIRE0 1
79+
#define SERIAL_INTERFACES_COUNT 2
80+
#define WIRE_INTERFACES_COUNT 1
81+
82+
// Arduino pin names
83+
// -----------------
84+
#define PIN_D0 7u // PA_7
85+
#define PIN_D1 5u // PA_5
86+
#define PIN_D2 3u // PA_3
87+
#define PIN_D3 10u // PA_10
88+
#define PIN_D4 2u // PA_2
89+
#define PIN_D5 1u // PA_1
90+
#define PIN_D6 4u // PA_4
91+
#define PIN_D7 9u // PA_9
92+
#define PIN_D8 24u // PB_8
93+
#define PIN_D9 25u // PB_9
94+
#define PIN_A0 1u // PA_1
95+
#define PIN_A1 4u // PA_4
96+
97+
// Static pin names
98+
// ----------------
99+
static const unsigned char A0 = PIN_A0;
100+
static const unsigned char A1 = PIN_A1;
101+
static const unsigned char D0 = PIN_D0;
102+
static const unsigned char D1 = PIN_D1;
103+
static const unsigned char D2 = PIN_D2;
104+
static const unsigned char D3 = PIN_D3;
105+
static const unsigned char D4 = PIN_D4;
106+
static const unsigned char D5 = PIN_D5;
107+
static const unsigned char D6 = PIN_D6;
108+
static const unsigned char D7 = PIN_D7;
109+
static const unsigned char D8 = PIN_D8;
110+
static const unsigned char D9 = PIN_D9;

boards/wb02a.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"_base": [
3+
"lightning-ln882x",
4+
"lightning-ln882hki",
5+
"ic/ln882hk",
6+
"pcb/wb02a",
7+
"pcb/wb02a-test"
8+
],
9+
"build": {
10+
"mcu": "ln882hk",
11+
"variant": "wb02a"
12+
},
13+
"name": "WB02A Wi-Fi/BLE Module",
14+
"url": "https://docs.libretiny.eu/boards/wb02a/",
15+
"vendor": "Unknown",
16+
"doc": {
17+
"fccid": ""
18+
},
19+
"pcb": {
20+
"symbol": ""
21+
}
22+
}

0 commit comments

Comments
 (0)