diff --git a/boards/_base/beken-7231-tuya.json b/boards/_base/beken-7231-tuya.json new file mode 100644 index 0000000..a96531f --- /dev/null +++ b/boards/_base/beken-7231-tuya.json @@ -0,0 +1,8 @@ +{ + "build": { + "bkcrypt_coeffs": "510fb093a3cbeadc5993a17ec7adeb03" + }, + "flash": { + "tuya": "0x1ED000+0x13000" + } +} diff --git a/boards/_base/beken-7231.json b/boards/_base/beken-7231.json new file mode 100644 index 0000000..d81a6fc --- /dev/null +++ b/boards/_base/beken-7231.json @@ -0,0 +1,10 @@ +{ + "build": { + "ldscript": "bk7231_bsp.ld", + "bkoffset_app": "0x10000", + "bkrbl_size_app": "0x108700" + }, + "upload": { + "maximum_size": 1083136 + } +} diff --git a/boards/_base/beken-7231n-tuya.json b/boards/_base/beken-7231n-tuya.json deleted file mode 100644 index 3c6e620..0000000 --- a/boards/_base/beken-7231n-tuya.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "build": { - "bkcrypt_coeffs": "510fb093a3cbeadc5993a17ec7adeb03", - "bkboot_version": "1.0.1-bk7231n" - }, - "flash": { - "tuya": "0x1ED000+0x13000" - } -} diff --git a/boards/_base/beken-7231n.json b/boards/_base/beken-7231n.json index 3946756..308a3ba 100644 --- a/boards/_base/beken-7231n.json +++ b/boards/_base/beken-7231n.json @@ -12,6 +12,7 @@ "download": "0x12A000+0xA6000", "calibration": "0x1D0000+0x1000", "net": "0x1D1000+0x1000", + "tlv": "0x1D2000+0x1000", "kvs": "0x1D3000+0x8000", "userdata": "0x1DB000+0x25000" }, diff --git a/boards/_base/beken-7231q.json b/boards/_base/beken-7231q.json new file mode 100644 index 0000000..fedddd9 --- /dev/null +++ b/boards/_base/beken-7231q.json @@ -0,0 +1,19 @@ +{ + "build": { + "family": "BK7231Q", + "bkboot_version": "bk7231q" + }, + "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": { + "speed": 460800 + } +} diff --git a/boards/_base/beken-7231t-tuya.json b/boards/_base/beken-7231t-tuya.json deleted file mode 100644 index 5049f2f..0000000 --- a/boards/_base/beken-7231t-tuya.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "build": { - "bkcrypt_coeffs": "510fb093a3cbeadc5993a17ec7adeb03", - "bkboot_version": "1.0.5-bk7231s" - }, - "flash": { - "tuya": "0x1ED000+0x13000" - } -} diff --git a/boards/_base/beken-7231u.json b/boards/_base/beken-7231t.json similarity index 69% rename from boards/_base/beken-7231u.json rename to boards/_base/beken-7231t.json index 219111b..82da778 100644 --- a/boards/_base/beken-7231u.json +++ b/boards/_base/beken-7231t.json @@ -1,10 +1,7 @@ { "build": { - "family": "BK7231U", - "ldscript": "bk7231_bsp.ld", - "bkboot_version": "1.0.8-bk7231u", - "bkoffset_app": "0x10000", - "bkrbl_size_app": "0x108700" + "family": "BK7231T", + "bkboot_version": "1.0.5-bk7231s" }, "flash": { "bootloader": "0x000000+0x11000", @@ -12,11 +9,11 @@ "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": [ diff --git a/boards/_base/ic/bk7231q-qfn40.json b/boards/_base/ic/bk7231q-qfn40.json new file mode 100644 index 0000000..cf8644d --- /dev/null +++ b/boards/_base/ic/bk7231q-qfn40.json @@ -0,0 +1,170 @@ +{ + "pcb": { + "ic": { + "11": { + "C_NAME": "GPIO30", + "GPIO": "P30", + "IRQ": null, + "USB": "DN" + }, + "12": { + "C_NAME": "GPIO29", + "GPIO": "P29", + "IRQ": null, + "USB": "DP" + }, + "14": { + "C_NAME": "GPIO6", + "GPIO": "P6", + "IRQ": null, + "PWM": 0 + }, + "15": { + "C_NAME": "GPIO7", + "GPIO": "P7", + "IRQ": null, + "PWM": 1 + }, + "16": { + "C_NAME": "GPIO8", + "GPIO": "P8", + "IRQ": null, + "PWM": 2 + }, + "17": { + "C_NAME": "GPIO17", + "GPIO": "P17", + "IRQ": null, + "SD": "D1", + "SPI": "MISO" + }, + "18": { + "C_NAME": "GPIO16", + "GPIO": "P16", + "IRQ": null, + "SD": "D0", + "SPI": "MOSI" + }, + "19": { + "C_NAME": "GPIO14", + "GPIO": "P14", + "IRQ": null, + "SD": "CLK", + "SPI": "SCK" + }, + "20": { + "C_NAME": "GPIO15", + "GPIO": "P15", + "IRQ": null, + "SD": "CMD", + "SPI": "CS" + }, + "21": { + "C_NAME": "GPIO19", + "GPIO": "P19", + "IRQ": null, + "SD": "D3", + "PWM": 5 + }, + "22": { + "C_NAME": "GPIO18", + "GPIO": "P18", + "IRQ": null, + "SD": "D2", + "PWM": 4 + }, + "23": { + "IO": "I", + "CTRL": "TEST" + }, + "24": { + "C_NAME": "GPIO9", + "GPIO": "P9", + "IRQ": null, + "PWM": 3 + }, + "25": { + "C_NAME": "GPIO10", + "GPIO": "P10", + "IRQ": null, + "UART": "1_RX" + }, + "26": { + "C_NAME": "GPIO11", + "GPIO": "P11", + "IRQ": null, + "UART": "1_TX" + }, + "27": { + "C_NAME": "GPIO1", + "GPIO": "P1", + "IRQ": null, + "UART": "2_RX", + "I2C": "2_SDA" + }, + "28": { + "C_NAME": "GPIO0", + "GPIO": "P0", + "IRQ": null, + "UART": "2_TX", + "I2C": "2_SCL" + }, + "29": { + "C_NAME": "GPIO20", + "GPIO": "P20", + "IRQ": null, + "I2C": "1_SCL", + "JTAG": "TCK", + "FLASH": "FSCK" + }, + "30": { + "C_NAME": "GPIO21", + "GPIO": "P21", + "IRQ": null, + "I2C": "1_SDA", + "JTAG": "TMS", + "FLASH": "^FCS" + }, + "31": { + "C_NAME": "GPIO22", + "GPIO": "P22", + "IRQ": null, + "JTAG": "TDI", + "FLASH": "FSI" + }, + "32": { + "C_NAME": "GPIO23", + "GPIO": "P23", + "IRQ": null, + "ADC": 3, + "JTAG": "TDO", + "FLASH": "FSO" + }, + "33": { + "C_NAME": "GPIO25", + "GPIO": "P25", + "IRQ": null + }, + "34": { + "C_NAME": "GPIO28", + "GPIO": "P28", + "IRQ": null + }, + "35": { + "C_NAME": "GPIO4", + "GPIO": "P4", + "IRQ": null, + "ADC": 1, + "I2S": "DIN" + }, + "36": { + "IO": "I", + "CTRL": "CODE" + }, + "37": { + "IO": "I", + "CTRL": "CEN" + } + } + } +} diff --git a/boards/_base/ic/bk7252-qfn68.json b/boards/_base/ic/bk7252-qfn68.json index e7eb08d..270d948 100644 --- a/boards/_base/ic/bk7252-qfn68.json +++ b/boards/_base/ic/bk7252-qfn68.json @@ -103,7 +103,7 @@ "C_NAME": "GPIO19", "GPIO": "P19", "IRQ": null, - "SD": "D1" + "SD": "D3" }, "31": { "C_NAME": "GPIO17", diff --git a/boards/_base/pcb/bw12.json b/boards/_base/pcb/bw12.json index 0161f7b..5347eca 100644 --- a/boards/_base/pcb/bw12.json +++ b/boards/_base/pcb/bw12.json @@ -2,14 +2,11 @@ "pcb": { "templates": [ "esp12s", - "esp12s-shield", - "rf-16mm-type1" + "pcb-black", + "rf-type1" ], "vars": { - "MASK_PRESET": "mask_black", - "TRACE_COLOR": "#FAFD9D", - "SILK_COLOR": "white", - "PINTYPE_VERT": "pin_vert_2mm_cast_nohole" + "TRACE_COLOR": "#FAFD9D" }, "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", "pinout": { diff --git a/boards/_base/pcb/bw15.json b/boards/_base/pcb/bw15.json index 035c23d..57e8fa7 100644 --- a/boards/_base/pcb/bw15.json +++ b/boards/_base/pcb/bw15.json @@ -3,13 +3,12 @@ "templates": [ "esp12s", "esp12s-shield", - "rf-16mm-type1" + "rf-type1" ], "vars": { "MASK_PRESET": "mask_black", "TRACE_COLOR": "#FAFD9D", - "SILK_COLOR": "white", - "PINTYPE_VERT": "pin_vert_2mm_cast_nohole" + "SILK_COLOR": "white" }, "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", "pinout": { diff --git a/boards/_base/pcb/cb1s-test.json b/boards/_base/pcb/cb1s-test.json new file mode 100644 index 0000000..d7b3f99 --- /dev/null +++ b/boards/_base/pcb/cb1s-test.json @@ -0,0 +1,69 @@ +{ + "pcb": { + "scale": 10, + "test_pads": { + "TSCK": "cb1s.back.sck.anchor", + "TCSN": "cb1s.back.csn.anchor", + "TSI": "cb1s.back.si.anchor", + "TSO": "cb1s.back.so.anchor" + }, + "back": [ + { + "name": "test_pad_1mm", + "pos": "2.66,14.4" + }, + { + "name": "test_pad_1mm", + "pos": "2.66,15.9" + }, + { + "name": "test_pad_1mm", + "pos": "2.66,17.4" + }, + { + "name": "test_pad_1mm", + "pos": "2.66,18.9" + }, + { + "id": "sck", + "name": "label_line_down", + "pos": "3.5,14.3", + "vars": { + "DIR": "right", + "W": 1.0, + "H": 0 + } + }, + { + "id": "csn", + "name": "label_line_down", + "pos": "3.5,15.8", + "vars": { + "DIR": "right", + "W": 1.0, + "H": 0 + } + }, + { + "id": "si", + "name": "label_line_down", + "pos": "3.5,17.3", + "vars": { + "DIR": "right", + "W": 1.0, + "H": 0 + } + }, + { + "id": "so", + "name": "label_line_down", + "pos": "3.5,18.8", + "vars": { + "DIR": "right", + "W": 1.0, + "H": 0 + } + } + ] + } +} diff --git a/boards/_base/pcb/cb1s.json b/boards/_base/pcb/cb1s.json new file mode 100644 index 0000000..88d9b12 --- /dev/null +++ b/boards/_base/pcb/cb1s.json @@ -0,0 +1,101 @@ +{ + "pcb": { + "templates": [ + "tuya1", + "pcb-blue-light", + "tuya-16x24", + "rf-type1" + ], + "scale": 15, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "PWR": "VCC5" + }, + "2": { + "IC": 27, + "ARD": "D0" + }, + "3": { + "IC": 26, + "ARD": "D1" + }, + "4": { + "PWR": 3.3 + }, + "5": { + "GND": null + }, + "6": { + "IC": 22, + "ARD": "D2" + }, + "7": { + "IC": 23, + "ARD": "D3" + }, + "8": { + "IC": 29, + "ARD": "D4" + }, + "9": { + "IC": 25, + "ARD": "D5" + }, + "10": { + "IC": 24, + "ARD": "D6" + }, + "11": { + "IC": 28, + "ARD": "D7" + }, + "12": { + "IC": 16, + "ARD": "D8" + }, + "13": { + "IC": 15, + "ARD": "D9" + }, + "14": { + "GND": null + }, + "15": { + "GND": null + }, + "16": { + "IC": 21 + }, + "17": { + "IC": 17, + "ARD": [ + "D10", + "A0" + ] + }, + "18": { + "GND": null + }, + "TSCK": { + "IC": 20, + "ARD": "D11" + }, + "TCSN": { + "IC": 19, + "ARD": "D12" + }, + "TSO": { + "IC": 17, + "ARD": [ + "D10", + "A0" + ] + }, + "TSI": { + "IC": 18, + "ARD": "D13" + } + } + } +} diff --git a/boards/_base/pcb/cb2l-test.json b/boards/_base/pcb/cb2l-test.json index 1b08e49..160fcc0 100644 --- a/boards/_base/pcb/cb2l-test.json +++ b/boards/_base/pcb/cb2l-test.json @@ -10,26 +10,12 @@ "TCSN": "cb2l.back.f_csn.anchor" }, "back": [ - { - "type": "rect", - "pos": "0,0", - "size": "15,17.3", - "preset": "${MASK_PRESET}" - }, - { - "name": "pins_horz7_2mm_0.7mm", - "pos": "1.15,17.3", - "vars": { - "PINTYPE": "${PINTYPE_HORZ}", - "PINDIR": "down" - } - }, { "name": "test_pad_1mm", "pos": "1.5,7.5" }, { - "name": "label_line_2mm_down", + "name": "label_line_down", "pos": "0.4,4.7", "vars": { "DIR": "right", @@ -51,7 +37,7 @@ }, { "id": "u2_txd", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "2.2,5.1", "vars": { "DIR": "left", @@ -65,7 +51,7 @@ }, { "id": "u1_txd", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "4.0,5.1", "vars": { "DIR": "left", @@ -79,7 +65,7 @@ }, { "id": "gnd", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "9.2,5.1", "vars": { "DIR": "left", @@ -93,7 +79,7 @@ }, { "id": "rst", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "2.2,9.9", "vars": { "DIR": "left", @@ -107,7 +93,7 @@ }, { "id": "f_csn", - "name": "label_line_2mm_down", + "name": "label_line_down", "pos": "2.2,12.8", "vars": { "DIR": "left", diff --git a/boards/_base/pcb/cb2l.json b/boards/_base/pcb/cb2l.json index e351231..575a497 100644 --- a/boards/_base/pcb/cb2l.json +++ b/boards/_base/pcb/cb2l.json @@ -2,15 +2,9 @@ "pcb": { "templates": [ "tuya2l", - "rf-15mm-type1", - "tuya2l-shield" + "pcb-white", + "rf-type1" ], - "vars": { - "MASK_PRESET": "mask_white", - "TRACE_COLOR": "#E0E0E0", - "SILK_COLOR": "black", - "PINTYPE_HORZ": "pin_horz_2mm_cast_hole" - }, "pinout_hidden": "I2S,I2C,JTAG,FLASH", "pinout": { "1": { diff --git a/boards/_base/pcb/cb2s-test.json b/boards/_base/pcb/cb2s-test.json index cc0e43c..321b980 100644 --- a/boards/_base/pcb/cb2s-test.json +++ b/boards/_base/pcb/cb2s-test.json @@ -15,7 +15,7 @@ }, { "id": "u2_txd", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "6.7,6.1", "vars": { "DIR": "left", @@ -29,7 +29,7 @@ }, { "id": "u2_rxd", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "6.2,8.1", "vars": { "DIR": "left", @@ -43,7 +43,7 @@ }, { "id": "csn", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "4.2,11.1", "vars": { "DIR": "left", diff --git a/boards/_base/pcb/cb2s.json b/boards/_base/pcb/cb2s.json index 5ab4d80..67f05af 100644 --- a/boards/_base/pcb/cb2s.json +++ b/boards/_base/pcb/cb2s.json @@ -2,14 +2,9 @@ "pcb": { "templates": [ "tuya2", - "rf-15mm-type1", - "tuya2-shield" + "pcb-blue-light", + "rf-type1" ], - "vars": { - "MASK_PRESET": "mask_blue_light", - "TRACE_COLOR": "#58839B", - "SILK_COLOR": "white" - }, "pinout_hidden": "I2S,JTAG,FLASH", "pinout": { "1": { diff --git a/boards/_base/pcb/cb3l.json b/boards/_base/pcb/cb3l.json index d615abe..8a4f260 100644 --- a/boards/_base/pcb/cb3l.json +++ b/boards/_base/pcb/cb3l.json @@ -2,16 +2,12 @@ "pcb": { "templates": [ "esp12s", - "esp12e-shield", + "pcb-white", "tuya-16x24", - "rf-16mm-type1" + "rf-type1" ], "vars": { - "MASK_PRESET": "mask_blue_light", - "TRACE_COLOR": "#58839B", - "SILK_COLOR": "white", - "PINTYPE_VERT": "pin_vert_2mm_cast_hole", - "PINTYPE_HORZ": "pin_horz_2mm_cast_hole" + "PINHOLE": 1 }, "pinout_hidden": "I2S,SD,SPI,I2C,JTAG,FLASH", "pinout": { diff --git a/boards/_base/pcb/cb3s.json b/boards/_base/pcb/cb3s.json index aca2d5d..22b4dc0 100644 --- a/boards/_base/pcb/cb3s.json +++ b/boards/_base/pcb/cb3s.json @@ -2,16 +2,12 @@ "pcb": { "templates": [ "esp12e-22", - "esp12e-shield-nohole", + "pcb-blue-light", "tuya-16x24", - "rf-16mm-type1" + "rf-type1" ], "vars": { - "MASK_PRESET": "mask_blue_light", - "TRACE_COLOR": "#58839B", - "SILK_COLOR": "white", - "PINTYPE_VERT": "pin_vert_2mm_cast_nohole", - "PINTYPE_HORZ": "pin_horz_2mm_cast_nohole" + "PINHOLE": 0 }, "pinout_hidden": "I2S,SD,SPI,SCL2", "pinout": { diff --git a/boards/_base/pcb/cb3se.json b/boards/_base/pcb/cb3se.json index da4e464..fc8566f 100644 --- a/boards/_base/pcb/cb3se.json +++ b/boards/_base/pcb/cb3se.json @@ -2,16 +2,12 @@ "pcb": { "templates": [ "esp12e-22", - "esp12e-shield-nohole", + "pcb-blue-light", "tuya-16x24", - "rf-16mm-type1" + "rf-type1" ], "vars": { - "MASK_PRESET": "mask_blue_light", - "TRACE_COLOR": "#58839B", - "SILK_COLOR": "white", - "PINTYPE_VERT": "pin_vert_2mm_cast_nohole", - "PINTYPE_HORZ": "pin_horz_2mm_cast_nohole" + "PINHOLE": 0 }, "pinout_hidden": "I2S,SD,JTAG,FLASH,SCL1", "pinout": { diff --git a/boards/_base/pcb/cblc5-test.json b/boards/_base/pcb/cblc5-test.json new file mode 100644 index 0000000..c9ef38e --- /dev/null +++ b/boards/_base/pcb/cblc5-test.json @@ -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 + } + } + ] + } +} diff --git a/boards/_base/pcb/cblc5.json b/boards/_base/pcb/cblc5.json new file mode 100644 index 0000000..dc549ce --- /dev/null +++ b/boards/_base/pcb/cblc5.json @@ -0,0 +1,78 @@ +{ + "pcb": { + "templates": [ + "tuyalc5", + "pcb-white" + ], + "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}" + } + } + ] + } +} diff --git a/boards/_base/pcb/cbu-test.json b/boards/_base/pcb/cbu-test.json new file mode 100644 index 0000000..fe46880 --- /dev/null +++ b/boards/_base/pcb/cbu-test.json @@ -0,0 +1,30 @@ +{ + "pcb": { + "test_pads": { + "TCSN": "cbu.back.csn.anchor" + }, + "back": [ + { + "type": "rect", + "pos": "6.3,11.6", + "size": "2.9,2.9", + "preset": "copper1" + }, + { + "id": "csn", + "name": "label_line_up", + "pos": "3.7,13.5", + "vars": { + "DIR": "left", + "RASTER": 2, + "W": 0, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.4,13.4" + } + ] + } +} diff --git a/boards/_base/pcb/cbu.json b/boards/_base/pcb/cbu.json new file mode 100644 index 0000000..fa24293 --- /dev/null +++ b/boards/_base/pcb/cbu.json @@ -0,0 +1,100 @@ +{ + "pcb": { + "templates": [ + "tuyau", + "pcb-white", + "rf-type1" + ], + "pinout_hidden": "I2S,USB,SD,FLASH", + "pinout": { + "1": { + "IC": 11, + "ARD": "D0" + }, + "2": { + "IC": 12, + "ARD": "D1" + }, + "3": { + "IC": 20, + "ARD": "D2" + }, + "4": { + "IC": 18, + "ARD": "D3" + }, + "5": { + "IC": 17, + "ARD": [ + "D4", + "A0" + ] + }, + "6": { + "IC": 28, + "ARD": "D5" + }, + "7": { + "IC": 29, + "ARD": "D6" + }, + "8": { + "IC": 24, + "ARD": "D7" + }, + "9": { + "IC": 23, + "ARD": "D8" + }, + "10": { + "IC": 22, + "ARD": "D9" + }, + "11": { + "IC": 15, + "ARD": "D10" + }, + "12": { + "IC": 16, + "ARD": "D11" + }, + "13": { + "GND": null + }, + "14": { + "PWR": 3.3 + }, + "15": { + "IC": 27, + "ARD": "D12" + }, + "16": { + "IC": 26, + "ARD": "D13" + }, + "17": { + "IC": 10, + "ARD": "D14" + }, + "18": { + "IC": 21 + }, + "19": { + "IC": 25, + "ARD": "D15" + }, + "20": { + "IC": 14, + "ARD": "D16" + }, + "21": { + "IC": 13, + "ARD": "D17" + }, + "TCSN": { + "IC": 19, + "ARD": "D18" + } + } + } +} diff --git a/boards/_base/pcb/lsc-lma35.json b/boards/_base/pcb/lsc-lma35.json index 044e107..2879718 100644 --- a/boards/_base/pcb/lsc-lma35.json +++ b/boards/_base/pcb/lsc-lma35.json @@ -2,15 +2,9 @@ "pcb": { "templates": [ "custom-20x24-22", - "rf-20mm-type1" + "pcb-blue-light", + "rf-type1" ], - "vars": { - "MASK_PRESET": "mask_blue_light", - "TRACE_COLOR": "#58839B", - "SILK_COLOR": "white", - "PINTYPE_VERT": "pin_vert_2mm_cast_nohole", - "PINTYPE_HORZ": "pin_horz_2mm_cast_nohole" - }, "pinout_hidden": "I2S,JTAG,FLASH,SD,SPI,SDA1", "pinout": { "1": { diff --git a/boards/_base/pcb/t102.json b/boards/_base/pcb/t102.json new file mode 100644 index 0000000..b331806 --- /dev/null +++ b/boards/_base/pcb/t102.json @@ -0,0 +1,55 @@ +{ + "pcb": { + "templates": [ + "tuya2", + "pcb-black", + "rf-type1" + ], + "scale": 10.5, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SPI", + "pinout": { + "1": { + "PWR": 3.3 + }, + "2": { + "IC": 17, + "ARD": "D0" + }, + "3": { + "GND": null + }, + "4": { + "IC": 16, + "ARD": "D1" + }, + "5": { + "IC": 29, + "ARD": "D5" + }, + "6": { + "IC": 28, + "ARD": "D2" + }, + "7": { + "IC": 32, + "ARD": "D6" + }, + "8": { + "IC": 1, + "ARD": "D3" + }, + "9": { + "IC": 13, + "ARD": "D7" + }, + "10": { + "IC": 2, + "ARD": "D4" + }, + "11": { + "IC": 14, + "ARD": "D8" + } + } + } +} diff --git a/boards/_base/pcb/t103.json b/boards/_base/pcb/t103.json new file mode 100644 index 0000000..5657b52 --- /dev/null +++ b/boards/_base/pcb/t103.json @@ -0,0 +1,79 @@ +{ + "pcb": { + "templates": [ + "esp12s", + "pcb-white", + "tuya-16x24", + "rf-type1" + ], + "vars": { + "PINHOLE": 1 + }, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "NC": null + }, + "2": { + "IC": 27, + "ARD": "A1" + }, + "3": { + "IC": 12 + }, + "4": { + "IC": 30, + "ARD": [ + "D0", + "A0" + ] + }, + "5": { + "IC": 13, + "ARD": "D1" + }, + "6": { + "IC": 14, + "ARD": "D2" + }, + "7": { + "IC": 16, + "ARD": "D3" + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "IC": 31, + "ARD": "D4" + }, + "11": { + "IC": 2, + "ARD": "D5" + }, + "12": { + "IC": 1, + "ARD": "D6" + }, + "13": { + "IC": 28, + "ARD": "D7" + }, + "14": { + "IC": 17, + "ARD": "D8" + }, + "15": { + "IC": 29, + "ARD": "D9" + }, + "16": { + "IC": 32, + "ARD": "D10" + } + } + } +} diff --git a/boards/_base/pcb/wa2-test.json b/boards/_base/pcb/wa2-test.json new file mode 100644 index 0000000..661498a --- /dev/null +++ b/boards/_base/pcb/wa2-test.json @@ -0,0 +1,143 @@ +{ + "pcb": { + "test_pads": { + "TTEST": "wa2.back.test.anchor", + "TTX2": "wa2.back.2tx.anchor", + "TGND": "wa2.back.gnd.anchor", + "TSCK": "wa2.back.sck.anchor", + "TCSN": "wa2.back.csn.anchor", + "TSI": "wa2.back.si.anchor", + "TSO": "wa2.back.so.anchor", + "TP4": "wa2.back.p4.anchor", + "TVCC": "wa2.back.vbat.anchor" + }, + "back": [ + { + "name": "test_pad_1mm", + "pos": "2.6,6.2" + }, + { + "id": "sck", + "name": "label_line_up", + "pos": "2.6,5.4", + "vars": { + "DIR": "left", + "W": 1.3, + "H": 2 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.6,6.2" + }, + { + "id": "so", + "name": "label_line_up", + "pos": "4.6,5.4", + "vars": { + "DIR": "left", + "W": 3.3, + "H": 4 + } + }, + { + "name": "test_pad_1mm", + "pos": "7.0,6.2" + }, + { + "id": "p4", + "name": "label_line_up", + "pos": "7.0,5.4", + "vars": { + "DIR": "right", + "W": 0, + "H": 4 + } + }, + { + "name": "test_pad_1mm", + "pos": "3.0,8.3" + }, + { + "id": "csn", + "name": "label_line_up", + "pos": "2.2,8.4", + "vars": { + "DIR": "left", + "W": 0.9, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "5.2,8.8" + }, + { + "id": "si", + "name": "label_line_up", + "pos": "6.0,8.9", + "vars": { + "DIR": "right", + "W": 1, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "2.1,11.6" + }, + { + "id": "2tx", + "name": "label_line_up", + "pos": "1.3,11.7", + "vars": { + "DIR": "left", + "W": 0, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.3,11.6" + }, + { + "id": "test", + "name": "label_line_up", + "pos": "5.1,11.7", + "vars": { + "DIR": "right", + "W": 1.9, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "2.5,14.5" + }, + { + "id": "vbat", + "name": "label_line_up", + "pos": "1.7,14.6", + "vars": { + "DIR": "left", + "W": 0.4, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.8,14.5" + }, + { + "id": "gnd", + "name": "label_line_up", + "pos": "5.6,14.6", + "vars": { + "DIR": "right", + "W": 1.4, + "H": 0 + } + } + ] + } +} diff --git a/boards/_base/pcb/wa2.json b/boards/_base/pcb/wa2.json new file mode 100644 index 0000000..181cb80 --- /dev/null +++ b/boards/_base/pcb/wa2.json @@ -0,0 +1,93 @@ +{ + "pcb": { + "scale": 10.5, + "templates": [ + "tuya2", + "pcb-blue-light", + "rf-type1" + ], + "pinout_hidden": "I2S,SD", + "pinout": { + "1": { + "PWR": 3.3 + }, + "2": { + "IC": 16, + "ARD": "D0" + }, + "3": { + "GND": null + }, + "4": { + "IC": 15, + "ARD": "D1" + }, + "5": { + "IC": 25, + "ARD": "D4" + }, + "6": { + "IC": 14, + "ARD": "D2" + }, + "7": { + "IC": 26, + "ARD": "D5" + }, + "8": { + "IC": 32, + "ARD": [ + "D3", + "A0" + ] + }, + "9": { + "IC": 22, + "ARD": "D6" + }, + "10": { + "IC": 37 + }, + "11": { + "IC": 21, + "ARD": "D7" + }, + "TSCK": { + "IC": 29, + "ARD": "D8" + }, + "TP4": { + "IC": 35, + "ARD": "D9" + }, + "TTEST": { + "IC": 23 + }, + "TTX2": { + "IC": 28, + "ARD": "D10" + }, + "TCSN": { + "IC": 30, + "ARD": "D11" + }, + "TSI": { + "IC": 31, + "ARD": "D12" + }, + "TSO": { + "IC": 32, + "ARD": [ + "D3", + "A0" + ] + }, + "TVCC": { + "PWR": 3.3 + }, + "TGND": { + "GND": null + } + } + } +} diff --git a/boards/_base/pcb/wb1s.json b/boards/_base/pcb/wb1s.json new file mode 100644 index 0000000..8560723 --- /dev/null +++ b/boards/_base/pcb/wb1s.json @@ -0,0 +1,99 @@ +{ + "pcb": { + "templates": [ + "tuya1", + "tuya1s", + "pcb-blue-light", + "tuya-16x24", + "rf-type1" + ], + "scale": 15, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "PWR": "VCC5" + }, + "2": { + "IC": 27, + "ARD": "D0" + }, + "3": { + "IC": 26, + "ARD": "D1" + }, + "4": { + "PWR": 3.3 + }, + "5": { + "GND": null + }, + "6": { + "IC": 15, + "ARD": "D2" + }, + "7": { + "IC": 16, + "ARD": "D3" + }, + "8": { + "IC": 29, + "ARD": "D4" + }, + "9": { + "IC": 24, + "ARD": "D5" + }, + "10": { + "IC": 23, + "ARD": "D6" + }, + "11": { + "IC": 28, + "ARD": "D7" + }, + "12": { + "IC": 25, + "ARD": "D8" + }, + "13": { + "IC": 22, + "ARD": "D9" + }, + "14": { + "GND": null + }, + "15": { + "GND": null + }, + "16": { + "IC": 21 + }, + "17": { + "IC": 17, + "ARD": [ + "D10", + "A0" + ] + }, + "18": { + "GND": null + }, + "19": { + "IC": 17, + "ARD": [ + "D10", + "A0" + ] + }, + "20": { + "IC": 18 + }, + "21": { + "IC": 19 + }, + "22": { + "IC": 20 + } + } + } +} diff --git a/boards/_base/pcb/wb2l-m1-test.json b/boards/_base/pcb/wb2l-m1-test.json new file mode 100644 index 0000000..b56840c --- /dev/null +++ b/boards/_base/pcb/wb2l-m1-test.json @@ -0,0 +1,16 @@ +{ + "pcb": { + "test_pads": { + "TRST": "wb2l-m1.back.rst.anchor", + "TRX1": "wb2l-m1.back.u1_rxd.anchor", + "TTX1": "wb2l-m1.back.u1_txd.anchor", + "TRX2": "wb2l-m1.back.u2_rxd.anchor", + "TTX2": "wb2l-m1.back.u2_txd.anchor", + "TGND": "wb2l-m1.back.gnd.anchor", + "TSCK": "wb2l-m1.back.f_sck.anchor", + "TCSN": "wb2l-m1.back.f_csn.anchor", + "TSI": "wb2l-m1.back.f_si.anchor", + "TSO": "wb2l-m1.back.f_so.anchor" + } + } +} diff --git a/boards/_base/pcb/wb2l-test.json b/boards/_base/pcb/wb2l-test.json index 3c28374..cffdc3f 100644 --- a/boards/_base/pcb/wb2l-test.json +++ b/boards/_base/pcb/wb2l-test.json @@ -14,26 +14,12 @@ "TSO": "wb2l.back.f_so.anchor" }, "back": [ - { - "type": "rect", - "pos": "0,0", - "size": "15,17.3", - "preset": "${MASK_PRESET}" - }, - { - "name": "pins_horz7_2mm_0.7mm", - "pos": "1.15,17.3", - "vars": { - "PINTYPE": "${PINTYPE_HORZ}", - "PINDIR": "down" - } - }, { "name": "test_pad_1mm", "pos": "1.5,7.5" }, { - "name": "label_line_2mm_down", + "name": "label_line_down", "pos": "0.4,4.7", "vars": { "DIR": "right", @@ -55,7 +41,7 @@ }, { "id": "u1_rxd", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "2.2,5.1", "vars": { "DIR": "left", @@ -69,7 +55,7 @@ }, { "id": "u1_txd", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "4.0,5.1", "vars": { "DIR": "left", @@ -83,7 +69,7 @@ }, { "id": "u2_rxd", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "5.7,5.1", "vars": { "DIR": "left", @@ -97,7 +83,7 @@ }, { "id": "u2_txd", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "7.3,5.1", "vars": { "DIR": "left", @@ -111,7 +97,7 @@ }, { "id": "gnd", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "9.2,5.1", "vars": { "DIR": "left", @@ -125,7 +111,7 @@ }, { "id": "f_sck", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "2.2,9.9", "vars": { "DIR": "left", @@ -139,7 +125,7 @@ }, { "id": "f_csn", - "name": "label_line_2mm_down", + "name": "label_line_down", "pos": "2.2,12.8", "vars": { "DIR": "left", @@ -153,7 +139,7 @@ }, { "id": "f_so", - "name": "label_line_2mm_down", + "name": "label_line_down", "pos": "3.5,14.3", "vars": { "DIR": "left", @@ -167,7 +153,7 @@ }, { "id": "f_si", - "name": "label_line_2mm_down", + "name": "label_line_down", "pos": "5.2,14.3", "vars": { "DIR": "left", diff --git a/boards/_base/pcb/wb2l.json b/boards/_base/pcb/wb2l.json index 49a4696..9e234d2 100644 --- a/boards/_base/pcb/wb2l.json +++ b/boards/_base/pcb/wb2l.json @@ -2,15 +2,9 @@ "pcb": { "templates": [ "tuya2l", - "rf-15mm-type1", - "tuya2l-shield" + "pcb-white", + "rf-type1" ], - "vars": { - "MASK_PRESET": "mask_white", - "TRACE_COLOR": "#E0E0E0", - "SILK_COLOR": "black", - "PINTYPE_HORZ": "pin_horz_2mm_cast_hole" - }, "pinout_hidden": "I2S", "pinout": { "1": { @@ -43,7 +37,7 @@ "GND": null }, "TRST": { - "CTRL": "^RST" + "IC": 21 }, "TRX1": { "IC": 26, diff --git a/boards/_base/pcb/wb2s-test.json b/boards/_base/pcb/wb2s-test.json index 0d32c26..81f2790 100644 --- a/boards/_base/pcb/wb2s-test.json +++ b/boards/_base/pcb/wb2s-test.json @@ -19,7 +19,7 @@ }, { "id": "sck", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "2.6,5.4", "vars": { "DIR": "left", @@ -33,7 +33,7 @@ }, { "id": "pwm3", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "4.6,5.4", "vars": { "DIR": "left", @@ -47,7 +47,7 @@ }, { "id": "2rx", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "7.0,5.4", "vars": { "DIR": "right", @@ -61,7 +61,7 @@ }, { "id": "2tx", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "9.0,5.4", "vars": { "DIR": "right", @@ -75,7 +75,7 @@ }, { "id": "csn", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "2.2,8.4", "vars": { "DIR": "left", @@ -89,7 +89,7 @@ }, { "id": "si", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "6.0,8.9", "vars": { "DIR": "right", @@ -103,7 +103,7 @@ }, { "id": "adc_so", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "1.3,11.7", "vars": { "DIR": "left", @@ -117,7 +117,7 @@ }, { "id": "cen", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "5.1,11.7", "vars": { "DIR": "right", @@ -131,7 +131,7 @@ }, { "id": "vbat", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "1.7,14.6", "vars": { "DIR": "left", @@ -145,7 +145,7 @@ }, { "id": "gnd", - "name": "label_line_2mm_up", + "name": "label_line_up", "pos": "5.6,14.6", "vars": { "DIR": "right", diff --git a/boards/_base/pcb/wb2s.json b/boards/_base/pcb/wb2s.json index eaf7cc0..45d1a74 100644 --- a/boards/_base/pcb/wb2s.json +++ b/boards/_base/pcb/wb2s.json @@ -3,14 +3,9 @@ "scale": 10.5, "templates": [ "tuya2", - "rf-15mm-type1", - "tuya2-shield" + "pcb-blue-light", + "rf-type1" ], - "vars": { - "MASK_PRESET": "mask_blue_light", - "TRACE_COLOR": "#58839B", - "SILK_COLOR": "white" - }, "pinout_hidden": "I2S,FLASH", "pinout": { "1": { diff --git a/boards/_base/pcb/wb3l.json b/boards/_base/pcb/wb3l.json index b257094..85e197b 100644 --- a/boards/_base/pcb/wb3l.json +++ b/boards/_base/pcb/wb3l.json @@ -2,16 +2,12 @@ "pcb": { "templates": [ "esp12e-21", - "esp12e-shield-nohole", + "pcb-white", "tuya-16x24", - "rf-16mm-type1" + "rf-type1" ], "vars": { - "MASK_PRESET": "mask_white", - "TRACE_COLOR": "#E0E0E0", - "SILK_COLOR": "black", - "PINTYPE_VERT": "pin_vert_2mm_cast_nohole", - "PINTYPE_HORZ": "pin_horz_2mm_cast_nohole" + "PINHOLE": 0 }, "pinout_hidden": "I2S,SD,SPI", "pinout": { diff --git a/boards/_base/pcb/wb3s.json b/boards/_base/pcb/wb3s.json index 2d3f136..9896ad4 100644 --- a/boards/_base/pcb/wb3s.json +++ b/boards/_base/pcb/wb3s.json @@ -2,16 +2,12 @@ "pcb": { "templates": [ "esp12e-22", - "esp12e-shield-nohole", + "pcb-blue-light", "tuya-16x24", - "rf-16mm-type1" + "rf-type1" ], "vars": { - "MASK_PRESET": "mask_blue_light", - "TRACE_COLOR": "#58839B", - "SILK_COLOR": "white", - "PINTYPE_VERT": "pin_vert_2mm_cast_nohole", - "PINTYPE_HORZ": "pin_horz_2mm_cast_nohole" + "PINHOLE": 0 }, "pinout_hidden": "I2S,SD,SPI", "pinout": { diff --git a/boards/_base/pcb/wblc5-test.json b/boards/_base/pcb/wblc5-test.json new file mode 100644 index 0000000..f956c84 --- /dev/null +++ b/boards/_base/pcb/wblc5-test.json @@ -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 + } + } + ] + } +} diff --git a/boards/_base/pcb/wblc5.json b/boards/_base/pcb/wblc5.json new file mode 100644 index 0000000..85112f0 --- /dev/null +++ b/boards/_base/pcb/wblc5.json @@ -0,0 +1,95 @@ +{ + "pcb": { + "templates": [ + "tuyalc5", + "pcb-white" + ], + "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" + } + ] + } +} diff --git a/boards/_base/pcb/wr1.json b/boards/_base/pcb/wr1.json new file mode 100644 index 0000000..986c86f --- /dev/null +++ b/boards/_base/pcb/wr1.json @@ -0,0 +1,82 @@ +{ + "pcb": { + "templates": [ + "tuya1", + "pcb-black", + "tuya-16x24", + "rf-type1" + ], + "scale": 15, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "PWR": "VCC5" + }, + "2": { + "IC": 32, + "ARD": "D0" + }, + "3": { + "IC": 29, + "ARD": "D1" + }, + "4": { + "PWR": 3.3 + }, + "5": { + "GND": null + }, + "6": { + "IC": 13, + "ARD": "D2" + }, + "7": { + "IC": 14, + "ARD": "D3" + }, + "8": { + "IC": 1, + "ARD": "D4" + }, + "9": { + "IC": 16, + "ARD": "D5" + }, + "10": { + "IC": 28, + "ARD": "D6" + }, + "11": { + "IC": 2, + "ARD": "D7" + }, + "12": { + "IC": 30, + "ARD": [ + "D8", + "A0" + ] + }, + "13": { + "IC": 31, + "ARD": "D9" + }, + "14": { + "GND": null + }, + "15": { + "GND": null + }, + "16": { + "IC": 12 + }, + "17": { + "IC": 27, + "ARD": "A1" + }, + "18": { + "GND": null + } + } + } +} diff --git a/boards/_base/pcb/wr1e.json b/boards/_base/pcb/wr1e.json new file mode 100644 index 0000000..e56d66e --- /dev/null +++ b/boards/_base/pcb/wr1e.json @@ -0,0 +1,82 @@ +{ + "pcb": { + "templates": [ + "tuya1", + "pcb-blue-light", + "tuya-16x24", + "rf-type1" + ], + "scale": 15, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "PWR": "VCC5" + }, + "2": { + "IC": 32, + "ARD": "D0" + }, + "3": { + "IC": 29, + "ARD": "D1" + }, + "4": { + "PWR": 3.3 + }, + "5": { + "GND": null + }, + "6": { + "IC": 13, + "ARD": "D2" + }, + "7": { + "IC": 14, + "ARD": "D3" + }, + "8": { + "IC": 1, + "ARD": "D4" + }, + "9": { + "IC": 17, + "ARD": "D5" + }, + "10": { + "IC": 28, + "ARD": "D6" + }, + "11": { + "IC": 2, + "ARD": "D7" + }, + "12": { + "IC": 30, + "ARD": [ + "D8", + "A0" + ] + }, + "13": { + "IC": 31, + "ARD": "D9" + }, + "14": { + "GND": null + }, + "15": { + "GND": null + }, + "16": { + "IC": 12 + }, + "17": { + "IC": 27, + "ARD": "A1" + }, + "18": { + "GND": null + } + } + } +} diff --git a/boards/_base/pcb/wr2-base.json b/boards/_base/pcb/wr2-base.json index 6a57129..1997844 100644 --- a/boards/_base/pcb/wr2-base.json +++ b/boards/_base/pcb/wr2-base.json @@ -2,13 +2,8 @@ "pcb": { "templates": [ "tuya2", - "rf-15mm-type1", - "tuya2-shield" - ], - "vars": { - "MASK_PRESET": "mask_blue_light", - "TRACE_COLOR": "#58839B", - "SILK_COLOR": "white" - } + "pcb-blue-light", + "rf-type1" + ] } } diff --git a/boards/_base/pcb/wr2l-base.json b/boards/_base/pcb/wr2l-base.json index 821124d..ae89345 100644 --- a/boards/_base/pcb/wr2l-base.json +++ b/boards/_base/pcb/wr2l-base.json @@ -2,14 +2,8 @@ "pcb": { "templates": [ "tuya2l", - "rf-15mm-type1", - "tuya2l-shield" - ], - "vars": { - "MASK_PRESET": "mask_blue_light", - "TRACE_COLOR": "#58839B", - "SILK_COLOR": "white", - "PINTYPE_HORZ": "pin_horz_2mm_cast_hole" - } + "pcb-blue-light", + "rf-type1" + ] } } diff --git a/boards/_base/pcb/wr3-base.json b/boards/_base/pcb/wr3-base.json index d22610a..2015c67 100644 --- a/boards/_base/pcb/wr3-base.json +++ b/boards/_base/pcb/wr3-base.json @@ -2,15 +2,8 @@ "pcb": { "templates": [ "esp12s", - "esp12s-shield", "tuya-16x24", - "rf-16mm-type1" - ], - "vars": { - "MASK_PRESET": "mask_black", - "TRACE_COLOR": "#505050", - "SILK_COLOR": "white", - "PINTYPE_VERT": "pin_vert_2mm_cast_nohole" - } + "rf-type1" + ] } } diff --git a/boards/_base/pcb/wr3.json b/boards/_base/pcb/wr3.json index e859d98..92b641f 100644 --- a/boards/_base/pcb/wr3.json +++ b/boards/_base/pcb/wr3.json @@ -1,5 +1,8 @@ { "pcb": { + "templates": [ + "pcb-black" + ], "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", "pinout": { "1": { diff --git a/boards/_base/pcb/wr3e.json b/boards/_base/pcb/wr3e.json index beec0a1..62732a3 100644 --- a/boards/_base/pcb/wr3e.json +++ b/boards/_base/pcb/wr3e.json @@ -1,10 +1,8 @@ { "pcb": { - "vars": { - "MASK_PRESET": "mask_blue_light", - "TRACE_COLOR": "#58839B", - "SILK_COLOR": "white" - }, + "templates": [ + "pcb-blue-light" + ], "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", "pinout": { "1": { diff --git a/boards/_base/pcb/wr3l-base.json b/boards/_base/pcb/wr3l-base.json index 218f8f0..c0ba943 100644 --- a/boards/_base/pcb/wr3l-base.json +++ b/boards/_base/pcb/wr3l-base.json @@ -2,15 +2,9 @@ "pcb": { "templates": [ "esp12s", - "esp12e-shield", + "pcb-white", "tuya-16x24", - "rf-16mm-type1" - ], - "vars": { - "MASK_PRESET": "mask_white", - "TRACE_COLOR": "#E0E0E0", - "SILK_COLOR": "black", - "PINTYPE_VERT": "pin_vert_2mm_cast_hole" - } + "rf-type1" + ] } } diff --git a/boards/_base/pcb/wr3n.json b/boards/_base/pcb/wr3n.json index d391c4b..d93d908 100644 --- a/boards/_base/pcb/wr3n.json +++ b/boards/_base/pcb/wr3n.json @@ -1,5 +1,8 @@ { "pcb": { + "templates": [ + "pcb-black" + ], "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SPI", "pinout": { "1": { diff --git a/boards/cb1s.json b/boards/cb1s.json new file mode 100644 index 0000000..b97e6ea --- /dev/null +++ b/boards/cb1s.json @@ -0,0 +1,20 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/cb1s", + "pcb/cb1s-test" + ], + "build": { + "mcu": "bk7231n", + "variant": "cb1s" + }, + "name": "CB1S Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/cb1s-module-datasheet?id=Kaij1abmwyjq2", + "vendor": "Tuya Inc.", + "pcb": { + "symbol": "CB1S" + } +} diff --git a/boards/cb2l.json b/boards/cb2l.json index b776534..84413c9 100644 --- a/boards/cb2l.json +++ b/boards/cb2l.json @@ -2,7 +2,7 @@ "_base": [ "beken-72xx", "beken-7231n", - "beken-7231n-tuya", + "beken-7231-tuya", "ic/bk7231-qfn32", "pcb/cb2l", "pcb/cb2l-test" diff --git a/boards/cb2s.json b/boards/cb2s.json index f539771..a4df4e2 100644 --- a/boards/cb2s.json +++ b/boards/cb2s.json @@ -2,7 +2,7 @@ "_base": [ "beken-72xx", "beken-7231n", - "beken-7231n-tuya", + "beken-7231-tuya", "ic/bk7231-qfn32", "pcb/cb2s", "pcb/cb2s-test" diff --git a/boards/cb3l.json b/boards/cb3l.json index badeea9..ea2161a 100644 --- a/boards/cb3l.json +++ b/boards/cb3l.json @@ -2,7 +2,7 @@ "_base": [ "beken-72xx", "beken-7231n", - "beken-7231n-tuya", + "beken-7231-tuya", "ic/bk7231-qfn32", "pcb/cb3l" ], diff --git a/boards/cb3s.json b/boards/cb3s.json index 206bb00..9aea411 100644 --- a/boards/cb3s.json +++ b/boards/cb3s.json @@ -2,7 +2,7 @@ "_base": [ "beken-72xx", "beken-7231n", - "beken-7231n-tuya", + "beken-7231-tuya", "ic/bk7231-qfn32", "pcb/cb3s" ], diff --git a/boards/cb3se.json b/boards/cb3se.json index 136c972..104e9d0 100644 --- a/boards/cb3se.json +++ b/boards/cb3se.json @@ -2,7 +2,7 @@ "_base": [ "beken-72xx", "beken-7231n", - "beken-7231n-tuya", + "beken-7231-tuya", "ic/bk7231-qfn32", "pcb/cb3se" ], diff --git a/boards/cblc5.json b/boards/cblc5.json new file mode 100644 index 0000000..7e91a73 --- /dev/null +++ b/boards/cblc5.json @@ -0,0 +1,20 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-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" + } +} diff --git a/boards/cbu.json b/boards/cbu.json new file mode 100644 index 0000000..92431d7 --- /dev/null +++ b/boards/cbu.json @@ -0,0 +1,23 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/cbu", + "pcb/cbu-test" + ], + "build": { + "mcu": "bk7231n", + "variant": "cbu" + }, + "name": "CBU Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/cbu-module-datasheet?id=Ka07pykl5dk4u", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-CBU" + }, + "pcb": { + "symbol": "CBU" + } +} diff --git a/boards/generic-bk7231n-qfn32-tuya.json b/boards/generic-bk7231n-qfn32-tuya.json index 03f346c..c38eaab 100644 --- a/boards/generic-bk7231n-qfn32-tuya.json +++ b/boards/generic-bk7231n-qfn32-tuya.json @@ -3,7 +3,7 @@ "generic", "beken-72xx", "beken-7231n", - "beken-7231n-tuya", + "beken-7231-tuya", "ic/bk7231-qfn32" ], "build": { diff --git a/boards/generic-bk7231t-qfn32-tuya.json b/boards/generic-bk7231t-qfn32-tuya.json index d748612..cfa840c 100644 --- a/boards/generic-bk7231t-qfn32-tuya.json +++ b/boards/generic-bk7231t-qfn32-tuya.json @@ -2,8 +2,9 @@ "_base": [ "generic", "beken-72xx", - "beken-7231u", - "beken-7231t-tuya", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", "ic/bk7231-qfn32" ], "build": { diff --git a/boards/lsc-lma35-t.json b/boards/lsc-lma35-t.json index fee18c3..60a7cba 100644 --- a/boards/lsc-lma35-t.json +++ b/boards/lsc-lma35-t.json @@ -1,8 +1,9 @@ { "_base": [ "beken-72xx", - "beken-7231u", - "beken-7231t-tuya", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", "ic/bk7231-qfn32", "pcb/lsc-lma35" ], diff --git a/boards/lsc-lma35.json b/boards/lsc-lma35.json index a6345d2..2f97e6e 100644 --- a/boards/lsc-lma35.json +++ b/boards/lsc-lma35.json @@ -2,7 +2,7 @@ "_base": [ "beken-72xx", "beken-7231n", - "beken-7231n-tuya", + "beken-7231-tuya", "ic/bk7231-qfn32", "pcb/lsc-lma35" ], @@ -10,8 +10,8 @@ "mcu": "bk7231n", "variant": "lsc-lma35" }, - "name": "LSC LMA35", - "symbol": "LSC LMA35", + "name": "LSC LMA35 BK7231N", + "symbol": "LSC LMA35 N", "url": "https://www.action.com/de-at/p/lsc-smart-connect-outdoor-led-streifen/", "vendor": "Unknown", "pcb": { diff --git a/boards/shapes/tuya2_pcb.json b/boards/shapes/tuya2_pcb.json new file mode 100644 index 0000000..74ccba2 --- /dev/null +++ b/boards/shapes/tuya2_pcb.json @@ -0,0 +1,54 @@ +[ + { + "type": "rect", + "pos": "0,0", + "size": "15,17.9", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Left cut stroke horizontal", + "type": "rect", + "pos": "0,14.35", + "size": "1.60,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Left cut stroke vertical", + "type": "rect", + "pos": "1.60,14.35", + "size": "0.1,3.45", + "preset": "pcb_stroke" + }, + { + "comment": "Left cut background", + "type": "rect", + "pos": "-0.1,14.45", + "size": "1.70,3.55", + "fill": { + "color": "white" + } + }, + { + "comment": "Right cut stroke horizontal", + "type": "rect", + "pos": "13.3,14.35", + "size": "1.60,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut stroke vertical", + "type": "rect", + "pos": "13.3,14.35", + "size": "0.1,3.45", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut background", + "type": "rect", + "pos": "13.4,14.45", + "size": "1.70,3.55", + "fill": { + "color": "white" + } + } +] diff --git a/boards/shapes/tuyau_pcb.json b/boards/shapes/tuyau_pcb.json new file mode 100644 index 0000000..ec813bb --- /dev/null +++ b/boards/shapes/tuyau_pcb.json @@ -0,0 +1,54 @@ +[ + { + "type": "rect", + "pos": "0,0", + "size": "15.8,20.3", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Left cut stroke horizontal", + "type": "rect", + "pos": "0,17.4", + "size": "1.50,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Left cut stroke vertical", + "type": "rect", + "pos": "1.50,17.4", + "size": "0.1,2.8", + "preset": "pcb_stroke" + }, + { + "comment": "Left cut background", + "type": "rect", + "pos": "-0.1,17.5", + "size": "1.60,2.85", + "fill": { + "color": "white" + } + }, + { + "comment": "Right cut stroke horizontal", + "type": "rect", + "pos": "14.1,17.4", + "size": "1.60,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut stroke vertical", + "type": "rect", + "pos": "14.1,17.4", + "size": "0.1,2.8", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut background", + "type": "rect", + "pos": "14.2,17.5", + "size": "1.70,2.85", + "fill": { + "color": "white" + } + } +] diff --git a/boards/t102-v1.1.json b/boards/t102-v1.1.json new file mode 100644 index 0000000..b18d55c --- /dev/null +++ b/boards/t102-v1.1.json @@ -0,0 +1,21 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/t102" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "t102-v1.1" + }, + "name": "T102_V1.1", + "url": "https://docs.libretiny.eu/boards/t102-v1.1/", + "vendor": "Unknown", + "doc": { + "fccid": "2AU7O-T102V11" + }, + "pcb": { + "symbol": "T102_V1.1" + } +} diff --git a/boards/t103-v1.0.json b/boards/t103-v1.0.json new file mode 100644 index 0000000..25692a1 --- /dev/null +++ b/boards/t103-v1.0.json @@ -0,0 +1,26 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-2mb-788k", + "realtek-ambz-bx", + "ic/rtl8710bn", + "pcb/t103" + ], + "build": { + "mcu": "rtl8710bx", + "variant": "t103-v1.0" + }, + "name": "T103_V1.0", + "url": "https://docs.libretiny.eu/boards/t103-v1.0/", + "vendor": "Unknown", + "doc": { + "fccid": "2AU7O-T102V11", + "extra": [ + "## Source", + "Pinout information sourced from [teardown post by @p.kaczmarek2 from Elektroda](https://www.elektroda.pl/rtvforum/topic3984148.html)." + ] + }, + "pcb": { + "symbol": "T103_V1.0" + } +} diff --git a/boards/templates/custom-20x24-22.json b/boards/templates/custom-20x24-22.json new file mode 100644 index 0000000..c17eb8e --- /dev/null +++ b/boards/templates/custom-20x24-22.json @@ -0,0 +1,141 @@ +{ + "name": "custom-20x24-22", + "title": "Custom 20x24mm form factor (22-pin)", + "width": 20, + "height": 24, + "vars": { + "PINTYPE_VERT": "pin_vert_cast_nohole", + "PINTYPE_HORZ": "pin_horz_cast_nohole", + "RASTER": 2, + "RF_W": 20, + "RF_H": 6.5 + }, + "front": [ + { + "comment": "PCB soldermask", + "type": "rect", + "pos": "0,0", + "size": "20,24", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Pins (1-7)", + "id": "left", + "name": "r_pins_vert", + "repeat": 7, + "pos": "0,8.5", + "vars": { + "PINDIR": "left" + } + }, + { + "comment": "Pins (8-15)", + "id": "right", + "name": "r_pins_vert", + "repeat": 7, + "pos": "20,8.5", + "vars": { + "PINDIR": "right" + } + }, + { + "comment": "Pins (16-22)", + "name": "r_pins_horz", + "repeat": 8, + "pos": "3,24", + "vars": { + "PINDIR": "down" + } + }, + { + "comment": "Pin labels (16-22)", + "id": "down", + "name": "r_labels_horz", + "repeat": 8, + "pos": "3,24", + "vars": { + "PINDIR": "down" + } + }, + { + "comment": "Metal shielding", + "type": "rect", + "pos": "1.2,6.95", + "size": "17.6,15.8", + "preset": "shield" + } + ], + "back": [ + { + "comment": "PCB soldermask", + "type": "rect", + "pos": "0,0", + "size": "20,24", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Pins (8-15)", + "id": "right", + "name": "r_pins_vert", + "repeat": 7, + "pos": "0,8.5", + "vars": { + "PINDIR": "left" + } + }, + { + "comment": "Pins (1-7)", + "id": "left", + "name": "r_pins_vert", + "repeat": 7, + "pos": "20,8.5", + "vars": { + "PINDIR": "right" + } + }, + { + "comment": "Pins (16-22)", + "name": "r_pins_horz", + "repeat": 8, + "pos": "3,24", + "vars": { + "PINDIR": "down" + } + }, + { + "comment": "Pin labels (16-22)", + "id": "down", + "name": "r_labels_horz", + "repeat": 8, + "pos": "3,24", + "vars": { + "PINDIR": "down" + } + } + ], + "pads": { + "1": "custom-20x24-22.front.left.pin1", + "2": "custom-20x24-22.front.left.pin2", + "3": "custom-20x24-22.front.left.pin3", + "4": "custom-20x24-22.front.left.pin4", + "5": "custom-20x24-22.front.left.pin5", + "6": "custom-20x24-22.front.left.pin6", + "7": "custom-20x24-22.front.left.pin7", + "8": "custom-20x24-22.front.right.pin7", + "9": "custom-20x24-22.front.right.pin6", + "10": "custom-20x24-22.front.right.pin5", + "11": "custom-20x24-22.front.right.pin4", + "12": "custom-20x24-22.front.right.pin3", + "13": "custom-20x24-22.front.right.pin2", + "14": "custom-20x24-22.front.right.pin1", + "15": "custom-20x24-22.front.down.label1.anchor", + "16": "custom-20x24-22.front.down.label2.anchor", + "17": "custom-20x24-22.front.down.label3.anchor", + "18": "custom-20x24-22.front.down.label4.anchor", + "19": "custom-20x24-22.front.down.label5.anchor", + "20": "custom-20x24-22.front.down.label6.anchor", + "21": "custom-20x24-22.front.down.label7.anchor", + "22": "custom-20x24-22.front.down.label8.anchor" + }, + "test_pads": {} +} diff --git a/boards/templates/tuya-16x24.json b/boards/templates/tuya-16x24.json new file mode 100644 index 0000000..4fe6873 --- /dev/null +++ b/boards/templates/tuya-16x24.json @@ -0,0 +1,27 @@ +{ + "name": "tuya-16x24", + "title": "Tuya boards; 16x24mm; 16 or 22 pin", + "width": 16, + "height": 24, + "front": [ + { + "comment": "Line below model name", + "type": "rect", + "pos": "0.5,6.2", + "size": "15,0.15", + "fill": { + "color": "${SILK_COLOR}" + } + }, + { + "comment": "Board model name", + "type": "text", + "pos": "7.0,5.5", + "text": "${SYMBOL}", + "font_size": 1.0, + "fill": { + "color": "${SILK_COLOR}" + } + } + ] +} diff --git a/boards/templates/tuya1.json b/boards/templates/tuya1.json new file mode 100644 index 0000000..3135f6c --- /dev/null +++ b/boards/templates/tuya1.json @@ -0,0 +1,99 @@ +{ + "name": "tuya1", + "title": "Tuya boards; 1 series", + "width": 18, + "height": 23.5, + "vars": { + "PINTYPE_VERT": "pin_vert_cast_nohole", + "PINTYPE_HORZ": "pin_horz_cast_nohole", + "RASTER": 1.5, + "RF_W": 18, + "RF_H": 6.1 + }, + "front": [ + { + "comment": "PCB soldermask", + "type": "rect", + "pos": "0,0", + "size": "18,23.5", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Metal shielding", + "type": "rect", + "pos": "1.3,7.3", + "size": "15.4,15.4", + "preset": "shield" + }, + { + "comment": "Pins (1-9)", + "id": "left", + "name": "r_pins_vert", + "repeat": 9, + "pos": "0,10.6", + "vars": { + "PINDIR": "left" + } + }, + { + "comment": "Pins (10-18)", + "id": "right", + "name": "r_pins_vert", + "repeat": 9, + "pos": "18,10.6", + "vars": { + "PINDIR": "right" + } + } + ], + "back": [ + { + "comment": "PCB soldermask", + "type": "rect", + "pos": "0,0", + "size": "18,23.5", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Pins (1-9)", + "id": "left", + "name": "r_pins_vert", + "repeat": 9, + "pos": "0,10.6", + "vars": { + "PINDIR": "left" + } + }, + { + "comment": "Pins (10-18)", + "id": "right", + "name": "r_pins_vert", + "repeat": 9, + "pos": "18,10.6", + "vars": { + "PINDIR": "right" + } + } + ], + "pads": { + "1": "tuya1.front.left.pin1", + "2": "tuya1.front.left.pin2", + "3": "tuya1.front.left.pin3", + "4": "tuya1.front.left.pin4", + "5": "tuya1.front.left.pin5", + "6": "tuya1.front.left.pin6", + "7": "tuya1.front.left.pin7", + "8": "tuya1.front.left.pin8", + "9": "tuya1.front.left.pin9", + "10": "tuya1.front.right.pin9", + "11": "tuya1.front.right.pin8", + "12": "tuya1.front.right.pin7", + "13": "tuya1.front.right.pin6", + "14": "tuya1.front.right.pin5", + "15": "tuya1.front.right.pin4", + "16": "tuya1.front.right.pin3", + "17": "tuya1.front.right.pin2", + "18": "tuya1.front.right.pin1" + }, + "test_pads": {} +} diff --git a/boards/templates/tuya1s.json b/boards/templates/tuya1s.json new file mode 100644 index 0000000..a5436d4 --- /dev/null +++ b/boards/templates/tuya1s.json @@ -0,0 +1,64 @@ +{ + "name": "tuya1s", + "title": "Tuya boards; 1S series", + "width": 18, + "height": 23.5, + "vars": { + "PINTYPE_VERT": "pin_vert_cast_nohole", + "PINTYPE_HORZ": "pin_horz_cast_nohole", + "RASTER": 1.5, + "RF_W": 18, + "RF_H": 6.1 + }, + "front": [ + { + "comment": "Pins (19-24)", + "name": "r_pins_horz", + "repeat": 6, + "pos": "5.25,23.5", + "vars": { + "PINDIR": "down" + } + }, + { + "comment": "Pin labels (19-24)", + "id": "down", + "name": "r_labels_horz", + "repeat": 6, + "pos": "5.25,23.5", + "vars": { + "PINDIR": "down" + } + } + ], + "back": [ + { + "comment": "Pins (10-18)", + "name": "r_pins_vert", + "repeat": 9, + "pos": "18,10.6", + "vars": { + "PINDIR": "right" + } + }, + { + "comment": "Pins (19-24)", + "id": "down", + "name": "r_pins_horz", + "repeat": 6, + "pos": "5.25,23.5", + "vars": { + "PINDIR": "down" + } + } + ], + "pads": { + "19": "tuya1s.front.down.label1.anchor", + "20": "tuya1s.front.down.label2.anchor", + "21": "tuya1s.front.down.label3.anchor", + "22": "tuya1s.front.down.label4.anchor", + "23": "tuya1s.front.down.label5.anchor", + "24": "tuya1s.front.down.label6.anchor" + }, + "test_pads": {} +} diff --git a/boards/templates/tuya2.json b/boards/templates/tuya2.json new file mode 100644 index 0000000..ca2f0e7 --- /dev/null +++ b/boards/templates/tuya2.json @@ -0,0 +1,80 @@ +{ + "name": "tuya2", + "title": "Tuya boards; 2 series", + "width": 15, + "height": 17.9, + "vars": { + "PINTYPE_HORZ": "pad_10x25", + "PINDIR": "down", + "RASTER": 2, + "RF_W": 15, + "RF_H": 5.5 + }, + "front": [ + { + "name": "tuya2_pcb", + "pos": "0,0" + }, + { + "comment": "Metal shielding", + "type": "rect", + "pos": "0.3,6", + "size": "14.4,8", + "preset": "shield" + }, + { + "comment": "Pins (10,8,6,4,2)", + "name": "r_pins_horz", + "repeat": 5, + "pos": "3.5,16.3" + }, + { + "comment": "Pin labels (10,8,6,4,2)", + "id": "pins", + "name": "r_labels_horz", + "repeat": 5, + "pos": "3.5,17.9" + }, + { + "type": "text", + "pos": "7.0,5.0", + "text": "${SYMBOL}", + "font_size": 1.0, + "fill": { + "color": "${SILK_COLOR}" + } + } + ], + "back": [ + { + "name": "tuya2_pcb", + "pos": "0,0" + }, + { + "comment": "Pins (1,3,5,7,9,11)", + "name": "r_pins_horz", + "repeat": 6, + "pos": "2.5,16.3" + }, + { + "comment": "Pin labels (1,3,5,7,9,11)", + "id": "pins", + "name": "r_labels_horz", + "repeat": 6, + "pos": "2.5,17.9" + } + ], + "pads": { + "1": "tuya2.back.pins.label1.anchor", + "2": "tuya2.front.pins.label5.anchor", + "3": "tuya2.back.pins.label2.anchor", + "4": "tuya2.front.pins.label4.anchor", + "5": "tuya2.back.pins.label3.anchor", + "6": "tuya2.front.pins.label3.anchor", + "7": "tuya2.back.pins.label4.anchor", + "8": "tuya2.front.pins.label2.anchor", + "9": "tuya2.back.pins.label5.anchor", + "10": "tuya2.front.pins.label1.anchor", + "11": "tuya2.back.pins.label6.anchor" + } +} diff --git a/boards/templates/tuya2l.json b/boards/templates/tuya2l.json new file mode 100644 index 0000000..c991342 --- /dev/null +++ b/boards/templates/tuya2l.json @@ -0,0 +1,73 @@ +{ + "name": "tuya2l", + "title": "Tuya boards; 2L series", + "width": 15, + "height": 17.3, + "vars": { + "PINTYPE_HORZ": "pin_horz_cast_hole", + "PINDIR": "down", + "RASTER": 2, + "RF_W": 15, + "RF_H": 5.5 + }, + "front": [ + { + "type": "rect", + "pos": "0,0", + "size": "15,17.3", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Metal shielding", + "type": "rect", + "pos": "0.7,6", + "size": "13.6,9", + "preset": "shield" + }, + { + "comment": "Pins (1-7)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "1.5,17.3" + }, + { + "comment": "Pin labels (1-7)", + "id": "pins", + "name": "r_labels_horz", + "repeat": 7, + "pos": "1.5,17.3" + }, + { + "type": "text", + "pos": "4.0,5.5", + "text": "${SYMBOL}", + "font_size": 1.0, + "fill": { + "color": "${SILK_COLOR}" + } + } + ], + "back": [ + { + "type": "rect", + "pos": "0,0", + "size": "15,17.3", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Pins (1-7)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "1.5,17.3" + } + ], + "pads": { + "1": "tuya2l.front.pins.label1.anchor", + "2": "tuya2l.front.pins.label2.anchor", + "3": "tuya2l.front.pins.label3.anchor", + "4": "tuya2l.front.pins.label4.anchor", + "5": "tuya2l.front.pins.label5.anchor", + "6": "tuya2l.front.pins.label6.anchor", + "7": "tuya2l.front.pins.label7.anchor" + } +} diff --git a/boards/templates/tuyalc5.json b/boards/templates/tuyalc5.json new file mode 100644 index 0000000..174b138 --- /dev/null +++ b/boards/templates/tuyalc5.json @@ -0,0 +1,255 @@ +{ + "name": "tuyalc5", + "title": "Tuya boards; LC5 series", + "width": 15.8, + "height": 20.3, + "vars": { + "RASTER": 2 + }, + "front": [ + { + "type": "rect", + "pos": "0,0", + "size": "8.5,12.7", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Middle cut background", + "type": "rect", + "pos": "4,10.3", + "size": "2.5,2.4", + "fill": { + "color": "white" + } + }, + { + "comment": "Middle cut stroke top", + "type": "rect", + "pos": "3.9,10.2", + "size": "2.7,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Middle cut stroke left", + "type": "rect", + "pos": "3.9,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Middle cut stroke right", + "type": "rect", + "pos": "6.5,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut background", + "type": "rect", + "pos": "7.7,10.3", + "size": "0.8,2.4", + "fill": { + "color": "white" + } + }, + { + "comment": "Right cut stroke top", + "type": "rect", + "pos": "7.6,10.2", + "size": "0.9,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut stroke left", + "type": "rect", + "pos": "7.6,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Pins (1-2)", + "id": "left", + "name": "r_pins_horz", + "repeat": 2, + "pos": "1.26,11.58", + "vars": { + "PINTYPE_HORZ": "pad", + "PINDIR": "down", + "RASTER": 2, + "W": 1, + "H": 2, + "R": 0.3 + } + }, + { + "comment": "Pins (3)", + "name": "pad", + "pos": "7.13,11.58", + "vars": { + "W": 1, + "H": 2, + "R": 0.3 + } + }, + { + "comment": "Pin label (1)", + "id": "pin1", + "name": "label_line_down", + "pos": "1.26,12.7", + "vars": { + "DIR": "left", + "W": 0, + "H": 2 + } + }, + { + "comment": "Pin label (2)", + "id": "pin2", + "name": "label_line_down", + "pos": "3.26,12.7", + "vars": { + "DIR": "left", + "W": 2, + "H": 4 + } + }, + { + "comment": "Pin label (3)", + "id": "pin3", + "name": "label_line_down", + "pos": "7.13,12.7", + "vars": { + "DIR": "left", + "W": 5.87, + "H": 6 + } + } + ], + "back": [ + { + "type": "rect", + "pos": "0,0", + "size": "8.5,12.7", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Middle cut background", + "type": "rect", + "pos": "8.5-4-2.5,10.3", + "size": "2.5,2.4", + "fill": { + "color": "white" + } + }, + { + "comment": "Middle cut stroke top", + "type": "rect", + "pos": "8.5-3.9-2.7,10.2", + "size": "2.7,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Middle cut stroke left", + "type": "rect", + "pos": "8.5-3.9-0.1,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Middle cut stroke right", + "type": "rect", + "pos": "8.5-6.5-0.1,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut background", + "type": "rect", + "pos": "8.5-7.7-0.8,10.3", + "size": "0.8,2.4", + "fill": { + "color": "white" + } + }, + { + "comment": "Right cut stroke top", + "type": "rect", + "pos": "8.5-7.6-0.9,10.2", + "size": "0.9,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut stroke left", + "type": "rect", + "pos": "8.5-7.6-0.1,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Pins (1-2)", + "id": "left", + "name": "r_pins_horz", + "repeat": 2, + "pos": "8.5-1.26-2,11.58", + "vars": { + "PINTYPE_HORZ": "pad", + "PINDIR": "down", + "RASTER": 2, + "W": 1, + "H": 2, + "R": 0.3 + } + }, + { + "comment": "Pins (3)", + "name": "pad", + "pos": "8.5-7.13,11.58", + "vars": { + "W": 1, + "H": 2, + "R": 0.3 + } + }, + { + "comment": "Pin label (1)", + "id": "pin1", + "name": "label_line_down", + "pos": "8.5-1.26,12.7", + "vars": { + "DIR": "right", + "W": 0, + "H": 2 + } + }, + { + "comment": "Pin label (2)", + "id": "pin2", + "name": "label_line_down", + "pos": "8.5-3.26,12.7", + "vars": { + "DIR": "right", + "W": 2, + "H": 4 + } + }, + { + "comment": "Pin label (3)", + "id": "pin3", + "name": "label_line_down", + "pos": "8.5-7.13,12.7", + "vars": { + "DIR": "right", + "W": 5.87, + "H": 6 + } + } + ], + "pads": { + "1": "tuyalc5.front.pin1.anchor", + "2": "tuyalc5.back.pin1.anchor", + "3": "tuyalc5.front.pin2.anchor", + "4": "tuyalc5.back.pin2.anchor", + "5": "tuyalc5.front.pin3.anchor", + "6": "tuyalc5.back.pin3.anchor" + } +} diff --git a/boards/templates/tuyau.json b/boards/templates/tuyau.json new file mode 100644 index 0000000..5ee814e --- /dev/null +++ b/boards/templates/tuyau.json @@ -0,0 +1,162 @@ +{ + "name": "tuyau", + "title": "Tuya boards; U series", + "width": 15.8, + "height": 20.3, + "vars": { + "PINTYPE_VERT": "pin_vert_cast_nohole", + "PINTYPE_HORZ": "pin_horz_cast_nohole", + "RF_W": 15.8, + "RF_H": 5.2 + }, + "front": [ + { + "name": "tuyau_pcb", + "pos": "0,0" + }, + { + "comment": "Metal shielding", + "type": "rect", + "pos": "1.1,5.6", + "size": "13.6,11.5", + "preset": "shield" + }, + { + "comment": "Pins (1-7)", + "id": "left", + "name": "r_pins_vert", + "repeat": 7, + "pos": "0,6.1", + "vars": { + "PINDIR": "left", + "RASTER": 1.4 + } + }, + { + "comment": "Pins (8-14)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "2.5,20.3", + "vars": { + "PINDIR": "down", + "RASTER": 1.8 + } + }, + { + "comment": "Long pads (8-14)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "2.5,17.5 + 1.2", + "vars": { + "PINTYPE_HORZ": "pad", + "W": "0.6 * 1.8", + "H": 2.4, + "R": 0, + "RASTER": 1.8 + } + }, + { + "comment": "Pin labels (8-14)", + "id": "down", + "name": "r_labels_horz", + "repeat": 7, + "pos": "2.5,20.3", + "vars": { + "PINDIR": "down", + "RASTER": 1.8 + } + }, + { + "comment": "Pins (15-21)", + "id": "right", + "name": "r_pins_vert", + "repeat": 7, + "pos": "15.8,6.1", + "vars": { + "PINDIR": "right", + "RASTER": 1.4 + } + }, + { + "type": "text", + "pos": "4.0,5.5", + "text": "${SYMBOL}", + "font_size": 1.0, + "fill": { + "color": "${SILK_COLOR}" + } + } + ], + "back": [ + { + "name": "tuyau_pcb", + "pos": "0,0" + }, + { + "comment": "Pins (1-7)", + "name": "r_pins_vert", + "repeat": 7, + "pos": "0,6.1", + "vars": { + "PINDIR": "left", + "RASTER": 1.4 + } + }, + { + "comment": "Pins (8-14)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "2.5,20.3", + "vars": { + "PINDIR": "down", + "RASTER": 1.8 + } + }, + { + "comment": "Long pads (8-14)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "2.5,17.5 + 1.2", + "vars": { + "PINTYPE_HORZ": "pad", + "W": "0.6 * 1.8", + "H": 2.4, + "R": 0, + "RASTER": 1.8 + } + }, + { + "comment": "Pins (15-21)", + "name": "r_pins_vert", + "repeat": 7, + "pos": "15.8,6.1", + "vars": { + "PINDIR": "right", + "RASTER": 1.4 + } + } + ], + "pads": { + "1": "tuyau.front.left.pin1", + "2": "tuyau.front.left.pin2", + "3": "tuyau.front.left.pin3", + "4": "tuyau.front.left.pin4", + "5": "tuyau.front.left.pin5", + "6": "tuyau.front.left.pin6", + "7": "tuyau.front.left.pin7", + "8": "tuyau.front.down.label1.anchor", + "9": "tuyau.front.down.label2.anchor", + "10": "tuyau.front.down.label3.anchor", + "11": "tuyau.front.down.label4.anchor", + "12": "tuyau.front.down.label5.anchor", + "13": "tuyau.front.down.label6.anchor", + "14": "tuyau.front.down.label7.anchor", + "15": "tuyau.front.right.pin7", + "16": "tuyau.front.right.pin6", + "17": "tuyau.front.right.pin5", + "18": "tuyau.front.right.pin4", + "19": "tuyau.front.right.pin3", + "20": "tuyau.front.right.pin2", + "21": "tuyau.front.right.pin1" + } +} diff --git a/boards/variants/cb1s.c b/boards/variants/cb1s.c new file mode 100644 index 0000000..55ef8cc --- /dev/null +++ b/boards/variants/cb1s.c @@ -0,0 +1,57 @@ +/* This file was auto-generated from cb1s.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D1: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D5: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D10: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D11: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D12: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D13: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[4]), // GPIO0 (D4) + [1] = &(lt_arduino_pin_info_list[7]), // GPIO1 (D7) + [6] = &(lt_arduino_pin_info_list[2]), // GPIO6 (D2) + [7] = &(lt_arduino_pin_info_list[3]), // GPIO7 (D3) + [8] = &(lt_arduino_pin_info_list[6]), // GPIO8 (D6) + [9] = &(lt_arduino_pin_info_list[5]), // GPIO9 (D5) + [10] = &(lt_arduino_pin_info_list[1]), // GPIO10 (D1) + [11] = &(lt_arduino_pin_info_list[0]), // GPIO11 (D0) + [20] = &(lt_arduino_pin_info_list[11]), // GPIO20 (D11) + [21] = &(lt_arduino_pin_info_list[12]), // GPIO21 (D12) + [22] = &(lt_arduino_pin_info_list[13]), // GPIO22 (D13) + [23] = &(lt_arduino_pin_info_list[10]), // GPIO23 (D10) + [24] = &(lt_arduino_pin_info_list[8]), // GPIO24 (D8) + [26] = &(lt_arduino_pin_info_list[9]), // GPIO26 (D9) +}; +// clang-format on diff --git a/boards/variants/cb1s.h b/boards/variants/cb1s.h new file mode 100644 index 0000000..c652cb0 --- /dev/null +++ b/boards/variants/cb1s.h @@ -0,0 +1,104 @@ +/* This file was auto-generated from cb1s.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 14 // Total GPIO count +#define NUM_DIGITAL_PINS 14 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // 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_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#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_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#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 11u // GPIO11 +#define PIN_D1 10u // GPIO10 +#define PIN_D2 6u // GPIO6 +#define PIN_D3 7u // GPIO7 +#define PIN_D4 0u // GPIO0 +#define PIN_D5 9u // GPIO9 +#define PIN_D6 8u // GPIO8 +#define PIN_D7 1u // GPIO1 +#define PIN_D8 24u // GPIO24 +#define PIN_D9 26u // GPIO26 +#define PIN_D10 23u // GPIO23 +#define PIN_D11 20u // GPIO20 +#define PIN_D12 21u // GPIO21 +#define PIN_D13 22u // GPIO22 +#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; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; diff --git a/boards/variants/cblc5.c b/boards/variants/cblc5.c new file mode 100644 index 0000000..e0f4e18 --- /dev/null +++ b/boards/variants/cblc5.c @@ -0,0 +1,39 @@ +/* This file was auto-generated from cblc5.json using boardgen */ + +#include + +#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 diff --git a/boards/variants/cblc5.h b/boards/variants/cblc5.h new file mode 100644 index 0000000..b6f78f0 --- /dev/null +++ b/boards/variants/cblc5.h @@ -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; diff --git a/boards/variants/cbu.c b/boards/variants/cbu.c new file mode 100644 index 0000000..2ce39d5 --- /dev/null +++ b/boards/variants/cbu.c @@ -0,0 +1,72 @@ +/* This file was auto-generated from cbu.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D1: P16, SD_D0, MOSI + {GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D2: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D3: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D4: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, 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: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D10: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D11: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D12: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D13: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D14: P28, DN + {GPIO28, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D15: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D16: P17, SD_D1, MISO + {GPIO17, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D17: P15, SD_CMD, CS + {GPIO15, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D18: 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[9]), // GPIO6 (D9) + [7] = &(lt_arduino_pin_info_list[8]), // GPIO7 (D8) + [8] = &(lt_arduino_pin_info_list[7]), // GPIO8 (D7) + [9] = &(lt_arduino_pin_info_list[15]), // GPIO9 (D15) + [10] = &(lt_arduino_pin_info_list[13]), // GPIO10 (D13) + [11] = &(lt_arduino_pin_info_list[12]), // GPIO11 (D12) + [14] = &(lt_arduino_pin_info_list[0]), // GPIO14 (D0) + [15] = &(lt_arduino_pin_info_list[17]), // GPIO15 (D17) + [16] = &(lt_arduino_pin_info_list[1]), // GPIO16 (D1) + [17] = &(lt_arduino_pin_info_list[16]), // GPIO17 (D16) + [20] = &(lt_arduino_pin_info_list[2]), // GPIO20 (D2) + [21] = &(lt_arduino_pin_info_list[18]), // GPIO21 (D18) + [22] = &(lt_arduino_pin_info_list[3]), // GPIO22 (D3) + [23] = &(lt_arduino_pin_info_list[4]), // GPIO23 (D4) + [24] = &(lt_arduino_pin_info_list[11]), // GPIO24 (D11) + [26] = &(lt_arduino_pin_info_list[10]), // GPIO26 (D10) + [28] = &(lt_arduino_pin_info_list[14]), // GPIO28 (D14) +}; +// clang-format on diff --git a/boards/variants/cbu.h b/boards/variants/cbu.h new file mode 100644 index 0000000..6938958 --- /dev/null +++ b/boards/variants/cbu.h @@ -0,0 +1,123 @@ +/* This file was auto-generated from cbu.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 19 // Total GPIO count +#define NUM_DIGITAL_PINS 19 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 28 // 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_CS 15u // GPIO15 +#define PIN_MISO 17u // GPIO17 +#define PIN_MOSI 16u // GPIO16 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P14 14u // GPIO14 +#define PIN_P15 15u // GPIO15 +#define PIN_P16 16u // GPIO16 +#define PIN_P17 17u // GPIO17 +#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_P28 28u // GPIO28 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCK 14u // GPIO14 +#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 14u // GPIO14 +#define PIN_D1 16u // GPIO16 +#define PIN_D2 20u // GPIO20 +#define PIN_D3 22u // GPIO22 +#define PIN_D4 23u // GPIO23 +#define PIN_D5 1u // GPIO1 +#define PIN_D6 0u // GPIO0 +#define PIN_D7 8u // GPIO8 +#define PIN_D8 7u // GPIO7 +#define PIN_D9 6u // GPIO6 +#define PIN_D10 26u // GPIO26 +#define PIN_D11 24u // GPIO24 +#define PIN_D12 11u // GPIO11 +#define PIN_D13 10u // GPIO10 +#define PIN_D14 28u // GPIO28 +#define PIN_D15 9u // GPIO9 +#define PIN_D16 17u // GPIO17 +#define PIN_D17 15u // GPIO15 +#define PIN_D18 21u // GPIO21 +#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; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; +static const unsigned char D15 = PIN_D15; +static const unsigned char D16 = PIN_D16; +static const unsigned char D17 = PIN_D17; +static const unsigned char D18 = PIN_D18; diff --git a/boards/variants/generic-bk7252.c b/boards/variants/generic-bk7252.c index b7287a6..7c138dc 100644 --- a/boards/variants/generic-bk7252.c +++ b/boards/variants/generic-bk7252.c @@ -42,7 +42,7 @@ PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { {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 + // D17: P19, SD_D3 {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}, diff --git a/boards/variants/t102-v1.1.c b/boards/variants/t102-v1.1.c new file mode 100644 index 0000000..153748b --- /dev/null +++ b/boards/variants/t102-v1.1.c @@ -0,0 +1,42 @@ +/* This file was auto-generated from t102-v1.1.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D4: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D5: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D6: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D7: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D8: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[1]), // PA_0 (D1) + [5] = &(lt_arduino_pin_info_list[2]), // PA_5 (D2) + [12] = &(lt_arduino_pin_info_list[0]), // PA_12 (D0) + [14] = &(lt_arduino_pin_info_list[7]), // PA_14 (D7) + [15] = &(lt_arduino_pin_info_list[8]), // PA_15 (D8) + [18] = &(lt_arduino_pin_info_list[5]), // PA_18 (D5) + [23] = &(lt_arduino_pin_info_list[6]), // PA_23 (D6) + [29] = &(lt_arduino_pin_info_list[4]), // PA_29 (D4) + [30] = &(lt_arduino_pin_info_list[3]), // PA_30 (D3) +}; +// clang-format on diff --git a/boards/variants/t102-v1.1.h b/boards/variants/t102-v1.1.h new file mode 100644 index 0000000..845ef38 --- /dev/null +++ b/boards/variants/t102-v1.1.h @@ -0,0 +1,89 @@ +/* This file was auto-generated from t102-v1.1.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 9 // Total GPIO count +#define NUM_DIGITAL_PINS 9 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 0 // ADC inputs +#define NUM_ANALOG_OUTPUTS 8 // PWM & DAC outputs +#define PINS_GPIO_MAX 30 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL 29u // PA_29 +#define PIN_WIRE0_SDA 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 + +// Serial ports +// ------------ +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 + +// Pin function macros +// ------------------- +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM0 14u // PA_14 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 29u // PA_29 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL0 29u // PA_29 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA0 30u // PA_30 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 12u // PA_12 +#define PIN_D1 0u // PA_0 +#define PIN_D2 5u // PA_5 +#define PIN_D3 30u // PA_30 +#define PIN_D4 29u // PA_29 +#define PIN_D5 18u // PA_18 +#define PIN_D6 23u // PA_23 +#define PIN_D7 14u // PA_14 +#define PIN_D8 15u // PA_15 + +// 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; +static const unsigned char D8 = PIN_D8; diff --git a/boards/variants/t103-v1.0.c b/boards/variants/t103-v1.0.c new file mode 100644 index 0000000..a4cff7c --- /dev/null +++ b/boards/variants/t103-v1.0.c @@ -0,0 +1,51 @@ +/* This file was auto-generated from t103-v1.0.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D1: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D2: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D5: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D10: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[3]), // PA_0 (D3) + [5] = &(lt_arduino_pin_info_list[7]), // PA_5 (D7) + [12] = &(lt_arduino_pin_info_list[8]), // PA_12 (D8) + [14] = &(lt_arduino_pin_info_list[1]), // PA_14 (D1) + [15] = &(lt_arduino_pin_info_list[2]), // PA_15 (D2) + [18] = &(lt_arduino_pin_info_list[9]), // PA_18 (D9) + [19] = &(lt_arduino_pin_info_list[0]), // PA_19 (D0) + [22] = &(lt_arduino_pin_info_list[4]), // PA_22 (D4) + [23] = &(lt_arduino_pin_info_list[10]), // PA_23 (D10) + [29] = &(lt_arduino_pin_info_list[5]), // PA_29 (D5) + [30] = &(lt_arduino_pin_info_list[6]), // PA_30 (D6) + [41] = &(lt_arduino_pin_info_list[11]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/t103-v1.0.h b/boards/variants/t103-v1.0.h new file mode 100644 index 0000000..8a3ea9f --- /dev/null +++ b/boards/variants/t103-v1.0.h @@ -0,0 +1,126 @@ +/* This file was auto-generated from t103-v1.0.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 12 // Total GPIO count +#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 22u // PA_22 +#define PIN_WIRE0_SCL_1 29u // PA_29 +#define PIN_WIRE0_SDA_0 19u // PA_19 +#define PIN_WIRE0_SDA_1 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM0 23u // PA_23 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 5u // PA_5 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL0 29u // PA_29 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA0 30u // PA_30 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 19u // PA_19 +#define PIN_D1 14u // PA_14 +#define PIN_D2 15u // PA_15 +#define PIN_D3 0u // PA_0 +#define PIN_D4 22u // PA_22 +#define PIN_D5 29u // PA_29 +#define PIN_D6 30u // PA_30 +#define PIN_D7 5u // PA_5 +#define PIN_D8 12u // PA_12 +#define PIN_D9 18u // PA_18 +#define PIN_D10 23u // PA_23 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +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; diff --git a/boards/variants/wa2.c b/boards/variants/wa2.c new file mode 100644 index 0000000..9127c24 --- /dev/null +++ b/boards/variants/wa2.c @@ -0,0 +1,54 @@ +/* This file was auto-generated from wa2.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D4: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D5: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D6: P18, SD_D2, PWM4 + {GPIO18, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: P19, SD_D3, PWM5 + {GPIO19, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D9: P4, ADC1, DIN + {GPIO4, PIN_GPIO | PIN_IRQ | PIN_I2S, PIN_NONE, 0}, + // D10: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D11: P21, I2C1_SDA, TMS, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D12: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[10]), // GPIO0 (D10) + [4] = &(lt_arduino_pin_info_list[9]), // GPIO4 (D9) + [6] = &(lt_arduino_pin_info_list[2]), // GPIO6 (D2) + [7] = &(lt_arduino_pin_info_list[1]), // GPIO7 (D1) + [8] = &(lt_arduino_pin_info_list[0]), // GPIO8 (D0) + [10] = &(lt_arduino_pin_info_list[4]), // GPIO10 (D4) + [11] = &(lt_arduino_pin_info_list[5]), // GPIO11 (D5) + [18] = &(lt_arduino_pin_info_list[6]), // GPIO18 (D6) + [19] = &(lt_arduino_pin_info_list[7]), // GPIO19 (D7) + [20] = &(lt_arduino_pin_info_list[8]), // GPIO20 (D8) + [21] = &(lt_arduino_pin_info_list[11]), // GPIO21 (D11) + [22] = &(lt_arduino_pin_info_list[12]), // GPIO22 (D12) + [23] = &(lt_arduino_pin_info_list[3]), // GPIO23 (D3) +}; +// clang-format on diff --git a/boards/variants/wa2.h b/boards/variants/wa2.h new file mode 100644 index 0000000..6c12143 --- /dev/null +++ b/boards/variants/wa2.h @@ -0,0 +1,95 @@ +/* This file was auto-generated from wa2.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 13 // Total GPIO count +#define NUM_DIGITAL_PINS 13 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 5 // PWM & DAC outputs +#define PINS_GPIO_MAX 23 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_TX 0u // GPIO0 + +// Pin function macros +// ------------------- +#define PIN_ADC1 4u // GPIO4 +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P4 4u // GPIO4 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P18 18u // GPIO18 +#define PIN_P19 19u // GPIO19 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM4 18u // GPIO18 +#define PIN_PWM5 19u // GPIO19 +#define PIN_RX1 10u // GPIO10 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#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 SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 1 + +// Arduino pin names +// ----------------- +#define PIN_D0 8u // GPIO8 +#define PIN_D1 7u // GPIO7 +#define PIN_D2 6u // GPIO6 +#define PIN_D3 23u // GPIO23 +#define PIN_D4 10u // GPIO10 +#define PIN_D5 11u // GPIO11 +#define PIN_D6 18u // GPIO18 +#define PIN_D7 19u // GPIO19 +#define PIN_D8 20u // GPIO20 +#define PIN_D9 4u // GPIO4 +#define PIN_D10 0u // GPIO0 +#define PIN_D11 21u // GPIO21 +#define PIN_D12 22u // GPIO22 +#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; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; diff --git a/boards/variants/wb1s.c b/boards/variants/wb1s.c new file mode 100644 index 0000000..1a039f1 --- /dev/null +++ b/boards/variants/wb1s.c @@ -0,0 +1,48 @@ +/* This file was auto-generated from wb1s.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D1: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D2: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D5: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, 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[4]), // GPIO0 (D4) + [1] = &(lt_arduino_pin_info_list[7]), // GPIO1 (D7) + [6] = &(lt_arduino_pin_info_list[9]), // GPIO6 (D9) + [7] = &(lt_arduino_pin_info_list[6]), // GPIO7 (D6) + [8] = &(lt_arduino_pin_info_list[5]), // GPIO8 (D5) + [9] = &(lt_arduino_pin_info_list[8]), // GPIO9 (D8) + [10] = &(lt_arduino_pin_info_list[1]), // GPIO10 (D1) + [11] = &(lt_arduino_pin_info_list[0]), // GPIO11 (D0) + [23] = &(lt_arduino_pin_info_list[10]), // GPIO23 (D10) + [24] = &(lt_arduino_pin_info_list[3]), // GPIO24 (D3) + [26] = &(lt_arduino_pin_info_list[2]), // GPIO26 (D2) +}; +// clang-format on diff --git a/boards/variants/wb1s.h b/boards/variants/wb1s.h new file mode 100644 index 0000000..e68cd92 --- /dev/null +++ b/boards/variants/wb1s.h @@ -0,0 +1,90 @@ +/* This file was auto-generated from wb1s.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 6 // 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_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#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_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 11u // GPIO11 +#define PIN_D1 10u // GPIO10 +#define PIN_D2 26u // GPIO26 +#define PIN_D3 24u // GPIO24 +#define PIN_D4 0u // GPIO0 +#define PIN_D5 8u // GPIO8 +#define PIN_D6 7u // GPIO7 +#define PIN_D7 1u // GPIO1 +#define PIN_D8 9u // GPIO9 +#define PIN_D9 6u // GPIO6 +#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; diff --git a/boards/variants/wb2l-m1.c b/boards/variants/wb2l-m1.c new file mode 100644 index 0000000..6ec0255 --- /dev/null +++ b/boards/variants/wb2l-m1.c @@ -0,0 +1,54 @@ +/* This file was auto-generated from wb2l-m1.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D6: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D7: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D9: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D10: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D11: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D12: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[8]), // GPIO0 (D8) + [1] = &(lt_arduino_pin_info_list[7]), // GPIO1 (D7) + [6] = &(lt_arduino_pin_info_list[2]), // GPIO6 (D2) + [7] = &(lt_arduino_pin_info_list[1]), // GPIO7 (D1) + [8] = &(lt_arduino_pin_info_list[0]), // GPIO8 (D0) + [10] = &(lt_arduino_pin_info_list[5]), // GPIO10 (D5) + [11] = &(lt_arduino_pin_info_list[6]), // GPIO11 (D6) + [20] = &(lt_arduino_pin_info_list[9]), // GPIO20 (D9) + [21] = &(lt_arduino_pin_info_list[10]), // GPIO21 (D10) + [22] = &(lt_arduino_pin_info_list[12]), // GPIO22 (D12) + [23] = &(lt_arduino_pin_info_list[11]), // GPIO23 (D11) + [24] = &(lt_arduino_pin_info_list[4]), // GPIO24 (D4) + [26] = &(lt_arduino_pin_info_list[3]), // GPIO26 (D3) +}; +// clang-format on diff --git a/boards/variants/wb2l-m1.h b/boards/variants/wb2l-m1.h new file mode 100644 index 0000000..d9a0aff --- /dev/null +++ b/boards/variants/wb2l-m1.h @@ -0,0 +1,100 @@ +/* This file was auto-generated from wb2l-m1.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 13 // Total GPIO count +#define NUM_DIGITAL_PINS 13 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 5 // 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_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#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_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#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 8u // GPIO8 +#define PIN_D1 7u // GPIO7 +#define PIN_D2 6u // GPIO6 +#define PIN_D3 26u // GPIO26 +#define PIN_D4 24u // GPIO24 +#define PIN_D5 10u // GPIO10 +#define PIN_D6 11u // GPIO11 +#define PIN_D7 1u // GPIO1 +#define PIN_D8 0u // GPIO0 +#define PIN_D9 20u // GPIO20 +#define PIN_D10 21u // GPIO21 +#define PIN_D11 23u // GPIO23 +#define PIN_D12 22u // GPIO22 +#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; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; diff --git a/boards/variants/wblc5.c b/boards/variants/wblc5.c new file mode 100644 index 0000000..4aa1d92 --- /dev/null +++ b/boards/variants/wblc5.c @@ -0,0 +1,48 @@ +/* This file was auto-generated from wblc5.json using boardgen */ + +#include + +#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 diff --git a/boards/variants/wblc5.h b/boards/variants/wblc5.h new file mode 100644 index 0000000..256336a --- /dev/null +++ b/boards/variants/wblc5.h @@ -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; diff --git a/boards/variants/wr1.c b/boards/variants/wr1.c new file mode 100644 index 0000000..5e920bd --- /dev/null +++ b/boards/variants/wr1.c @@ -0,0 +1,48 @@ +/* This file was auto-generated from wr1.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D1: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D2: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D4: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D5: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D9: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[5]), // PA_0 (D5) + [5] = &(lt_arduino_pin_info_list[6]), // PA_5 (D6) + [14] = &(lt_arduino_pin_info_list[2]), // PA_14 (D2) + [15] = &(lt_arduino_pin_info_list[3]), // PA_15 (D3) + [18] = &(lt_arduino_pin_info_list[1]), // PA_18 (D1) + [19] = &(lt_arduino_pin_info_list[8]), // PA_19 (D8) + [22] = &(lt_arduino_pin_info_list[9]), // PA_22 (D9) + [23] = &(lt_arduino_pin_info_list[0]), // PA_23 (D0) + [29] = &(lt_arduino_pin_info_list[7]), // PA_29 (D7) + [30] = &(lt_arduino_pin_info_list[4]), // PA_30 (D4) + [41] = &(lt_arduino_pin_info_list[10]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/wr1.h b/boards/variants/wr1.h new file mode 100644 index 0000000..aee98f0 --- /dev/null +++ b/boards/variants/wr1.h @@ -0,0 +1,122 @@ +/* This file was auto-generated from wr1.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 11 // Total GPIO count +#define NUM_DIGITAL_PINS 10 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 8 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 29u // PA_29 +#define PIN_WIRE0_SCL_1 22u // PA_22 +#define PIN_WIRE0_SDA_0 30u // PA_30 +#define PIN_WIRE0_SDA_1 19u // PA_19 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM0 14u // PA_14 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM4 29u // PA_29 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL0 22u // PA_22 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA0 19u // PA_19 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 23u // PA_23 +#define PIN_D1 18u // PA_18 +#define PIN_D2 14u // PA_14 +#define PIN_D3 15u // PA_15 +#define PIN_D4 30u // PA_30 +#define PIN_D5 0u // PA_0 +#define PIN_D6 5u // PA_5 +#define PIN_D7 29u // PA_29 +#define PIN_D8 19u // PA_19 +#define PIN_D9 22u // PA_22 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +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; diff --git a/boards/variants/wr1e.c b/boards/variants/wr1e.c new file mode 100644 index 0000000..0403623 --- /dev/null +++ b/boards/variants/wr1e.c @@ -0,0 +1,48 @@ +/* This file was auto-generated from wr1e.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D1: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D2: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D4: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D5: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D9: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [5] = &(lt_arduino_pin_info_list[6]), // PA_5 (D6) + [12] = &(lt_arduino_pin_info_list[5]), // PA_12 (D5) + [14] = &(lt_arduino_pin_info_list[2]), // PA_14 (D2) + [15] = &(lt_arduino_pin_info_list[3]), // PA_15 (D3) + [18] = &(lt_arduino_pin_info_list[1]), // PA_18 (D1) + [19] = &(lt_arduino_pin_info_list[8]), // PA_19 (D8) + [22] = &(lt_arduino_pin_info_list[9]), // PA_22 (D9) + [23] = &(lt_arduino_pin_info_list[0]), // PA_23 (D0) + [29] = &(lt_arduino_pin_info_list[7]), // PA_29 (D7) + [30] = &(lt_arduino_pin_info_list[4]), // PA_30 (D4) + [41] = &(lt_arduino_pin_info_list[10]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/wr1e.h b/boards/variants/wr1e.h new file mode 100644 index 0000000..2a643d8 --- /dev/null +++ b/boards/variants/wr1e.h @@ -0,0 +1,122 @@ +/* This file was auto-generated from wr1e.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 11 // Total GPIO count +#define NUM_DIGITAL_PINS 10 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 8 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 29u // PA_29 +#define PIN_WIRE0_SCL_1 22u // PA_22 +#define PIN_WIRE0_SDA_0 30u // PA_30 +#define PIN_WIRE0_SDA_1 19u // PA_19 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM0 14u // PA_14 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 29u // PA_29 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL0 22u // PA_22 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA0 19u // PA_19 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 23u // PA_23 +#define PIN_D1 18u // PA_18 +#define PIN_D2 14u // PA_14 +#define PIN_D3 15u // PA_15 +#define PIN_D4 30u // PA_30 +#define PIN_D5 12u // PA_12 +#define PIN_D6 5u // PA_5 +#define PIN_D7 29u // PA_29 +#define PIN_D8 19u // PA_19 +#define PIN_D9 22u // PA_22 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +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; diff --git a/boards/wa2.json b/boards/wa2.json new file mode 100644 index 0000000..f71f872 --- /dev/null +++ b/boards/wa2.json @@ -0,0 +1,20 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231", + "beken-7231q", + "ic/bk7231q-qfn40", + "pcb/wa2", + "pcb/wa2-test" + ], + "build": { + "mcu": "bk7231q", + "variant": "wa2" + }, + "name": "WA2 Wi-Fi Module", + "url": "https://docs.libretiny.eu/boards/wa2/", + "vendor": "Tuya Inc.", + "pcb": { + "symbol": "WA2" + } +} diff --git a/boards/wb1s.json b/boards/wb1s.json new file mode 100644 index 0000000..f9097cb --- /dev/null +++ b/boards/wb1s.json @@ -0,0 +1,23 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/wb1s" + ], + "build": { + "mcu": "bk7231t", + "variant": "wb1s" + }, + "name": "WB1S Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wb1s?id=K9duevbj3ol4x", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WB1S" + }, + "pcb": { + "symbol": "WB1S" + } +} diff --git a/boards/wb2l-m1.json b/boards/wb2l-m1.json new file mode 100644 index 0000000..a0252fa --- /dev/null +++ b/boards/wb2l-m1.json @@ -0,0 +1,21 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/wb2l", + "pcb/wb2l-test", + "pcb/wb2l-m1-test" + ], + "build": { + "mcu": "bk7231n", + "variant": "wb2l-m1" + }, + "name": "WB2L_M1 Wi-Fi Module", + "url": "https://docs.libretiny.eu/boards/wb2l-m1/", + "vendor": "Tuya Inc.", + "pcb": { + "symbol": "WB2L_M1" + } +} diff --git a/boards/wb2l.json b/boards/wb2l.json index 69b3f7c..0652710 100644 --- a/boards/wb2l.json +++ b/boards/wb2l.json @@ -1,8 +1,9 @@ { "_base": [ "beken-72xx", - "beken-7231u", - "beken-7231t-tuya", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", "ic/bk7231-qfn32", "pcb/wb2l", "pcb/wb2l-test" diff --git a/boards/wb2s.json b/boards/wb2s.json index 1c85074..3f9966c 100644 --- a/boards/wb2s.json +++ b/boards/wb2s.json @@ -1,8 +1,9 @@ { "_base": [ "beken-72xx", - "beken-7231u", - "beken-7231t-tuya", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", "ic/bk7231-qfn32", "pcb/wb2s", "pcb/wb2s-test" diff --git a/boards/wb3l.json b/boards/wb3l.json index 34d0d2f..81711e4 100644 --- a/boards/wb3l.json +++ b/boards/wb3l.json @@ -1,8 +1,9 @@ { "_base": [ "beken-72xx", - "beken-7231u", - "beken-7231t-tuya", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", "ic/bk7231-qfn32", "pcb/wb3l" ], diff --git a/boards/wb3s.json b/boards/wb3s.json index 1e96809..cd50b81 100644 --- a/boards/wb3s.json +++ b/boards/wb3s.json @@ -1,8 +1,9 @@ { "_base": [ "beken-72xx", - "beken-7231u", - "beken-7231t-tuya", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", "ic/bk7231-qfn32", "pcb/wb3s" ], diff --git a/boards/wblc5.json b/boards/wblc5.json new file mode 100644 index 0000000..89ee151 --- /dev/null +++ b/boards/wblc5.json @@ -0,0 +1,21 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231", + "beken-7231t", + "beken-7231-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" + } +} diff --git a/boards/wr1.json b/boards/wr1.json new file mode 100644 index 0000000..62bcf8d --- /dev/null +++ b/boards/wr1.json @@ -0,0 +1,21 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/wr1" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "wr1" + }, + "name": "WR1 Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wifiwr1module?id=K9605tc0k90t3", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR1" + }, + "pcb": { + "symbol": "WR1" + } +} diff --git a/boards/wr1e.json b/boards/wr1e.json new file mode 100644 index 0000000..00421ae --- /dev/null +++ b/boards/wr1e.json @@ -0,0 +1,21 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/wr1e" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "wr1e" + }, + "name": "WR1E Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wr1e?id=K96smbbeycxtf", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR1E" + }, + "pcb": { + "symbol": "WR1E" + } +} diff --git a/builder/family/beken-72xx.py b/builder/family/beken-72xx.py index dc1038f..534a4e5 100644 --- a/builder/family/beken-72xx.py +++ b/builder/family/beken-72xx.py @@ -27,7 +27,7 @@ SOC_BK7271 = 4 SOC_BK7231N = 5 SOC_BK7236 = 6 SOC_NAMES = { - SOC_BK7231: "bk7231", + SOC_BK7231: "bk7231u", SOC_BK7231U: "bk7231u", SOC_BK7251: "bk7251", SOC_BK7271: "bk7271", @@ -98,13 +98,13 @@ queue.AppendPrivate( srcs_core = [] # Fix for BK7231T's bootloader compatibility -if board.get("build.bkboot_version") == "1.0.5-bk7231s": +if board.get("build.bkboot_version") in ["1.0.5-bk7231s", "bk7231q"]: # this has to be public, so that fixups/intc.c sees it queue.AppendPublic(CPPDEFINES=[("CFG_SUPPORT_BOOTLOADER", "1")]) queue.AddLibrary( name="bdk_boot", - base_dir="$FAMILY_DIR/base/fixups", - srcs=["+"], + base_dir="$CORES_DIR/beken-72xx/base/fixups", + srcs=["+"], ) else: srcs_core.append("+") @@ -216,7 +216,7 @@ queue.AddLibrary( "+", "+", "+", - "+", + SOC != SOC_BK7231 and "+", "+", "+", "+", @@ -320,7 +320,7 @@ queue.AddLibrary( ) # Sources - chip-specific drivers -if SOC in [SOC_BK7231U, SOC_BK7251]: +if SOC in [SOC_BK7231, SOC_BK7231U, SOC_BK7251]: queue.AddLibrary( name="bdk_driver_spi", base_dir=join(DRIVER_DIR, "spi"), @@ -486,7 +486,7 @@ queue.AppendPublic( "sensor", "usb", # "wpa", # this is compiled from func/hostapd_intf/hostapd_intf.c - f"ble_{SOC_NAMES[SOC]}", + SOC != SOC_BK7231 and f"ble_{SOC_NAMES[SOC]}", f"cal_{SOC_NAMES[SOC]}", f"rf_test_{SOC_NAMES[SOC]}", f"rf_use_{SOC_NAMES[SOC]}", diff --git a/builder/utils/libs-queue.py b/builder/utils/libs-queue.py index 0e611d8..ddca5a2 100644 --- a/builder/utils/libs-queue.py +++ b/builder/utils/libs-queue.py @@ -21,7 +21,7 @@ def add_base_dir( ): out = [] for expr in expressions: - if expr == False: + if expr == False or expr is None: # support '[cond] and [path]' logical expressions continue if expr[1] != "<" or expr[-1] != ">": @@ -39,6 +39,9 @@ def add_base_dir( def iter_expressions(expressions: List[str]) -> Generator[Tuple[str, str], None, None]: for expr in expressions: + if expr == False or expr is None: + # support '[cond] and [path]' logical expressions + continue if expr[1:2] != "<" or expr[-1:] != ">": yield ("+", expr) continue diff --git a/cores/beken-7231q/base/config/sys_config.h b/cores/beken-7231q/base/config/sys_config.h new file mode 100644 index 0000000..6f592e0 --- /dev/null +++ b/cores/beken-7231q/base/config/sys_config.h @@ -0,0 +1,105 @@ +#pragma once + +#define CFG_AIRKISS_TEST 0 +#define CFG_AP_MONITOR_COEXIST 0 +#define CFG_AP_SUPPORT_HT_IE 0 +#define CFG_BACKGROUND_PRINT 0 +#define CFG_BK_AWARE 0 +#define CFG_BK_AWARE_OUI "\xC8\x47\x8C" +#define CFG_EASY_FLASH 1 +#define CFG_ENABLE_BUTTON 0 +#define CFG_ENABLE_DEMO_TEST 0 +#define CFG_ENABLE_WPA_LOG 0 +#define CFG_GENERAL_DMA 1 +#define CFG_IEEE80211N 1 +#define CFG_IEEE80211W 0 +#define CFG_IPERF_TEST 0 +#define CFG_JTAG_ENABLE 0 +#define CFG_LESS_MEMERY_IN_RWNX 0 +#define CFG_MAC_PHY_BAPASS 1 +#define CFG_MSDU_RESV_HEAD_LEN 96 +#define CFG_MSDU_RESV_TAIL_LEN 16 +#define CFG_REAL_SDIO 0 +#define CFG_RELEASE_FIRMWARE 0 +#define CFG_RF_OTA_TEST 0 +#define CFG_RF_USER_BLE 0 +#define CFG_ROLE_LAUNCH 0 +#define CFG_RUNNING_PLATFORM SOC_PLATFORM +#define CFG_RWNX_QOS_MSDU 1 +#define CFG_RX_SENSITIVITY_TEST 1 +#define CFG_SARADC_CALIBRATE 0 +#define CFG_SDIO 0 +#define CFG_SDIO_TRANS 0 +#define CFG_SOC_NAME SOC_BK7231 +#define CFG_SUPPORT_BKREG 1 +#define CFG_SUPPORT_BLE 0 +#define CFG_SUPPORT_BSSID_CONNECT 0 +#define CFG_SUPPORT_CALIBRATION 1 +#define CFG_SUPPORT_MANUAL_CALI 1 +#define CFG_SUPPORT_OTA_HTTP 1 +#define CFG_SUPPORT_OTA_TFTP 0 +#define CFG_SUPPORT_TPC_PA_MAP 1 +#define CFG_SYS_REDUCE_NORMAL_POWER 0 +#define CFG_TCP_SERVER_TEST 0 +#define CFG_TX_EVM_TEST 1 +#define CFG_UART_DEBUG 0 +#define CFG_UART_DEBUG_COMMAND_LINE 1 +#define CFG_UDISK_MP3 0 +#define CFG_USB 0 +#define CFG_USE_AP_IDLE 0 +#define CFG_USE_AP_PS 0 +#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0 +#define CFG_USE_AUD_ADC 0 +#define CFG_USE_AUD_DAC 0 +#define CFG_USE_AUDIO 0 +#define CFG_USE_BLE_PS 0 +#define CFG_USE_CAMERA_INTF 0 +#define CFG_USE_DEEP_PS 1 +#define CFG_USE_DHCP 1 +#define CFG_USE_FAKERTC_PS 0 +#define CFG_USE_FTPD_UPGRADE 0 +#define CFG_USE_HSLAVE_SPI 0 +#define CFG_USE_LWIP_NETSTACK 1 +#define CFG_USE_MCU_PS 0 +#define CFG_USE_SDCARD_HOST 0 +#define CFG_USE_SPIDMA 0 +#define CFG_USE_STA_PS 1 +#define CFG_USE_TEMPERATURE_DETECT 0 +#define CFG_USE_TICK_CAL 0 +#define CFG_USE_UART1 0 +#define CFG_USE_USB_CHARGE 0 +#define CFG_USE_USB_HOST 0 +#define CFG_USE_WPA_29 1 +#define CFG_WFA_CERT 0 +#define CFG_WIFI_RAW_TX_CMD 0 +#define CFG_WIFI_SENSOR 0 +#define CFG_WLAN_FAST_CONNECT 0 +#define CFG_WPA_CTRL_IFACE 1 +#define CFG_WPA3 0 +#define CFG_XTAL_FREQUENCE CFG_XTAL_FREQUENCE_26M +#define CFG_XTAL_FREQUENCE_26M 26000000 +#define CFG_XTAL_FREQUENCE_40M 40000000 +#define CONFIG_APP_MP3PLAYER 0 +#define FPGA_PLATFORM 0 +#define OSMALLOC_STATISTICAL 0 +#define RF_USE_POLICY WIFI_DEFAULT_BLE_REQUEST +#define SOC_BK7221U 3 +#define SOC_BK7231 1 +#define SOC_BK7231N 5 +#define SOC_BK7231U 2 +#define SOC_PLATFORM 1 +#define THD_APPLICATION_PRIORITY 3 +#define THD_CORE_PRIORITY 2 +#define THD_EXTENDED_APP_PRIORITY 5 +#define THD_HOSTAPD_PRIORITY 5 +#define THD_INIT_PRIORITY 4 +#define THD_LWIP_PRIORITY 4 +#define THD_MEDIA_PRIORITY 4 +#define THD_RECONNECT_PRIORITY 4 +#define THD_UBG_PRIORITY 5 +#define THD_UMP3_PRIORITY 4 +#define THD_WPAS_PRIORITY 5 +#define THDD_KEY_SCAN_PRIORITY 7 +#define UART1_USE_FIFO_REC 0 +#define UART2_USE_FIFO_REC 0 +#define WIFI_DEFAULT_BLE_REQUEST 1 diff --git a/cores/beken-7231q/base/fixups/bk7231q.c b/cores/beken-7231q/base/fixups/bk7231q.c new file mode 100644 index 0000000..425e5bf --- /dev/null +++ b/cores/beken-7231q/base/fixups/bk7231q.c @@ -0,0 +1,26 @@ +/* Copyright (c) Kuba SzczodrzyƄski 2023-06-20. */ + +int ble_active = 0; +int ble_switch_mac_sleeped = 0; + +int wifi_notice_ble_status() { + return 0; +} + +int wn_txl_hd_pending_is_allow() { + return 1; +} + +int if_ble_sleep() { + return 1; +} + +void ble_switch_rf_to_wifi() {} + +int rwip_get_current_time() { + return 0; +} + +int rwip_get_next_target_time() { + return 0; +} diff --git a/cores/beken-7231q/base/fixups/bk7231q.h b/cores/beken-7231q/base/fixups/bk7231q.h new file mode 100644 index 0000000..9976210 --- /dev/null +++ b/cores/beken-7231q/base/fixups/bk7231q.h @@ -0,0 +1,19 @@ +/* Copyright (c) Kuba SzczodrzyƄski 2023-06-20. */ + +#pragma once + +#define GPIO_SD1_DMA_MODULE GPIO_SD_DMA_MODULE +#define SARADC_ADC_SATURATION_CFG (SARADC_BASE + 3 * 4) +#define SARADC_ADC_SAT_CTRL_MASK (0x3) +#define SARADC_ADC_DAT_AFTER_STA SARADC_ADC_DATA + +#define CMD_GET_SCTRL_RETETION 0xC123F48 +#define CMD_SET_SCTRL_RETETION 0xC123F49 + +inline void turnon_PA_in_temp_dect() {} + +inline void turnoff_PA_in_temp_dect() {} + +inline int if_ble_sleep() { + return 1; +} diff --git a/cores/beken-7231u/base/config/sys_config.h b/cores/beken-7231t/base/config/sys_config.h similarity index 100% rename from cores/beken-7231u/base/config/sys_config.h rename to cores/beken-7231t/base/config/sys_config.h diff --git a/cores/beken-72xx/arduino/src/wiring.c b/cores/beken-72xx/arduino/src/wiring.c index f6d7873..97c9dc0 100644 --- a/cores/beken-72xx/arduino/src/wiring.c +++ b/cores/beken-72xx/arduino/src/wiring.c @@ -2,10 +2,16 @@ #include "wiring_private.h" +#if LT_BK7231Q +#undef LT_MICROS_HIGH_RES +#define LT_MICROS_HIGH_RES 0 +#endif + #define TICKS_PER_US (CFG_XTAL_FREQUENCE / 1000 / 1000) #define US_PER_OVERFLOW (portTICK_PERIOD_MS * 1000) #define TICKS_PER_OVERFLOW (TICKS_PER_US * US_PER_OVERFLOW) +#if LT_MICROS_HIGH_RES static uint32_t getTicksCount() { // copied from bk_timer_ctrl(), for speeds uint32_t timeout = 0; @@ -17,6 +23,7 @@ static uint32_t getTicksCount() { } return REG_READ(TIMER0_2_READ_VALUE); } +#endif void delayMicroseconds(unsigned int us) { #if LT_MICROS_HIGH_RES @@ -50,10 +57,6 @@ unsigned long millis() { } unsigned long micros() { -#if (CFG_SOC_NAME == SOC_BK7231) -#error "Not implemented" -#endif - #if LT_MICROS_HIGH_RES static uint32_t lastMillis = 0; static uint32_t correctedMillis = 0; diff --git a/cores/beken-7231u/base/fixups/boot_handlers_105_bk7231s.S b/cores/beken-72xx/base/fixups/boot_handlers_bk7231u.S similarity index 100% rename from cores/beken-7231u/base/fixups/boot_handlers_105_bk7231s.S rename to cores/beken-72xx/base/fixups/boot_handlers_bk7231u.S diff --git a/cores/beken-72xx/base/fixups/clock_rtos.c b/cores/beken-72xx/base/fixups/clock_rtos.c index fb7596a..107cf46 100644 --- a/cores/beken-72xx/base/fixups/clock_rtos.c +++ b/cores/beken-72xx/base/fixups/clock_rtos.c @@ -12,7 +12,7 @@ #include "uart_pub.h" // from lt_config.h -#ifndef LT_MICROS_HIGH_RES +#if !defined(LT_MICROS_HIGH_RES) && !LT_BK7231Q #define LT_MICROS_HIGH_RES 1 #endif @@ -30,7 +30,7 @@ static void fclk_hdl(UINT8 param); void fclk_init(void) { #if (CFG_SOC_NAME == SOC_BK7231) - fclk_timer_hw_init(BK_PWM_TIMER_ID0); + fclk_timer_hw_init(BK_PWM_TIMER_ID3); #elif LT_MICROS_HIGH_RES fclk_timer_hw_init(BK_TIMER_ID0); #else @@ -51,7 +51,7 @@ static void fclk_timer_hw_init(BK_HW_TIMER_INDEX timer_id) { fclk_id = timer_id; if (fclk_id >= BK_PWM_TIMER_ID0) { // pwm timer pwm_param_t param; - param.channel = (fclk_id - PWM0); + param.channel = (fclk_id - BK_PWM_TIMER_ID0); param.cfg.bits.en = PWM_ENABLE; param.cfg.bits.int_en = PWM_INT_EN; param.cfg.bits.mode = PWM_TIMER_MODE; diff --git a/cores/beken-72xx/base/fixups/include.h b/cores/beken-72xx/base/fixups/include.h index ebff54e..85fa1aa 100644 --- a/cores/beken-72xx/base/fixups/include.h +++ b/cores/beken-72xx/base/fixups/include.h @@ -6,3 +6,7 @@ // force including fixups/generic.h, even by BDK/include.h #include "generic.h" + +#if CFG_SOC_NAME == SOC_BK7231 +#include "bk7231q.h" +#endif diff --git a/cores/common/base/lt_types.h b/cores/common/base/lt_types.h index ef27c29..acf7b62 100644 --- a/cores/common/base/lt_types.h +++ b/cores/common/base/lt_types.h @@ -22,7 +22,8 @@ typedef enum { F_RTL8710B = 0x22E0D6FC, // Realtek AmebaZ (realtek-ambz) F_RTL8720C = 0xE08F7564, // Realtek AmebaZ2 F_RTL8720D = 0x3379CFE2, // Realtek AmebaD - F_BK7231U = 0x675A40B0, // Beken 7231U/7231T + F_BK7231Q = 0xAFE81D49, // Beken 7231Q + F_BK7231T = 0x675A40B0, // Beken 7231T F_BK7231N = 0x7B3EF230, // Beken 7231N F_BK7251 = 0x6A82CC42, // Beken 7251/7252 F_BL60X = 0xDE1270B7, // Boufallo 602 @@ -46,7 +47,8 @@ typedef enum { RTL8720CF = CPU_MODEL(F_RTL8720C, 0xED), // 0xFB << 2 | 1 RTL8720CX = RTL8720CM, // Beken 72XX - BK7231T = CPU_MODEL(F_BK7231U, 0x1A), // *SCTRL_CHIP_ID = 0x7231a + BK7231Q = CPU_MODEL(F_BK7231Q, 0x31), // *SCTRL_CHIP_ID = 0x7231 + BK7231T = CPU_MODEL(F_BK7231T, 0x1A), // *SCTRL_CHIP_ID = 0x7231a BK7231N = CPU_MODEL(F_BK7231N, 0x1C), // *SCTRL_CHIP_ID = 0x7231c BK7252 = CPU_MODEL(F_BK7251, 0x00), // TODO BL2028N = BK7231N, diff --git a/docs/dev/config.md b/docs/dev/config.md index ac64f39..94950fb 100644 --- a/docs/dev/config.md +++ b/docs/dev/config.md @@ -116,7 +116,7 @@ Options for controlling default UART log output. ### Misc options - `LT_USE_TIME` (0) - enables implementation of `gettimeofday()` and `settimeofday()`; checks for `millis()` overflows periodically -- `LT_MICROS_HIGH_RES` (1) - count runtime microseconds using a high-resolution timer; disable if your application doesn't need `micros()` +- `LT_MICROS_HIGH_RES` (1) - count runtime microseconds using a high-resolution timer (if possible); disable if your application doesn't need `micros()` - `LT_AUTO_DOWNLOAD_REBOOT` (1) - automatically reboot into "download mode" after detecting a flashing protocol command; [read more](../flashing/tools/adr.md) ### Family feature config diff --git a/families.json b/families.json index 2d68612..f4d455a 100644 --- a/families.json +++ b/families.json @@ -51,12 +51,24 @@ "code": "bk72xxgen2", "description": "Beken 72xx (RISC-V & ARM)" }, - "beken-7231u": { + "beken-7231": { "parent": "beken-72xx-gen1", - "code": "bk7231u", - "description": "Beken 7231U/7231T", + "code": "bk7231", + "description": "Beken 7231" + }, + "beken-7231q": { + "parent": "beken-7231", + "code": "bk7231q", + "description": "Beken 7231Q", + "id": "0xAFE81D49", + "short_name": "BK7231Q" + }, + "beken-7231t": { + "parent": "beken-7231", + "code": "bk7231t", + "description": "Beken 7231T", "id": "0x675A40B0", - "short_name": "BK7231U" + "short_name": "BK7231T" }, "beken-7231n": { "parent": "beken-72xx-gen1",