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
dist/index.js
PCB
Schematic
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
import { NormalComponent, Group, PlatedHole, SOLVERS, SchematicText, Board } from 'tscircuit';
import { SchematicTracePipelineSolver } from '@tscircuit/schematic-trace-solver';
import { AutoroutingPipelineSolver9_PreloadedTraceGraph } from '@tscircuit/capacity-autorouter';
import { Fragment as Fragment$1 } from 'react';
// Scoped compatibility fix for core #2841. core writes resolved millimetre
// numbers to display_offset_x/y, whose Circuit JSON contract requires strings.
// This repairs the renderer's metadata after native placement. Copper, connectivity,
// clearances and physical component positions are not changed.
const componentLayout = NormalComponent.prototype.doInitialPcbLayout;
NormalComponent.prototype.doInitialPcbLayout = function () {
componentLayout.call(this);
if (this._getBoard()?.name !== "USB_HUB_BOARD" || !this.pcb_component_id)
return;
const pcbComponent = this.root?.db.pcb_component.get(this.pcb_component_id);
if (!pcbComponent)
return;
this.root?.db.pcb_component.update(this.pcb_component_id, {
...(typeof pcbComponent.display_offset_x === "number"
? { display_offset_x: `${pcbComponent.display_offset_x}mm` }
: {}),
...(typeof pcbComponent.display_offset_y === "number"
? { display_offset_y: `${pcbComponent.display_offset_y}mm` }
: {}),
});
};
const groupLayout$1 = Group.prototype.doInitialPcbLayout;
Group.prototype.doInitialPcbLayout = function () {
groupLayout$1.call(this);
if (this._getBoard()?.name !== "USB_HUB_BOARD" || !this.pcb_group_id)
return;
const pcbGroup = this.root?.db.pcb_group.get(this.pcb_group_id);
if (!pcbGroup)
return;
this.root?.db.pcb_group.update(this.pcb_group_id, {
...(typeof pcbGroup.display_offset_x === "number"
? { display_offset_x: `${pcbGroup.display_offset_x}mm` }
: {}),
...(typeof pcbGroup.display_offset_y === "number"
? { display_offset_y: `${pcbGroup.display_offset_y}mm` }
: {}),
});
};
// Board assembly policy: reflow the SMT contacts, then solder connector stakes
// and USB-A pins separately. No stencil apertures on either side of PTH lands.
// The SDK currently inherits paste generation from the whole mixed footprint.
const inheritedIsSmt = PlatedHole.prototype._getIsSmt;
PlatedHole.prototype._getIsSmt = function () {
if (this._getBoard()?.name === "USB_HUB_BOARD")
return false;
return inheritedIsSmt.call(this);
};
// Signals are routed on top/bottom copper; the two inner ground references
// remain available for return currents. Through-via barrels occupy all four
// copper layers. Each two-wire phase uses a bounded search region. Copper obstacles and
// electrical constraints remain in the input; the output cannot leave this
// region. Obstacles wholly outside that region plus a 1 mm safety band cannot
// meet any in-bounds trace or via, and are excluded from the local search only.
// The remaining board connections use the full board and all its obstacles.
class CompactPairRouter extends AutoroutingPipelineSolver9_PreloadedTraceGraph {
boardBounds;
boardLayerCount;
constructor(srj, opts) {
const pairPoints = srj.connections.flatMap((connection) => connection.pointsToConnect);
const isSinglePair = srj.connections.length === 2 && srj.differentialPairs?.length === 1;
const marginMm = 6;
const bounds = isSinglePair && pairPoints.length === 4
? {
minX: Math.max(srj.bounds.minX, Math.min(...pairPoints.map((point) => point.x)) - marginMm),
maxX: Math.min(srj.bounds.maxX, Math.max(...pairPoints.map((point) => point.x)) + marginMm),
minY: Math.max(srj.bounds.minY, Math.min(...pairPoints.map((point) => point.y)) - marginMm),
maxY: Math.min(srj.bounds.maxY, Math.max(...pairPoints.map((point) => point.y)) + marginMm),
}
: srj.bounds;
const outerLayers = ["top", "bottom"];
super({
...srj,
bounds,
layerCount: 2,
allowBlindAndBuriedVias: false,
obstacles: srj.obstacles
.filter((obstacle) => {
if (!isSinglePair)
return true;
const obstacleRadius = Math.hypot(obstacle.width / 2, obstacle.height / 2) + 1;
return (obstacle.center.x + obstacleRadius >= bounds.minX &&
obstacle.center.x - obstacleRadius <= bounds.maxX &&
obstacle.center.y + obstacleRadius >= bounds.minY &&
obstacle.center.y - obstacleRadius <= bounds.maxY);
})
.map((obstacle) => ({
...obstacle,
layers: obstacle.layers.filter((layer) => outerLayers.includes(layer)),
}))
.filter((obstacle) => obstacle.layers.length > 0),
connections: srj.connections.map((connection) => ({
...connection,
pointsToConnect: connection.pointsToConnect.map((point) => point.layers
? {
...point,
layers: point.layers.filter((layer) => outerLayers.includes(layer)),
}
: point),
})),
}, opts);
this.boardBounds = srj.bounds;
this.boardLayerCount = srj.layerCount;
}
getOutputSimplifiedPcbTraces() {
return super
.getOutputSimplifiedPcbTraces()
.map((trace) => ({
...trace,
route: trace.route.map((point) => point.route_type === "via"
? { ...point, layers: ["top", "inner1", "inner2", "bottom"] }
: point),
}));
}
getOutputSimpleRouteJson() {
return {
...super.getOutputSimpleRouteJson(),
bounds: this.boardBounds,
layerCount: this.boardLayerCount,
};
}
}
// Use current published local solver packages, rather than the older copies
// bundled into core. This registry is the SDK's supported solver interface.
// The two bundles contain nominally distinct private solver types. Their
// public input/output interface is the same; keep the exported runtime registry.
Reflect.set(SOLVERS, "SchematicTracePipelineSolver", SchematicTracePipelineSolver);
Reflect.set(SOLVERS, "AutoroutingPipelineSolver9_PreloadedTraceGraph", CompactPairRouter);
Reflect.set(SchematicText.prototype, "doInitialSchematicLayout", function () {
if (this._getBoard()?.name !== "USB_HUB_BOARD" ||
this._parsedProps.fontSize !== 0.22 ||
!this.schematic_text_id)
return;
const note = this.root?.db.schematic_text.get(this.schematic_text_id);
if (!note)
return;
const projectedChipName = /^([A-Z][A-Z0-9_]+): /.exec(note.text)?.[1];
const projectedChip = projectedChipName
? this.getSubcircuit().selectOne(`.${projectedChipName}`)
: null;
const schematicComponentId = this.parent?.schematic_component_id ??
projectedChip?.schematic_component_id;
if (!schematicComponentId)
return;
const chip = this.root?.db.schematic_component.get(schematicComponentId);
if (!chip)
return;
this.root?.db.schematic_text.update(this.schematic_text_id, {
schematic_component_id: schematicComponentId,
position: {
x: chip.center.x,
y: chip.center.y - chip.size.height / 2 - 0.8,
},
});
});
// Scoped workaround for core #2845. Non-subcircuit schematic groups serialize a null
// subcircuit_id. Use the real enclosing subcircuit ID after native layout;
// positions, symbols, wires and electrical connectivity are unchanged.
const groupLayout = Group.prototype.doInitialSchematicLayout;
Group.prototype.doInitialSchematicLayout = function () {
groupLayout.call(this);
if (this._getBoard()?.name !== "USB_HUB_BOARD" || !this.schematic_group_id)
return;
const schematicGroup = this.root?.db.schematic_group.get(this.schematic_group_id);
const subcircuit_id = this.getSubcircuit().subcircuit_id;
if (!schematicGroup || schematicGroup.subcircuit_id || !subcircuit_id)
return;
this.root?.db.schematic_group.update(this.schematic_group_id, {
subcircuit_id,
});
};
const originalBoardLayout = Board.prototype.doInitialSchematicLayout;
Board.prototype.doInitialSchematicLayout = function () {
if (this.name !== "USB_HUB_BOARD" || this.root?.schematicDisabled) {
originalBoardLayout.call(this);
return;
}
const db = this.root?.db;
if (!db)
return;
for (const sheet of db.schematic_sheet.list()) {
const chips = db.schematic_component
.list()
.filter((chip) => chip.schematic_sheet_id === sheet.schematic_sheet_id);
// Put the controllers and connectors first, then the smaller support parts.
// Positions are derived from rendered symbol sizes, not authored schX/Y.
chips.sort((first, second) => second.size.height - first.size.height);
const placements = [];
const rowWidth = 84;
let cursorX = 0;
let cursorY = 0;
let rowHeight = 0;
for (const chip of chips) {
const reservedWidth = Math.max(8, chip.size.width + 6);
const reservedHeight = Math.max(3.5, chip.size.height + 3);
if (cursorX > 0 && cursorX + reservedWidth > rowWidth) {
cursorY -= rowHeight;
cursorX = 0;
rowHeight = 0;
}
placements.push({
chip,
x: cursorX + reservedWidth / 2,
y: cursorY - reservedHeight / 2,
});
cursorX += reservedWidth;
rowHeight = Math.max(rowHeight, reservedHeight);
}
const drawingHeight = -cursorY + rowHeight;
for (const placement of placements) {
const center = {
x: placement.x - rowWidth / 2,
y: placement.y + drawingHeight / 2,
};
const deltaX = center.x - placement.chip.center.x;
const deltaY = center.y - placement.chip.center.y;
db.schematic_component.update(placement.chip.schematic_component_id, {
center,
});
for (const port of db.schematic_port.list({
schematic_component_id: placement.chip.schematic_component_id,
})) {
db.schematic_port.update(port.schematic_port_id, {
center: { x: port.center.x + deltaX, y: port.center.y + deltaY },
});
}
for (const text of db.schematic_text.list({
schematic_component_id: placement.chip.schematic_component_id,
})) {
db.schematic_text.update(text.schematic_text_id, {
position: {
x: text.position.x + deltaX,
y: text.position.y + deltaY,
},
});
}
}
}
};
// These are manufactured PCB features, not parts to buy or assemble.
// An explicit owner keeps fiducial and silkscreen records valid in Circuit JSON.
const BoardMarkings = () => (jsxs(Fragment, { children: [[
[-39, 29],
[39, 29],
[39, -29],
].map(([x, y], index) => (jsx(Fragment$1, { children: jsx("chip", { name: `FID${index + 1}`, pcbX: `${x}mm`, pcbY: `${y}mm`, doNotPlace: true, noSchematicRepresentation: true, footprint: jsxs("footprint", { children: [jsx("fiducial", { name: "target", padDiameter: 1, pcbX: "0mm", pcbY: "0mm" }), jsx("pcbsoldermaskopening", { shape: "circle", radius: 1, pcbX: "0mm", pcbY: "0mm", layer: "top" })] }) }) }, index))), jsx("chip", { name: "BOARD_MARKINGS", pcbX: "0mm", pcbY: "0mm", doNotPlace: true, noSchematicRepresentation: true, obstructsWithinBounds: false, footprint: jsxs("footprint", { children: [jsx("silkscreentext", { text: "USB 5Gbps + SD", pcbX: "9mm", pcbY: "-30mm", fontSize: 1 }), jsx("silkscreentext", { text: "HOST", pcbX: "-30mm", pcbY: "26mm", fontSize: 0.9 }), jsx("silkscreentext", { text: "POWER", pcbX: "-25mm", pcbY: "1mm", fontSize: 0.7 }), jsx("silkscreentext", { text: "SD", pcbX: "-36mm", pcbY: "-5mm", fontSize: 0.7 })] }) })] }));
// Explicit board coordinates, verified against complete component courtyards.
const positions = {
J_A1: [5.5, 21.5],
J_A2: [23, 21.5],
J_C1: [38, 0],
J_C2: [38, -15],
J_HOST: [-38, 19],
J_SD: [-26, -17.5],
U_33_REG: [-10, 26],
U_ATTACH_AND: [15, -7],
U_ATTACH_INV: [15, -2],
U_C1_MUX: [28.5, 4],
U_C4_MUX: [29, -13],
U_CORE_REG: [-24, 30],
U_HUB: [0, 5],
U_HUB_FLASH: [13, -21],
U_INPUT_LIMIT: [-29, 20],
U_P1_SW: [22, 0],
U_P2_SW: [12, 14],
U_P3_SW: [26, 14],
U_P4_SW: [22, -15],
U_POWER_LOGIC: [-18, 24],
U_RESET: [-12, 16],
U_SD: [-4, -17],
U_SD_EEPROM: [7, -23],
U_SD_POWER: [-7.25, -5.4],
U_SD_RESET: [5, -29],
U_UP_MUX: [-25, 11],
C_33_OUT: [-4.9, 30],
C_CORE_OUT: [-16, 29],
C_P1_OUT: [23, -7.5],
C_P2_OUT: [14, 6.5],
C_P3_OUT: [36, 13],
C_P4_OUT: [23, -25],
L_33: [-6, 26],
L_CORE: [-22.75, 26.25],
Y_HUB: [-10, 12],
Y_SD: [-4, -10.8],
D_A2_1: [5, 17.2],
D_A2_2: [6.8, 17.2],
D_A2_3: [8.6, 17.2],
D_A2_4: [10.4, 17.2],
D_A2_5: [5, 15.9],
D_A2_6: [6.8, 15.9],
D_A3_1: [21, 17.2],
D_A3_2: [22.8, 17.2],
D_A3_3: [24.6, 17.2],
D_A3_4: [26.4, 17.2],
D_A3_5: [21, 15.9],
D_A3_6: [22.8, 15.9],
D_C1_1: [26.5, 0],
D_C1_10: [30.1, -1.3],
D_C1_11: [30.1, -2.6],
D_C1_12: [30.1, -3.9],
D_C1_2: [26.5, -1.3],
D_C1_3: [26.5, -2.6],
D_C1_4: [24.75, -3.15],
D_C1_5: [28.3, 0],
D_C1_6: [28.3, -1.3],
D_C1_7: [28.3, -2.6],
D_C1_8: [28.8, -5.4],
D_C1_9: [30.1, 0],
D_C4_1: [26.5, -15.5],
D_C4_10: [30.1, -16.3],
D_C4_11: [30.1, -17.6],
D_C4_12: [30.1, -18.9],
D_C4_2: [26.5, -16.8],
D_C4_3: [26.5, -18.1],
D_C4_4: [26.5, -19.4],
D_C4_5: [28.3, -15.5],
D_C4_6: [28.3, -16.8],
D_C4_7: [28.3, -18.1],
D_C4_8: [28.3, -19.4],
D_C4_9: [30.1, -10.5],
D_HOST_1: [-34, 12],
D_HOST_10: [-30.4, 10.7],
D_HOST_11: [-30.4, 9.4],
D_HOST_12: [-30.4, 8.1],
D_HOST_2: [-34, 10.7],
D_HOST_3: [-34, 9.4],
D_HOST_4: [-34, 8.1],
D_HOST_5: [-32.2, 12],
D_HOST_6: [-32.2, 10.7],
D_HOST_7: [-32.2, 9.4],
D_HOST_8: [-32.2, 8.1],
D_HOST_9: [-30.4, 12],
D_SD_1: [-29, 1.3],
D_SD_2: [-27.2, 1.3],
D_SD_3: [-25.4, 1.3],
D_SD_4: [-23.6, 1.3],
D_SD_5: [-29, 0],
D_SD_6: [-27.2, 0],
C_33_IN: [-13.75, 24],
C_ATTACH_AND: [10.5, -7],
C_ATTACH_INV: [10.5, -4.5],
C_CARD: [-16, 0],
C_CARD_HF: [-20, 1.5],
C_CORE_IN: [-28, 30],
C_D1_33: [27, 8.5],
C_D1_5: [24.75, 8.5],
C_D1_TXN: [-7.4, 6.3],
C_D1_TXP: [-7.4, 7.3],
C_D2_TXN: [-2.6, -2.4],
C_D2_TXP: [-3.6, -2.4],
C_D3_TXN: [0.3, -2.4],
C_D3_TXP: [-0.7, -2.4],
C_D4_33: [24.5, -17.5],
C_D4_5: [24.5, -18.75],
C_D4_TXN: [3.5, -2.4],
C_D4_TXP: [2.5, -2.4],
C_EEP: [8, -14],
C_FLASH: [11, -14.5],
C_HOST: [-29, 23],
C_HUB_10: [-9.5, 6.2],
C_HUB_17: [-8, 3.4],
C_HUB_2: [-8, 9.4],
C_HUB_26: [-4.8, -2.4],
C_HUB_27: [-5.85, -2.4],
C_HUB_32: [-1.65, -2.4],
C_HUB_39: [1.4, -2.4],
C_HUB_42: [1.4, -4.5],
C_HUB_47: [5.6, -2.4],
C_HUB_5: [-9.5, 8.2],
C_HUB_54: [8, 1.4],
C_HUB_59: [8, 3.4],
C_HUB_64: [8, 5.4],
C_HUB_72: [8, 8.6],
C_HUB_78: [3, 15],
C_HUB_83: [1.75, 13],
C_HUB_90: [-0.8, 13],
C_HUB_93: [-5.25, 15.05],
C_HUB_98: [-5.25, 13],
C_HUB_X1: [-15.25, 14],
C_HUB_X2: [-14, 12.8],
C_P1_IN: [19, -3.25],
C_P2_IN: [7.7, 14],
C_P3_IN: [23.25, 11.5],
C_P4_IN: [17.7, -15],
C_POWER_LOGIC: [-18, 21],
C_RESET: [-14, 19],
C_SD_12: [-9.1, -19.75],
C_SD_16: [-5.25, -22.1],
C_SD_18: [-7.5, -22],
C_SD_25: [-1.3, -22.1],
C_SD_26: [0.85, -22.1],
C_SD_33A: [-1, -7],
C_SD_33B: [-8, -31],
C_SD_34: [1.1, -15.25],
C_SD_41: [-0.75, -11.9],
C_SD_48: [-7.25, -11.9],
C_SD_5: [-9.1, -16.25],
C_SD_IN: [-8.9, -10],
C_SD_MAIN: [-8, -27.5],
C_SD_PLL: [-0.75, -10.25],
C_SD_RESET: [1.75, -27],
C_SD_X1: [-7.25, -8.8],
C_SD_X2: [-0.75, -9.05],
C_UP_33: [-24, 7.5],
C_UP_5: [-26.25, 7.5],
C_UP_TXN: [-3.9, 13.0],
C_UP_TXP: [-2.9, 13.0],
C_VBUS: [-24.75, 22.75],
LED_CARD_PRESENT: [-33, 0],
LED_P1: [39, 8],
LED_P2: [0.25, 15],
LED_P3: [40, 19],
LED_P4: [39, -23],
LED_POWER: [-24, 3],
LED_SD_POWER: [-36, 3],
Q_ILIM_CC: [-35, 29],
Q_ILIM_SS: [-30, 27],
R_33_FB1: [-8, 23],
R_33_FB2: [-10.25, 23],
R_BC_DISABLE: [12, 2],
R_CARD_CD: [-35, 1.5],
R_CARD_LED: [-36, 0],
R_CARD_WP: [-32.75, 1.5],
R_CORE_FB1: [-20.25, 21],
R_CORE_FB2: [-26.25, 27],
R_CORE_PG: [-26.25, 25.75],
R_D1_DIR: [29, -7],
R_D1_ID: [31.25, -7],
R_D1_SENSE: [33.5, -7],
R_D4_DIR: [29, -22],
R_D4_ID: [31.25, -22],
R_D4_SENSE: [33.5, -22],
R_EEP_SCL: [5.75, -14],
R_EEP_SDA: [3.5, -14],
R_HOST_CURRENT: [-21.75, 23.25],
R_HOST_CURRENT3: [-22.5, 21],
R_HOST_DIR: [-21, 11],
R_HOST_SPEED: [-19.25, 26.5],
R_HUB_BIAS: [-12, 8.5],
R_HUB_CFG: [-11.5, 6],
R_ILIM_BASE: [-27, 16],
R_ILIM_LOW: [-31, 16],
R_ILIM_MID: [-29, 14.75],
R_INPUT_FAULT: [-24.75, 17],
R_LED_P1: [35.7, 8],
R_LED_P2: [-2.55, 15],
R_LED_P3: [36.7, 19],
R_LED_P4: [35.7, -23],
R_LED_POWER: [-27.3, 3],
R_LED_SD_POWER: [-39.3, 3],
R_NON_REM: [12, 0.5],
R_P1_CTRL: [21.25, -3.25],
R_P1_ILIM: [18.5, -2],
R_P2_CTRL: [7.7, 12.5],
R_P2_ILIM: [9, 11],
R_P3_CTRL: [21.7, 13.5],
R_P3_ILIM: [20.95, 12.25],
R_P4_CTRL: [17.7, -16.5],
R_P4_ILIM: [19, -18],
R_PULL_SD_CMD: [-20, -0.5],
R_PULL_SD_D0: [-28, 5],
R_PULL_SD_D1: [-25.75, 5],
R_PULL_SD_D2: [-23.5, 5],
R_PULL_SD_D3: [-21.25, 4],
R_RESET: [-11.75, 19],
R_SD_BIAS: [-3.75, -8.25],
R_SD_CLK: [-12, 0],
R_SD_CTRL: [-9.5, 0],
R_SD_ILIM: [-6.65, -7.75],
R_SD_RESET: [-0.5, -27.25],
R_SD_VBUS1: [1.5, -10],
R_SD_VBUS2: [1.5, -8.75],
R_SMB_SCL: [9, -2.5],
R_SMB_SDA: [9, -1],
R_UP_VSENSE: [-21, 9],
R_VBUS_DET1: [-11, 4.5],
R_VBUS_DET2: [-11, 3],
};
const placementFor = (name) => {
const position = name ? positions[name] : undefined;
return position ? { pcbX: `${position[0]}mm`, pcbY: `${position[1]}mm` } : {};
};
const coordinatesFor = (name) => {
const position = positions[name];
if (!position)
throw new Error(`Unknown component: ${name}`);
return position;
};
const GroundVias = () => (jsxs(Fragment, { children: [[
[-5.7, 11.6],
[-25.8, 8.7],
[-22, 8.2],
[-2.1, 14.2],
[-4.7, 13.8],
[-7.9, 8.5],
[27.6, 1.5],
[31.2, 1.4],
[-10, 6.1],
[-9.6, 3.8],
[1.8, -7.5],
[5.4, -8.5],
[28.8, -15.8],
[30.6, -16.3],
[31.8, -15.5],
].map(([x, y], index) => (jsx(Fragment$1, { children: jsx("via", { name: `V_RETURN_${index + 1}`, pcbX: x, pcbY: y, outerDiameter: 0.6, holeDiameter: 0.3, layers: ["top", "inner1", "inner2", "bottom"], connectsTo: "net.GND", tented: "both_sides" }) }, `return-${index}`))), jsx("via", { name: "V_RETURN_CENTRE", pcbX: 29.5, pcbY: 0.8, outerDiameter: 0.45, holeDiameter: 0.2, layers: ["top", "inner1", "inner2", "bottom"], connectsTo: "net.GND", tented: "both_sides" }), jsx("via", { name: "V_RETURN_C4_CENTRE", pcbX: 3.6, pcbY: -9.6, outerDiameter: 0.45, holeDiameter: 0.2, layers: ["top", "inner1", "inner2", "bottom"], connectsTo: "net.GND", tented: "both_sides" }), Array.from({ length: 36 }, (_, index) => (jsx(Fragment$1, { children: jsx("via", { name: `V_HUB_${index + 1}`, pcbX: coordinatesFor("U_HUB")[0] + ((index % 6) - 2.5) * 1.2, pcbY: coordinatesFor("U_HUB")[1] + (Math.floor(index / 6) - 2.5) * 1.2, outerDiameter: 0.6, holeDiameter: 0.33, layers: ["top", "inner1", "inner2", "bottom"], connectsTo: "net.GND", tented: "bottom_tented" }) }, index))), Array.from({ length: 16 }, (_, index) => (jsx(Fragment$1, { children: jsx("via", { name: `V_SD_${index + 1}`, pcbX: coordinatesFor("U_SD")[0] + ((index % 4) - 1.5) * 1.2, pcbY: coordinatesFor("U_SD")[1] + (Math.floor(index / 4) - 1.5) * 1.2, outerDiameter: 0.6, holeDiameter: 0.33, layers: ["top", "inner1", "inner2", "bottom"], connectsTo: "net.GND", tented: "bottom_tented" }) }, index))), ["U_UP_MUX", "U_C1_MUX", "U_C4_MUX", "U_CORE_REG", "U_33_REG"].map((name, index) => (jsx(Fragment$1, { children: jsx("via", { name: `V_THERMAL_${index + 1}`, ...placementFor(name), outerDiameter: 0.6, holeDiameter: 0.3, layers: ["top", "inner1", "inner2", "bottom"], connectsTo: "net.GND", tented: "bottom_tented" }) }, name)))] }));
const traceWidthMm$1 = 0.136;
const halfCenterGapMm$1 = (traceWidthMm$1 + 0.15) / 2;
function wire$1(point, layer = "bottom") {
return { ...point, route_type: "wire", width: traceWidthMm$1, layer };
}
function via$1(point, fromLayer) {
return {
...point,
route_type: "via",
from_layer: fromLayer,
to_layer: fromLayer === "top" ? "bottom" : "top",
via_diameter: 0.45,
via_hole_diameter: 0.2,
};
}
// Intersect the adjacent offset lines. The centre path contains straight/45-degree
// segments; miter offsets retain the same 0.286 mm perpendicular centre spacing.
function offsetPath({ points, offsetMm, }) {
const segments = points.slice(1).map((end, index) => {
const start = points[index];
const dx = end.x - start.x;
const dy = end.y - start.y;
const length = Math.hypot(dx, dy);
if (length === 0)
throw new Error("Duplicate centre-path point");
return {
start: {
x: start.x + (dy / length) * offsetMm,
y: start.y - (dx / length) * offsetMm,
},
end: {
x: end.x + (dy / length) * offsetMm,
y: end.y - (dx / length) * offsetMm,
},
dx,
dy,
};
});
return [
segments[0].start,
...segments.slice(1).map((next, index) => {
const previous = segments[index];
const determinant = previous.dx * next.dy - previous.dy * next.dx;
if (Math.abs(determinant) < 1e-9)
return previous.end;
const fraction = ((next.start.x - previous.start.x) * next.dy -
(next.start.y - previous.start.y) * next.dx) /
determinant;
return {
x: previous.start.x + fraction * previous.dx,
y: previous.start.y + fraction * previous.dy,
};
}),
segments.at(-1).end,
];
}
function copperLengthMm(path) {
return path.route.slice(1).reduce((sum, end, index) => {
const start = path.route[index];
return (sum +
(start.route_type === "wire" &&
end.route_type === "wire" &&
start.layer === end.layer
? Math.hypot(end.x - start.x, end.y - start.y)
: 0));
}, 0);
}
// Spread compensation over separated, short excursions. Every excursion must be
// checked for coupling and clearance on the complete board after it is inserted.
function matchOnHorizontal({ paths, startXsMm, awayDirection, }) {
const lengths = paths.map(copperLengthMm);
const shorterIndex = lengths[0] < lengths[1] ? 0 : 1;
const differenceMm = Math.abs(lengths[0] - lengths[1]);
if (differenceMm <= 0.1)
return paths;
const count = Math.max(1, Math.ceil(differenceMm / 0.8));
if (count > startXsMm.length)
throw new Error("Not enough clear compensation regions");
const cornerMm = 0.1;
const depthMm = (differenceMm / count + 4 * cornerMm * (2 - Math.SQRT2)) / 2;
return paths.map((path, index) => {
if (index !== shorterIndex)
return path;
const starts = startXsMm.slice(0, count);
const endIndex = path.route.findIndex((point, routeIndex) => {
const previous = path.route[routeIndex - 1];
return (previous?.route_type === "wire" &&
point.route_type === "wire" &&
point.layer === "bottom" &&
previous.layer === "bottom" &&
Math.abs(point.y - previous.y) < 1e-8 &&
previous.x < starts[0] &&
point.x > starts.at(-1) + 0.7);
});
if (endIndex < 0)
throw new Error("Horizontal compensation region missing");
const y = path.route[endIndex].y;
const direction = awayDirection[index];
const compensation = starts.flatMap((x) => [
wire$1({ x, y }),
wire$1({ x: x + 0.1, y: y + direction * cornerMm }),
wire$1({ x: x + 0.1, y: y + direction * (depthMm - cornerMm) }),
wire$1({ x: x + 0.2, y: y + direction * depthMm }),
wire$1({ x: x + 0.5, y: y + direction * depthMm }),
wire$1({ x: x + 0.6, y: y + direction * (depthMm - cornerMm) }),
wire$1({ x: x + 0.6, y: y + direction * cornerMm }),
wire$1({ x: x + 0.7, y }),
]);
return {
...path,
route: [
...path.route.slice(0, endIndex),
...compensation,
...path.route.slice(endIndex),
],
};
});
}
const transmitTop = [
{ x: 3, y: -3.5 },
{ x: 3, y: -6.8 },
];
const transmitBottom = [
{ x: 3, y: -8 },
{ x: 3, y: -10.2 },
{ x: 4, y: -11.2 },
{ x: 29.65, y: -11.2 },
{ x: 31, y: -12.55 },
{ x: 29.55, y: -14 },
{ x: 29.55, y: -14.3 },
];
const receiveTop = [
{ x: 4.2, y: -1.6 },
{ x: 4.2, y: -7.8 },
];
const receiveBottom = [
{ x: 4.2, y: -9 },
{ x: 4.2, y: -9.1 },
{ x: 5.2, y: -10.1 },
{ x: 31, y: -10.1 },
{ x: 32, y: -11.1 },
{ x: 32, y: -13.2 },
{ x: 30.65, y: -14.55 },
{ x: 30.65, y: -14.85 },
];
function transmitPath$1(positive) {
const offsetMm = positive ? halfCenterGapMm$1 : -halfCenterGapMm$1;
const capPad = { x: positive ? 2.5 : 3.5, y: -2.91 };
const firstVia = { x: positive ? 2.65 : 3.35, y: -7.5 };
const landing = { x: positive ? 29.2 : 29.9, y: -14.8 };
const muxPad = { x: positive ? 29.199898 : 29.599948, y: -14.199896 };
const top = offsetPath({ points: transmitTop, offsetMm });
const bottom = offsetPath({ points: transmitBottom, offsetMm });
const first = top[0];
const last = top.at(-1);
const bottomLast = bottom.at(-1);
return {
connection: positive ? "C_D4_TXP.pin2" : "C_D4_TXN.pin2",
route: [
wire$1(capPad, "top"),
wire$1({ x: first.x, y: capPad.y - Math.abs(first.x - capPad.x) }, "top"),
...top.map((point) => wire$1(point, "top")),
wire$1({ x: last.x, y: firstVia.y + Math.abs(last.x - firstVia.x) }, "top"),
wire$1(firstVia, "top"),
via$1(firstVia, "top"),
wire$1(firstVia),
...bottom.map((point) => wire$1(point)),
wire$1({
x: bottomLast.x,
y: landing.y + Math.abs(bottomLast.x - landing.x),
}),
wire$1(landing),
via$1(landing, "bottom"),
wire$1(landing, "top"),
wire$1({ x: landing.x, y: -14.45 - Math.abs(muxPad.x - landing.x) }, "top"),
wire$1({ x: muxPad.x, y: -14.45 }, "top"),
wire$1(muxPad, "top"),
],
};
}
function receivePath$1(positive) {
const offsetMm = positive ? halfCenterGapMm$1 : -halfCenterGapMm$1;
const hubPad = { x: positive ? 4 : 4.4, y: -0.85 };
const firstVia = { x: positive ? 3.85 : 4.55, y: -8.5 };
const landing = { x: positive ? 30.4 : 31.1, y: -15.35 };
const muxPad = {
x: positive ? 30.400048 : 30.8000472,
y: positive ? -14.199896 : -14.2000992,
};
const top = offsetPath({ points: receiveTop, offsetMm });
const bottom = offsetPath({ points: receiveBottom, offsetMm });
const first = top[0];
const last = top.at(-1);
const bottomLast = bottom.at(-1);
return {
connection: positive ? "U_HUB.D4_RXP" : "U_HUB.D4_RXN",
route: [
wire$1(hubPad, "top"),
wire$1({ x: hubPad.x, y: first.y + Math.abs(first.x - hubPad.x) }, "top"),
...top.map((point) => wire$1(point, "top")),
wire$1({ x: last.x, y: firstVia.y + Math.abs(last.x - firstVia.x) }, "top"),
wire$1(firstVia, "top"),
via$1(firstVia, "top"),
wire$1(firstVia),
...bottom.map((point) => wire$1(point)),
wire$1({
x: bottomLast.x,
y: landing.y + Math.abs(bottomLast.x - landing.x),
}),
wire$1(landing),
via$1(landing, "bottom"),
wire$1(landing, "top"),
wire$1({ x: landing.x, y: -14.55 - Math.abs(muxPad.x - landing.x) }, "top"),
wire$1({ x: muxPad.x, y: -14.55 }, "top"),
wire$1(muxPad, "top"),
],
};
}
const downstreamFourTransmitPaths = matchOnHorizontal({
paths: [transmitPath$1(true), transmitPath$1(false)],
startXsMm: [8, 14, 20],
awayDirection: [-1, 1],
});
const downstreamFourReceivePaths = matchOnHorizontal({
paths: [receivePath$1(true), receivePath$1(false)],
startXsMm: [8, 14, 20],
awayDirection: [-1, 1],
});
const hubEscape = [
{ x: -6.6, y: 5.6 },
{ x: -6.9, y: 5.6 },
{ x: -7.6, y: 4.9 },
{ x: -8.7, y: 4.9 },
];
const bottomPath = [
{ x: -9.5, y: 5.05 },
{ x: -10.5, y: 5.05 },
{ x: -11.5, y: 4.05 },
{ x: -11.5, y: -5.5 },
{ x: -10.5, y: -6.5 },
{ x: 29.1, y: -6.5 },
{ x: 30.1, y: -5.5 },
{ x: 30.1, y: 0.9 },
];
function receivePath(positive) {
const offsetMm = positive ? halfCenterGapMm$1 : -halfCenterGapMm$1;
const hubPad = { x: -5.85, y: positive ? 5.8 : 5.4 };
const muxPad = {
x: positive ? 30.3000472 : 29.900048,
y: positive ? 2.7999008 : 2.800104,
};
const firstVia = { x: -9.1, y: positive ? 5.25 : 4.55 };
const secondVia = { x: positive ? 30.45 : 29.75, y: 1.4 };
const escape = offsetPath({ points: hubEscape, offsetMm });
const spine = offsetPath({ points: bottomPath, offsetMm });
const last = spine.at(-1);
return {
connection: positive ? "U_HUB.D1_RXP" : "U_HUB.D1_RXN",
route: [
wire$1(hubPad, "top"),
...escape.map((point) => wire$1(point, "top")),
wire$1(firstVia, "top"),
via$1(firstVia, "top"),
wire$1(firstVia),
...spine.map((point) => wire$1(point)),
wire$1({ x: last.x, y: secondVia.y - Math.abs(last.x - secondVia.x) }),
wire$1(secondVia),
via$1(secondVia, "bottom"),
wire$1(secondVia, "top"),
wire$1({ x: secondVia.x, y: 2.35 - Math.abs(muxPad.x - secondVia.x) }, "top"),
wire$1({ x: muxPad.x, y: 2.35 }, "top"),
wire$1(muxPad, "top"),
],
};
}
const downstreamOneReceivePaths = matchOnHorizontal({
paths: [receivePath(true), receivePath(false)],
startXsMm: [-7, -1, 5, 11, 17, 23],
awayDirection: [-1, 1],
});
const centrePath = [
{ 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) {
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$1 : -halfCenterGapMm$1,
});
const first = offsetPoints[0];
const last = offsetPoints.at(-1);
return {
connection: positive ? "C_D1_TXP.pin2" : "C_D1_TXN.pin2",
route: [
wire$1(launch, "top"),
via$1(launch, "top"),
wire$1(launch),
wire$1({ x: first.x, y: launch.y - Math.abs(first.x - launch.x) }),
...offsetPoints.map((point) => wire$1(point)),
wire$1({ x: last.x, y: landing.y - Math.abs(last.x - landing.x) }),
wire$1(landing),
via$1(landing, "bottom"),
wire$1(landing, "top"),
wire$1({ x: landing.x, y: 2.5 - Math.abs(muxPad.x - landing.x) }, "top"),
wire$1({ x: muxPad.x, y: 2.5 }, "top"),
wire$1(muxPad, "top"),
],
};
}
const downstreamOneTransmitPaths = matchOnHorizontal({
paths: [transmitPath(true), transmitPath(false)],
startXsMm: [-2, 4, 10, 16, 22],
awayDirection: [-1, 1],
});
const traceWidthMm = 0.136;
const halfCenterGapMm = (traceWidthMm + 0.15) / 2;
const cornerExtensionMm = halfCenterGapMm * (Math.SQRT2 - 1);
const spineLengthDifferenceMm = 16 * halfCenterGapMm * (Math.SQRT2 - 1);
const meanderCornerMm = 0.1;
const meanderDepthMm = (spineLengthDifferenceMm + 4 * meanderCornerMm * (2 - Math.SQRT2)) / 2;
function wire(point, layer = "bottom") {
return { route_type: "wire", ...point, width: traceWidthMm, layer };
}
function via(point, fromLayer) {
return {
route_type: "via",
...point,
from_layer: fromLayer,
to_layer: fromLayer === "top" ? "bottom" : "top",
via_diameter: 0.45,
via_hole_diameter: 0.2,
};
}
function upstreamTransmitPath(positive) {
const polarity = positive ? 1 : -1;
const launch = { x: positive ? -2.9 : -3.9, y: 13.51 };
const landing = { x: positive ? -24.95 : -24.25, y: 8.9 };
const muxPad = { x: positive ? -24.800102 : -24.400052, y: 9.800104 };
const traceY = 15.2 + polarity * halfCenterGapMm;
const meander = positive
? []
: [
{ x: -9, y: traceY },
{ x: -9.1, y: traceY - meanderCornerMm },
{ x: -9.1, y: traceY - meanderDepthMm + meanderCornerMm },
{ x: -9.2, y: traceY - meanderDepthMm },
{ x: -9.5, y: traceY - meanderDepthMm },
{ x: -9.6, y: traceY - meanderDepthMm + meanderCornerMm },
{ x: -9.6, y: traceY - meanderCornerMm },
{ x: -9.7, y: traceY },
];
const spine = [
{ x: launch.x, y: 13.643 },
{ x: -3.4 + polarity * halfCenterGapMm, y: 14 },
{
x: -3.4 + polarity * halfCenterGapMm,
y: 14.2 + polarity * cornerExtensionMm,
},
{ x: -4.4 + polarity * cornerExtensionMm, y: traceY },
...meander,
{ x: -22.6 - polarity * cornerExtensionMm, y: traceY },
{
x: -23.6 - polarity * halfCenterGapMm,
y: 14.2 + polarity * cornerExtensionMm,
},
{
x: -23.6 - polarity * halfCenterGapMm,
y: 10.8 + polarity * cornerExtensionMm,
},
{
x: -24.6 - polarity * halfCenterGapMm,
y: 9.8 + polarity * cornerExtensionMm,
},
{ x: -24.6 - polarity * halfCenterGapMm, y: 9.3 },
{ x: -24.6 - polarity * halfCenterGapMm, y: 9.107 },
];
const topCornerY = 9.35 - Math.abs(muxPad.x - landing.x);
return {
connection: positive ? "C_UP_TXP.pin2" : "C_UP_TXN.pin2",
route: [
wire(launch, "top"),
via(launch, "top"),
wire(launch),
...spine.map((point) => wire(point)),
wire(landing),
via(landing, "bottom"),
wire(landing, "top"),
wire({ x: landing.x, y: topCornerY }, "top"),
wire({ x: muxPad.x, y: 9.35 }, "top"),
wire(muxPad, "top"),
],
};
}
const upstreamTransmitPaths = [
upstreamTransmitPath(true),
upstreamTransmitPath(false),
];
function upstreamReceivePath(positive) {
const polarity = positive ? 1 : -1;
const launch = { x: positive ? -4.2 : -4.9, y: 11.8 };
const landing = { x: positive ? -23.45 : -22.75, y: 8.5 };
const hubPad = { x: positive ? -4.4 : -4.8, y: 10.85 };
const muxPad = {
x: positive ? -23.599952 : -23.1999528,
y: positive ? 9.800104 : 9.7999008,
};
const stemX = -4.6 + polarity * halfCenterGapMm;
const endX = -22.6 - polarity * halfCenterGapMm;
const horizontalY = 13.3 + polarity * halfCenterGapMm;
return {
connection: positive ? "U_HUB.UP_RXP" : "U_HUB.UP_RXN",
route: [
wire(hubPad, "top"),
wire({ x: hubPad.x, y: launch.y - Math.abs(launch.x - hubPad.x) }, "top"),
wire(launch, "top"),
via(launch, "top"),
wire(launch),
wire({ x: stemX, y: launch.y + Math.abs(stemX - launch.x) }),
wire({ x: stemX, y: 12.3 + polarity * cornerExtensionMm }),
wire({ x: -5.6 + polarity * cornerExtensionMm, y: horizontalY }),
wire({ x: -21.6 - polarity * cornerExtensionMm, y: horizontalY }),
wire({ x: endX, y: 12.3 + polarity * cornerExtensionMm }),
wire({ x: endX, y: landing.y + Math.abs(landing.x - endX) }),
wire(landing),
via(landing, "bottom"),
wire(landing, "top"),
wire({ x: landing.x, y: 9.35 - Math.abs(muxPad.x - landing.x) }, "top"),
wire({ x: muxPad.x, y: 9.35 }, "top"),
wire(muxPad, "top"),
],
};
}
// Add length only to the shorter member, on a clear horizontal region.
function matchReceiveLengths(paths) {
const lengths = paths.map((path) => path.route.slice(1).reduce((sum, end, index) => {
const start = path.route[index];
return (sum +
(start.route_type === "wire" &&
end.route_type === "wire" &&
start.layer === end.layer
? Math.hypot(end.x - start.x, end.y - start.y)
: 0));
}, 0));
const shorterIndex = lengths[0] < lengths[1] ? 0 : 1;
const differenceMm = Math.abs(lengths[0] - lengths[1]);
const cornerMm = 0.1;
const depthMm = (differenceMm + 4 * cornerMm * (2 - Math.SQRT2)) / 2;
return paths.map((path, index) => {
if (index !== shorterIndex)
return path;
const direction = index === 0 ? 1 : -1;
const routeIndex = path.route.findIndex((point) => point.route_type === "wire" &&
point.layer === "bottom" &&
point.x < -20 &&
point.y > 13);
const y = path.route[routeIndex].y;
return {
...path,
route: [
...path.route.slice(0, routeIndex),
wire({ x: -12, y }),
wire({ x: -12.1, y: y + direction * cornerMm }),
wire({ x: -12.1, y: y + direction * (depthMm - cornerMm) }),
wire({ x: -12.2, y: y + direction * depthMm }),
wire({ x: -12.5, y: y + direction * depthMm }),
wire({ x: -12.6, y: y + direction * (depthMm - cornerMm) }),
wire({ x: -12.6, y: y + direction * cornerMm }),
wire({ x: -12.7, y }),
...path.route.slice(routeIndex),
],
};
});
}
const upstreamReceivePaths = matchReceiveLengths([
upstreamReceivePath(true),
upstreamReceivePath(false),
]);
const pairedPorts = [
["U_HUB.UP_TXP", "U_HUB.UP_TXN"],
["U_UP_MUX.TXp", "U_UP_MUX.TXn"],
["U_HUB.UP_RXP", "U_HUB.UP_RXN"],
["U_HUB.D1_TXP", "U_HUB.D1_TXN"],
["U_C1_MUX.TXp", "U_C1_MUX.TXn"],
["U_HUB.D1_RXP", "U_HUB.D1_RXN"],
["U_HUB.D2_TXP", "U_HUB.D2_TXN"],
["U_HUB.D3_TXP", "U_HUB.D3_TXN"],
["U_HUB.D4_TXP", "U_HUB.D4_TXN"],
["U_C4_MUX.TXp", "U_C4_MUX.TXn"],
["U_HUB.D4_RXP", "U_HUB.D4_RXN"],
];
const HighSpeedRouting = () => (jsxs(Fragment, { children: [pairedPorts.map((pair, phaseIndex) => pair.map((port) => {
const [component, pin] = port.split(".");
const prefix = component === "U_UP_MUX"
? "UP"
: component === "U_C1_MUX"
? "D1"
: "D4";
const netName = component === "U_HUB"
? pin
: `${prefix}_${pin === "TXp" ? "TXP" : "TXN"}_AC`;
return (jsx(Fragment$1, { children: jsx("net", { name: netName, routingPhaseIndex: phaseIndex, nominalTraceWidth: 0.136 }) }, netName));
})), pairedPorts.map(([positive, negative]) => (jsx(Fragment$1, { children: jsx("differentialpair", { name: `${positive.replaceAll(".", "_")}_PAIR`, positiveConnection: positive, negativeConnection: negative, pcbTraceGap: 0.15, maxLengthSkew: 0.127, maxUncoupledLength: 2, targetDifferentialImpedance: "90\u00B110ohm", pcbSpacingToOtherSignals: "3w" }) }, positive))), pairedPorts.map((pair, phaseIndex) => (jsx(Fragment$1, { children: jsx("autoroutingphase", { name: `Coupled pair ${pair[0]}`, phaseIndex: phaseIndex, autorouter: "auto-local", connections: pair, pcbTracePaths: phaseIndex === 1
? upstreamTransmitPaths
: phaseIndex === 2
? upstreamReceivePaths
: phaseIndex === 4
? downstreamOneTransmitPaths
: phaseIndex === 5
? downstreamOneReceivePaths
: phaseIndex === 9
? downstreamFourTransmitPaths
: phaseIndex === 10
? downstreamFourReceivePaths
: undefined }) }, pair[0])))] }));
const QfnFootprint = ({ pins, pitch, padWidth, padLength, rowSpacing, bodySize, exposedPad, }) => {
const pinsPerSide = pins / 4;
const pasteRows = Math.max(2, Math.floor(exposedPad / 1.2));
const pastePitch = exposedPad / pasteRows;
const pasteOpening = exposedPad * Math.sqrt(0.6) / pasteRows;
return (jsxs("footprint", { children: [Array.from({ length: pins }, (_, index) => {
const side = Math.floor(index / pinsPerSide);
const along = ((index % pinsPerSide) - (pinsPerSide - 1) / 2) * pitch;
const pcbX = [-rowSpacing / 2, along, rowSpacing / 2, -along][side];
const pcbY = [-along, -rowSpacing / 2, along, rowSpacing / 2][side];
return (jsx(Fragment$1, { children: jsx("smtpad", { portHints: [`pin${index + 1}`], shape: "rect", pcbX: pcbX, pcbY: pcbY, width: side % 2 ? padWidth : padLength, height: side % 2 ? padLength : padWidth }) }, index));
}), jsx("smtpad", { portHints: [`pin${pins + 1}`], shape: "rect", width: exposedPad, height: exposedPad, noSolderPaste: true }), Array.from({ length: pasteRows * pasteRows }, (_, index) => (jsx(Fragment$1, { children: jsx("solderpaste", { shape: "rect", width: pasteOpening, height: pasteOpening, pcbX: ((index % pasteRows) - (pasteRows - 1) / 2) * pastePitch, pcbY: (Math.floor(index / pasteRows) - (pasteRows - 1) / 2) * pastePitch, layer: "top" }) }, `paste-${index}`))), jsx("courtyardrect", { width: bodySize + 0.8, height: bodySize + 0.8 }), jsx("silkscreencircle", { pcbX: -bodySize / 2 - 0.35, pcbY: bodySize / 2 + 0.35, radius: 0.15 })] }));
};
// USB5816C: Microchip DS00003186C, Table 3.2 (physical pin numbering).
const hubPinNames = [
"RBIAS",
"VDD33_2",
"XTALI",
"XTALO",
"VDD33_5",
"D1_DP",
"D1_DM",
"D1_TXP",
"D1_TXN",
"VDD12_10",
"D1_RXP",
"D1_RXN",
"D6_DP",
"D6_DM",
"D1B_TXP",
"D1B_TXN",
"VDD12_17",
"D1B_RXP",
"D1B_RXN",
"CFG_STRAP",
"NC21",
"NC22",
"TESTEN",
"VBUS_DET",
"RESET_N",
"VDD12_26",
"VDD33_27",
"D2_DP",
"D2_DM",
"D2_TXP",
"D2_TXN",
"VDD12_32",
"D2_RXP",
"D2_RXN",
"D3_DP",
"D3_DM",
"D3_TXP",
"D3_TXN",
"VDD12_39",
"D3_RXP",
"D3_RXN",
"VDD33_42",
"D4_DP",
"D4_DM",
"D4_TXP",
"D4_TXN",
"VDD12_47",
"D4_RXP",
"D4_RXN",
"AB1",
"PWR5",
"PWR4",
"HOST_TYPE0",
"VDD33_54",
"HOST_TYPE1",
"C_ATTACH2",
"PWR3",
"PWR2",
"VDD12_59",
"GPIO3",
"CC_POL",
"PWR6",
"ALT_MUX_EN",
"VDD33_64",
"SPI_CLK",
"SPI_DO",
"SPI_DI_CFG_BC",
"SPI_CS_CFG_NONREM",
"GPIO69",
"PWR1",
"GPIO66",
"VDD33_72",
"C_ATTACH1",
"SMBDATA",
"SMBCLK",
"C_ATTACH0",
"SUSP_IND",
"VDD12_78",
"NC79",
"NC80",
"NC81",
"NC82",
"VDD12_83",
"NC84",
"NC85",
"D5_DP",
"D5_DM",
"D5_TXP",
"D5_TXN",
"VDD12_90",
"D5_RXP",
"D5_RXN",
"VDD33_93",
"UP_DP",
"UP_DM",
"UP_TXP",
"UP_TXN",
"VDD12_98",
"UP_RXP",
"UP_RXN",
"EP",
];
const hubPinLabels = Object.fromEntries(hubPinNames.map((label, index) => [`pin${index + 1}`, label]));
// USB2642: Microchip DS00001578C, Figure 3-1 and Table 5-1.
const readerPinNames = [
"DN2_DM",
"DN2_DP",
"DN3_DM",
"DN3_DP",
"VDDA33_5",
"PRTCTL2",
"PRTCTL3",
"SPI_CS",
"EEP_SCL",
"EEP_SDA",
"SPI_DI",
"VDD33_12",
"SD_WP",
"SD_CD_N",
"VDD18",
"VDD33_16",
"SD_D1",
"SD_D0",
"SD_D7",
"SD_D6",
"SD_CLK",
"REG_EN",
"SD_D5",
"SD_CMD",
"VDD33_25",
"VDD33_OTP",
"TEST1",
"TEST2",
"I2C_SDA",
"SD_D4",
"NC31",
"SD_D3",
"SD_D2",
"VDD33_34",
"CRD_PWR",
"I2C_SCL",
"GPO1",
"RESET_N",
"VBUS_DET",
"TEST0",
"VDDA33_41",
"USB_DP",
"USB_DM",
"XTAL2",
"XTAL1",
"VDD18PLL",
"RBIAS",
"VDDA33_48",
"EP",
];
const readerPinLabels = Object.fromEntries(readerPinNames.map((label, index) => [`pin${index + 1}`, label]));
const usbCPinLabels = Object.fromEntries([
...Array.from({ length: 12 }, (_, index) => [
`pin${index + 1}`,
`A${index + 1}`,
]),
...Array.from({ length: 12 }, (_, index) => [
`pin${index + 13}`,
`B${index + 1}`,
]),
["pin25", ["S1", "SHIELD"]],
]);
const usbAPinLabels = {
pin1: "VBUS",
pin2: "DM",
pin3: "DP",
pin4: "GND",
pin5: "RXN",
pin6: "RXP",
pin7: "GND_DRAIN",
pin8: "TXN",
pin9: "TXP",
pin10: "SHIELD",
};
const sdPinLabels = {
pin1: "DAT3",
pin2: "CMD",
pin3: "VSS1",
pin4: "VDD",
pin5: "CLK",
pin6: "VSS2",
pin7: "DAT0",
pin8: "DAT1",
pin9: "DAT2",
pin10: "CD",
pin11: "WP",
pin12: "SWITCH_COMMON",
pin13: "SHIELD1",
pin14: "SHIELD2",
pin15: "SHIELD3",
pin16: "SHIELD4",
};
const hubPinAttributes = Object.fromEntries(hubPinNames.map((label) => [
label,
label.startsWith("VDD")
? {
requiresPower: true,
requiresVoltage: label.startsWith("VDD12") ? "1.2V" : "3.3V",
requiredVoltageTolerance: "5%",
}
: label === "EP"
? { requiresGround: true }
: label.startsWith("NC")
? { doNotConnect: true }
: {},
]));
const readerPinAttributes = Object.fromEntries(readerPinNames.map((label) => [
label,
label.startsWith("VDD33") || label.startsWith("VDDA33")
? {
requiresPower: true,
requiresVoltage: "3.3V",
requiredVoltageTolerance: "5%",
}
: label === "EP"
? { requiresGround: true }
: label === "VDD18" || label === "VDD18PLL"
? { providesPower: true, providesVoltage: "1.8V" }
: {},
]));
const hubConnections = Object.fromEntries(hubPinNames.flatMap((label) => {
if (label.startsWith("VDD33"))
return [[label, "net.VDD33"]];
if (label.startsWith("VDD12"))
return [[label, "net.VDD12"]];
if (label === "EP" ||
label === "TESTEN" ||
label === "CC_POL" ||
label === "ALT_MUX_EN")
return [[label, "net.GND"]];
if (label === "AB1" ||
label.startsWith("C_ATTACH") ||
label === "D6_DP" ||
label === "D6_DM")
return [[label, "net.VDD33"]];
if (label === "RBIAS")
return [[label, "net.HUB_RBIAS"]];
if (label === "CFG_STRAP")
return [[label, "net.HUB_CFG"]];
if (label === "RESET_N")
return [[label, "net.RESET_N"]];
if (label === "VBUS_DET")
return [[label, "net.HOST_VBUS_DET"]];
if (label === "XTALI" || label === "XTALO")
return [[label, `net.HUB_${label}`]];
if (label.startsWith("UP_") ||
/^D[1-5]_(DP|DM|TXP|TXN|RXP|RXN)$/.test(label) ||
label.startsWith("PWR"))
return [[label, `net.${label}`]];
if (label === "SPI_CLK")
return [[label, "net.HUB_SPI_CLK"]];
if (label === "SPI_DO")
return [[label, "net.HUB_SPI_MOSI"]];
if (label === "SPI_DI_CFG_BC")
return [[label, "net.HUB_SPI_MISO"]];
if (label === "SPI_CS_CFG_NONREM")
return [[label, "net.HUB_SPI_CS"]];
if (label === "SMBDATA" ||
label === "SMBCLK" ||
label === "HOST_TYPE0" ||
label === "SUSP_IND")
return [[label, `net.HUB_${label}`]];
return [];
}));
const readerConnections = Object.fromEntries(readerPinNames.flatMap((label) => {
if (label.startsWith("VDD33") ||
label.startsWith("VDDA33") ||
label === "REG_EN")
return [[label, "net.SD_VDD33"]];
if (label === "EP" || label.startsWith("TEST"))
return [[label, "net.GND"]];
if (label === "USB_DP")
return [[label, "net.D5_DP"]];
if (label === "USB_DM")
return [[label, "net.D5_DM"]];
if (label.startsWith("SD_") || label === "CRD_PWR")
return [[label, `net.${label}`]];
if ([
"VDD18",
"VDD18PLL",
"RESET_N",
"RBIAS",
"XTAL1",
"XTAL2",
"VBUS_DET",
"EEP_SCL",
"EEP_SDA",
].includes(label))
return [[label, `net.SD_${label}`]];
return [];
}));
const usbCConnections = ({ prefix, vbus, }) => ({
A1: "net.GND",
A12: "net.GND",
B1: "net.GND",
B12: "net.GND",
SHIELD: "net.GND",
A4: `net.${vbus}`,
A9: `net.${vbus}`,
B4: `net.${vbus}`,
B9: `net.${vbus}`,
A5: `net.${prefix}_CC1`,
B5: `net.${prefix}_CC2`,
A6: `net.${prefix}_DP`,
B6: `net.${prefix}_DP`,
A7: `net.${prefix}_DM`,
B7: `net.${prefix}_DM`,
A2: `net.${prefix}_TX1P`,
A3: `net.${prefix}_TX1N`,
B2: `net.${prefix}_TX2P`,
B3: `net.${prefix}_TX2N`,
B11: `net.${prefix}_RX1P`,
B10: `net.${prefix}_RX1N`,
A11: `net.${prefix}_RX2P`,
A10: `net.${prefix}_RX2N`,
});
const muxConnections = ({ invertSuperspeedPolarity = false, prefix, source, upstream, vbus, }) => ({
CC1: `net.${prefix}_CC1`,
CC2: `net.${prefix}_CC2`,
CURRENT_MODE: "net.GND",
PORT: upstream ? "net.GND" : "net.VBUS_HUB",
VBUS_DET: `net.${prefix}_VBUS_SENSE`,
VDD5: "net.VBUS_HOST",
VCC33: "net.VDD33",
GND1: "net.GND",
GND2: "net.GND",
EP: "net.GND",
ENn_CC: "net.GND",
ENn_MUX: "net.GND",
TXp: `net.${source}_${invertSuperspeedPolarity ? "TXN_AC" : "TXP_AC"}`,
TXn: `net.${source}_${invertSuperspeedPolarity ? "TXP_AC" : "TXN_AC"}`,
RXp: `net.${source}_${invertSuperspeedPolarity ? "RXN" : "RXP"}`,
RXn: `net.${source}_${invertSuperspeedPolarity ? "RXP" : "RXN"}`,
TX1p: `net.${prefix}_TX1P`,
TX1n: `net.${prefix}_TX1N`,
TX2p: `net.${prefix}_TX2P`,
TX2n: `net.${prefix}_TX2N`,
RX1p: `net.${prefix}_RX1P`,
RX1n: `net.${prefix}_RX1N`,
RX2p: `net.${prefix}_RX2P`,
RX2n: `net.${prefix}_RX2N`,
DIR: `net.${prefix}_DIR`,
ID: `net.${prefix}_ID`,
...(upstream
? { OUT1: "net.HOST_CURRENT_GE_1A5_N", OUT2: "net.HOST_CURRENT_3A_N" }
: {}),
});
const Controllers = () => (jsxs(Fragment, { children: [jsx("chip", { name: "U_HUB", manufacturerPartNumber: "USB5816C-I/KD", pcbX: "0mm", pcbY: 5, ...placementFor("U_HUB"), pinLabels: hubPinLabels, pinAttributes: hubPinAttributes, connections: hubConnections, noSchematicRepresentation: true, footprint: jsx(QfnFootprint, { pins: 100, pitch: 0.4, padWidth: 0.2, padLength: 1.05, rowSpacing: 11.7, bodySize: 12, exposedPad: 8.1 }), cadModel: {
jscad: { type: "cuboid", size: [12, 12, 1] },
zOffsetFromSurface: 0.5,
}, pcbStyle: { silkscreenFontSize: 0.6 } }), jsx("chip", { name: "U_SD", manufacturerPartNumber: "USB2642-I/ML", pcbX: -7, pcbY: -16, ...placementFor("U_SD"), pinLabels: readerPinLabels, pinAttributes: readerPinAttributes, connections: readerConnections, noSchematicRepresentation: true, footprint: jsx(QfnFootprint, { pins: 48, pitch: 0.5, padWidth: 0.25, padLength: 0.75, rowSpacing: 7, bodySize: 7, exposedPad: 5.3 }), cadModel: {
jscad: { type: "cuboid", size: [7, 7, 1] },
zOffsetFromSurface: 0.5,
}, pcbStyle: { silkscreenFontSize: 0.6 } })] }));
const hubPowerPinLabels = Object.fromEntries(Object.entries(hubPinLabels)
.filter(([, label]) => /^(VDD|EP|TEST|RBIAS|XTAL|RESET|VBUS|CFG_|SPI_|SMB|GPIO|CC_POL|ALT_MUX|AB1|C_ATTACH|HOST_TYPE|SUSP)/.test(label))
.map(([, label], index) => [`pin${index + 1}`, label]));
const hubSignalPinLabels = Object.fromEntries(Object.entries(hubPinLabels)
.filter(([, label]) => /^(UP_|D[1-6]_|PWR)/.test(label))
.map(([, label], index) => [`pin${index + 1}`, label]));
// The renderer derives note placement from the chip's bounds. No schematic
// coordinates are authored in the design source.
const SchematicNote = ({ text, chipName, }) => (jsx("schematictext", { text: chipName ? `${chipName}: ${text}` : text, fontSize: 0.22, anchor: "top_center" }));
// Nominal mechanical envelopes. These do not replace tolerance qualification.
function passiveModelForPart(mpn) {
if (mpn === "XFL4020-222MEC")
return {
jscad: { type: "cuboid", size: [4, 4, 2.1], center: [0, 0, 1.05] },
zOffsetFromSurface: 0,
};
if (mpn === "EEEFK1A151AP")
return {
jscad: {
type: "union",
shapes: [
{
type: "colorize",
color: [0.12, 0.13, 0.14],
shape: {
type: "cuboid",
size: [6.6, 6.6, 0.4],
center: [0, 0, 0.2],
},
},
{
type: "colorize",
color: [0.7, 0.72, 0.75],
shape: {
type: "cylinder",
radius: 3.15,
height: 5.4,
center: [0, 0, 3.1],
segments: 64,
},
},
],
},
zOffsetFromSurface: 0,
};
return undefined;
}
// Yageo RC0402: 1%, 50 V maximum working voltage, 0.063 W.
// Every resistance below is a standard E24/E96 ordering value.
const resistors = {
"22": "RC0402FR-0722RL",
"2.2k": "RC0402FR-072K2L",
"4.7k": "RC0402FR-074K7L",
"10k": "RC0402FR-0710KL",
"12k": "RC0402FR-0712KL",
"16.9k": "RC0402FR-0716K9L",
"20k": "RC0402FR-0720KL",
"22.1k": "RC0402FR-0722K1L",
"43.2k": "RC0402FR-0743K2L",
"47k": "RC0402FR-0747KL",
"100k": "RC0402FR-07100KL",
"169k": "RC0402FR-07169KL",
"200k": "RC0402FR-07200KL",
"316k": "RC0402FR-07316KL",
"887k": "RC0402FR-07887KL",
};
const capacitors = {
// Murata: 0402, 16 V, X7R, 10%.
"100nF": "GRM155R71C104KA88D",
// Murata: 0402, 50 V, C0G, 5%.
"18pF": "GRM1555C1H180JA01D",
// Murata: 0402, 10 V, X5R, 10%.
"1uF": "GRM155R61A105KE15D",
// Murata: 0603, 16 V, X5R, 10%.
"4.7uF": "GRM188R61C475KE11D",
// Murata: 0805, 16 V, X5R, 10% / 20% respectively.
"10uF": "GRM21BR61C106KE15L",
"22uF": "GRM21BR61C226ME44L",
};
const selectPassivePart = ({ kind, rating }) => {
const selectedPart = kind === "resistor" ? resistors[rating] : capacitors[rating];
if (!selectedPart)
throw new Error(`No ordering part selected for ${kind} ${rating}`);
return selectedPart;
};
const Passives = ({ parts }) => (jsx("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schGrid: true, gridCols: 6, gridGap: 2, children: parts.map((part) => {
const manufacturerPartNumber = part.manufacturerPartNumber ?? selectPassivePart(part);
const props = {
name: part.name,
pcbX: `${part.pcbX}mm`,
pcbY: `${part.pcbY}mm`,
pcbRotation: part.pcbRotation ?? 0,
footprint: part.footprint ?? "0402",
connections: { pin1: `net.${part.from}`, pin2: `net.${part.to}` },
manufacturerPartNumber,
cadModel: passiveModelForPart(manufacturerPartNumber),
pcbStyle: { silkscreenFontSize: 0.5 },
...placementFor(part.name),
};
if (part.kind === "resistor")
return jsx("resistor", { ...props, resistance: part.rating }, part.name);
if (part.kind === "inductor")
return jsx("inductor", { ...props, inductance: part.rating }, part.name);
return jsx("capacitor", { ...props, capacitance: part.rating }, part.name);
}) }));
const Indicator = ({ name, net, pcbX, pcbY, color = "green", }) => (jsxs("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, name: `${name}_indicator`, schLayout: { flex: "row", gap: 2 }, children: [jsx("resistor", { name: `R_${name}`, resistance: "2.2k", footprint: "0402", pcbX: `${pcbX - 3.3}mm`, pcbY: `${pcbY}mm`, ...placementFor(`R_${name}`), manufacturerPartNumber: "RC0402FR-072K2L", connections: { pin1: `net.${net}`, pin2: `net.${name}_A` } }), jsx("led", { name: name, color: color, footprint: "0603", pcbX: pcbX, pcbY: pcbY, ...placementFor(name), manufacturerPartNumber: color === "green" ? "LTST-C190KGKT" : "LTST-C190TBKT", connections: { anode: `net.${name}_A`, cathode: "net.GND" } })] }));
const HubBypass = () => (jsx(Fragment, { children: jsx("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schTitle: "Local supply bypass capacitors", schGrid: true, gridCols: 6, gridGap: 2, children: jsx(Passives, { parts: hubPinNames.flatMap((label, index) => {
if (!label.startsWith("VDD"))
return [];
const side = Math.floor(index / 25);
const along = ((index % 25) - 12) * 0.4;
return [
{
name: `C_HUB_${index + 1}`,
kind: "capacitor",
rating: "100nF",
pcbX: [-8, along, 8, -along][side],
pcbY: 5 + [-along, -8, along, 8][side],
pcbRotation: [180, 270, 0, 90][side],
from: label.startsWith("VDD33") ? "VDD33" : "VDD12",
to: "GND",
},
];
}) }) }) }));
const SdBypass = () => (jsx(Fragment, { children: jsx("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schTitle: "Local 3.3 V bypass capacitors", schGrid: true, gridCols: 4, gridGap: 2, children: jsx(Passives, { parts: readerPinNames.flatMap((label, index) => {
if (!label.startsWith("VDD33") && !label.startsWith("VDDA33"))
return [];
const side = Math.floor(index / 12);
const along = ((index % 12) - 5.5) * 0.5;
return [
{
name: `C_SD_${index + 1}`,
kind: "capacitor",
rating: "100nF",
pcbX: -4 + [-5.1, along, 5.1, -along][side],
pcbY: -17 + [-along, -5.1, along, 5.1][side],
pcbRotation: side % 2 ? 90 : 0,
from: "SD_VDD33",
to: "GND",
},
];
}) }) }) }));
// Land dimensions from KiCad official libraries and TI DCU0008A.
const Coilcraft4020 = () => (jsxs("footprint", { children: [jsx("smtpad", { portHints: ["pin1"], shape: "rect", pcbX: -1.185, width: 0.98, height: 3.4 }), jsx("smtpad", { portHints: ["pin2"], shape: "rect", pcbX: 1.185, width: 0.98, height: 3.4 }), jsx("courtyardrect", { width: 4.52, height: 4.52 }), jsx("silkscreenrect", { width: 4.31, height: 4.31 })] }));
const Electrolytic63 = () => (jsxs("footprint", { children: [jsx("smtpad", { portHints: ["pin1", "positive"], shape: "rect", pcbX: -2.7, width: 3.5, height: 1.6 }), jsx("smtpad", { portHints: ["pin2", "negative"], shape: "rect", pcbX: 2.7, width: 3.5, height: 1.6 }), jsx("courtyardrect", { width: 9.4, height: 7.1 }), jsx("silkscreencircle", { radius: 3.41 }), jsx("silkscreentext", { text: "+", pcbX: -4.1, pcbY: -2, fontSize: 0.8 })] }));
const Vssop8 = () => (jsxs("footprint", { children: [Array.from({ length: 8 }, (_, index) => (jsx(Fragment$1, { children: jsx("smtpad", { portHints: [`pin${index + 1}`], shape: "rect", pcbX: index < 4 ? -1.55 : 1.55, pcbY: index < 4 ? 0.75 - index * 0.5 : (index - 4) * 0.5 - 0.75, width: 0.85, height: 0.3 }) }, index))), jsx("courtyardrect", { width: 4.3, height: 2.5 }), jsx("silkscreencircle", { pcbX: -2.2, pcbY: 1, radius: 0.15 })] }));
const metal = [0.68, 0.7, 0.73];
const polymer = [0.08, 0.09, 0.1];
const gold = [0.86, 0.65, 0.2];
function block({ size, center }) {
return { type: "cuboid", size, center };
}
function colored(shape, color) {
return { type: "colorize", color, shape };
}
// Amphenol GSB311131HR, customer drawing GSB3111XXXHR rev B2.
const usbAPins = [
{ pin: 1, x: -3.5, y: 0 },
{ pin: 2, x: -1, y: 0 },
{ pin: 3, x: 1, y: 0 },
{ pin: 4, x: 3.5, y: 0 },
{ pin: 5, x: 4, y: 1.5 },
{ pin: 6, x: 2, y: 1.5 },
{ pin: 7, x: 0, y: 1.5 },
{ pin: 8, x: -2, y: 1.5 },
{ pin: 9, x: -4, y: 1.5 },
];
const usbAModel = {
type: "union",
shapes: [
colored({
type: "subtract",
shapes: [
block({ size: [14.4, 16.5, 7], center: [0, -5.53, 3.5] }),
block({ size: [13.8, 16.3, 6.4], center: [0, -5.83, 3.5] }),
],
}, metal),
colored(block({ size: [12.5, 12, 1.2], center: [0, -4.2, 2.25] }), [0.04, 0.2, 0.66]),
...usbAPins.map((pin) => colored(block({ size: [0.4, 0.25, 3.2], center: [pin.x, pin.y, -1.6] }), metal)),
...[-6.57, 6.57].map((x) => colored(block({ size: [0.3, 1.5, 2.4], center: [x, -2, -1.2] }), metal)),
],
};
// Amphenol 12401610E4#2A, drawing C12401610 rev C.
const usbCModel = {
type: "union",
shapes: [
colored({
type: "subtract",
shapes: [
{
type: "roundedCuboid",
size: [9.2, 10.45, 3.28],
center: [0, -5e-3, 1.64],
roundRadius: 0.18,
segments: 16,
},
{
type: "roundedCuboid",
size: [8.6, 9.6, 2.68],
center: [0, -0.53, 1.64],
roundRadius: 0.15,
segments: 16,
},
],
}, metal),
colored(block({ size: [6.69, 6.8, 0.7], center: [0, 0, 1.64] }), polymer),
...Array.from({ length: 12 }, (_, index) => colored(block({
size: [0.2, 2.4, 0.05],
center: [-2.75 + index * 0.5, -1.8, 2.015],
}), gold)),
...[
[-4.13, 3.11],
[4.13, 3.11],
[-4.49, -2.84],
[4.49, -2.84],
].map(([x, y]) => colored(block({ size: [0.3, 0.7, 1], center: [x, y, -0.5] }), metal)),
],
};
// Hirose DM1AA-SF-PEJ(82), EDC3-153736-02 rev 3.
// This is not derived from Hirose's restricted downloadable STEP model.
const sdSocketModel = {
type: "union",
shapes: [
colored({
type: "subtract",
shapes: [
block({ size: [28, 30.5, 2.9], center: [0, 0, 1.45] }),
block({ size: [27.6, 30.5, 2.5], center: [0, -0.2, 1.25] }),
],
}, metal),
...[-13, 13].map((x) => colored(block({ size: [1.5, 29.8, 1.8], center: [x, 0.15, 0.9] }), polymer)),
colored(block({ size: [25, 2, 2.5], center: [0, 14.1, 1.25] }), polymer),
...[
[-14.5, 8.15],
[14.5, 8.15],
[-14.1, -10.5],
[14.5, -10.5],
].map(([x, y]) => colored(block({ size: [1.6, 2.2, 0.2], center: [x, y, 0.1] }), metal)),
...[1.35, 3.05, 5.475, 7.975, 10.475, 12.975, 15.475, 17.975, 20.475].map((x) => colored(block({ size: [0.7, 1.7, 0.15], center: [x - 11.9, 14.9, 0.075] }), gold)),
],
};
// Amphenol 12401610E4#2A, C12401610 rev C recommended PCB layout.
// Connector-local Y is the reverse of the drawing/KiCad downward Y axis.
const UsbCReceptacle = (props) => (jsx("connector", { allowOffBoard: true, pinAttributes: {
pin8: { doNotConnect: true },
pin20: { doNotConnect: true },
}, cadModel: {
jscad: usbCModel,
modelOriginPosition: { x: 0, y: 0.48, z: 0 },
zOffsetFromSurface: 0,
}, footprint: jsxs("footprint", { children: [Array.from({ length: 12 }, (_, index) => (jsxs(Fragment$1, { children: [jsx("smtpad", { portHints: [`pin${index + 1}`], shape: "rect", pcbX: -2.75 + index * 0.5, pcbY: 5.02, width: 0.3, height: 0.7 }), jsx("smtpad", { portHints: [`pin${index + 13}`], shape: "rect", pcbX: 2.5 - index * 0.5, pcbY: 3.32, width: 0.3, height: 0.7 })] }, index))), [-1, 1].map((side) => (jsxs(Fragment$1, { children: [jsx("platedhole", { portHints: ["pin25"], shape: "pill", pcbX: side * 4.13, pcbY: 3.11, outerWidth: 0.8, outerHeight: 1.4, holeWidth: 0.5, holeHeight: 1.1 }), jsx("platedhole", { portHints: ["pin25"], shape: "pill", pcbX: side * 4.49, pcbY: -2.84, outerWidth: 0.8, outerHeight: 1.4, holeWidth: 0.5, holeHeight: 1.1 })] }, side))), jsx("hole", { shape: "pill", pcbRotation: props.pcbRotation, pcbX: 3.6, pcbY: 4.36, width: 0.95, height: 0.65 }), jsx("hole", { pcbX: -3.6, pcbY: 4.36, diameter: 0.65 }), jsx("courtyardrect", { pcbY: -0.07, width: 10.78, height: 11.6 }), jsx("fabricationnoterect", { pcbY: -5e-3, width: 9.2, height: 10.45 }), jsx("silkscreenpath", { route: [
{ x: -4.75, y: 1.89 },
{ x: -4.75, y: -5.37 },
{ x: 4.75, y: -5.37 },
{ x: 4.75, y: 1.89 },
], strokeWidth: 0.12 }), jsx("silkscreentext", { pcbY: 6.36, text: props.name ?? "", fontSize: 0.7 }), jsx("keepout", { shape: "rect", pcbX: 0, pcbY: -1.01, width: 7.5, height: 6.8, layers: ["top"], excludeRefs: [`.${props.name}`] })] }), ...props, ...placementFor(props.name) }));
const pinLabels$4 = {
pin1: ["CC2"],
pin2: ["CC1"],
pin3: ["CURRENT_MODE"],
pin4: ["PORT"],
pin5: ["VBUS_DET"],
pin6: ["TXp"],
pin7: ["TXn"],
pin8: ["VCC33"],
pin9: ["RXp"],
pin10: ["RXn"],
pin11: ["DIR"],
pin12: ["ENn_MUX"],
pin13: ["GND1"],
pin14: ["RX1n"],
pin15: ["RX1p"],
pin16: ["TX1n"],
pin17: ["TX1p"],
pin18: ["RX2n"],
pin19: ["RX2p"],
pin20: ["TX2n"],
pin21: ["TX2p"],
pin22: ["ADDR"],
pin23: ["INT_N", "OUT3"],
pin24: ["VCONN_FAULT_N"],
pin25: ["SDA", "OUT1"],
pin26: ["SCL", "OUT2"],
pin27: ["ID"],
pin28: ["GND2"],
pin29: ["ENn_CC"],
pin30: ["VDD5"],
pin31: ["EP"],
};
const pinAttributes$4 = {
pin8: { requiresPower: true },
pin13: { requiresGround: true },
pin28: { requiresGround: true },
pin30: { requiresPower: true },
};
const HD3SS3220RNHR = (props) => {
return (jsx("chip", { pinLabels: pinLabels$4, pinAttributes: pinAttributes$4, supplierPartNumbers: {
jlcpcb: ["C165155"],
}, manufacturerPartNumber: "HD3SS3220RNHR", footprint: jsxs("footprint", { children: [jsx("smtpad", { portHints: ["pin2"], pcbX: "-1.400048mm", pcbY: "-1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin3"], pcbX: "-0.999998mm", pcbY: "-1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin4"], pcbX: "-0.599948mm", pcbY: "-1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin5"], pcbX: "-0.199898mm", pcbY: "-1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin6"], pcbX: "0.199898mm", pcbY: "-1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin7"], pcbX: "0.599948mm", pcbY: "-1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin8"], pcbX: "0.999998mm", pcbY: "-1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin9"], pcbX: "1.400048mm", pcbY: "-1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin12"], pcbX: "2.199894mm", pcbY: "-0.40005mm", width: "0.5050028mm", height: "0.1999996mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin13"], pcbX: "2.199894mm", pcbY: "0mm", width: "0.5050028mm", height: "0.1999996mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin14"], pcbX: "2.199894mm", pcbY: "0.40005mm", width: "0.5050028mm", height: "0.1999996mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin17"], pcbX: "1.400048mm", pcbY: "1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin18"], pcbX: "0.999998mm", pcbY: "1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin19"], pcbX: "0.599948mm", pcbY: "1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin20"], pcbX: "0.199898mm", pcbY: "1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin21"], pcbX: "-0.199898mm", pcbY: "1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin22"], pcbX: "-0.599948mm", pcbY: "1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin23"], pcbX: "-0.999998mm", pcbY: "1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin24"], pcbX: "-1.400048mm", pcbY: "1.199896mm", width: "0.1999996mm", height: "0.5050028mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin27"], pcbX: "-2.199894mm", pcbY: "0.40005mm", width: "0.5050028mm", height: "0.1999996mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin28"], pcbX: "-2.199894mm", pcbY: "0mm", width: "0.5050028mm", height: "0.1999996mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin29"], pcbX: "-2.199894mm", pcbY: "-0.40005mm", width: "0.5050028mm", height: "0.1999996mm", radius: "0.0999998mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin31"], pcbX: "0mm", pcbY: "0mm", width: "3.1999936mm", height: "1.1999976mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin15"], points: [
{ x: "2.4500078mm", y: "0.8999982mm" },
{ x: "2.4500078mm", y: "0.6999986mm" },
{ x: "1.9500088mm", y: "0.700024mm" },
{ x: "1.9500088mm", y: "0.7001256mm" },
{ x: "1.9500088mm", y: "0.8000492mm" },
{ x: "1.9500088mm", y: "0.8000492mm" },
{ x: "2.0500086mm", y: "0.8999982mm" },
], shape: "polygon" }), jsx("smtpad", { portHints: ["pin16"], points: [
{ x: "1.8999962mm", y: "1.4499844mm" },
{ x: "1.6999712mm", y: "1.4499844mm" },
{ x: "1.700022mm", y: "0.9500362mm" },
{ x: "1.7001998mm", y: "0.9500362mm" },
{ x: "1.8000218mm", y: "0.9500362mm" },
{ x: "1.8000218mm", y: "0.9500362mm" },
{ x: "1.8999962mm", y: "1.0499852mm" },
], shape: "polygon" }), jsx("smtpad", { portHints: ["pin1"], points: [
{ x: "-1.900047mm", y: "-1.4499844mm" },
{ x: "-1.700022mm", y: "-1.4499844mm" },
{ x: "-1.7000728mm", y: "-0.9500362mm" },
{ x: "-1.7002506mm", y: "-0.9500362mm" },
{ x: "-1.8000726mm", y: "-0.9500362mm" },
{ x: "-1.8000726mm", y: "-0.9500362mm" },
{ x: "-1.900047mm", y: "-1.0499852mm" },
], shape: "polygon" }), jsx("smtpad", { portHints: ["pin30"], points: [
{ x: "-2.4500332mm", y: "-0.8999728mm" },
{ x: "-2.4500332mm", y: "-0.6999986mm" },
{ x: "-1.9500596mm", y: "-0.700024mm" },
{ x: "-1.9500596mm", y: "-0.7001002mm" },
{ x: "-1.9500596mm", y: "-0.8000492mm" },
{ x: "-1.9500596mm", y: "-0.8000492mm" },
{ x: "-2.0500594mm", y: "-0.8999728mm" },
], shape: "polygon" }), jsx("smtpad", { portHints: ["pin26"], points: [
{ x: "-2.4499316mm", y: "0.8998712mm" },
{ x: "-2.4499316mm", y: "0.699897mm" },
{ x: "-1.9499326mm", y: "0.6999478mm" },
{ x: "-1.9499326mm", y: "0.7000748mm" },
{ x: "-1.9499326mm", y: "0.7999476mm" },
{ x: "-1.9499326mm", y: "0.7999476mm" },
{ x: "-2.0499832mm", y: "0.8999982mm" },
], shape: "polygon" }), jsx("smtpad", { portHints: ["pin25"], points: [
{ x: "-1.900047mm", y: "1.4499336mm" },
{ x: "-1.700022mm", y: "1.4498828mm" },
{ x: "-1.7001236mm", y: "0.9499854mm" },
{ x: "-1.7002506mm", y: "0.9499346mm" },
{ x: "-1.8000472mm", y: "0.9499346mm" },
{ x: "-1.8000472mm", y: "0.9499346mm" },
{ x: "-1.900047mm", y: "1.0498074mm" },
], shape: "polygon" }), jsx("smtpad", { portHints: ["pin10"], points: [
{ x: "1.900047mm", y: "-1.450086mm" },
{ x: "1.6999712mm", y: "-1.4500606mm" },
{ x: "1.7000474mm", y: "-0.9501378mm" },
{ x: "1.7002252mm", y: "-0.9501378mm" },
{ x: "1.7999964mm", y: "-0.9501124mm" },
{ x: "1.7999964mm", y: "-0.9501124mm" },
{ x: "1.9001232mm", y: "-1.0499852mm" },
], shape: "polygon" }), jsx("smtpad", { portHints: ["pin11"], points: [
{ x: "2.449957mm", y: "-0.899922mm" },
{ x: "2.449957mm", y: "-0.6999986mm" },
{ x: "1.9499326mm", y: "-0.6999986mm" },
{ x: "1.9499326mm", y: "-0.7001256mm" },
{ x: "1.9499326mm", y: "-0.8000492mm" },
{ x: "1.9499326mm", y: "-0.8000492mm" },
{ x: "2.0499832mm", y: "-0.899922mm" },
], shape: "polygon" }), jsx("silkscreenpath", { route: [
{ x: -2.3262081999999964, y: 1.1025124000000233 },
{ x: -2.3262081999999964, y: 1.326210200000105 },
{ x: -2.1025103999999146, y: 1.326210200000105 },
] }), jsx("silkscreenpath", { route: [
{ x: 2.3262081999999964, y: 1.1025124000000233 },
{ x: 2.3262081999999964, y: 1.326210200000105 },
{ x: 2.1025104000000283, y: 1.326210200000105 },
] }), jsx("silkscreenpath", { route: [
{ x: -2.3262081999999964, y: -1.1025124000000233 },
{ x: -2.3262081999999964, y: -1.326210200000105 },
{ x: -2.1025103999999146, y: -1.326210200000105 },
] }), jsx("silkscreenpath", { route: [
{ x: 2.3262081999999964, y: -1.1025124000000233 },
{ x: 2.3262081999999964, y: -1.326210200000105 },
{ x: 2.1025104000000283, y: -1.326210200000105 },
] }), jsx("silkscreencircle", { pcbX: "-1.800098mm", pcbY: "-1.729994mm", radius: "0.07493mm" }), jsx("silkscreentext", { text: "{NAME}", pcbX: "-0.0127mm", pcbY: "2.4478mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("courtyardoutline", { outline: [
{ x: -2.702395400000114, y: 1.702397400000109 },
{ x: 2.7023954000000003, y: 1.702397400000109 },
{ x: 2.7023954000000003, y: -1.7023973999999953 },
{ x: -2.702395400000114, y: -1.7023973999999953 },
{ x: -2.702395400000114, y: 1.702397400000109 },
] })] }), cadModel: {
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C165155.obj?uuid=db8cca3278554dd79dd0e7b7f825ecec",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C165155.step?uuid=db8cca3278554dd79dd0e7b7f825ecec",
pcbRotationOffset: 0,
modelOriginPosition: {
x: 0.000012700000070253736,
y: 0.000012699999842880061,
z: -0.025,
},
}, ...props, ...placementFor(props.name), children: jsx(SchematicNote, { text: "USB-C orientation / CC control\n3.3 V logic; 5 V supply; 5 Gbps" + (props.name === "U_C1_MUX" ? "\nUSB3 TX/RX P/N swapped: DS00004191B" : "") }) }));
};
const pinLabels$3 = {
pin1: ["PGND"],
pin2: ["VIN"],
pin3: ["EN"],
pin4: ["AGND"],
pin5: ["FB"],
pin6: ["VOS"],
pin7: ["SW"],
pin8: ["PG"],
pin9: ["PAD"],
};
const pinAttributes$3 = {
pin1: { requiresGround: true },
pin2: { requiresPower: true },
pin4: { requiresGround: true },
};
const TPS62160DSGR = (props) => {
return (jsx("chip", { pinLabels: pinLabels$3, pinAttributes: pinAttributes$3, supplierPartNumbers: {
jlcpcb: ["C324077"],
}, manufacturerPartNumber: "TPS62160DSGR", footprint: jsxs("footprint", { children: [jsx("smtpad", { portHints: ["pin1"], pcbX: "-0.94996mm", pcbY: "0.750062mm", width: "0.5210048mm", height: "0.2500122mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin2"], pcbX: "-0.94996mm", pcbY: "0.249936mm", width: "0.5210048mm", height: "0.2500122mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin3"], pcbX: "-0.94996mm", pcbY: "-0.249936mm", width: "0.5210048mm", height: "0.2500122mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin4"], pcbX: "-0.94996mm", pcbY: "-0.750062mm", width: "0.5210048mm", height: "0.2500122mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin5"], pcbX: "0.94996mm", pcbY: "-0.750062mm", width: "0.5210048mm", height: "0.2500122mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin6"], pcbX: "0.94996mm", pcbY: "-0.249936mm", width: "0.5210048mm", height: "0.2500122mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin7"], pcbX: "0.94996mm", pcbY: "0.249936mm", width: "0.5210048mm", height: "0.2500122mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin8"], pcbX: "0.94996mm", pcbY: "0.750062mm", width: "0.5210048mm", height: "0.2500122mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin9"], pcbX: "0mm", pcbY: "0mm", width: "0.8999982mm", height: "1.5999968mm", shape: "rect" }), jsx("silkscreenpath", { route: [
{ x: -1.040002999999956, y: -1.0599928000000318 },
{ x: 1.059052999999949, y: -1.0599928000000318 },
] }), jsx("silkscreenpath", { route: [
{ x: 1.0500359999998636, y: 1.0627359999999726 },
{ x: -1.0500359999999773, y: 1.0627359999999726 },
] }), jsx("silkscreencircle", { pcbX: "-1.397mm", pcbY: "1.143mm", radius: "0.0762mm" }), jsx("silkscreentext", { text: "{NAME}", pcbX: "-0.127mm", pcbY: "2.2319mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("courtyardoutline", { outline: [
{ x: -1.460462399999983, y: 1.249998000000005 },
{ x: 1.460462399999983, y: 1.249998000000005 },
{ x: 1.460462399999983, y: -1.249998000000005 },
{ x: -1.460462399999983, y: -1.249998000000005 },
{ x: -1.460462399999983, y: 1.249998000000005 },
] })] }), cadModel: {
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C324077.obj?uuid=2be2baea8d8242eebd2ce617314d92a1",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C324077.step?uuid=2be2baea8d8242eebd2ce617314d92a1",
pcbRotationOffset: 0,
modelOriginPosition: { x: 0, y: 0, z: 0 },
}, ...props, ...placementFor(props.name), children: jsx(SchematicNote, { text: "Buck supply, 1 A output\n3–17 V input; external feedback" }) }));
};
const pinLabels$2 = {
pin1: ["IN"],
pin2: ["GND"],
pin3: ["EN"],
pin4: ["FAULT"],
pin5: ["ILIM"],
pin6: ["OUT"],
};
const pinAttributes$2 = {
pin1: { requiresPower: true },
pin6: { providesPower: true },
pin2: { requiresGround: true },
};
const TPS2553DBVR = (props) => {
return (jsx("chip", { pinLabels: pinLabels$2, pinAttributes: pinAttributes$2, supplierPartNumbers: {
jlcpcb: ["C55266"],
}, manufacturerPartNumber: "TPS2553DBVR", footprint: jsxs("footprint", { children: [jsx("smtpad", { portHints: ["pin3"], pcbX: "1.35001mm", pcbY: "0.94996mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin2"], pcbX: "1.35001mm", pcbY: "-0mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin1"], pcbX: "1.35001mm", pcbY: "-0.94996mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin6"], pcbX: "-1.35001mm", pcbY: "-0.94996mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin5"], pcbX: "-1.35001mm", pcbY: "-0mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin4"], pcbX: "-1.35001mm", pcbY: "0.94996mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("silkscreenpath", { route: [
{ x: -0.899998200000141, y: 1.5499080000000731 },
{ x: 0.9000236000000541, y: 1.5499080000000731 },
] }), jsx("silkscreenpath", { route: [
{ x: -0.899998200000141, y: -1.5501111999999466 },
{ x: 0.9000236000000541, y: -1.5501111999999466 },
] }), jsx("silkscreencircle", { pcbX: "1.397mm", pcbY: "-1.651mm", radius: "0.127mm" }), jsx("silkscreentext", { text: "{NAME}", pcbX: "0.012446mm", pcbY: "2.562354mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("courtyardoutline", { outline: [
{ x: -2.150008899999989, y: 1.6999081999999817 },
{ x: 2.150008899999989, y: 1.6999081999999817 },
{ x: 2.150008899999989, y: -1.700085999999942 },
{ x: -2.150008899999989, y: -1.700085999999942 },
{ x: -2.150008899999989, y: 1.6999081999999817 },
] })] }), cadModel: {
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C55266.obj?uuid=229b69761e2c45dba6a83d8866dec72d",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C55266.step?uuid=229b69761e2c45dba6a83d8866dec72d",
pcbRotationOffset: 180,
modelOriginPosition: {
x: 0.000025399999913133797,
y: -889000000370288e-19,
z: -0.048939,
},
}, ...props, ...placementFor(props.name), children: jsx(SchematicNote, { text: "Current-limited power switch\n2.5–6.5 V; resistor-set limit" }) }));
};
const pinLabels$1 = {
pin1: ["1A"],
pin2: ["GND"],
pin3: ["2A"],
pin4: ["2Y"],
pin5: ["VCC"],
pin6: ["1Y"],
};
const pinAttributes$1 = {
pin2: { requiresGround: true },
pin5: { requiresPower: true },
};
const SN74LVC2G04DBVR = (props) => {
return (jsx("chip", { pinLabels: pinLabels$1, pinAttributes: pinAttributes$1, supplierPartNumbers: {
jlcpcb: ["C10428"],
}, manufacturerPartNumber: "SN74LVC2G04DBVR", footprint: jsxs("footprint", { children: [jsx("smtpad", { portHints: ["pin3"], pcbX: "1.35001mm", pcbY: "0.94996mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin2"], pcbX: "1.35001mm", pcbY: "-0mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin1"], pcbX: "1.35001mm", pcbY: "-0.94996mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin6"], pcbX: "-1.35001mm", pcbY: "-0.94996mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin5"], pcbX: "-1.35001mm", pcbY: "-0mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin4"], pcbX: "-1.35001mm", pcbY: "0.94996mm", width: "1.0999978mm", height: "0.5999988mm", shape: "rect" }), jsx("silkscreenpath", { route: [
{ x: -0.899998200000141, y: 1.5499080000000731 },
{ x: 0.9000236000000541, y: 1.5499080000000731 },
] }), jsx("silkscreenpath", { route: [
{ x: -0.899998200000141, y: -1.5501111999999466 },
{ x: 0.9000236000000541, y: -1.5501111999999466 },
] }), jsx("silkscreencircle", { pcbX: "1.397mm", pcbY: "-1.651mm", radius: "0.127mm" }), jsx("silkscreentext", { text: "{NAME}", pcbX: "0.012446mm", pcbY: "2.562354mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("courtyardoutline", { outline: [
{ x: -2.150008899999989, y: 1.6999081999999817 },
{ x: 2.150008899999989, y: 1.6999081999999817 },
{ x: 2.150008899999989, y: -1.700085999999942 },
{ x: -2.150008899999989, y: -1.700085999999942 },
{ x: -2.150008899999989, y: 1.6999081999999817 },
] })] }), cadModel: {
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C10428.obj?uuid=229b69761e2c45dba6a83d8866dec72d",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C10428.step?uuid=229b69761e2c45dba6a83d8866dec72d",
pcbRotationOffset: 180,
modelOriginPosition: {
x: 0.000025399999913133797,
y: -889000000370288e-19,
z: -0.048939,
},
}, ...props, ...placementFor(props.name), children: jsx(SchematicNote, { text: "Dual inverter\n1.65–5.5 V supply; 3.3 V here" }) }));
};
const pinLabels = {
pin1: ["I", "O"],
pin2: ["GND"],
};
const pinAttributes = {
pin2: { requiresGround: true },
};
const TPD1E05U06DPYR = (props) => {
return (jsx("chip", { pinLabels: pinLabels, pinAttributes: pinAttributes, supplierPartNumbers: {
jlcpcb: ["C436349"],
}, manufacturerPartNumber: "TPD1E05U06DPYR", footprint: jsxs("footprint", { children: [jsx("smtpad", { portHints: ["pin2"], pcbX: "0.324993mm", pcbY: "0mm", width: "0.3999992mm", height: "0.5999988mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin1"], pcbX: "-0.324993mm", pcbY: "0mm", width: "0.3999992mm", height: "0.5999988mm", shape: "rect" }), jsx("silkscreenpath", { route: [
{ x: -0.8322564000000057, y: 0.3550412000000023 },
{ x: -0.8322564000000057, y: -0.35107880000001046 },
] }), jsx("silkscreenpath", { route: [
{ x: 0.12677139999999554, y: 0.43294300000000874 },
{ x: 0.6565391999999832, y: 0.43294300000000874 },
{ x: 0.6565391999999832, y: -0.43428919999999493 },
{ x: 0.1376425999999924, y: -0.43428919999999493 },
{ x: 0.1376425999999924, y: -0.4324603999999965 },
] }), jsx("silkscreenpath", { route: [
{ x: -0.15808960000001093, y: 0.41661080000000084 },
{ x: -0.5971540000000033, y: 0.41661080000000084 },
{ x: -0.6878574000000128, y: 0.3259073999999913 },
{ x: -0.6878574000000128, y: -0.35082479999998384 },
{ x: -0.6043930000000017, y: -0.43428919999999493 },
{ x: -0.1544573999999983, y: -0.43428919999999493 },
{ x: -0.1526286000000141, y: -0.4324603999999965 },
] }), jsx("silkscreentext", { text: "{NAME}", pcbX: "-0.081915mm", pcbY: "1.4318mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("fabricationnotepath", { route: [
{ x: -0.6286754000000059, y: 0.13086079999999356 },
{ x: -0.6286754000000059, y: -0.1891284000000013 },
{ x: -0.5886958000000106, y: -0.1891284000000013 },
{ x: -0.5886958000000106, y: 0.13086079999999356 },
{ x: -0.6286754000000059, y: 0.13086079999999356 },
], strokeWidth: "0mm", isFilled: true, hasStroke: false }), jsx("fabricationnotepath", { route: [
{ x: -0.5486907999999886, y: -0.20914360000000443 },
{ x: -0.408686000000003, y: 0.1708658000000014 },
{ x: -0.38966744110929596, y: 0.17911858836004058 },
{ x: -0.3805428000000006, y: 0.16050259999998673 },
{ x: -0.5205476000000004, y: -0.21950679999999068 },
{ x: -0.5395661588907075, y: -0.22775958835998722 },
{ x: -0.548690800000017, y: -0.20914360000000443 },
{ x: -0.5486907999999886, y: -0.20914360000000443 },
], strokeWidth: "0mm", isFilled: true, hasStroke: false }), jsx("fabricationnotepath", { route: [
{ x: -0.3086861999999968, y: 0.11087100000000305 },
{ x: -0.1886712000000017, y: 0.11087100000000305 },
{ x: -0.18394438497651322, y: 0.1096817007255737 },
{ x: -0.18034000000000106, y: 0.10640060000000062 },
{ x: -0.14033500000000743, y: 0.04640580000000227 },
{ x: -0.13908794104592914, y: 0.043760982986100316 },
{ x: -0.1386585999999852, y: 0.04086860000001025 },
{ x: -0.13865860000001362, y: -0.1391411999999974 },
{ x: -0.13943033594124188, y: -0.14296449723315163 },
{ x: -0.14160500000001264, y: -0.14620239999999285 },
{ x: -0.18160999999999206, y: -0.1861820000000023 },
{ x: -0.18484790276684748, y: -0.18835666405877305 },
{ x: -0.1886712000000017, y: -0.1891284000000013 },
{ x: -0.3086861999999968, y: -0.1891284000000013 },
{ x: -0.312509497233151, y: -0.18835666405877305 },
{ x: -0.31574740000000645, y: -0.1861820000000023 },
{ x: -0.3557270000000159, y: -0.14620240000000706 },
{ x: -0.35790166405878665, y: -0.14296449723315163 },
{ x: -0.3586734000000149, y: -0.1391411999999974 },
{ x: -0.3586734000000149, y: 0.0008636000000024069 },
{ x: -0.3386582000000118, y: 0.0008636000000024069 },
{ x: -0.3386582000000118, y: -0.1350010000000026 },
{ x: -0.3045460000000162, y: -0.1691131999999982 },
{ x: -0.19281140000001074, y: -0.1691131999999982 },
{ x: -0.15867380000000253, y: -0.1350010000000026 },
{ x: -0.15867380000000253, y: 0.03784599999998761 },
{ x: -0.19403060000000494, y: 0.09085579999999993 },
{ x: -0.3086861999999968, y: 0.09085579999999993 },
{ x: -0.3086861999999968, y: 0.11087100000000305 },
], strokeWidth: "0mm", isFilled: true, hasStroke: false }), jsx("fabricationnotepath", { route: [
{ x: -0.3579622000000171, y: -0.005410200000000032 },
{ x: -0.31795720000000927, y: 0.09458960000000616 },
{ x: -0.3050782105412537, y: 0.09983831772815677 },
{ x: -0.29938980000000015, y: 0.08714740000000631 },
{ x: -0.339394800000008, y: -0.012852399999999875 },
{ x: -0.3522737894587351, y: -0.01810111772807943 },
{ x: -0.3579622000000313, y: -0.005410200000000032 },
{ x: -0.3579622000000171, y: -0.005410200000000032 },
], strokeWidth: "0mm", isFilled: true, hasStroke: false }), jsx("fabricationnotepath", { route: [
{ x: 0.2800095999999854, y: 0.10998961999999324 },
{ x: 0.204139799999993, y: 0.10998961999999324 },
{ x: 0.15000478000000328, y: 0.05585460000000353 },
{ x: 0.15000478000000328, y: -0.07586980000000665 },
{ x: 0.18415000000000248, y: -0.10998961999999324 },
{ x: 0.27000199999999097, y: -0.10998961999999324 },
{ x: 0.27000199999999097, y: -0.01998980000000472 },
{ x: 0.28000578999998993, y: -0.010258322066931669 },
{ x: 0.2900095800000031, y: -0.01998980000000472 },
{ x: 0.2900095800000031, y: -0.11998960000001091 },
{ x: 0.28707842472221046, y: -0.12705842472223594 },
{ x: 0.2800095999999854, y: -0.12998958000001437 },
{ x: 0.18000980000000766, y: -0.12998958000001437 },
{ x: 0.17618738076862428, y: -0.1292213632611947 },
{ x: 0.172948599999998, y: -0.12705080000000635 },
{ x: 0.13294359999999017, y: -0.0870711999999969 },
{ x: 0.1307730367388018, y: -0.08383241923138485 },
{ x: 0.13000481999998215, y: -0.08001000000000147 },
{ x: 0.13000481999998215, y: 0.05999479999999835 },
{ x: 0.1307730367388018, y: 0.06381721923138173 },
{ x: 0.13294359999999017, y: 0.067056000000008 },
{ x: 0.19293839999998852, y: 0.12705079999999214 },
{ x: 0.1961771807686148, y: 0.1292213632611947 },
{ x: 0.19999959999999817, y: 0.12998958000000016 },
{ x: 0.2800095999999854, y: 0.12998958000000016 },
{ x: 0.28962674160335666, y: 0.1199895999999967 },
{ x: 0.2800095999999854, y: 0.10998961999999324 },
], strokeWidth: "0mm", isFilled: true, hasStroke: false }), jsx("fabricationnotepath", { route: [
{ x: 0.34999421999999925, y: -0.14000479999999982 },
{ x: 0.34999421999999925, y: 0.1199895999999967 },
{ x: 0.35785330820561967, y: 0.1297049406486508 },
{ x: 0.36906199999998535, y: 0.12418060000000253 },
{ x: 0.47000159999998914, y: -0.09448800000001256 },
{ x: 0.47000159999998914, y: 0.1199895999999967 },
{ x: 0.4800053900000023, y: 0.12972107793305554 },
{ x: 0.4900091800000155, y: 0.1199895999999967 },
{ x: 0.49000918000000127, y: -0.14000479999999982 },
{ x: 0.48215009179436663, y: -0.1497201406486539 },
{ x: 0.47094140000000095, y: -0.14419580000000565 },
{ x: 0.37000179999999716, y: 0.07447280000000944 },
{ x: 0.37000179999999716, y: -0.14000479999999982 },
{ x: 0.3599980099999982, y: -0.14973627793307287 },
{ x: 0.34999421999998503, y: -0.14000479999999982 },
{ x: 0.34999421999999925, y: -0.14000479999999982 },
], strokeWidth: "0mm", isFilled: true, hasStroke: false }), jsx("fabricationnotepath", { route: [
{ x: 0.5699937800000043, y: 0.1199895999999967 },
{ x: 0.5699937800000043, y: -0.14000479999999982 },
{ x: 0.5599937999999867, y: -0.14962194160337106 },
{ x: 0.5499938199999974, y: -0.14000479999999982 },
{ x: 0.5499938199999974, y: 0.1199895999999967 },
{ x: 0.5599937999999867, y: 0.12960674160336794 },
{ x: 0.5699937800000043, y: 0.1199895999999967 },
], strokeWidth: "0mm", isFilled: true, hasStroke: false }), jsx("fabricationnotepath", { route: [
{ x: 0.6900087799999994, y: 0 },
{ x: 0.6900087799999994, y: -0.01998980000000472 },
{ x: 0.6800049899999863, y: -0.029721277933077772 },
{ x: 0.6700011999999731, y: -0.01998980000000472 },
{ x: 0.6700011999999873, y: 0 },
{ x: 0.6800049899999863, y: 0.009731477933073052 },
{ x: 0.6900087799999994, y: 0 },
], strokeWidth: "0mm", isFilled: true, hasStroke: false }), jsx("fabricationnotepath", { route: [
{ x: 0.5600191999999851, y: 0.10998961999999324 },
{ x: 0.6377909122092689, y: 0.07777394397827209 },
{ x: 0.6700011999999873, y: 0 },
{ x: 0.6800049899999863, y: -0.010283722066944279 },
{ x: 0.6900087799999994, y: 0 },
{ x: 0.6519334818785723, y: 0.09191428187857298 },
{ x: 0.5600191999999851, y: 0.12998958000000016 },
{ x: 0.5496211416033532, y: 0.1199895999999967 },
{ x: 0.5600191999999851, y: 0.10998961999999324 },
], strokeWidth: "0mm", isFilled: true, hasStroke: false }), jsx("fabricationnotepath", { route: [
{ x: 0.6700011999999873, y: -0.01998980000000472 },
{ x: 0.6377834727214804, y: -0.09778170449051515 },
{ x: 0.5599937999999867, y: -0.13000481999999636 },
{ x: 0.549595741603369, y: -0.14000479999999982 },
{ x: 0.5599937999999867, y: -0.15000478000000328 },
{ x: 0.6519260423907696, y: -0.11192204239078762 },
{ x: 0.6900087799999994, y: -0.01998980000000472 },
{ x: 0.6800049899999863, y: -0.009706077933074653 },
{ x: 0.6700011999999731, y: -0.01998980000000472 },
{ x: 0.6700011999999873, y: -0.01998980000000472 },
], strokeWidth: "0mm", isFilled: true, hasStroke: false }), jsx("courtyardoutline", { outline: [
{ x: -0.7749925999999903, y: 0.5499994000000044 },
{ x: 0.7749925999999903, y: 0.5499994000000044 },
{ x: 0.7749925999999903, y: -0.5499994000000044 },
{ x: -0.7749925999999903, y: -0.5499994000000044 },
{ x: -0.7749925999999903, y: 0.5499994000000044 },
] })] }), cadModel: {
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C436349.obj?uuid=6b949832b6e54429b6fc36202eac00ba",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C436349.step?uuid=6b949832b6e54429b6fc36202eac00ba",
pcbRotationOffset: 0,
modelOriginPosition: { x: 0, y: 0, z: -0.03 },
}, ...props, ...placementFor(props.name), children: jsx(SchematicNote, { text: "Signal ESD protection\n5.5 V working voltage; 0.42 pF" }) }));
};
const EsdBank = ({ prefix, signals, pcbX, pcbY, vertical = false, }) => (jsx("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, name: `${prefix}_esd`, schGrid: true, gridCols: 4, gridGap: 2, children: signals.map((signal, index) => (jsx(TPD1E05U06DPYR, { name: `D_${prefix}_${index + 1}`, pcbX: pcbX + (vertical ? Math.floor(index / 4) * 1.8 : (index % 4) * 1.8), pcbY: pcbY - (vertical ? (index % 4) * 1.3 : Math.floor(index / 4) * 1.3), ...placementFor(`D_${prefix}_${index + 1}`), connections: { I: `net.${signal}`, GND: "net.GND" }, pcbStyle: { silkscreenTextVisibility: "hidden" } }, signal))) }));
const parts$2 = [
{
name: "C_HOST",
kind: "capacitor",
rating: "4.7uF",
footprint: "0603",
pcbX: -32,
pcbY: 20,
from: "VBUS_HOST",
to: "GND",
},
{
name: "C_VBUS",
kind: "capacitor",
rating: "10uF",
footprint: "0805",
pcbX: -28,
pcbY: 24,
from: "VBUS_HUB",
to: "GND",
},
{
name: "R_ILIM_BASE",
kind: "resistor",
rating: "22.1k",
pcbX: -27,
pcbY: 16,
from: "INPUT_ILIM_BASE",
to: "GND",
},
{
name: "R_ILIM_MID",
kind: "resistor",
rating: "16.9k",
pcbX: -29,
pcbY: 16,
from: "INPUT_ILIM_MID",
to: "INPUT_ILIM_BASE",
},
{
name: "R_ILIM_LOW",
kind: "resistor",
rating: "20k",
pcbX: -31,
pcbY: 16,
from: "INPUT_ILIM",
to: "INPUT_ILIM_MID",
},
{
name: "R_INPUT_FAULT",
kind: "resistor",
rating: "10k",
pcbX: -33,
pcbY: 16,
from: "VBUS_HOST",
to: "INPUT_FAULT_N",
},
{
name: "R_HOST_SPEED",
kind: "resistor",
rating: "200k",
pcbX: -22,
pcbY: 25,
from: "VDD33",
to: "HUB_HOST_TYPE0",
},
{
name: "R_HOST_CURRENT",
kind: "resistor",
rating: "200k",
pcbX: -22,
pcbY: 23.5,
from: "VDD33",
to: "HOST_CURRENT_GE_1A5_N",
},
{
name: "R_HOST_CURRENT3",
kind: "resistor",
rating: "200k",
pcbX: -22,
pcbY: 22,
from: "VDD33",
to: "HOST_CURRENT_3A_N",
},
{
name: "R_HOST_DIR",
kind: "resistor",
rating: "200k",
pcbX: -25,
pcbY: 10,
from: "VDD33",
to: "UP_DIR",
},
{
name: "R_UP_VSENSE",
kind: "resistor",
rating: "887k",
pcbX: -29,
pcbY: 10,
from: "VBUS_HOST",
to: "UP_VBUS_SENSE",
},
{
name: "C_UP_33",
kind: "capacitor",
rating: "100nF",
pcbX: -28,
pcbY: 7.5,
from: "VDD33",
to: "GND",
},
{
name: "C_UP_5",
kind: "capacitor",
rating: "100nF",
pcbX: -30,
pcbY: 7.5,
from: "VBUS_HOST",
to: "GND",
},
{
name: "C_UP_TXP",
kind: "capacitor",
rating: "100nF",
pcbRotation: 90,
pcbX: -14,
pcbY: 10,
from: "UP_TXP",
to: "UP_TXP_AC",
},
{
name: "C_UP_TXN",
kind: "capacitor",
rating: "100nF",
pcbRotation: 90,
pcbX: -14,
pcbY: 8.5,
from: "UP_TXN",
to: "UP_TXN_AC",
},
{
name: "C_CORE_IN",
kind: "capacitor",
rating: "10uF",
footprint: "0805",
pcbX: -28,
pcbY: 30,
from: "VBUS_HUB",
to: "GND",
},
{
name: "L_CORE",
kind: "inductor",
rating: "2.2uH",
footprint: jsx(Coilcraft4020, {}),
manufacturerPartNumber: "XFL4020-222MEC",
pcbX: -20,
pcbY: 29,
from: "CORE_SW",
to: "VDD12",
},
{
name: "C_CORE_OUT",
kind: "capacitor",
rating: "22uF",
footprint: "0805",
pcbX: -16,
pcbY: 29,
from: "VDD12",
to: "GND",
},
{
name: "R_CORE_FB1",
kind: "resistor",
rating: "100k",
pcbX: -22,
pcbY: 27,
from: "VDD12",
to: "CORE_FB",
},
{
name: "R_CORE_FB2",
kind: "resistor",
rating: "200k",
pcbX: -24,
pcbY: 27,
from: "CORE_FB",
to: "GND",
},
{
name: "R_CORE_PG",
kind: "resistor",
rating: "100k",
pcbX: -26,
pcbY: 27,
from: "VBUS_HUB",
to: "CORE_PG",
},
{
name: "C_33_IN",
kind: "capacitor",
rating: "10uF",
footprint: "0805",
pcbX: -14,
pcbY: 24,
from: "VBUS_HUB",
to: "GND",
},
{
name: "L_33",
kind: "inductor",
rating: "2.2uH",
footprint: jsx(Coilcraft4020, {}),
manufacturerPartNumber: "XFL4020-222MEC",
pcbX: -6,
pcbY: 26,
from: "VDD33_SW",
to: "VDD33",
},
{
name: "C_33_OUT",
kind: "capacitor",
rating: "22uF",
footprint: "0805",
pcbX: -2,
pcbY: 26,
from: "VDD33",
to: "GND",
},
{
name: "R_33_FB1",
kind: "resistor",
rating: "316k",
pcbX: -8,
pcbY: 23,
from: "VDD33",
to: "VDD33_FB",
},
{
name: "R_33_FB2",
kind: "resistor",
rating: "100k",
pcbX: -10,
pcbY: 23,
from: "VDD33_FB",
to: "GND",
},
{
name: "R_RESET",
kind: "resistor",
rating: "10k",
pcbX: -12,
pcbY: 19,
from: "VDD33",
to: "RESET_N",
},
{
name: "C_RESET",
kind: "capacitor",
rating: "100nF",
pcbX: -14,
pcbY: 19,
from: "VDD33",
to: "GND",
},
{
name: "R_HUB_BIAS",
kind: "resistor",
rating: "12k",
pcbX: -10,
pcbY: 13,
from: "HUB_RBIAS",
to: "GND",
},
{
name: "R_HUB_CFG",
kind: "resistor",
rating: "200k",
pcbX: -11,
pcbY: 6,
from: "HUB_CFG",
to: "GND",
},
{
name: "R_BC_DISABLE",
kind: "resistor",
rating: "200k",
pcbX: 10,
pcbY: 6,
from: "HUB_SPI_MISO",
to: "GND",
},
{
name: "R_NON_REM",
kind: "resistor",
rating: "200k",
pcbX: 10,
pcbY: 4.5,
from: "HUB_SPI_CS",
to: "GND",
},
{
name: "R_SMB_SDA",
kind: "resistor",
rating: "10k",
pcbX: 10,
pcbY: 3,
from: "VDD33",
to: "HUB_SMBDATA",
},
{
name: "R_SMB_SCL",
kind: "resistor",
rating: "10k",
pcbX: 10,
pcbY: 1.5,
from: "VDD33",
to: "HUB_SMBCLK",
},
{
name: "R_VBUS_DET1",
kind: "resistor",
rating: "100k",
pcbX: -11,
pcbY: 4.5,
from: "VBUS_HOST",
to: "HOST_VBUS_DET",
},
{
name: "R_VBUS_DET2",
kind: "resistor",
rating: "200k",
pcbX: -11,
pcbY: 3,
from: "HOST_VBUS_DET",
to: "GND",
},
{
name: "C_HUB_X1",
kind: "capacitor",
rating: "18pF",
pcbX: -15,
pcbY: 14,
from: "HUB_XTALI",
to: "GND",
},
{
name: "C_HUB_X2",
kind: "capacitor",
rating: "18pF",
pcbX: -19,
pcbY: 14,
from: "HUB_XTALO",
to: "GND",
},
{
name: "C_POWER_LOGIC",
kind: "capacitor",
rating: "100nF",
pcbX: -18,
pcbY: 21,
from: "VDD33",
to: "GND",
},
];
const HostAndPower = () => (jsx("schematicsheet", { name: "Host and Power", sheetIndex: 0, sheetWidth: "841mm", sheetHeight: "594mm", children: jsxs("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schAutoLayoutEnabled: true, children: [jsxs("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schTitle: "USB-C host, 5 Gbps; host-powered, no host charging", schGrid: true, gridCols: 3, gridGap: 5, children: [jsx(UsbCReceptacle, { name: "J_HOST", manufacturerPartNumber: "12401610E4#2A", pcbX: -38, pcbY: 19, pcbRotation: -90, pinLabels: usbCPinLabels, connections: usbCConnections({ prefix: "UP", vbus: "VBUS_HOST" }) }), jsx(HD3SS3220RNHR, { name: "U_UP_MUX", pcbX: -25, pcbY: 11, connections: muxConnections({
prefix: "UP",
source: "UP",
upstream: true,
vbus: "VBUS_HOST",
}) }), jsx(TPS2553DBVR, { name: "U_INPUT_LIMIT", pcbX: -29, pcbY: 20, connections: {
IN: "net.VBUS_HOST",
GND: "net.GND",
EN: "net.VBUS_HOST",
FAULT: "net.INPUT_FAULT_N",
ILIM: "net.INPUT_ILIM",
OUT: "net.VBUS_HUB",
} }), jsx(SN74LVC2G04DBVR, { name: "U_POWER_LOGIC", pcbX: -18, pcbY: 24, connections: {
pin1: "net.HUB_HOST_TYPE0",
pin2: "net.GND",
pin3: "net.HOST_CURRENT_GE_1A5_N",
pin4: "net.HIGH_CURRENT",
pin5: "net.VDD33",
pin6: "net.SS_HOST",
} }), jsx("chip", { name: "Q_ILIM_SS", pinLabels: { pin1: "gate", pin2: "source", pin3: "drain" }, pinAttributes: {
pin1: { mustBeConnected: true },
pin2: { mustBeConnected: true },
pin3: { mustBeConnected: true },
}, footprint: "sot23", manufacturerPartNumber: "2N7002-7-F", pcbX: -34, pcbY: 25, connections: {
gate: "net.SS_HOST",
source: "net.INPUT_ILIM_MID",
drain: "net.INPUT_ILIM",
}, ...placementFor("Q_ILIM_SS"), children: jsx(SchematicNote, { text: "N-channel MOSFET; 60 V VDS\nILIM bypass; physical pins G1 S2 D3" }) }), jsx("chip", { name: "Q_ILIM_CC", pinLabels: { pin1: "gate", pin2: "source", pin3: "drain" }, pinAttributes: {
pin1: { mustBeConnected: true },
pin2: { mustBeConnected: true },
pin3: { mustBeConnected: true },
}, footprint: "sot23", manufacturerPartNumber: "2N7002-7-F", pcbX: -34, pcbY: 29, connections: {
gate: "net.HIGH_CURRENT",
source: "net.INPUT_ILIM_BASE",
drain: "net.INPUT_ILIM",
}, ...placementFor("Q_ILIM_CC"), children: jsx(SchematicNote, { text: "N-channel MOSFET; 60 V VDS\nILIM bypass; physical pins G1 S2 D3" }) })] }), jsxs("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schTitle: "Sequenced 1.2 V / 3.3 V supplies; 1 A each", schGrid: true, gridCols: 3, gridGap: 5, children: [jsx(TPS62160DSGR, { name: "U_CORE_REG", pcbX: -24, pcbY: 30, connections: {
VIN: "net.VBUS_HUB",
EN: "net.VBUS_HUB",
PGND: "net.GND",
AGND: "net.GND",
PAD: "net.GND",
FB: "net.CORE_FB",
VOS: "net.VDD12",
SW: "net.CORE_SW",
PG: "net.CORE_PG",
} }), jsx(TPS62160DSGR, { name: "U_33_REG", pcbX: -10, pcbY: 26, connections: {
VIN: "net.VBUS_HUB",
EN: "net.CORE_PG",
PGND: "net.GND",
AGND: "net.GND",
PAD: "net.GND",
FB: "net.VDD33_FB",
VOS: "net.VDD33",
SW: "net.VDD33_SW",
} }), jsx("chip", { name: "U_RESET", manufacturerPartNumber: "TLV803EA29DBZR", footprint: "sot23", pcbX: -12, pcbY: 16, pinLabels: { pin1: "GND", pin2: "RESET_N", pin3: "VDD" }, pinAttributes: {
pin1: { requiresGround: true },
pin3: { requiresPower: true, requiresVoltage: "3.3V" },
}, connections: {
GND: "net.GND",
RESET_N: "net.RESET_N",
VDD: "net.VDD33",
}, ...placementFor("U_RESET"), children: jsx(SchematicNote, { text: "Supply supervisor\n2.9 V threshold; active-low reset" }) }), jsx("crystal", { name: "Y_HUB", pinVariant: "four_pin", frequency: "25MHz", loadCapacitance: "12pF", footprint: "crystal_w3.2mm_h2.5mm_4pin", manufacturerPartNumber: "ABM8-25.000MHZ-12-1-U-T", pcbX: -17, pcbY: 11, connections: {
pin1: "net.HUB_XTALI",
pin2: "net.GND",
pin3: "net.HUB_XTALO",
pin4: "net.GND",
}, ...placementFor("Y_HUB") }), jsx("schematicbox", { name: "HUB_POWER", chipRef: ".U_HUB", width: 6, height: 4.9, title: "USB5816C power, clock and configuration", pinLabels: hubPowerPinLabels }), jsx(SchematicNote, { chipName: "HUB_POWER", text: "USB5816C power / configuration\n1.2 V core; 3.3 V I/O; 25 MHz" }), jsx("chip", { name: "U_HUB_FLASH", manufacturerPartNumber: "W25Q16JVSSIQ", footprint: "soic8", pcbX: 15, pcbY: 5, pinAttributes: {
pin4: { requiresGround: true },
pin8: {
requiresPower: true,
requiresVoltage: "3.3V",
requiredVoltageTolerance: "10%",
},
}, pinLabels: {
pin1: "CS",
pin2: "DO",
pin3: "WP",
pin4: "GND",
pin5: "DI",
pin6: "CLK",
pin7: "HOLD",
pin8: "VCC",
}, connections: {
CS: "net.HUB_SPI_CS",
DO: "net.HUB_SPI_MISO",
WP: "net.VDD33",
GND: "net.GND",
DI: "net.HUB_SPI_MOSI",
CLK: "net.HUB_SPI_CLK",
HOLD: "net.VDD33",
VCC: "net.VDD33",
}, ...placementFor("U_HUB_FLASH"), children: jsx(SchematicNote, { text: "SPI configuration storage\n16 Mbit; 2.7–3.6 V supply" }) })] }), jsx(Passives, { parts: parts$2 }), jsx(HubBypass, {}), jsx(EsdBank, { prefix: "HOST", signals: [
"UP_DP",
"UP_DM",
"UP_TX1P",
"UP_TX1N",
"UP_RX1P",
"UP_RX1N",
"UP_TX2P",
"UP_TX2N",
"UP_RX2P",
"UP_RX2N",
"UP_CC1",
"UP_CC2",
], pcbX: -34, pcbY: 12, vertical: true }), jsx(Indicator, { name: "LED_POWER", net: "VDD33", pcbX: -24, pcbY: 3 })] }) }));
// Amphenol GSB311131HR, recommended top-view PCB layout, rev B2.
// Origin at the centre of USB2 contact row; mating direction is local -Y.
const UsbAReceptacle = (props) => (jsx("connector", { allowOffBoard: true, isSmt: false, cadModel: {
jscad: usbAModel,
modelOriginPosition: { x: 0, y: -0.775, z: 0 },
zOffsetFromSurface: 0,
}, footprint: jsxs("footprint", { children: [usbAPins.map((pin) => (jsx(Fragment$1, { children: jsx("platedhole", { portHints: [`pin${pin.pin}`], shape: "circle", pcbX: pin.x, pcbY: pin.y, holeDiameter: 0.7, outerDiameter: 1.2 }) }, pin.pin))), [-6.57, 6.57].map((x) => (jsx(Fragment$1, { children: jsx("platedhole", { portHints: ["pin10"], shape: "circle", pcbX: x, pcbY: -2, holeDiameter: 2.3, outerDiameter: 3.3 }) }, x))), jsx("courtyardrect", { pcbY: -5.53, width: 16.94, height: 17.5 }), jsx("fabricationnoterect", { pcbY: -5.53, width: 14.4, height: 16.5 }), jsx("silkscreenpath", { route: [
{ x: -7.35, y: -13.93 },
{ x: 7.35, y: -13.93 },
], strokeWidth: 0.12 }), jsx("silkscreentext", { pcbY: 4.1, text: props.name ?? "", fontSize: 0.7 })] }), ...props, ...placementFor(props.name) }));
const ports = [
{ number: 1, pcbX: 25, pcbY: 0 },
{ number: 2, pcbX: 14, pcbY: 19 },
{ number: 3, pcbX: 30, pcbY: 19 },
{ number: 4, pcbX: 25, pcbY: -15 },
];
const parts$1 = ports.flatMap((port) => [
{
name: `R_P${port.number}_ILIM`,
kind: "resistor",
rating: "169k",
pcbX: port.pcbX - 3,
pcbY: port.pcbY - 3,
from: `P${port.number}_ILIM`,
to: "GND",
},
{
name: `R_P${port.number}_CTRL`,
kind: "resistor",
rating: "10k",
pcbX: port.pcbX - 3,
pcbY: port.pcbY - 1.5,
from: "VDD33",
to: `PWR${port.number}`,
},
{
name: `C_P${port.number}_IN`,
kind: "capacitor",
rating: "1uF",
pcbX: port.pcbX - 3,
pcbY: port.pcbY,
from: "VBUS_HUB",
to: "GND",
},
{
name: `C_P${port.number}_OUT`,
kind: "capacitor",
rating: "150uF",
footprint: jsx(Electrolytic63, {}),
manufacturerPartNumber: "EEEFK1A151AP",
pcbX: port.pcbX + 3.5,
pcbY: port.pcbY - 3,
from: `P${port.number}_VBUS`,
to: "GND",
},
{
name: `C_D${port.number}_TXP`,
pcbRotation: port.number === 1 ? 180 : 270,
kind: "capacitor",
rating: "100nF",
pcbX: port.pcbX - 6,
pcbY: port.pcbY + 2,
from: `D${port.number}_TXP`,
to: `D${port.number}_TXP_AC`,
},
{
name: `C_D${port.number}_TXN`,
pcbRotation: port.number === 1 ? 180 : 270,
kind: "capacitor",
rating: "100nF",
pcbX: port.pcbX - 6,
pcbY: port.pcbY + 0.5,
from: `D${port.number}_TXN`,
to: `D${port.number}_TXN_AC`,
},
]);
const HubAndPorts = () => (jsx("schematicsheet", { name: "Hub and USB Ports", sheetIndex: 1, sheetWidth: "841mm", sheetHeight: "594mm", children: jsxs("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schAutoLayoutEnabled: true, children: [jsx("schematicbox", { name: "HUB_PORTS", chipRef: ".U_HUB", width: 6, height: 4.8, title: "USB5816C: four external 5 Gbps ports, internal SD reader", pinLabels: hubSignalPinLabels }), jsx(SchematicNote, { chipName: "HUB_PORTS", text: "Six-port 5 Gbps hub\nFour accessory ports; internal SD reader" }), jsx("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schTitle: "Two USB-A accessory ports", schGrid: true, gridCols: 2, gridGap: 8, children: [
{ number: 2, pcbX: 10 },
{ number: 3, pcbX: 26 },
].map((port) => (jsx(UsbAReceptacle, { name: `J_A${port.number - 1}`, manufacturerPartNumber: "GSB311131HR", pcbX: port.pcbX, pcbY: 21, pcbRotation: 180, pinLabels: usbAPinLabels, connections: {
VBUS: `net.P${port.number}_VBUS`,
DM: `net.D${port.number}_DM`,
DP: `net.D${port.number}_DP`,
GND: "net.GND",
GND_DRAIN: "net.GND",
SHIELD: "net.GND",
RXN: `net.D${port.number}_RXN`,
RXP: `net.D${port.number}_RXP`,
TXN: `net.D${port.number}_TXN_AC`,
TXP: `net.D${port.number}_TXP_AC`,
} }, port.number))) }), jsx("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schTitle: "Two reversible USB-C accessory ports; attachment-controlled VBUS", schAutoLayoutEnabled: true, children: [
{ number: 1, pcbY: 0 },
{ number: 4, pcbY: -15 },
].map((port) => (jsxs("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, children: [jsx(UsbCReceptacle, { name: `J_C${port.number === 1 ? 1 : 2}`, manufacturerPartNumber: "12401610E4#2A", pcbX: 38, pcbY: port.pcbY, pcbRotation: 90, pinLabels: usbCPinLabels, connections: usbCConnections({
prefix: `D${port.number}`,
vbus: `P${port.number}_VBUS`,
}) }), jsx(HD3SS3220RNHR, { name: `U_C${port.number}_MUX`, pcbX: 30, pcbY: port.pcbY + 4, connections: muxConnections({
prefix: `D${port.number}`,
source: `D${port.number}`,
invertSuperspeedPolarity: port.number === 1,
upstream: false,
vbus: `P${port.number}_VBUS`,
}) }), jsx(Passives, { parts: [
{
name: `R_D${port.number}_SENSE`,
kind: "resistor",
rating: "887k",
pcbX: 32,
pcbY: port.pcbY - 4,
from: `P${port.number}_VBUS`,
to: `D${port.number}_VBUS_SENSE`,
},
{
name: `R_D${port.number}_ID`,
kind: "resistor",
rating: "200k",
pcbX: 30,
pcbY: port.pcbY - 4,
from: "VDD33",
to: `D${port.number}_ID`,
},
{
name: `R_D${port.number}_DIR`,
kind: "resistor",
rating: "200k",
pcbX: 28,
pcbY: port.pcbY - 4,
from: "VDD33",
to: `D${port.number}_DIR`,
},
{
name: `C_D${port.number}_33`,
kind: "capacitor",
rating: "100nF",
pcbX: 27,
pcbY: port.pcbY + 6,
from: "VDD33",
to: "GND",
},
{
name: `C_D${port.number}_5`,
kind: "capacitor",
rating: "100nF",
pcbX: 27,
pcbY: port.pcbY + 4.5,
from: "VBUS_HOST",
to: "GND",
},
] }), jsx(EsdBank, { prefix: `C${port.number}`, signals: [
`D${port.number}_DP`,
`D${port.number}_DM`,
`D${port.number}_TX1P`,
`D${port.number}_TX1N`,
`D${port.number}_RX1P`,
`D${port.number}_RX1N`,
`D${port.number}_TX2P`,
`D${port.number}_TX2N`,
`D${port.number}_RX2P`,
`D${port.number}_RX2N`,
`D${port.number}_CC1`,
`D${port.number}_CC2`,
], pcbX: 26.5, pcbY: port.pcbY, vertical: true })] }, port.number))) }), jsxs("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schTitle: "Per-port current limiting and overcurrent feedback", schGrid: true, gridCols: 2, gridGap: 5, children: [ports.map((port) => (jsx(TPS2553DBVR, { name: `U_P${port.number}_SW`, pcbX: port.pcbX, pcbY: port.pcbY, connections: {
IN: "net.VBUS_HUB",
GND: "net.GND",
EN: `net.${port.number === 1 || port.number === 4 ? `P${port.number}_ENABLE` : `PWR${port.number}`}`,
FAULT: `net.PWR${port.number}`,
ILIM: `net.P${port.number}_ILIM`,
OUT: `net.P${port.number}_VBUS`,
} }, port.number))), jsx(SN74LVC2G04DBVR, { name: "U_ATTACH_INV", pcbX: 15, pcbY: -2, connections: {
pin1: "net.D1_ID",
pin2: "net.GND",
pin3: "net.D4_ID",
pin4: "net.D4_ATTACHED",
pin5: "net.VDD33",
pin6: "net.D1_ATTACHED",
} }), jsx("chip", { name: "U_ATTACH_AND", cadModel: {
jscad: {
type: "cuboid",
size: [2.0, 2.3, 1.0],
center: [0, 0, 0.5],
},
zOffsetFromSurface: 0,
}, manufacturerPartNumber: "SN74LVC2G08DCUR", pcbX: 15, pcbY: -7, pinAttributes: {
pin4: { requiresGround: true },
pin8: {
requiresPower: true,
requiresVoltage: "3.3V",
requiredVoltageTolerance: "10%",
},
}, pinLabels: {
pin1: "A1",
pin2: "B1",
pin3: "Y2",
pin4: "GND",
pin5: "A2",
pin6: "B2",
pin7: "Y1",
pin8: "VCC",
}, ...placementFor("U_ATTACH_AND"), footprint: jsx(Vssop8, {}), connections: {
A1: "net.PWR1",
B1: "net.D1_ATTACHED",
Y1: "net.P1_ENABLE",
A2: "net.PWR4",
B2: "net.D4_ATTACHED",
Y2: "net.P4_ENABLE",
VCC: "net.VDD33",
GND: "net.GND",
}, children: jsx(SchematicNote, { text: "Dual attachment / power-enable AND\n1.65–5.5 V supply; 3.3 V here" }) })] }), jsx(Passives, { parts: parts$1 }), jsx(Passives, { parts: [
{
name: "C_ATTACH_INV",
kind: "capacitor",
rating: "100nF",
pcbX: 12,
pcbY: -2,
from: "VDD33",
to: "GND",
},
{
name: "C_ATTACH_AND",
kind: "capacitor",
rating: "100nF",
pcbX: 12,
pcbY: -7,
from: "VDD33",
to: "GND",
},
{
name: "C_FLASH",
kind: "capacitor",
rating: "100nF",
pcbX: 15,
pcbY: 9,
from: "VDD33",
to: "GND",
},
] }), [2, 3].map((number) => (jsx(EsdBank, { prefix: `A${number}`, signals: [
`D${number}_DP`,
`D${number}_DM`,
`D${number}_TXP_AC`,
`D${number}_TXN_AC`,
`D${number}_RXP`,
`D${number}_RXN`,
], pcbX: number === 2 ? 5 : 21, pcbY: 17.2 }, number))), ports.map((port) => (jsx(Indicator, { name: `LED_P${port.number}`, net: `P${port.number}_VBUS`, pcbX: port.pcbX - 1, pcbY: port.pcbY - 5.5 }, port.number)))] }) }));
// Hirose DM1AA-SF-PEJ(82), EDC3-153736-02 revision 3, page 1.
// The drawing's mounting-side view uses the left locating hole as its datum.
// Translate that datum to the footprint origin: (11.9 mm, -12.7 mm).
// CD closes on card insertion. WP closes for a write-enabled card.
// Expose the four shell tabs as separate physical ports. They all connect to
// GND, but are too far apart to represent as one short routed pad-to-pad link.
const contactLands = [
{ pin: "8", x: 1.35 },
{ pin: "7", x: 3.05 },
{ pin: "6", x: 5.475 },
{ pin: "5", x: 7.975 },
{ pin: "4", x: 10.475 },
{ pin: "3", x: 12.975 },
{ pin: "2", x: 15.475 },
{ pin: "1", x: 17.975 },
{ pin: "9", x: 20.475 },
];
const switchLands = [
{ pin: "10", y: -9.2 },
{ pin: "11", y: -18.15 },
{ pin: "12", y: -20.75 },
];
const shellLands = [
{ x: -2.6, y: -4.55 },
{ x: 26.4, y: -4.55 },
{ x: -2.2, y: -23.2 },
{ x: 26.4, y: -23.2 },
];
const SdSocket = (props) => (jsx("connector", { pinAttributes: {
pin3: { requiresGround: true },
pin6: { requiresGround: true },
pin12: { requiresGround: true },
pin13: { requiresGround: true },
pin14: { requiresGround: true },
pin15: { requiresGround: true },
pin16: { requiresGround: true },
pin4: {
requiresPower: true,
requiresVoltage: "3.3V",
requiredVoltageTolerance: "10%",
},
}, footprint: jsxs("footprint", { insertionDirection: "from_bottom", children: [contactLands.map((land) => (jsx(Fragment$1, { children: jsx("smtpad", { portHints: [land.pin], pcbX: `${land.x - 11.9}mm`, pcbY: "14.9mm", width: "1.1mm", height: "2mm", shape: "rect", layer: "top" }) }, land.pin))), switchLands.map((land) => (jsx(Fragment$1, { children: jsx("smtpad", { portHints: [land.pin], pcbX: "-14.1mm", pcbY: `${land.y + 12.7}mm`, width: "2mm", height: "1mm", shape: "rect", layer: "top" }) }, land.pin))), shellLands.map((land, index) => (jsx(Fragment$1, { children: jsx("smtpad", { portHints: [`${index + 13}`], pcbX: `${land.x - 11.9}mm`, pcbY: `${land.y + 12.7}mm`, width: "2mm", height: "2mm", shape: "rect", layer: "top" }) }, index))), jsx("hole", { pcbX: "-11.9mm", pcbY: "12.7mm", diameter: "1.3mm" }), jsx("hole", { pcbX: "10.5mm", pcbY: "12.7mm", diameter: "1.3mm" }), jsx("courtyardrect", { pcbX: "0mm", pcbY: "0.1mm", width: "31.6mm", height: "32.1mm", layer: "top" }), jsx("fabricationnoterect", { pcbX: "0mm", pcbY: "0mm", width: "30mm", height: "30.5mm", strokeWidth: "0.1mm" }), jsx("fabricationnotetext", { text: props.name ?? "", pcbX: "0mm", pcbY: "0mm", fontSize: "1mm" }), jsx("silkscreenline", { x1: "-15.2mm", y1: "-15.45mm", x2: "15.2mm", y2: "-15.45mm", strokeWidth: "0.12mm" }), jsx("silkscreenline", { x1: "-15.2mm", y1: "-15.45mm", x2: "-15.2mm", y2: "-12mm", strokeWidth: "0.12mm" }), jsx("silkscreenline", { x1: "15.2mm", y1: "-15.45mm", x2: "15.2mm", y2: "-12mm", strokeWidth: "0.12mm" })] }), cadModel: {
jscad: sdSocketModel,
modelOriginPosition: { x: 0, y: 2.2, z: 0 },
zOffsetFromSurface: 0,
}, ...props, ...placementFor(props.name) }));
const parts = [
{
name: "R_SD_CTRL",
kind: "resistor",
rating: "10k",
pcbX: -16,
pcbY: -13,
from: "VDD33",
to: "PWR5",
},
{
name: "R_SD_ILIM",
kind: "resistor",
rating: "43.2k",
pcbX: -16,
pcbY: -14.5,
from: "SD_ILIM",
to: "GND",
},
{
name: "C_SD_IN",
kind: "capacitor",
rating: "1uF",
pcbX: -16,
pcbY: -16,
from: "VDD33",
to: "GND",
},
{
name: "C_SD_MAIN",
kind: "capacitor",
rating: "10uF",
footprint: "0805",
pcbX: -12,
pcbY: -22,
from: "SD_VDD33",
to: "GND",
},
{
name: "C_SD_18",
kind: "capacitor",
rating: "1uF",
pcbX: -11.5,
pcbY: -18,
from: "SD_VDD18",
to: "GND",
},
{
name: "C_SD_PLL",
kind: "capacitor",
rating: "1uF",
pcbX: -9,
pcbY: -10.5,
from: "SD_VDD18PLL",
to: "GND",
},
{
name: "C_SD_33A",
kind: "capacitor",
rating: "4.7uF",
footprint: "0603",
pcbX: -10,
pcbY: -10.5,
from: "SD_VDD33",
to: "GND",
},
{
name: "C_SD_33B",
kind: "capacitor",
rating: "4.7uF",
footprint: "0603",
pcbX: -11.5,
pcbY: -14,
from: "SD_VDD33",
to: "GND",
},
{
name: "R_SD_BIAS",
kind: "resistor",
rating: "12k",
pcbX: -6,
pcbY: -10.5,
from: "SD_RBIAS",
to: "GND",
},
{
name: "R_SD_RESET",
kind: "resistor",
rating: "10k",
pcbX: -4,
pcbY: -23,
from: "SD_VDD33",
to: "SD_RESET_N",
},
{
name: "C_SD_RESET",
kind: "capacitor",
rating: "100nF",
pcbX: -2,
pcbY: -23,
from: "SD_VDD33",
to: "GND",
},
{
name: "R_SD_VBUS1",
kind: "resistor",
rating: "100k",
pcbX: -1,
pcbY: -10,
from: "VBUS_HUB",
to: "SD_VBUS_DET",
},
{
name: "R_SD_VBUS2",
kind: "resistor",
rating: "200k",
pcbX: 1,
pcbY: -10,
from: "SD_VBUS_DET",
to: "GND",
},
{
name: "C_SD_X1",
kind: "capacitor",
rating: "18pF",
pcbX: -10,
pcbY: -26,
from: "SD_XTAL1",
to: "GND",
},
{
name: "C_SD_X2",
kind: "capacitor",
rating: "18pF",
pcbX: -4,
pcbY: -26,
from: "SD_XTAL2",
to: "GND",
},
{
name: "R_SD_CLK",
kind: "resistor",
rating: "22",
pcbX: -14,
pcbY: -10,
from: "SD_CLK",
to: "SD_CLK_SOCKET",
},
{
name: "C_CARD",
kind: "capacitor",
rating: "10uF",
footprint: "0805",
pcbX: -18,
pcbY: -10,
from: "CRD_PWR",
to: "GND",
},
{
name: "C_CARD_HF",
kind: "capacitor",
rating: "100nF",
pcbX: -20,
pcbY: -10,
from: "CRD_PWR",
to: "GND",
},
{
name: "R_CARD_CD",
kind: "resistor",
rating: "47k",
pcbX: -34,
pcbY: -10,
from: "SD_VDD33",
to: "SD_CD_N",
},
{
name: "R_CARD_WP",
kind: "resistor",
rating: "47k",
pcbX: -32,
pcbY: -10,
from: "SD_VDD33",
to: "SD_WP",
},
{
name: "R_EEP_SDA",
kind: "resistor",
rating: "4.7k",
pcbX: 0,
pcbY: -17,
from: "SD_VDD33",
to: "SD_EEP_SDA",
},
{
name: "R_EEP_SCL",
kind: "resistor",
rating: "4.7k",
pcbX: 2,
pcbY: -17,
from: "SD_VDD33",
to: "SD_EEP_SCL",
},
{
name: "C_EEP",
kind: "capacitor",
rating: "100nF",
pcbX: 4,
pcbY: -17,
from: "SD_VDD33",
to: "GND",
},
...["SD_D0", "SD_D1", "SD_D2", "SD_D3", "SD_CMD"].map((signal, index) => ({
name: `R_PULL_${signal}`,
kind: "resistor",
rating: "47k",
pcbX: -28 + index * 2,
pcbY: -12,
from: "CRD_PWR",
to: signal,
})),
];
const SdReader = () => (jsx("schematicsheet", { name: "Full-size SD Reader", sheetIndex: 2, sheetWidth: "841mm", sheetHeight: "594mm", children: jsxs("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schAutoLayoutEnabled: true, children: [jsxs("group", { pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", pcbLayout: { layoutMode: "none" }, schTitle: "Full-size SD / SDHC / SDXC; internal USB 2.0 card reader", schGrid: true, gridCols: 2, gridGap: 6, children: [jsx("schematicbox", { name: "SD_READER", chipRef: ".U_SD", width: 6, height: 6, title: "USB2642: 3.3 V SD/MMC reader; 24 MHz clock", pinLabels: readerPinLabels }), jsx(SchematicNote, { chipName: "SD_READER", text: "USB2642 SD / SDHC / SDXC reader\nUSB 2.0; 3.3 V supply; 24 MHz" }), jsx(SdSocket, { name: "J_SD", manufacturerPartNumber: "DM1AA-SF-PEJ(82)", pcbX: -25, pcbY: -20, pinLabels: sdPinLabels, connections: {
DAT3: "net.SD_D3",
CMD: "net.SD_CMD",
VSS1: "net.GND",
VDD: "net.CRD_PWR",
CLK: "net.SD_CLK_SOCKET",
VSS2: "net.GND",
DAT0: "net.SD_D0",
DAT1: "net.SD_D1",
DAT2: "net.SD_D2",
CD: "net.SD_CD_N",
WP: "net.SD_WP",
SWITCH_COMMON: "net.GND",
SHIELD1: "net.GND",
SHIELD2: "net.GND",
SHIELD3: "net.GND",
SHIELD4: "net.GND",
} }), jsx(TPS2553DBVR, { name: "U_SD_POWER", pcbX: -15, pcbY: -18, connections: {
IN: "net.VDD33",
GND: "net.GND",
EN: "net.PWR5",
FAULT: "net.PWR5",
ILIM: "net.SD_ILIM",
OUT: "net.SD_VDD33",
} }), jsx("chip", { name: "U_SD_RESET", manufacturerPartNumber: "TLV803EA29DBZR", footprint: "sot23", pcbX: -1, pcbY: -26, pinLabels: { pin1: "GND", pin2: "RESET_N", pin3: "VDD" }, pinAttributes: {
pin1: { requiresGround: true },
pin3: { requiresPower: true, requiresVoltage: "3.3V" },
}, connections: {
GND: "net.GND",
RESET_N: "net.SD_RESET_N",
VDD: "net.SD_VDD33",
}, ...placementFor("U_SD_RESET"), children: jsx(SchematicNote, { text: "Reader supply supervisor\n2.9 V threshold; active-low reset" }) }), jsx("crystal", { name: "Y_SD", pinVariant: "four_pin", frequency: "24MHz", loadCapacitance: "12pF", footprint: "crystal_w3.2mm_h2.5mm_4pin", manufacturerPartNumber: "ABM8-24.000MHZ-12-1-U-T", pcbX: -7, pcbY: -23.5, connections: {
pin1: "net.SD_XTAL1",
pin2: "net.GND",
pin3: "net.SD_XTAL2",
pin4: "net.GND",
}, ...placementFor("Y_SD") }), jsx("chip", { name: "U_SD_EEPROM", manufacturerPartNumber: "24LC04BT-I/SN", footprint: "soic8", pcbX: 4, pcbY: -21, pinAttributes: {
pin4: { requiresGround: true },
pin8: {
requiresPower: true,
requiresVoltage: "3.3V",
requiredVoltageTolerance: "10%",
},
}, pinLabels: {
pin1: "A0",
pin2: "A1",
pin3: "A2",
pin4: "GND",
pin5: "SDA",
pin6: "SCL",
pin7: "WP",
pin8: "VCC",
}, connections: {
A0: "net.GND",
A1: "net.GND",
A2: "net.GND",
GND: "net.GND",
WP: "net.GND",
VCC: "net.SD_VDD33",
SDA: "net.SD_EEP_SDA",
SCL: "net.SD_EEP_SCL",
}, ...placementFor("U_SD_EEPROM"), children: jsx(SchematicNote, { text: "Reader configuration storage\n4 Kbit; 2.5–5.5 V supply" }) })] }), jsx(Passives, { parts: parts }), jsx(SdBypass, {}), jsx(EsdBank, { prefix: "SD", signals: [
"SD_CMD",
"SD_CLK_SOCKET",
"SD_D0",
"SD_D1",
"SD_D2",
"SD_D3",
], pcbX: -29, pcbY: -3.8 }), jsx(Indicator, { name: "LED_SD_POWER", net: "CRD_PWR", pcbX: -36, pcbY: -3 }), jsx("resistor", { name: "R_CARD_LED", manufacturerPartNumber: "RC0402FR-072K2L", ...placementFor("R_CARD_LED"), resistance: "2.2k", footprint: "0402", pcbX: -36, pcbY: "0mm", connections: { pin1: "net.SD_VDD33", pin2: "net.CARD_LED_A" } }), jsx("led", { name: "LED_CARD_PRESENT", ...placementFor("LED_CARD_PRESENT"), color: "blue", footprint: "0603", manufacturerPartNumber: "LTST-C190TBKT", pcbX: -33, pcbY: "0mm", connections: { anode: "net.CARD_LED_A", cathode: "net.SD_CD_N" } })] }) }));
var index_circuit = () => (jsxs("board", { name: "USB_HUB_BOARD", pcbAnchorAlignment: "center", pcbX: "0mm", pcbY: "0mm", width: 86, height: 68, layers: 4, thickness: 1.6, isViaInPadAllowed: true, title: "ENGINEERING DRAFT: USB-C / USB-A Hub with Full-size SD", autorouter: "auto-local", routeRemaining: true, schMaxTraceDistance: 0.1, schAutoLayoutEnabled: true, pcbLayout: { layoutMode: "none" }, minTraceWidth: 0.136, minTraceToPadEdgeClearance: 0.13, minPadEdgeToPadEdgeClearance: 0.13, minViaPadDiameter: 0.45, minViaHoleDiameter: 0.2, minBoardEdgeClearance: 0.3, defaultViaTenting: "bottom_tented", solderMaskColor: "black", pcbStyle: { silkscreenFontSize: 0.6 }, children: [jsx("net", { name: "GND", isGroundNet: true, nominalTraceWidth: 0.4 }), ["VBUS_HOST", "VBUS_HUB", "VDD12", "VDD33", "SD_VDD33", "CRD_PWR"].map((name) => (jsx(Fragment$1, { children: jsx("net", { name: name, isPowerNet: true, nominalTraceWidth: name.startsWith("VBUS") ? 0.8 : 0.5 }) }, name))), jsx(Controllers, {}), jsx(HostAndPower, {}), jsx(HubAndPorts, {}), jsx(SdReader, {}), jsx(GroundVias, {}), jsx(HighSpeedRouting, {}), jsx("copperpour", { name: "GroundReference", layer: "inner1", connectsTo: "net.GND", unbroken: true, clearance: 0.2, boardEdgeMargin: 0.4 }), jsx("copperpour", { name: "GroundBottomReference", layer: "inner2", connectsTo: "net.GND", unbroken: true, clearance: 0.2, boardEdgeMargin: 0.4 }), jsx(BoardMarkings, {})] }));
export { index_circuit as default };