krishnax12/hyprland-macropad

A tscircuit package created by krishnax12.

Version
1.0.7
License
CC-BY-SA-3.0
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone krishnax12/hyprland-macropad  # download the package files into ./hyprland-macropad
tsci add krishnax12/hyprland-macropad    # add it to your project as @tsci/krishnax12.hyprland-macropad

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

imports/RP2040_Zero/RP2040_Zero.tsx

import objPath from "./RP2040_Zero.obj"
import type { ChipProps } from "@tscircuit/props"

const pinLabels = {
  pin1: ["GP0"],
  pin2: ["GP1"],
  pin3: ["GP2"],
  pin4: ["GP3"],
  pin5: ["GP4"],
  pin6: ["GP5"],
  pin7: ["GP6"],
  pin8: ["GP7"],
  pin9: ["GP8"],
  pin10: ["GP9"],
  pin11: ["GP10"],
  pin12: ["GP11"],
  pin13: ["GP12"],
  pin14: ["GP13"],
  pin15: ["GP14"],
  pin16: ["GP15"],
  pin17: ["GP26"],
  pin18: ["GP27"],
  pin19: ["GP28"],
  pin20: ["GP29"],
  pin21: ["3V3"],
  pin22: ["GND"],
  pin23: ["5V"],
  pin24: ["pin24"],
  pin25: ["pin25"],
  pin26: ["pin26"],
  pin27: ["pin27"],
  pin28: ["pin28"],
  pin29: ["pin29"],
  pin30: ["pin30"],
  pin31: ["pin31"],
  pin32: ["pin32"],
  pin33: ["pin33"],
} as const

export const RP2040_Zero = (props: ChipProps<typeof pinLabels>) => {
  return (
    <chip
      pinLabels={pinLabels}
      pinAttributes={{
        pin22: { providesGround: true, requiresGround: true },
        pin23: { requiresPower: true, requiresVoltage: 5 },
        ...Object.fromEntries(
          Array.from({ length: 9 }, (_, i) => [
            `pin${i + 3}`,
            {
              isInput: true,
              canUseInternalPullup: true,
              isUsingInternalPullup: true,
            },
          ]),
        ),
      }}
      supplierPartNumbers={{
        lcsc: ["C5350143"],
      }}
      manufacturerPartNumber="RP2040-Zero"
      footprint={
        <footprint>
          <keepout
            shape="rect"
            width={14.6}
            height={18.6}
            pcbX={0}
            pcbY={0}
            layers={["top", "bottom"]}
            allowPlacements
          />
          <cutout
            name="MODULE_UNDERSIDE_CLEARANCE"
            shape="rect"
            width={14}
            height={18}
            pcbX={0}
            pcbY={0}
          />
          <smtpad
            portHints={["pin1"]}
            pcbX="8.499983mm"
            pcbY="10.9049566mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin2"]}
            pcbX="8.499983mm"
            pcbY="8.3649566mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin3"]}
            pcbX="8.499983mm"
            pcbY="5.8249566mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin4"]}
            pcbX="8.499983mm"
            pcbY="3.2849566mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin5"]}
            pcbX="8.499983mm"
            pcbY="0.7449566mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin6"]}
            pcbX="8.499983mm"
            pcbY="-1.7950434mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin7"]}
            pcbX="8.499983mm"
            pcbY="-4.3350434mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin8"]}
            pcbX="8.499983mm"
            pcbY="-6.8750434mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin9"]}
            pcbX="8.499983mm"
            pcbY="-9.4150434mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin10"]}
            pcbX="5.079873mm"
            pcbY="-10.5049574mm"
            width="1.1999976mm"
            height="1.999996mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin11"]}
            pcbX="2.539873mm"
            pcbY="-10.5049574mm"
            width="1.1999976mm"
            height="1.999996mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin12"]}
            pcbX="-0.000127mm"
            pcbY="-10.5049574mm"
            width="1.1999976mm"
            height="1.999996mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin13"]}
            pcbX="-2.540127mm"
            pcbY="-10.5049574mm"
            width="1.1999976mm"
            height="1.999996mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin14"]}
            pcbX="-5.080127mm"
            pcbY="-10.5049574mm"
            width="1.1999976mm"
            height="1.999996mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin15"]}
            pcbX="-8.499983mm"
            pcbY="-9.4150434mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin16"]}
            pcbX="-8.499983mm"
            pcbY="-6.8750434mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin17"]}
            pcbX="-8.499983mm"
            pcbY="-4.3350434mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin18"]}
            pcbX="-8.499983mm"
            pcbY="-1.7950434mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin19"]}
            pcbX="-8.499983mm"
            pcbY="0.7449566mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin20"]}
            pcbX="-8.499983mm"
            pcbY="3.2849566mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin21"]}
            pcbX="-8.499983mm"
            pcbY="5.8249566mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin22"]}
            pcbX="-8.499983mm"
            pcbY="8.3649566mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />
          <smtpad
            portHints={["pin23"]}
            pcbX="-8.499983mm"
            pcbY="10.9049566mm"
            width="1.999996mm"
            height="1.1999976mm"
            shape="rect"
          />

          <silkscreenpath
            route={[
              { x: 4.481322000000091, y: 12.499924200000123 },
              { x: 4.481322000000091, y: 13.99992120000013 },
              { x: -4.47974720000002, y: 13.99992120000013 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -4.47974720000002, y: 12.499924200000123 },
              { x: -4.47974720000002, y: 13.99992120000013 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -5.911240399999997, y: -11.000028799999882 },
              { x: -9.000058200000012, y: -11.000028799999882 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -3.3712404000000333, y: -11.000028799999882 },
              { x: -4.248962799999958, y: -11.000028799999882 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -0.831240399999956, y: -11.000028799999882 },
              { x: -1.708962799999881, y: -11.000028799999882 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: 1.7087342000000945, y: -11.000028799999882 },
              { x: 0.8310372000000825, y: -11.000028799999882 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: 4.248734200000172, y: -11.000028799999882 },
              { x: 3.371011800000133, y: -11.000028799999882 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: 8.999905800000079, y: -10.24615679999988 },
              { x: 8.999905800000079, y: -11.000028799999882 },
              { x: 5.911011799999983, y: -11.000028799999882 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: 8.999905800000079, y: -7.70618219999983 },
              { x: 8.999905800000079, y: -8.583879199999728 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: 8.999905800000079, y: -5.166182199999753 },
              { x: 8.999905800000079, y: -6.043904599999905 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: 8.999905800000079, y: -2.626182199999903 },
              { x: 8.999905800000079, y: -3.5039045999999416 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: 8.999905800000079, y: -0.08618219999982557 },
              { x: 8.999905800000079, y: -0.9639045999998643 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: 8.999905800000079, y: 2.4538178000002517 },
              { x: 8.999905800000079, y: 1.576095400000213 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: 8.999905800000079, y: 4.9937924000001885 },
              { x: 8.999905800000079, y: 4.116095400000063 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: 8.999905800000079, y: 7.5337924000000385 },
              { x: 8.999905800000079, y: 6.656070000000113 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: 8.999905800000079, y: 10.073792400000116 },
              { x: 8.999905800000079, y: 9.19607000000019 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -9.000058200000012, y: 11.736095400000067 },
              { x: -9.000058200000012, y: 12.499924200000123 },
              { x: 8.999905800000079, y: 12.499924200000123 },
              { x: 8.999905800000079, y: 11.736070000000268 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -9.000058200000012, y: 9.196095400000104 },
              { x: -9.000058200000012, y: 10.073817800000256 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -9.000058200000012, y: 6.65609540000014 },
              { x: -9.000058200000012, y: 7.533817800000179 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -9.000058200000012, y: 4.116120800000203 },
              { x: -9.000058200000012, y: 4.993817800000102 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -9.000058200000012, y: 1.576120800000126 },
              { x: -9.000058200000012, y: 2.453843200000051 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -9.000058200000012, y: -0.9638791999998375 },
              { x: -9.000058200000012, y: -0.08615679999979875 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -9.000058200000012, y: -3.503879199999801 },
              { x: -9.000058200000012, y: -2.626156799999876 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -9.000058200000012, y: -6.043879199999878 },
              { x: -9.000058200000012, y: -5.166156799999953 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -9.000058200000012, y: -8.583853799999929 },
              { x: -9.000058200000012, y: -7.706156799999917 },
            ]}
          />
          <silkscreenpath
            route={[
              { x: -9.000058200000012, y: -11.000028799999882 },
              { x: -9.000058200000012, y: -10.24613139999974 },
            ]}
          />
          <silkscreentext
            text="{NAME}"
            pcbX="-0.000127mm"
            pcbY="15.0291566mm"
            anchorAlignment="center"
            fontSize="1mm"
          />
          <fabricationnotepath
            route={[
              { x: -4.400067400000012, y: 12.499924200000123 },
              { x: -4.400067400000012, y: 13.99992120000013 },
              { x: 4.3999149999999645, y: 13.99992120000013 },
              { x: 4.3999149999999645, y: 12.499924200000123 },
              { x: -4.400067400000012, y: 12.499924200000123 },
            ]}
            strokeWidth="0.254mm"
          />
          <courtyardoutline
            outline={[
              { x: -9.749727000000007, y: 14.279156600000306 },
              { x: 9.74947300000008, y: 14.279156600000306 },
              { x: 9.74947300000008, y: -11.747843399999738 },
              { x: -9.749727000000007, y: -11.747843399999738 },
              { x: -9.749727000000007, y: 14.279156600000306 },
            ]}
          />
        </footprint>
      }
      cadModel={{
        objUrl: objPath,
        modelOriginPosition: { x: 8.94996, y: 11.09155, z: -1.09144 },
      }}
      {...props}
    />
  )
}