gokul/usb3-sd-hub
Engineering draft: four-layer, computer-powered USB 3 hub with one USB-C host socket, two USB-C and two USB-A accessory sockets, and a full-size SD slot. Board and three schematic previews are available. Routing and production checks are incomplete; not fabrication ready.
- Version
- 0.1.5
- License
- MIT
- Stars
- 0
design/downstream-one-transmit.ts
import {
wire,
via,
offsetPath,
matchOnHorizontal,
halfCenterGapMm,
type NumericPath,
type Point,
} from "./paired-paths";
const centrePath: Point[] = [
{ x: -8.35, y: 6 },
{ x: -8.35, y: -3.3 },
{ x: -7.35, y: -4.3 },
{ x: 27.9, y: -4.3 },
{ x: 28.9, y: -3.3 },
{ x: 28.9, y: 1.4 },
];
function transmitPath(positive: boolean): NumericPath {
const launch = { x: -7.91, y: positive ? 7.3 : 6.3 };
const landing = { x: positive ? 29.25 : 28.55, y: 1.9 };
const muxPad = { x: positive ? 29.099948 : 28.699898, y: 2.800104 };
const offsetPoints = offsetPath({
points: centrePath,
offsetMm: positive ? halfCenterGapMm : -halfCenterGapMm,
});
const first = offsetPoints[0];
const last = offsetPoints.at(-1)!;
return {
connection: positive ? "C_D1_TXP.pin2" : "C_D1_TXN.pin2",
route: [
wire(launch, "top"),
via(launch, "top"),
wire(launch),
wire({ x: first.x, y: launch.y - Math.abs(first.x - launch.x) }),
...offsetPoints.map((point) => wire(point)),
wire({ x: last.x, y: landing.y - Math.abs(last.x - landing.x) }),
wire(landing),
via(landing, "bottom"),
wire(landing, "top"),
wire({ x: landing.x, y: 2.5 - Math.abs(muxPad.x - landing.x) }, "top"),
wire({ x: muxPad.x, y: 2.5 }, "top"),
wire(muxPad, "top"),
],
};
}
export const downstreamOneTransmitPaths = matchOnHorizontal({
paths: [transmitPath(true), transmitPath(false)],
startXsMm: [-2, 4, 10, 16, 22],
awayDirection: [-1, 1],
});