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-split-check.ts
// Fails if any two power nets share one connectivity net (a short as tsci's connectivity map sees it).
import { readFileSync } from "fs"
import { getFullConnectivityMapFromCircuitJson } from "circuit-json-to-connectivity-map"
const cj = JSON.parse(readFileSync(process.env.CJ ?? "dist/index/circuit.json", "utf8")), m = getFullConnectivityMapFromCircuitJson(cj)
const names = ["GND", "VIN_SYS", "V5V0", "V3V3", "V3V3_AON", "VBUS_IN"], seen = new Map<string, string>(); let bad = 0
for (const n of names) { const s = cj.find((e: any) => e.type === "source_net" && e.name === n); if (!s) continue
const k = m.getNetConnectedToId(s.source_net_id); if (k && seen.has(k)) { console.log(`SHORT: ${n} joined with ${seen.get(k)}`); bad++ } else if (k) seen.set(k, n) }
console.log(bad ? `${bad} power-net short(s)` : "power nets separate: OK")