MustafaMulla29/usb-pd-motherboard
4-layer USB-C PD hub motherboard with 20 V USB-C input, Linux T113-S3 computer, CH338F USB hub, four individually controlled 5–20 V PD outputs, USB data/camera ports, regulated rails, and hardware watchdog/E-stop safety interlock.
- Version
- 1.0.24
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone MustafaMulla29/usb-pd-motherboard # download the package files into ./usb-pd-motherboard
tsci add MustafaMulla29/usb-pd-motherboard # add it to your project as @tsci/MustafaMulla29.usb-pd-motherboardIn a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.
tools/net-groups-diff.ts
// Lists nets that share a connectivity net in this build but not in the reference build (= new shorts).
import { readFileSync } from "fs"
import { getFullConnectivityMapFromCircuitJson } from "circuit-json-to-connectivity-map"
const groups = (p: string) => { const cj = JSON.parse(readFileSync(p, "utf8")), m = getFullConnectivityMapFromCircuitJson(cj), g = new Map<string, string[]>()
for (const n of cj.filter((e: any) => e.type === "source_net")) { const k = m.getNetConnectedToId(n.source_net_id); if (!k) continue; g.set(k, [...(g.get(k) ?? []), n.name]) }
const pairOf = new Set<string>(); for (const v of g.values()) for (const a of v) for (const b of v) if (a < b) pairOf.add(a + "|" + b); return pairOf }
const a = groups(process.env.CJ ?? "dist/index/circuit.json"), b = groups(process.env.REF ?? "../motherboard/dist/index/circuit.json")
const extra = [...a].filter((x) => !b.has(x)); console.log(extra.length ? `NEW joined net pairs: ${extra.slice(0, 20).join(", ")}` : "no new joined nets vs reference: OK")