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
imports/UsbCReceptacle.tsx
import { Fragment } from "react";
import type { ConnectorProps } from "@tscircuit/props";
import { placementFor } from "../design/placement";
import { usbCModel } from "../design/connector-models";
// Amphenol 12401610E4#2A, C12401610 rev C recommended PCB layout.
// Connector-local Y is the reverse of the drawing/KiCad downward Y axis.
export const UsbCReceptacle = (props: ConnectorProps) => (
<connector
allowOffBoard
pinAttributes={{
pin8: { doNotConnect: true },
pin20: { doNotConnect: true },
}}
cadModel={{
jscad: usbCModel,
modelOriginPosition: { x: 0, y: 0.48, z: 0 },
zOffsetFromSurface: 0,
}}
footprint={
<footprint>
{Array.from({ length: 12 }, (_, index) => (
<Fragment key={index}>
<smtpad
portHints={[`pin${index + 1}`]}
shape="rect"
pcbX={-2.75 + index * 0.5}
pcbY={5.02}
width={0.3}
height={0.7}
/>
<smtpad
portHints={[`pin${index + 13}`]}
shape="rect"
pcbX={2.5 - index * 0.5}
pcbY={3.32}
width={0.3}
height={0.7}
/>
</Fragment>
))}
{[-1, 1].map((side) => (
<Fragment key={side}>
<platedhole
portHints={["pin25"]}
shape="pill"
pcbX={side * 4.13}
pcbY={3.11}
outerWidth={0.8}
outerHeight={1.4}
holeWidth={0.5}
holeHeight={1.1}
/>
<platedhole
portHints={["pin25"]}
shape="pill"
pcbX={side * 4.49}
pcbY={-2.84}
outerWidth={0.8}
outerHeight={1.4}
holeWidth={0.5}
holeHeight={1.1}
/>
</Fragment>
))}
<hole
shape="pill"
pcbRotation={props.pcbRotation}
pcbX={3.6}
pcbY={4.36}
width={0.95}
height={0.65}
/>
<hole pcbX={-3.6} pcbY={4.36} diameter={0.65} />
<courtyardrect pcbY={-0.07} width={10.78} height={11.6} />
<fabricationnoterect pcbY={-0.005} width={9.2} height={10.45} />
<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}
/>
<silkscreentext pcbY={6.36} text={props.name ?? ""} fontSize={0.7} />
<keepout
shape="rect"
pcbX={0}
pcbY={-1.01}
width={7.5}
height={6.8}
layers={["top"]}
excludeRefs={[`.${props.name}`]}
/>
</footprint>
}
{...props}
{...placementFor(props.name)}
/>
);