MustafaMulla29/rp2040-chip
This code defines and maps a compact 30mm x 30mm PCB featuring an RP2040 microcontroller with integrated GPIO, power regulation, USB-C interface, QSPI flash memory, crystal oscillator, pushbuttons, test points, and associated routing traces.
- Version
- 0.0.1
- License
- unset
- Stars
- 0
dist/index.js
import { jsxs, jsx } from 'react/jsx-runtime';
const denseTraceProps = { thickness: "0.1mm" };
const gndLabel = { displayName: "GND", schDisplayLabel: "GND" };
const v3v3Label = { displayName: "V3V3", schDisplayLabel: "V3V3" };
const v1v1Label = { displayName: "V1V1", schDisplayLabel: "V1V1" };
const adcRefLabel = {
displayName: "ADC_REF",
schDisplayLabel: "ADC_REF",
};
const schSections = {
rp2040: "rp2040",
usb: "usb",
clock: "clock",
status: "status",
};
const pinLabels = {
pin1: ["IOVDD6"],
pin2: ["GPIO0"],
pin3: ["GPIO1"],
pin4: ["GPIO2"],
pin5: ["GPIO3"],
pin6: ["GPIO4"],
pin7: ["GPIO5"],
pin8: ["GPIO6"],
pin9: ["GPIO7"],
pin10: ["IOVDD5"],
pin11: ["GPIO8"],
pin12: ["GPIO9"],
pin13: ["GPIO10"],
pin14: ["GPIO11"],
pin15: ["GPIO12"],
pin16: ["GPIO13"],
pin17: ["GPIO14"],
pin18: ["GPIO15"],
pin19: ["TESTEN"],
pin20: ["XIN"],
pin21: ["XOUT"],
pin22: ["IOVDD4"],
pin23: ["DVDD2"],
pin24: ["SWCLK"],
pin25: ["SWD"],
pin26: ["RUN"],
pin27: ["GPIO16"],
pin28: ["GPIO17"],
pin29: ["GPIO18"],
pin30: ["GPIO19"],
pin31: ["GPIO20"],
pin32: ["GPIO21"],
pin33: ["IOVDD3"],
pin34: ["GPIO22"],
pin35: ["GPIO23"],
pin36: ["GPIO24"],
pin37: ["GPIO25"],
pin38: ["GPIO26_ADC0"],
pin39: ["GPIO27_ADC1"],
pin40: ["GPIO28_ADC2"],
pin41: ["GPIO29_ADC3"],
pin42: ["IOVDD2"],
pin43: ["ADC_AVDD"],
pin44: ["VREG_IN"],
pin45: ["VREG_VOUT"],
pin46: ["USB_DM"],
pin47: ["USB_DP"],
pin48: ["USB_VDD"],
pin49: ["IOVDD1"],
pin50: ["DVDD1"],
pin51: ["QSPI_SD3"],
pin52: ["QSPI_SCLK"],
pin53: ["QSPI_SD0"],
pin54: ["QSPI_SD2"],
pin55: ["QSPI_SD1"],
pin56: ["QSPI_SS"],
pin57: ["GND", "thermalpad"],
};
const flashPinLabels = {
pin1: ["CS"],
pin2: ["pin2"],
pin3: ["pin3"],
pin4: ["GND"],
pin5: ["pin5"],
pin6: ["CLK"],
pin7: ["pin7"],
pin8: ["VCC"],
pin9: ["EP"],
};
const pushButtonPinLabels = {
pin1: ["pin1"],
pin2: ["pin2"],
pin3: ["pin3"],
pin4: ["pin4"],
};
const RP2040 = (props) => (jsx("chip", { pinLabels: pinLabels, supplierPartNumbers: { jlcpcb: ["C2040"] }, manufacturerPartNumber: "RP2040", footprint: "qfn56_thermalpad3.1mmx3.1mm_p0.4001mm_w7.8999mm_h7.9001mm_pw0.2mm_pl0.85mm", ...props }));
var index = () => (jsxs("board", { width: "30mm", height: "30mm", routingDisabled: true, children: [jsx("schematicsection", { name: schSections.rp2040, displayName: "RP2040 & Power" }), jsx("schematicsection", { name: schSections.usb, displayName: "Programming USB-C & QSPI" }), jsx("schematicsection", { name: schSections.clock, displayName: "Clock" }), jsx("schematicsection", { name: schSections.status, displayName: "Status & SWD Debug" }), jsx(RP2040, { name: "U1", showPinAliases: true, schSectionName: schSections.rp2040, pcbX: 0, pcbY: 0.5, schX: -0.08, schY: -2.5, schWidth: 2.8, schHeight: 5.8 }), jsx("capacitor", { name: "C_CORE", capacitance: "1uF", footprint: "0402", schSectionName: schSections.rp2040, schOrientation: "vertical", pcbX: 3.8, pcbY: -5.5, schX: -3.65, schY: -3.7 }), jsx("resistor", { name: "R_RUN", resistance: "10k", footprint: "0402", schSectionName: schSections.status, schX: 12.8, schY: -13.5, schRotation: 90 }), jsx("chip", { name: "U2", pinLabels: flashPinLabels, manufacturerPartNumber: "W25Q16JVUXIQ", footprint: "wson", schSectionName: schSections.usb, schX: 17, schY: -4, schHeight: 2, schPinArrangement: {
leftSide: [8, 1, 2, 3, 5, 6, 7, 4, 9],
} }), jsx("resistor", { name: "R_USB1", resistance: "27", footprint: "0402", schSectionName: schSections.usb, schX: 13.3, schY: -7.7 }), jsx("resistor", { name: "R_USB2", resistance: "27", footprint: "0402", schSectionName: schSections.usb, schX: 13.3, schY: -6.6 }), jsx("crystal", { name: "Y1", frequency: "12MHz", loadCapacitance: "12pF", pinVariant: "four_pin", footprint: "crystal", schSectionName: schSections.clock, schX: 1.2, schY: -12.5 }), jsx("pushbutton", { name: "SW_BOOT", pinLabels: pushButtonPinLabels, footprint: "smdpushbutton", internallyConnectedPins: [
["pin1", "pin2"],
["pin3", "pin4"],
], schSectionName: schSections.status, schX: 8.6, schY: -12 }), jsx("pushbutton", { name: "SW_RUN", pinLabels: pushButtonPinLabels, footprint: "smdpushbutton", internallyConnectedPins: [
["pin1", "pin2"],
["pin3", "pin4"],
], schSectionName: schSections.status, schX: 12.8, schY: -12 }), jsx("resistor", { name: "R_BOOT", resistance: "10k", footprint: "0402", schSectionName: schSections.status, schX: 8.6, schY: -13.5, schRotation: 90 }), jsx("resistor", { name: "R_LED", resistance: "330", footprint: "0402", schSectionName: schSections.status, schX: 10.4, schY: -12.2, schRotation: 270 }), jsx("testpoint", { name: "TP_SWCLK", footprintVariant: "pad", padShape: "circle", padDiameter: "1.1mm", schSectionName: schSections.status, schX: 8.6, schY: -16.5 }), jsx("testpoint", { name: "TP_SWDIO", footprintVariant: "pad", padShape: "circle", padDiameter: "1.1mm", schSectionName: schSections.status, schX: 12.2, schY: -16.5 }), jsx("trace", { ...denseTraceProps, name: "RUN_R", from: ".R_RUN > .pin1", to: ".U1 > .RUN" }), jsx("trace", { name: "TEST_G", from: ".U1 > .TESTEN", to: "net.GND", ...gndLabel }), jsx("trace", { ...denseTraceProps, name: "QSPI_SS", from: ".U1 > .QSPI_SS", to: ".U2 > .CS", schDisplayLabel: "QSPI_SS" }), jsx("trace", { ...denseTraceProps, name: "QSPI_SD0", from: ".U1 > .QSPI_SD0", to: ".U2 > .pin5", schDisplayLabel: "QSPI_SD0" }), jsx("trace", { ...denseTraceProps, name: "QSPI_SD1", from: ".U1 > .QSPI_SD1", to: ".U2 > .pin2", schDisplayLabel: "QSPI_SD1" }), jsx("trace", { ...denseTraceProps, name: "QSPI_SD2", from: ".U1 > .QSPI_SD2", to: ".U2 > .pin3", schDisplayLabel: "QSPI_SD2" }), jsx("trace", { ...denseTraceProps, name: "QSPI_SD3", from: ".U1 > .QSPI_SD3", to: ".U2 > .pin7", schDisplayLabel: "QSPI_SD3" }), jsx("trace", { ...denseTraceProps, name: "QSPI_SCLK", from: ".U1 > .QSPI_SCLK", to: ".U2 > .CLK", schDisplayLabel: "QSPI_SCLK" }), jsx("trace", { ...denseTraceProps, name: "IOVDD1_P", from: ".U1 > .IOVDD1", to: "net.V3V3", ...v3v3Label }), jsx("trace", { ...denseTraceProps, name: "IOVDD2_P", from: ".U1 > .IOVDD2", to: "net.V3V3", ...v3v3Label }), jsx("trace", { ...denseTraceProps, name: "IOVDD3_P", from: ".U1 > .IOVDD3", to: "net.V3V3", ...v3v3Label }), jsx("trace", { ...denseTraceProps, name: "IOVDD4_P", from: ".U1 > .IOVDD4", to: "net.V3V3", ...v3v3Label }), jsx("trace", { ...denseTraceProps, name: "IOVDD5_P", from: ".U1 > .IOVDD5", to: "net.V3V3", ...v3v3Label }), jsx("trace", { ...denseTraceProps, name: "IOVDD6_P", from: ".U1 > .IOVDD6", to: "net.V3V3", ...v3v3Label }), jsx("trace", { ...denseTraceProps, name: "DVDD1_P", from: ".U1 > .DVDD1", to: "net.V1V1", ...v1v1Label }), jsx("trace", { ...denseTraceProps, name: "DVDD2_P", from: ".U1 > .DVDD2", to: "net.V1V1", ...v1v1Label }), jsx("trace", { ...denseTraceProps, name: "VREG_IN_P", from: ".U1 > .VREG_IN", to: "net.V3V3", ...v3v3Label }), jsx("trace", { ...denseTraceProps, name: "VREG_VOUT_P", from: ".U1 > .VREG_VOUT", to: "net.V1V1", ...v1v1Label }), jsx("trace", { ...denseTraceProps, name: "USB_VDD_P", from: ".U1 > .USB_VDD", to: "net.V3V3", ...v3v3Label }), jsx("trace", { name: "GND_G", from: ".U1 > .GND", to: "net.GND", ...gndLabel }), jsx("trace", { ...denseTraceProps, name: "USBV_IO1", from: ".U1 > .USB_VDD", to: ".U1 > .IOVDD1" }), jsx("trace", { ...denseTraceProps, name: "USB_DN", from: ".R_USB1 > .pin2", to: ".U1 > .USB_DM" }), jsx("trace", { ...denseTraceProps, name: "USB_DP", from: ".R_USB2 > .pin2", to: ".U1 > .USB_DP" }), jsx("trace", { name: "CORE_P", from: ".C_CORE > .pin1", to: "net.V1V1", ...v1v1Label }), jsx("trace", { name: "CORE_G", from: ".C_CORE > .pin2", to: "net.GND", ...gndLabel }), jsx("trace", { name: "ADC_AVDD", from: ".U1 > .ADC_AVDD", to: "net.ADC_VREF", ...adcRefLabel }), jsx("trace", { name: "XIN", from: ".Y1 > .pin1", to: ".U1 > .XIN", maxLength: "10mm" }), jsx("trace", { name: "XOUT", from: ".Y1 > .pin3", to: ".U1 > .XOUT", maxLength: "10mm" }), jsx("trace", { name: "BOOT_SW", from: ".SW_BOOT > .pin1", to: ".U1 > .QSPI_SS" }), jsx("trace", { name: "BOOT_R", from: ".R_BOOT > .pin1", to: ".U1 > .QSPI_SS" }), jsx("trace", { name: "RUN_SW", from: ".SW_RUN > .pin1", to: ".U1 > .RUN" }), jsx("trace", { name: "LED_GP25", from: ".U1 > .GPIO25", to: ".R_LED > .pin1" }), jsx("trace", { name: "SWCLK", from: ".U1 > .SWCLK", to: ".TP_SWCLK > .pin1" }), jsx("trace", { name: "SWD", from: ".U1 > .SWD", to: ".TP_SWDIO > .pin1" })] }));
export { index as default };