@tscircuit/common 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ChipProps } from '@tscircuit/props';
3
+
4
+ declare const ArduinoShield: (props: ChipProps & {
5
+ children?: any;
6
+ }) => react_jsx_runtime.JSX.Element;
7
+
8
+ declare const MicroModBoard: ({ variant, ...props }: ChipProps & {
9
+ children?: any;
10
+ variant?: "processor" | "function";
11
+ }) => react_jsx_runtime.JSX.Element;
12
+
13
+ declare const RaspberryPiHatBoard: (props: ChipProps & {
14
+ children?: any;
15
+ }) => react_jsx_runtime.JSX.Element;
16
+
17
+ interface XiaoBoardProps extends ChipProps {
18
+ children?: any;
19
+ variant?: "RP2040" | "Receiver";
20
+ withPlatedHoles?: boolean;
21
+ }
22
+ declare const XiaoBoard: ({ variant, withPlatedHoles, ...props }: XiaoBoardProps) => react_jsx_runtime.JSX.Element;
23
+
24
+ export { ArduinoShield, MicroModBoard, RaspberryPiHatBoard, XiaoBoard };
package/dist/index.js CHANGED
@@ -148,7 +148,7 @@ var require_react_production = __commonJS({
148
148
  var isArrayImpl = Array.isArray;
149
149
  var ReactSharedInternals = { H: null, A: null, T: null, S: null, V: null };
150
150
  var hasOwnProperty = Object.prototype.hasOwnProperty;
151
- function ReactElement2(type, key, self, source, owner, props) {
151
+ function ReactElement3(type, key, self, source, owner, props) {
152
152
  self = props.ref;
153
153
  return {
154
154
  $$typeof: REACT_ELEMENT_TYPE,
@@ -159,7 +159,7 @@ var require_react_production = __commonJS({
159
159
  };
160
160
  }
161
161
  function cloneAndReplaceKey(oldElement, newKey) {
162
- return ReactElement2(
162
+ return ReactElement3(
163
163
  oldElement.type,
164
164
  newKey,
165
165
  void 0,
@@ -389,7 +389,7 @@ var require_react_production = __commonJS({
389
389
  childArray[i] = arguments[i + 2];
390
390
  props.children = childArray;
391
391
  }
392
- return ReactElement2(element.type, key, void 0, void 0, owner, props);
392
+ return ReactElement3(element.type, key, void 0, void 0, owner, props);
393
393
  };
394
394
  exports.createContext = function(defaultValue) {
395
395
  defaultValue = {
@@ -422,7 +422,7 @@ var require_react_production = __commonJS({
422
422
  if (type && type.defaultProps)
423
423
  for (propName in childrenLength = type.defaultProps, childrenLength)
424
424
  void 0 === props[propName] && (props[propName] = childrenLength[propName]);
425
- return ReactElement2(type, key, void 0, void 0, null, props);
425
+ return ReactElement3(type, key, void 0, void 0, null, props);
426
426
  };
427
427
  exports.createRef = function() {
428
428
  return { current: null };
@@ -686,7 +686,7 @@ var require_react_development = __commonJS({
686
686
  componentName = this.props.ref;
687
687
  return void 0 !== componentName ? componentName : null;
688
688
  }
689
- function ReactElement2(type, key, self, source, owner, props, debugStack, debugTask) {
689
+ function ReactElement3(type, key, self, source, owner, props, debugStack, debugTask) {
690
690
  self = props.ref;
691
691
  type = {
692
692
  $$typeof: REACT_ELEMENT_TYPE,
@@ -728,7 +728,7 @@ var require_react_development = __commonJS({
728
728
  return type;
729
729
  }
730
730
  function cloneAndReplaceKey(oldElement, newKey) {
731
- newKey = ReactElement2(
731
+ newKey = ReactElement3(
732
732
  oldElement.type,
733
733
  newKey,
734
734
  void 0,
@@ -1230,7 +1230,7 @@ var require_react_development = __commonJS({
1230
1230
  JSCompiler_inline_result[i] = arguments[i + 2];
1231
1231
  props.children = JSCompiler_inline_result;
1232
1232
  }
1233
- props = ReactElement2(
1233
+ props = ReactElement3(
1234
1234
  element.type,
1235
1235
  key,
1236
1236
  void 0,
@@ -1290,7 +1290,7 @@ var require_react_development = __commonJS({
1290
1290
  "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1291
1291
  );
1292
1292
  var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1293
- return ReactElement2(
1293
+ return ReactElement3(
1294
1294
  type,
1295
1295
  node,
1296
1296
  void 0,
@@ -1601,7 +1601,7 @@ var require_react_jsx_runtime_development = __commonJS({
1601
1601
  componentName = this.props.ref;
1602
1602
  return void 0 !== componentName ? componentName : null;
1603
1603
  }
1604
- function ReactElement2(type, key, self, source, owner, props, debugStack, debugTask) {
1604
+ function ReactElement3(type, key, self, source, owner, props, debugStack, debugTask) {
1605
1605
  self = props.ref;
1606
1606
  type = {
1607
1607
  $$typeof: REACT_ELEMENT_TYPE,
@@ -1681,7 +1681,7 @@ var require_react_jsx_runtime_development = __commonJS({
1681
1681
  maybeKey,
1682
1682
  "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1683
1683
  );
1684
- return ReactElement2(
1684
+ return ReactElement3(
1685
1685
  type,
1686
1686
  children,
1687
1687
  self,
@@ -1695,20 +1695,20 @@ var require_react_jsx_runtime_development = __commonJS({
1695
1695
  function validateChildKeys(node) {
1696
1696
  "object" === typeof node && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
1697
1697
  }
1698
- var React2 = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
1698
+ var React3 = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
1699
1699
  Symbol.for("react.provider");
1700
- var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
1700
+ var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
1701
1701
  return null;
1702
1702
  };
1703
- React2 = {
1703
+ React3 = {
1704
1704
  react_stack_bottom_frame: function(callStackForError) {
1705
1705
  return callStackForError();
1706
1706
  }
1707
1707
  };
1708
1708
  var specialPropKeyWarningShown;
1709
1709
  var didWarnAboutElementRef = {};
1710
- var unknownOwnerDebugStack = React2.react_stack_bottom_frame.bind(
1711
- React2,
1710
+ var unknownOwnerDebugStack = React3.react_stack_bottom_frame.bind(
1711
+ React3,
1712
1712
  UnknownOwner
1713
1713
  )();
1714
1714
  var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
@@ -1756,7 +1756,7 @@ var require_jsx_runtime = __commonJS({
1756
1756
  }
1757
1757
  });
1758
1758
 
1759
- // Common Boards/ArduinoShield/ArduinoShieldFootprint.tsx
1759
+ // lib/ArduinoShield/ArduinoShieldFootprint.tsx
1760
1760
  var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
1761
1761
  var ArduinoShieldFootprint = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("footprint", { children: [
1762
1762
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -2145,7 +2145,7 @@ var ArduinoShieldFootprint = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
2145
2145
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("silkscreentext", { text: "SCL", fontSize: 0.8, pcbX: -12.9, pcbY: 22.2 })
2146
2146
  ] });
2147
2147
 
2148
- // Common Boards/ArduinoShield/ArduinoShield.circuit.tsx
2148
+ // lib/ArduinoShield/ArduinoShield.circuit.tsx
2149
2149
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
2150
2150
  var ArduinoShield = (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2151
2151
  "board",
@@ -2269,7 +2269,7 @@ var ArduinoShield = (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2269
2269
  }
2270
2270
  );
2271
2271
 
2272
- // Common Boards/MicroModBoard/MicroModBoardFootprint.tsx
2272
+ // lib/MicroModBoard/MicroModBoardFootprint.tsx
2273
2273
  var import_react = __toESM(require_react(), 1);
2274
2274
  var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
2275
2275
  var createSmtPad = (props) => import_react.default.createElement("smtpad", props);
@@ -2511,11 +2511,11 @@ var outlineBuilder = (x, y) => {
2511
2511
  return new OutlineBuilder(x, y);
2512
2512
  };
2513
2513
 
2514
- // Common Boards/MicroModBoard/outlines/boardOutlines.ts
2514
+ // lib/MicroModBoard/outlines/boardOutlines.ts
2515
2515
  var processorOutline = outlineBuilder(-9, 11).lineTo(11, 11).corner({ radius: 1, turn: "ccw" }).lineTo(11, -7).corner({ radius: 0.5, turn: "ccw" }).lineTo(10, -7).corner({ radius: 0.5, turn: "cw" }).lineTo(10, -11).lineTo(3.28, -11).lineTo(3.28, -8).arcTo(2.08, -8, { radius: 0.6, sweep: true }).lineTo(2.08, -11).lineTo(-10, -11).lineTo(-10, -7).corner({ radius: 0.5, turn: "cw" }).lineTo(-11, -7).corner({ radius: 0.5, turn: "ccw" }).lineTo(-11, 11).corner({ radius: 1, turn: "ccw" }).toArray();
2516
2516
  var functionOutline = outlineBuilder(0, 32.5).lineTo(19, 32.5).corner({ radius: 1, turn: "ccw" }).lineTo(19, -28.5).corner({ radius: 0.5, turn: "ccw" }).lineTo(10, -28.5).corner({ radius: 0.5, turn: "cw" }).lineTo(10, -32.5).lineTo(3.28, -32.5).lineTo(3.28, -29.5).arcTo(2.08, -29.5, { radius: 0.6, sweep: true }).lineTo(2.08, -32.5).lineTo(-10, -32.5).lineTo(-10, -28.5).corner({ radius: 0.5, turn: "cw" }).lineTo(-19, -28.5).corner({ radius: 0.5, turn: "ccw" }).lineTo(-19, 32.5).corner({ radius: 1, turn: "ccw" }).toArray();
2517
2517
 
2518
- // Common Boards/MicroModBoard/MicroModBoard.tsx
2518
+ // lib/MicroModBoard/MicroModBoard.tsx
2519
2519
  var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
2520
2520
  var MicroModBoard = (_a) => {
2521
2521
  var _b = _a, {
@@ -2733,9 +2733,468 @@ var MicroModBoard = (_a) => {
2733
2733
  props.children
2734
2734
  ] }) });
2735
2735
  };
2736
+
2737
+ // lib/RaspberryPiHatBoard/RaspberryPiHatBoard.circuit.tsx
2738
+ var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
2739
+ var RaspberryPiHatBoard = (props) => {
2740
+ const outline = new OutlineBuilder(0, 28).lineTo(32.5, 28).corner({ radius: 1, turn: "ccw" }).lineTo(32.5, -28).corner({ radius: 1, turn: "ccw" }).lineTo(13.5, -28).corner({ radius: 1, turn: "ccw" }).lineTo(13.5, -9).arcTo(11.5, -9, { radius: 1, sweep: true }).lineTo(11.5, -28).corner({ radius: 1, turn: "ccw" }).lineTo(-32.5, -28).corner({ radius: 1, turn: "ccw" }).lineTo(-32.5, -8.5).corner({ radius: 1, turn: "ccw" }).lineTo(-27.5, -8.5).corner({ radius: 1, turn: "cw" }).lineTo(-27.5, 8.5).corner({ radius: 1, turn: "cw" }).lineTo(-32.5, 8.5).corner({ radius: 1, turn: "ccw" }).lineTo(-32.5, 28).corner({ radius: 1, turn: "ccw" }).toArray();
2741
+ const pinLabels = {
2742
+ pin1: ["V3_3_1"],
2743
+ pin2: ["V5_1"],
2744
+ pin3: ["V5_2"],
2745
+ pin4: ["GND_1"],
2746
+ pin5: ["GPIO_14", "TX"],
2747
+ pin6: ["GPIO_15", "RX"],
2748
+ pin7: ["GPIO_18", "PCM_CLK"],
2749
+ pin8: ["GND_2"],
2750
+ pin9: ["GPIO_23"],
2751
+ pin10: ["GPIO_24"],
2752
+ pin11: ["GND_3"],
2753
+ pin12: ["GPIO_25"],
2754
+ pin13: ["GPIO_8", "CE0"],
2755
+ pin14: ["GPIO_7", "CE1"],
2756
+ pin15: ["GPIO_1", "ID_SC"],
2757
+ pin16: ["GND_4"],
2758
+ pin17: ["GPIO_12", "PWM0"],
2759
+ pin18: ["GND_5"],
2760
+ pin19: ["GPIO_16"],
2761
+ pin20: ["GPIO_20", "PCM_DIN"],
2762
+ pin21: ["GPIO_21", "PCM_DOUT"],
2763
+ pin22: ["GND_6"],
2764
+ pin23: ["GPIO_26"],
2765
+ pin24: ["GPIO_19", "PCM_FS"],
2766
+ pin25: ["GPIO_13", "PWM1"],
2767
+ pin26: ["GPIO_6"],
2768
+ pin27: ["GPIO_5"],
2769
+ pin28: ["GPIO_0", "ID_SD"],
2770
+ pin29: ["GND_7"],
2771
+ pin30: ["GPIO_11", "SCLK"],
2772
+ pin31: ["GPIO_9", "MISO"],
2773
+ pin32: ["GPIO_10", "MOSI"],
2774
+ pin33: ["V3_3_2"],
2775
+ pin34: ["GPIO_22"],
2776
+ pin35: ["GPIO_27"],
2777
+ pin36: ["GPIO_17"],
2778
+ pin37: ["GND_8"],
2779
+ pin38: ["GPIO_4", "GPCLK0"],
2780
+ pin39: ["GPIO_3", "SCL"],
2781
+ pin40: ["GPIO_2", "SDA"]
2782
+ };
2783
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("board", { outline, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("group", { children: [
2784
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2785
+ "chip",
2786
+ {
2787
+ name: "JP1",
2788
+ schWidth: 3.5,
2789
+ pinLabels,
2790
+ layer: "bottom",
2791
+ footprint: "pinrow40_rows2_nopinlabels_p2.54_id1.016_od1.524",
2792
+ pcbY: 23.23,
2793
+ pcbRotation: 180,
2794
+ showPinAliases: true,
2795
+ schPinArrangement: {
2796
+ leftSide: {
2797
+ direction: "top-to-bottom",
2798
+ pins: [
2799
+ "V3_3_1",
2800
+ "V3_3_2",
2801
+ "V5_1",
2802
+ "V5_2",
2803
+ "GPIO_14",
2804
+ "GPIO_15",
2805
+ "GPIO_3",
2806
+ "GPIO_2",
2807
+ "GPIO_20",
2808
+ "GPIO_21",
2809
+ "GPIO_9",
2810
+ "GPIO_10",
2811
+ "GND_1",
2812
+ "GND_2",
2813
+ "GND_3",
2814
+ "GND_4",
2815
+ "GND_5",
2816
+ "GND_6",
2817
+ "GND_7",
2818
+ "GND_8"
2819
+ ]
2820
+ },
2821
+ rightSide: {
2822
+ direction: "top-to-bottom",
2823
+ pins: [
2824
+ "GPIO_18",
2825
+ "GPIO_11",
2826
+ "GPIO_24",
2827
+ "GPIO_25",
2828
+ "GPIO_8",
2829
+ "GPIO_7",
2830
+ "GPIO_12",
2831
+ "GPIO_13",
2832
+ "GPIO_26",
2833
+ "GPIO_19",
2834
+ "GPIO_16",
2835
+ "GPIO_6",
2836
+ "GPIO_5",
2837
+ "GPIO_0",
2838
+ "GPIO_22",
2839
+ "GPIO_27",
2840
+ "GPIO_17",
2841
+ "GPIO_4",
2842
+ "GPIO_1"
2843
+ ]
2844
+ }
2845
+ },
2846
+ schPinStyle: {
2847
+ pin3: {
2848
+ marginBottom: 0.3
2849
+ },
2850
+ pin6: {
2851
+ marginBottom: 0.3
2852
+ },
2853
+ pin40: {
2854
+ marginBottom: 0.3
2855
+ },
2856
+ pin21: {
2857
+ marginBottom: 0.3
2858
+ },
2859
+ pin32: {
2860
+ marginBottom: 0.3
2861
+ },
2862
+ pin30: {
2863
+ marginBottom: 0.3
2864
+ },
2865
+ pin12: {
2866
+ marginBottom: 0.3
2867
+ },
2868
+ pin14: {
2869
+ marginBottom: 0.3
2870
+ },
2871
+ pin25: {
2872
+ marginBottom: 0.3
2873
+ }
2874
+ }
2875
+ }
2876
+ ),
2877
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("hole", { diameter: 2.8, pcbX: -29, pcbY: 24.5 }),
2878
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("hole", { diameter: 2.8, pcbX: 29, pcbY: -24.5 }),
2879
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("hole", { diameter: 2.8, pcbX: -29, pcbY: -24.5 }),
2880
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("hole", { diameter: 2.8, pcbX: 29, pcbY: 24.5 }),
2881
+ props.children
2882
+ ] }) });
2883
+ };
2884
+
2885
+ // lib/XiaoBoard/XiaoBoardFootprint.tsx
2886
+ var import_react2 = __toESM(require_react(), 1);
2887
+ var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
2888
+ var createSmtPad2 = (props) => import_react2.default.createElement("smtpad", props);
2889
+ var createPlatedHole2 = (props) => import_react2.default.createElement("platedhole", props);
2890
+ var createHole = (props) => import_react2.default.createElement("hole", props);
2891
+ var XiaoBoardFootprint = ({
2892
+ top = 0,
2893
+ bottom = 0,
2894
+ left = 7,
2895
+ right = 7,
2896
+ pitch = 2.54,
2897
+ padLength = 2,
2898
+ padWidth = 3,
2899
+ edgeClearance = 1.2,
2900
+ componentWidth = 17,
2901
+ bottomPadWidth = 1.016,
2902
+ bottomPadHeight = 2.032,
2903
+ bottomPitch = 2.54,
2904
+ variant,
2905
+ withPlatedHoles = false
2906
+ }) => {
2907
+ const isRP2040 = variant === "RP2040";
2908
+ if (isRP2040) {
2909
+ top = 4;
2910
+ bottom = 2;
2911
+ left = 7;
2912
+ right = 7;
2913
+ pitch = 2.54;
2914
+ padLength = 2;
2915
+ padWidth = 3;
2916
+ edgeClearance = 1.2;
2917
+ componentWidth = 17;
2918
+ bottomPadWidth = 1.016;
2919
+ bottomPadHeight = 2.032;
2920
+ bottomPitch = 2.54;
2921
+ }
2922
+ const leftRowX = -componentWidth / 2 + 0.25;
2923
+ const rightRowX = componentWidth / 2 - 0.25;
2924
+ const generatePads = () => {
2925
+ const pads = [];
2926
+ let pinNumber = 1;
2927
+ if (top > 0) {
2928
+ pads.push(
2929
+ createSmtPad2({
2930
+ portHints: [`pin${pinNumber++}`],
2931
+ radius: 0.5715,
2932
+ pcbX: -1.396,
2933
+ pcbY: 8.442,
2934
+ layer: "top",
2935
+ shape: "circle"
2936
+ }),
2937
+ createSmtPad2({
2938
+ portHints: [`pin${pinNumber++}`],
2939
+ radius: 0.5715,
2940
+ pcbX: 1.144,
2941
+ pcbY: 8.442,
2942
+ layer: "top",
2943
+ shape: "circle"
2944
+ })
2945
+ );
2946
+ pads.push(
2947
+ createSmtPad2({
2948
+ portHints: [`pin${pinNumber++}`],
2949
+ radius: 0.5715,
2950
+ pcbX: -1.396,
2951
+ pcbY: 5.902,
2952
+ layer: "top",
2953
+ shape: "circle"
2954
+ }),
2955
+ createSmtPad2({
2956
+ portHints: [`pin${pinNumber++}`],
2957
+ radius: 0.5715,
2958
+ pcbX: 1.144,
2959
+ pcbY: 5.902,
2960
+ layer: "top",
2961
+ shape: "circle"
2962
+ })
2963
+ );
2964
+ }
2965
+ if (bottom > 0) {
2966
+ const actualBottomPitch = bottomPitch != null ? bottomPitch : pitch;
2967
+ const xOffset = (bottom - 1) / 2 * actualBottomPitch;
2968
+ const bottomPadW = bottomPadWidth != null ? bottomPadWidth : padWidth;
2969
+ const bottomPadH = bottomPadHeight != null ? bottomPadHeight : padLength;
2970
+ for (let i = 0; i < bottom; i++) {
2971
+ pads.push(
2972
+ createSmtPad2({
2973
+ portHints: [`pin${pinNumber++}`],
2974
+ width: bottomPadW,
2975
+ height: bottomPadH,
2976
+ pcbX: xOffset - i * actualBottomPitch,
2977
+ pcbY: -9.7 + edgeClearance,
2978
+ layer: "top",
2979
+ shape: "rect"
2980
+ })
2981
+ );
2982
+ }
2983
+ }
2984
+ if (left > 0) {
2985
+ const yOffset = (left - 1) / 2 * pitch;
2986
+ for (let i = 0; i < left; i++) {
2987
+ const halfPad = padWidth / 2;
2988
+ if (variant !== "Receiver") {
2989
+ pads.push(
2990
+ createHole({
2991
+ diameter: 0.7,
2992
+ pcbX: leftRowX - halfPad + 0.86,
2993
+ pcbY: yOffset - i * pitch
2994
+ })
2995
+ );
2996
+ }
2997
+ if (withPlatedHoles) {
2998
+ pads.push(
2999
+ createPlatedHole2({
3000
+ portHints: [`pin${pinNumber}`],
3001
+ holeDiameter: 0.85,
3002
+ rectPadWidth: padWidth,
3003
+ rectPadHeight: padLength,
3004
+ pcbX: leftRowX,
3005
+ pcbY: yOffset - i * pitch,
3006
+ shape: "circular_hole_with_rect_pad",
3007
+ holeOffsetX: 0.63
3008
+ })
3009
+ );
3010
+ pinNumber++;
3011
+ } else {
3012
+ pads.push(
3013
+ createSmtPad2({
3014
+ portHints: [`pin${pinNumber}`],
3015
+ width: padWidth,
3016
+ height: padLength,
3017
+ pcbX: leftRowX,
3018
+ pcbY: yOffset - i * pitch,
3019
+ layer: "top",
3020
+ shape: "rect"
3021
+ })
3022
+ );
3023
+ pinNumber++;
3024
+ }
3025
+ }
3026
+ }
3027
+ if (right > 0) {
3028
+ const yOffset = (right - 1) / 2 * pitch;
3029
+ for (let i = 0; i < right; i++) {
3030
+ const halfPad = padWidth / 2;
3031
+ if (variant !== "Receiver") {
3032
+ pads.push(
3033
+ createHole({
3034
+ diameter: 0.7,
3035
+ pcbX: rightRowX + halfPad - 0.86,
3036
+ pcbY: yOffset - i * pitch
3037
+ })
3038
+ );
3039
+ }
3040
+ if (withPlatedHoles) {
3041
+ pads.push(
3042
+ createPlatedHole2({
3043
+ portHints: [`pin${pinNumber}`],
3044
+ holeDiameter: 0.85,
3045
+ rectPadWidth: padWidth,
3046
+ rectPadHeight: padLength,
3047
+ pcbX: rightRowX,
3048
+ pcbY: yOffset - i * pitch,
3049
+ shape: "circular_hole_with_rect_pad",
3050
+ holeOffsetX: -0.63
3051
+ })
3052
+ );
3053
+ pinNumber++;
3054
+ } else {
3055
+ pads.push(
3056
+ createSmtPad2({
3057
+ portHints: [`pin${pinNumber}`],
3058
+ width: padWidth,
3059
+ height: padLength,
3060
+ pcbX: rightRowX,
3061
+ pcbY: yOffset - i * pitch,
3062
+ layer: "top",
3063
+ shape: "rect"
3064
+ })
3065
+ );
3066
+ pinNumber++;
3067
+ }
3068
+ }
3069
+ }
3070
+ return pads;
3071
+ };
3072
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("footprint", { children: generatePads() });
3073
+ };
3074
+
3075
+ // lib/XiaoBoard/XiaoBoard.circuit.tsx
3076
+ var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
3077
+ var XiaoBoard = (_a) => {
3078
+ var _b = _a, {
3079
+ variant,
3080
+ withPlatedHoles = false
3081
+ } = _b, props = __objRest(_b, [
3082
+ "variant",
3083
+ "withPlatedHoles"
3084
+ ]);
3085
+ const DefaultPinLabels = {
3086
+ pin1: "A0",
3087
+ pin2: "A1",
3088
+ pin3: "A2",
3089
+ pin4: "A3",
3090
+ pin5: "SDA",
3091
+ pin6: "SCL",
3092
+ pin7: "TX",
3093
+ pin8: "VBUS",
3094
+ pin9: "GND1",
3095
+ pin10: "V3_3",
3096
+ pin11: "MOSI",
3097
+ pin12: "MISO",
3098
+ pin13: "SCK",
3099
+ pin14: "RX"
3100
+ };
3101
+ const RP2040PinLabels = {
3102
+ pin1: "SWDIO",
3103
+ pin2: "SWCLK",
3104
+ pin3: "RUN",
3105
+ pin4: "GND1",
3106
+ pin5: "GND2",
3107
+ pin6: "VIN",
3108
+ pin7: "A0",
3109
+ pin8: "A1",
3110
+ pin9: "A2",
3111
+ pin10: "A3",
3112
+ pin11: "SDA",
3113
+ pin12: "SCL",
3114
+ pin13: "TX",
3115
+ pin14: "VBUS",
3116
+ pin15: "GND3",
3117
+ pin16: "V3_3",
3118
+ pin17: "MOSI",
3119
+ pin18: "MISO",
3120
+ pin19: "SCK",
3121
+ pin20: "RX"
3122
+ };
3123
+ const defaultPinArrangement = {
3124
+ leftSide: {
3125
+ direction: "top-to-bottom",
3126
+ pins: ["A0", "A1", "A2", "A3", "SDA", "SCL", "TX"]
3127
+ },
3128
+ rightSide: {
3129
+ direction: "top-to-bottom",
3130
+ pins: ["RX", "SCK", "MISO", "MOSI", "V3_3", "GND1", "VBUS"]
3131
+ }
3132
+ };
3133
+ const rp2040PinArrangement = {
3134
+ leftSide: {
3135
+ direction: "top-to-bottom",
3136
+ pins: ["SWDIO", "RUN", "A0", "A1", "A2", "A3", "SDA", "SCL", "TX", "VIN"]
3137
+ },
3138
+ rightSide: {
3139
+ direction: "top-to-bottom",
3140
+ pins: [
3141
+ "SWCLK",
3142
+ "RX",
3143
+ "SCK",
3144
+ "MISO",
3145
+ "MOSI",
3146
+ "V3_3",
3147
+ "GND1",
3148
+ "GND2",
3149
+ "GND3",
3150
+ "VBUS"
3151
+ ]
3152
+ }
3153
+ };
3154
+ const outline = outlineBuilder(0, 10.55).lineTo(8.89, 10.55).corner({ radius: 1.8, turn: "ccw" }).lineTo(8.89, -10.55).corner({ radius: 1.8, turn: "ccw" }).lineTo(-8.89, -10.55).corner({ radius: 1.8, turn: "ccw" }).lineTo(-8.89, 10.55).corner({ radius: 1.8, turn: "ccw" }).lineTo(0, 10.55).toArray();
3155
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("board", { outline, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("group", { children: [
3156
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3157
+ "chip",
3158
+ __spreadValues({
3159
+ name: props.name,
3160
+ footprint: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3161
+ XiaoBoardFootprint,
3162
+ {
3163
+ variant,
3164
+ withPlatedHoles
3165
+ }
3166
+ ),
3167
+ pinLabels: variant === "RP2040" ? RP2040PinLabels : DefaultPinLabels,
3168
+ schWidth: 1.5,
3169
+ schPinArrangement: variant === "RP2040" ? rp2040PinArrangement : defaultPinArrangement
3170
+ }, variant === "RP2040" && {
3171
+ schPinStyle: {
3172
+ pin2: {
3173
+ marginBottom: 0.2
3174
+ },
3175
+ pin3: {
3176
+ marginBottom: 0.3
3177
+ },
3178
+ pin15: {
3179
+ marginBottom: 0.2
3180
+ },
3181
+ pin16: {
3182
+ marginBottom: 0.2
3183
+ },
3184
+ pin13: {
3185
+ marginBottom: 0.3
3186
+ }
3187
+ }
3188
+ })
3189
+ ),
3190
+ props.children
3191
+ ] }) });
3192
+ };
2736
3193
  export {
2737
3194
  ArduinoShield,
2738
- MicroModBoard
3195
+ MicroModBoard,
3196
+ RaspberryPiHatBoard,
3197
+ XiaoBoard
2739
3198
  };
2740
3199
  /*! Bundled license information:
2741
3200
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/common",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"