techmannih/usbc-charger
This code defines a detailed electronic hardware design for an 85-265VAC to USB-C PD 18W wall charger, including the schematic layout and physical component placements such as connectors, filtering inductors, capacitors, resistors, protection diodes, and an isolated power module, all integrated with 3D models and mechanical enclosures.
- Version
- 1.0.7
- License
- unset
- Stars
- 0
.claude/skills/tscircuit/templates/chip-with-pinouts.tsx
import type { ChipProps } from "tscircuit"
const pinLabels = {
pin1: "GND",
pin2: "TRIG",
pin3: "OUT",
pin4: "RESET",
pin5: "CTRL",
pin6: "THRES",
pin7: "DISCH",
pin8: "VCC",
} as const
export const NE555 = (props: ChipProps<typeof pinLabels>) => (
<chip
{...props}
pinLabels={pinLabels}
pinAttributes={{
VCC: { requiresPower: true },
RESET: { mustBeConnected: true },
}}
schPinArrangement={{
leftSide: {
direction: "top-to-bottom",
pins: ["RESET", "CTRL", "THRES", "TRIG"],
},
rightSide: {
direction: "top-to-bottom",
pins: ["VCC", "OUT", "DISCH", "GND"],
},
}}
supplierPartNumbers={{ jlcpcb: ["C46749"] }}
footprint="dip8"
/>
)
export default () => (
<board width="40mm" height="30mm">
<NE555 name="U1" />
<resistor name="R1" resistance="1k" footprint="0402" />
<resistor name="R2" resistance="10k" footprint="0402" />
<capacitor name="C1" capacitance="10uF" footprint="0805" />
<capacitor name="C2" capacitance="10nF" footprint="0402" />
<capacitor name="C3" capacitance="100nF" footprint="0402" />
<trace from="U1.VCC" to="net.VCC" />
<trace from="U1.GND" to="net.GND" />
<trace from="U1.RESET" to="net.VCC" />
<trace from="C3.pin1" to="net.VCC" />
<trace from="C3.pin2" to="net.GND" />
<trace from="U1.CTRL" to="C2.pin1" />
<trace from="C2.pin2" to="net.GND" />
<trace from="R1.pin1" to="net.VCC" />
<trace from="R1.pin2" to="U1.DISCH" />
<trace from="U1.DISCH" to="R2.pin1" />
<trace from="R2.pin2" to="net.TIMING" />
<trace from="U1.THRES" to="net.TIMING" />
<trace from="U1.TRIG" to="net.TIMING" />
<trace from="C1.pin1" to="net.TIMING" />
<trace from="C1.pin2" to="net.GND" />
</board>
)