sang-it/base_board_pin_header
This code defines a PCB layout featuring mounted pin headers, mounting holes, and a Xiao RP2040 socket, including their physical footprints, drilled hole specifications, and interconnecting traces on a green FR4 board.
- Version
- 1.0.0
- License
- unset
- Stars
- 0
dist/index.cjs
'use strict';
var jsxRuntime = require('react/jsx-runtime');
const headerHole = (pin, pcbX, outerDiameter) => (jsxRuntime.jsx("platedhole", { name: String(pin), portHints: [String(pin)], shape: "circle", holeDiameter: "1mm", outerDiameter: outerDiameter, pcbX: pcbX, pcbY: 0 }));
const twoPinHeaderFootprint = () => (jsxRuntime.jsxs("footprint", { children: [headerHole(1, -1.27, "1.6mm"), headerHole(2, 1.27, "1.6mm")] }));
const eightPinHeaderFootprint = () => (jsxRuntime.jsxs("footprint", { children: [headerHole(1, 8.89, "1.8mm"), headerHole(2, 6.35, "1.8mm"), headerHole(3, 3.81, "1.8mm"), headerHole(4, 1.27, "1.8mm"), headerHole(5, -1.27, "1.8mm"), headerHole(6, -3.81, "1.8mm"), headerHole(7, -6.35, "1.8mm"), headerHole(8, -8.89, "1.8mm")] }));
const mountingHoles = () => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("hole", { name: "H1", diameter: "3.1mm", pcbX: -46, pcbY: 31 }), jsxRuntime.jsx("hole", { name: "H2", diameter: "3.1mm", pcbX: 70, pcbY: 31 }), jsxRuntime.jsx("hole", { name: "H3", diameter: "3.1mm", pcbX: 70, pcbY: -31 }), jsxRuntime.jsx("hole", { name: "H4", diameter: "3.1mm", pcbX: -46, pcbY: -31 })] }));
const twoPinFemaleHeaderCadModel = () => ({
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/download?pn=C49661",
rotationOffset: { x: 0, y: 0, z: 0 },
positionOffset: { x: 0, y: 0, z: 0 },
});
const eightPinFemaleHeaderCadModel = () => ({
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/download?pn=C27439",
rotationOffset: { x: 0, y: 0, z: 0 },
positionOffset: { x: 0, y: 0, z: 4.25 },
});
const xiaoSocketHole = (pin, pinHints, pcbX, pcbY) => (jsxRuntime.jsx("platedhole", { name: String(pin), portHints: [String(pin), ...pinHints], shape: "circle", holeDiameter: "0.889mm", outerDiameter: "1.524mm", pcbX: pcbX, pcbY: pcbY }));
const xiaoPinLabels = {
pin1: ["D0", "A0", "GPIO26"],
pin2: ["D1", "A1", "GPIO27"],
pin3: ["D2", "A2", "GPIO28"],
pin4: ["D3", "A3", "GPIO29"],
pin5: ["D4", "SDA", "GPIO6"],
pin6: ["D5", "SCL", "GPIO7"],
pin7: ["D6", "UART_TX", "GPIO0"],
pin8: ["D7", "GPIO1", "UART_RX"],
pin9: ["D8", "GPIO2", "SPI0_SCK"],
pin10: ["D9", "GPIO4", "SPI0_MISO"],
pin11: ["D10", "GPIO3", "SPI0_MOSI"],
pin12: ["3V3", "V3_3_OUT"],
pin13: ["GND"],
pin14: ["VBUS"],
};
const xiaoRp2040Footprint = () => (jsxRuntime.jsxs("footprint", { children: [xiaoSocketHole(1, xiaoPinLabels.pin1, 7.62, 7.62), xiaoSocketHole(2, xiaoPinLabels.pin2, 5.08, 7.62), xiaoSocketHole(3, xiaoPinLabels.pin3, 2.54, 7.62), xiaoSocketHole(4, xiaoPinLabels.pin4, 0, 7.62), xiaoSocketHole(5, xiaoPinLabels.pin5, -2.54, 7.62), xiaoSocketHole(6, xiaoPinLabels.pin6, -5.08, 7.62), xiaoSocketHole(7, xiaoPinLabels.pin7, -7.62, 7.62), xiaoSocketHole(8, xiaoPinLabels.pin8, -7.62, -7.62), xiaoSocketHole(9, xiaoPinLabels.pin9, -5.08, -7.62), xiaoSocketHole(10, xiaoPinLabels.pin10, -2.54, -7.62), xiaoSocketHole(11, xiaoPinLabels.pin11, 0, -7.62), xiaoSocketHole(12, xiaoPinLabels.pin12, 2.54, -7.62), xiaoSocketHole(13, xiaoPinLabels.pin13, 5.08, -7.62), xiaoSocketHole(14, xiaoPinLabels.pin14, 7.62, -7.62)] }));
const cladTestBreakerTraces = () => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("trace", { name: "D3_J5_1", from: "U1.D3", to: "J5.pin1", thickness: "0.3mm" }), jsxRuntime.jsx("trace", { name: "D2_J5_2", from: "U1.D2", to: "J5.pin2", thickness: "0.3mm" }), jsxRuntime.jsx("trace", { name: "D1_J5_3", from: "U1.D1", to: "J5.pin3", thickness: "0.3mm" }), jsxRuntime.jsx("trace", { name: "D0_J5_4", from: "U1.D0", to: "J5.pin4", thickness: "0.3mm" }), jsxRuntime.jsx("trace", { name: "D10_J5_5", from: "U1.D10", to: "J5.pin5", thickness: "0.3mm" }), jsxRuntime.jsx("trace", { name: "D9_J5_6", from: "U1.D9", to: "J5.pin6", thickness: "0.3mm" }), jsxRuntime.jsx("trace", { name: "D8_J5_7", from: "U1.D8", to: "J5.pin7", thickness: "0.3mm" }), jsxRuntime.jsx("trace", { name: "D7_J5_8", from: "U1.D7", to: "J5.pin8", thickness: "0.3mm" })] }));
const xiaoRp2040Socket = () => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("chip", { name: "U1", pinLabels: xiaoPinLabels, pinAttributes: {
VBUS: { requiresPower: true },
GND: { requiresGround: true },
}, footprint: xiaoRp2040Footprint(), cadModel: null, pcbX: 63.5, pcbY: 0 }), jsxRuntime.jsx("silkscreenrect", { width: "21mm", height: "17.8mm", filled: false, stroke: "solid", strokeWidth: "0.2mm", pcbX: 63.5, pcbY: 0 }), jsxRuntime.jsx("silkscreentext", { text: "USB", fontSize: "0.7mm", pcbX: 72.7, pcbY: 0, pcbRotation: 90 })] }));
var index_circuit = () => (jsxRuntime.jsxs("board", { width: "124mm", height: "70mm", outlineOffsetX: 12, thickness: "1.6mm", layers: 2, material: "fr4", solderMaskColor: "green", silkscreenColor: "white", children: [mountingHoles(), jsxRuntime.jsx("pinheader", { name: "J1", pinCount: 2, gender: "female", pitch: "2.54mm", footprint: twoPinHeaderFootprint(), manufacturerPartNumber: "2.54-1*2PFemale", supplierPartNumbers: { lcsc: ["C49661"], jlcpcb: ["C49661"] }, cadModel: twoPinFemaleHeaderCadModel(), pcbX: -42.5, pcbY: 27.5, pcbRotation: 45 }), jsxRuntime.jsx("pinheader", { name: "J2", pinCount: 2, gender: "female", pitch: "2.54mm", footprint: twoPinHeaderFootprint(), manufacturerPartNumber: "2.54-1*2PFemale", supplierPartNumbers: { lcsc: ["C49661"], jlcpcb: ["C49661"] }, cadModel: twoPinFemaleHeaderCadModel(), pcbX: 42.5, pcbY: 27.5, pcbRotation: 135 }), jsxRuntime.jsx("pinheader", { name: "J3", pinCount: 2, gender: "female", pitch: "2.54mm", footprint: twoPinHeaderFootprint(), manufacturerPartNumber: "2.54-1*2PFemale", supplierPartNumbers: { lcsc: ["C49661"], jlcpcb: ["C49661"] }, cadModel: twoPinFemaleHeaderCadModel(), pcbX: 42.5, pcbY: -27.5, pcbRotation: 45 }), jsxRuntime.jsx("pinheader", { name: "J4", pinCount: 2, gender: "female", pitch: "2.54mm", footprint: twoPinHeaderFootprint(), manufacturerPartNumber: "2.54-1*2PFemale", supplierPartNumbers: { lcsc: ["C49661"], jlcpcb: ["C49661"] }, cadModel: twoPinFemaleHeaderCadModel(), pcbX: -42.5, pcbY: -27.5, pcbRotation: 135 }), jsxRuntime.jsx("pinheader", { name: "J5", pinCount: 8, gender: "female", pitch: "2.54mm", footprint: eightPinHeaderFootprint(), manufacturerPartNumber: "2.54-1*8P", supplierPartNumbers: { lcsc: ["C27438"], jlcpcb: ["C27438"] }, cadModel: eightPinFemaleHeaderCadModel(), pcbX: 47.5, pcbY: 0, pcbRotation: 90 }), xiaoRp2040Socket(), cladTestBreakerTraces()] }));
module.exports = index_circuit;