Skip to content

Commit 05059fe

Browse files
authored
feat: add common net definitions to sel and include validation tests (#2094)
1 parent b98ce3d commit 05059fe

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

lib/sel/sel.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ type CommonNetNames =
8383
| "FLASH_N_HOLD"
8484
| "INT"
8585
| "N_INT"
86+
| "VBUS"
87+
| "SWCLK"
88+
| "USB_DM"
89+
| "USB_DP"
90+
| "QSPI_SS"
91+
| "XIN"
92+
| "XOUT"
93+
| "RUN"
94+
| "SWD"
95+
| `GPIO${Nums40}`
8696

8797
type TransistorSel = Record<`Q${Nums40}`, Record<TransistorPinNames, string>>
8898

tests/sel/sel-common-nets.test.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { sel } from "lib/sel"
2+
import { test, expect } from "bun:test"
3+
4+
test("sel.net.VBUS = net.VBUS", () => {
5+
expect(sel.net.VBUS).toBe("net.VBUS")
6+
})
7+
8+
test("sel.net.SWCLK = net.SWCLK", () => {
9+
expect(sel.net.SWCLK).toBe("net.SWCLK")
10+
})
11+
12+
test("sel.net.USB_DM = net.USB_DM", () => {
13+
expect(sel.net.USB_DM).toBe("net.USB_DM")
14+
})
15+
16+
test("sel.net.USB_DP = net.USB_DP", () => {
17+
expect(sel.net.USB_DP).toBe("net.USB_DP")
18+
})
19+
20+
test("sel.net.QSPI_SS = net.QSPI_SS", () => {
21+
expect(sel.net.QSPI_SS).toBe("net.QSPI_SS")
22+
})
23+
24+
test("sel.net.XIN = net.XIN", () => {
25+
expect(sel.net.XIN).toBe("net.XIN")
26+
})
27+
28+
test("sel.net.XOUT = net.XOUT", () => {
29+
expect(sel.net.XOUT).toBe("net.XOUT")
30+
})
31+
32+
test("sel.net.RUN = net.RUN", () => {
33+
expect(sel.net.RUN).toBe("net.RUN")
34+
})
35+
36+
test("sel.net.SWD = net.SWD", () => {
37+
expect(sel.net.SWD).toBe("net.SWD")
38+
})
39+
40+
test("sel.net.GPIO0 = net.GPIO0", () => {
41+
expect(sel.net.GPIO0).toBe("net.GPIO0")
42+
})
43+
44+
test("sel.net.GPIO28 = net.GPIO28", () => {
45+
expect(sel.net.GPIO28).toBe("net.GPIO28")
46+
})

0 commit comments

Comments
 (0)