tscircuit/rv1106g2-breakout

This code defines a set of PCB components and their footprints, including connecters, chips, resistors, capacitors, and other hardware parts, for assembling a Core1106-based circuit board with detailed pinouts, footprints, and 3D models.

Version
1.0.2
License
unset
Stars
0

Use with the tscircuit CLI

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

tsci clone tscircuit/rv1106g2-breakout  # download the package files into ./rv1106g2-breakout
tsci add tscircuit/rv1106g2-breakout    # add it to your project as @tsci/tscircuit.rv1106g2-breakout

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.

index.circuit.tsx

import { CORE1106_PIN_LABELS, Core1106 } from "./components/Core1106"
import { AP2112K_1_8TRG1 } from "./imports/AP2112K_1_8TRG1"
import { DM3AT_SF_PEJM5 } from "./imports/DM3AT_SF_PEJM5"
import { ESD5Z5V0 } from "./imports/ESD5Z5V0"
import { F_0603_00025_P2_0603G1TS2_06T_002 } from "./imports/F_0603_00025_P2_0603G1TS2_06T_002"
import { FH12_24S_0_5SH_55_ } from "./imports/FH12_24S_0_5SH_55_"
import { HR911105A } from "./imports/HR911105A"
import { LM66100DCKR } from "./imports/LM66100DCKR"
import { RClamp0524P_TCT_MS } from "./imports/RClamp0524P_TCT_MS"
import { S2B_PH_SM4_TB_LF__SN_ } from "./imports/S2B_PH_SM4_TB_LF__SN_"
import { SMD1206P110TF } from "./imports/SMD1206P110TF"
import { SM04B_SRSS_TB_LF__SN_ } from "./imports/SM04B_SRSS_TB_LF__SN_"
import { SM08B_SRSS_TB_LF__SN_ } from "./imports/SM08B_SRSS_TB_LF__SN_"
import { TLV62569DBVR } from "./imports/TLV62569DBVR"
import { TSB019A2516A } from "./imports/TSB019A2516A"
import { TYPE_C_31_M_12 } from "./imports/TYPE_C_31_M_12"
import { USBLC6_2SC6 } from "./imports/USBLC6_2SC6"
import { WPN4020H2R2MT } from "./imports/WPN4020H2R2MT"

const GROUND_PINS = [21, 25, 28, 29, 36, 47, 55, 56, 57, 75, 82, 83, 84, 89, 112]

const CONNECTED_CORE_PINS = new Set([
  ...Array.from({ length: 12 }, (_, index) => index + 1),
  16,
  17,
  18,
  19,
  ...GROUND_PINS,
  22,
  23,
  24,
  26,
  27,
  30,
  31,
  32,
  33,
  48,
  49,
  50,
  51,
  52,
  53,
  54,
  ...Array.from({ length: 24 }, (_, index) => index + 58),
  85,
  86,
  87,
  88,
  90,
  91,
  92,
  93,
  94,
  98,
  99,
  100,
  101,
  102,
  103,
  104,
  105,
  106,
  107,
  108,
  109,
])

const CORE_NO_CONNECT = Array.from({ length: 112 }, (_, index) => index + 1)
  .filter((pin) => !CONNECTED_CORE_PINS.has(pin))
  .map((pin) => CORE1106_PIN_LABELS[`pin${pin}`])

const JLC = {
  r5k1: { jlcpcb: ["C25905"] },
  r10k: { jlcpcb: ["C25744"] },
  r18k: { jlcpcb: ["C25762"] },
  r22: { jlcpcb: ["C25092"] },
  r47k: { jlcpcb: ["C25792"] },
  r100k: { jlcpcb: ["C25741"] },
  r4k7: { jlcpcb: ["C25900"] },
  r1k: { jlcpcb: ["C11702"] },
  r100: { jlcpcb: ["C25076"] },
  r453k: { jlcpcb: ["C3013172"] },
  c100n: { jlcpcb: ["C71687"] },
  c10n: { jlcpcb: ["C5137480"] },
  c1n: { jlcpcb: ["C126532"] },
  c2u2: { jlcpcb: ["C107127"] },
  c10u: { jlcpcb: ["C86038"] },
  c22u: { jlcpcb: ["C91604"] },
  c1u: { jlcpcb: ["C95843"] },
  c6p8: { jlcpcb: ["C88896"] },
  bat54: { jlcpcb: ["C124205"] },
  gpio40: { jlcpcb: ["C2977589"] },
  header8: { jlcpcb: ["C492407"] },
}

const GPIO40_CONNECTIONS: Array<[number, string]> = [
  [1, "net.EXT_3V3"], [2, "net.SYS5V"], [3, ".U_CORE > .pin64"], [4, "net.SYS5V"],
  [5, ".U_CORE > .pin63"], [6, "net.GND"], [7, ".U_CORE > .pin60"], [8, ".U_CORE > .pin59"],
  [9, "net.GND"], [10, ".U_CORE > .pin58"], [11, ".U_CORE > .pin61"], [12, ".U_CORE > .pin62"],
  [13, ".U_CORE > .pin67"], [14, "net.GND"], [15, ".U_CORE > .pin68"], [16, ".U_CORE > .pin69"],
  [17, "net.EXT_3V3"], [18, ".U_CORE > .pin70"], [19, ".U_CORE > .pin99"], [20, "net.GND"],
  [21, ".U_CORE > .pin98"], [22, ".U_CORE > .pin71"], [23, ".U_CORE > .pin100"], [24, ".U_CORE > .pin101"],
  [25, "net.GND"], [26, ".U_CORE > .pin91"], [27, ".U_CORE > .pin66"], [28, ".U_CORE > .pin65"],
  [29, ".U_CORE > .pin72"], [30, "net.GND"], [31, ".U_CORE > .pin73"], [32, ".U_CORE > .pin93"],
  [33, ".U_CORE > .pin92"], [34, "net.GND"], [35, ".U_CORE > .pin94"], [36, ".U_CORE > .pin90"],
  [37, ".U_CORE > .pin108"], [38, ".U_CORE > .pin109"], [39, "net.GND"], [40, "net.EXT_3V3"],
]

const GPIO40_LABELS = {
  pin1: "3V3_EXT", pin2: "5V_SYS", pin3: "I2C1_SDA", pin4: "5V_SYS", pin5: "I2C1_SCL", pin6: "GND",
  pin7: "PWM3_GPIO0_A2", pin8: "UART0_TX", pin9: "GND", pin10: "UART0_RX", pin11: "GPIO0_A3", pin12: "GPIO0_A4",
  pin13: "PWM0_GPIO1_A2", pin14: "GND", pin15: "I2C0_SCL_UART1_TX", pin16: "I2C0_SDA_UART1_RX", pin17: "3V3_EXT",
  pin18: "UART4_RX", pin19: "SPI0_MOSI", pin20: "GND", pin21: "SPI0_MISO", pin22: "UART4_TX_SPI1_CS1",
  pin23: "SPI0_CLK", pin24: "SPI0_CS0", pin25: "GND", pin26: "SPI0_CS1", pin27: "I2C2_SDA_UART3_RX",
  pin28: "I2C2_SCL_UART3_TX", pin29: "UART2_TX_JTAG_TCK", pin30: "GND", pin31: "UART2_RX_JTAG_TMS",
  pin32: "UART3_TX_GPIO1_D0", pin33: "UART3_RX_GPIO1_D1", pin34: "GND", pin35: "GPIO1_D2", pin36: "GPIO1_D3",
  pin37: "I2C3_SCL_UART0_RTS", pin38: "I2C3_SDA_UART0_CTS", pin39: "GND", pin40: "3V3_EXT",
} as const

const SD_SERIES: Array<[string, number, number]> = [
  ["R_SD_D2", 51, 1], ["R_SD_D3", 52, 2], ["R_SD_CMD", 53, 3],
  ["R_SD_CLK", 54, 5], ["R_SD_D0", 49, 7], ["R_SD_D1", 50, 8],
]

const SD_PULLUPS: Array<[string, number]> = [
  ["R_SD_PU_D2", 1], ["R_SD_PU_D3", 2], ["R_SD_PU_CMD", 3],
  ["R_SD_PU_D0", 7], ["R_SD_PU_D1", 8],
]

const SPI_DISPLAY_SERIES: Array<[string, number, number, number]> = [
  ["R_SPI_SCLK", 100, 3, 33.94],
  ["R_SPI_MOSI", 99, 4, 41.92],
  ["R_SPI_MISO", 98, 5, 49.9],
  ["R_SPI_CS", 101, 6, 57.64],
  ["R_SPI_DC", 61, 7, 64.3],
  ["R_SPI_RESET", 62, 8, 68.82],
]

const CAMERA_CONNECTIONS: Array<[number, number | "GND" | "EXT_1V8" | "EXT_3V3"]> = [
  [1, "GND"], [2, 1], [3, 2], [4, "GND"], [5, 3], [6, 4], [7, "GND"], [8, 5], [9, 6], [10, "GND"],
  [11, 7], [12, 8], [13, "GND"], [14, 9], [15, 10], [16, "EXT_3V3"], [17, 11], [18, 12],
  [19, "EXT_1V8"], [20, 16], [21, 17], [22, 18], [23, 19], [24, "GND"],
]

export default () => (
  <board
    name="CORE1106_CARRIER"
    title="Core1106 RV1106G2 Carrier"
    width="100mm"
    height="72mm"
    layers={4}
    thickness="1.6mm"
    borderRadius="2mm"
    solderMaskColor="black"
    silkscreenColor="white"
    autorouter="auto"
    autorouterEffortLevel="2x"
    minTraceWidth="0.15mm"
    nominalTraceWidth="0.2mm"
  >
    <net name="GND" isGroundNet nominalTraceWidth="0.2mm" />
    <net name="VBUS_RAW" isPowerNet nominalTraceWidth="0.6mm" />
    <net name="VBUS_FUSED" isPowerNet nominalTraceWidth="0.6mm" />
    <net name="AUX5_RAW" isPowerNet nominalTraceWidth="0.6mm" />
    <net name="AUX5_FUSED" isPowerNet nominalTraceWidth="0.6mm" />
    <net name="SYS5V" isPowerNet nominalTraceWidth="0.4mm" />
    <net name="CORE_3V3" isPowerNet nominalTraceWidth="0.2mm" />
    <net name="CORE_1V8" isPowerNet nominalTraceWidth="0.2mm" />
    <net name="EXT_3V3" isPowerNet nominalTraceWidth="0.3mm" />
    <net name="EXT_1V8" isPowerNet nominalTraceWidth="0.25mm" />
    <net name="RTC_VCC" isPowerNet nominalTraceWidth="0.2mm" />

    <Core1106 name="U_CORE" pcbX={-10} pcbY={3} schX={0} schY={0}
      noConnect={CORE_NO_CONNECT} noSchematicRepresentation doNotPlace />

    <TYPE_C_31_M_12 name="J_USB" noConnect={["pin5", "pin11"]}
      pcbX={-45.9} pcbY={-11} pcbRotation={-90} schX={-80} schY={-40} />
    <SMD1206P110TF name="F1" pcbX={-38} pcbY={-18} schX={-68} schY={-32} />
    <LM66100DCKR name="U_USB_IDEAL" noConnect={["NC", "ST"]}
      pcbX={-33.5} pcbY={-14} schX={-57} schY={-32} />
    <resistor name="R_CC1" resistance="5.1k" footprint="0402" supplierPartNumbers={JLC.r5k1}
      pcbX={-40.5} pcbY={-9.75} schX={-75} schY={-30} />
    <resistor name="R_CC2" resistance="5.1k" footprint="0402" supplierPartNumbers={JLC.r5k1}
      pcbX={-40.5} pcbY={-12.75} schX={-71} schY={-30} />
    <resistor name="R_VBUS_TOP" resistance="10k" footprint="0402" supplierPartNumbers={JLC.r10k}
      pcbX={-38} pcbY={-5} schX={-64.33} schY={-42} />
    <resistor name="R_VBUS_BOTTOM" resistance="18k" footprint="0402" supplierPartNumbers={JLC.r18k}
      pcbX={-36} pcbY={-5} schX={-57.67} schY={-42} />
    <capacitor name="C_VBUS_DET" capacitance="100nF" footprint="0402" supplierPartNumbers={JLC.c100n}
      pcbX={-34} pcbY={-5} schX={-53} schY={-42} schOrientation="vertical" />
    <capacitor name="C_VBUS" capacitance="2.2uF" footprint="0805" supplierPartNumbers={JLC.c2u2}
      pcbX={-42.3} pcbY={-18} schX={-67} schY={-38} schOrientation="vertical" />
    <capacitor name="C_SYS_BULK" capacitance="22uF" footprint="1206" supplierPartNumbers={JLC.c22u}
      maxDecouplingTraceLength="15mm"
      pcbX={-28} pcbY={-16} schX={-48} schY={-32} schOrientation="vertical" />
    <capacitor name="C_SYS_HF" capacitance="100nF" footprint="0402" supplierPartNumbers={JLC.c100n}
      pcbX={-29} pcbY={-9} schX={-44} schY={-32} schOrientation="vertical" />
    <USBLC6_2SC6 name="U_USB_ESD" pcbX={-38} pcbY={-1} schX={-61} schY={-49} />

    <S2B_PH_SM4_TB_LF__SN_ name="J_PWR" noConnect={["pin3", "pin4"]}
      pcbX={-27} pcbY={-31} schX={-80} schY={-57} />
    <SMD1206P110TF name="F2" pcbX={-35} pcbY={-32} schX={-68} schY={-57} />
    <LM66100DCKR name="U_AUX_IDEAL" noConnect={["NC", "ST"]}
      pcbX={-26} pcbY={-24} schX={-57} schY={-57} />
    <capacitor name="C_AUX_IN" capacitance="2.2uF" footprint="0805" supplierPartNumbers={JLC.c2u2}
      pcbX={-34} pcbY={-28} schX={-74} schY={-62} schOrientation="vertical" />

    <TLV62569DBVR name="U_REG3V3" pcbX={-36} pcbY={6} schX={-62} schY={-15} schHeight="0.6mm" />
    <WPN4020H2R2MT name="L_3V3" pcbX={-30.5} pcbY={6} schX={-56} schY={-15} />
    <resistor name="R_3V3_FB_TOP" resistance="453k" footprint="0402" supplierPartNumbers={JLC.r453k}
      pcbX={-34} pcbY={10} schX={-52} schY={-11} />
    <resistor name="R_3V3_FB_BOTTOM" resistance="100k" footprint="0402" supplierPartNumbers={JLC.r100k}
      pcbX={-32} pcbY={9} schX={-46} schY={-11} />
    <capacitor name="C_3V3_FF" capacitance="6.8pF" footprint="0402" supplierPartNumbers={JLC.c6p8}
      pcbX={-32} pcbY={12} schX={-49} schY={-15} schOrientation="vertical" />
    <capacitor name="C_3V3_IN" capacitance="10uF" footprint="0805" supplierPartNumbers={JLC.c10u}
      pcbX={-42} pcbY={1} schX={-70} schY={-15} schOrientation="vertical" />
    <capacitor name="C_3V3_OUT" capacitance="22uF" footprint="1206" supplierPartNumbers={JLC.c22u}
      pcbX={-28} pcbY={11} schX={-43} schY={-15} schOrientation="vertical" />
    <AP2112K_1_8TRG1 name="U_REG1V8" noConnect={["NC"]}
      pcbX={-37} pcbY={16} schX={-60} schY={0} schHeight="0.6mm" />
    <capacitor name="C_1V8_IN" capacitance="10uF" footprint="0805" supplierPartNumbers={JLC.c10u}
      pcbX={-42} pcbY={16} schX={-68} schY={0} schOrientation="vertical" />
    <capacitor name="C_1V8_OUT" capacitance="10uF" footprint="0805" supplierPartNumbers={JLC.c10u}
      pcbX={-31} pcbY={16} schX={-52} schY={0} schOrientation="vertical" />

    <FH12_24S_0_5SH_55_ name="J_CAM" noConnect={["pin25", "pin26"]}
      pcbX={-4} pcbY={31} pcbRotation={180} schX={-82} schY={28} />

    <DM3AT_SF_PEJM5 name="J_SD" pcbX={-10} pcbY={-26} pcbRotation={0} schX={-71} schY={8} />
    {SD_SERIES.map(([name], index) => <resistor key={name} name={name} resistance="22" footprint="0402"
      supplierPartNumbers={JLC.r22} pcbX={index * 2} pcbY={-16}
      schX={[-65, -55, -45, -35, -25, -15][index]} schY={14} />)}
    {SD_PULLUPS.map(([name], index) => <resistor key={name} name={name} resistance="47k" footprint="0402"
      supplierPartNumbers={JLC.r47k} pcbX={index * 2} pcbY={-19}
      schX={[-58, -54, -50, -46, -42.26][index]} schY={8} />)}
    <resistor name="R_SD_DET_PU" resistance="100k" footprint="0402" supplierPartNumbers={JLC.r100k}
      pcbX={10} pcbY={-19} schX={-37.74} schY={8} />
    <capacitor name="C_SD_BULK" capacitance="10uF" footprint="0805" supplierPartNumbers={JLC.c10u}
      pcbX={12} pcbY={-23} schX={-50} schY={3} schOrientation="vertical" />
    <capacitor name="C_SD_HF" capacitance="100nF" footprint="0402" supplierPartNumbers={JLC.c100n}
      pcbX={14.7} pcbY={-23} schX={-46} schY={3} schOrientation="vertical" />

    <pinheader name="J_GPIO" pinCount={40} doubleRow gender="female" pcbOrientation="vertical" showSilkscreenPinLabels
      supplierPartNumbers={JLC.gpio40} pinLabels={GPIO40_LABELS}
      pcbX={39} pcbY={3} schX={76} schY={0} schWidth="1.91mm" schHeight="8.2mm" />
    <SM04B_SRSS_TB_LF__SN_ name="J_I2C" noConnect={["MP1", "MP2"]}
      pcbX={-46.7244785} pcbY={24} pcbRotation={-90} schX={57.5} schY={42} />
    <resistor name="R_I2C_SDA" resistance="4.7k" footprint="0402" supplierPartNumbers={JLC.r4k7}
      pcbX={-38} pcbY={23} schX={47.8} schY={43} />
    <resistor name="R_I2C_SCL" resistance="4.7k" footprint="0402" supplierPartNumbers={JLC.r4k7}
      pcbX={-36} pcbY={23} schX={52.2} schY={43} />
    <pinheader name="J_ADC" pinCount={4} gender="male" doNotPlace pinLabels={{ pin1: "GND", pin2: "1V8", pin3: "ADC0_RECOVERY", pin4: "ADC1" }} pcbX={-43} pcbY={9} pcbOrientation="vertical" schX={57.5} schY={30} schWidth="1.435mm" />
    <pinheader name="J_AUDIO" pinCount={6} gender="male" doNotPlace pinLabels={{ pin1: "GND", pin2: "LINEOUT_AC", pin3: "MICBIAS", pin4: "MIC0P", pin5: "MIC0N", pin6: "GND" }} pcbX={-43.5} pcbY={-27.5} pcbOrientation="vertical" schX={57.5} schY={18} schWidth="1.15mm" />
    <capacitor name="C_LINEOUT" capacitance="1uF" footprint="0603" supplierPartNumbers={JLC.c1u}
      pcbX={-36} pcbY={-21} schX={43} schY={18} schOrientation="vertical" />
    <resistor name="R_LINEOUT" resistance="100" footprint="0402" supplierPartNumbers={JLC.r100}
      pcbX={-33} pcbY={-21} schX={48} schY={18} />
    <ESD5Z5V0 name="D_LINEOUT_ESD" pcbX={-40} pcbY={-22} schX={53} schY={18} schWidth="0.8mm" />
    <pinheader name="J_I2S" pinCount={8} gender="male" supplierPartNumbers={JLC.header8}
      pinLabels={{ pin1: "GND", pin2: "3V3", pin3: "SCLK", pin4: "LRCK", pin5: "MCLK", pin6: "SDO3", pin7: "SDO0", pin8: "SDI0" }}
      pcbX={19} pcbY={31} pcbOrientation="horizontal" schX={58} schY={54} schWidth="0.58mm" />
    <SM08B_SRSS_TB_LF__SN_ name="J_SPI_DISPLAY" noConnect={["MP1", "MP2"]}
      pcbX={-35} pcbY={32.6749866} pcbRotation={180} schX={58} schY={66} />
    {SPI_DISPLAY_SERIES.map(([name, , , schX], index) => <resistor key={name} name={name} resistance="22" footprint="0402"
      supplierPartNumbers={JLC.r22} pcbX={-41 + index * 2} pcbY={27}
      schX={schX} schY={62} />)}
    <HR911105A name="J_ETH_PHY" symbol={undefined} noConnect={["NC", "pin9", "pin10", "pin11", "pin12"]}
      pinAttributes={{
        pin1: {}, pin2: {}, pin3: {}, pin4: {}, pin5: {}, pin6: {},
        pin7: { doNotConnect: true }, pin8: { requiresGround: true },
        pin9: { requiresPower: true, requiresVoltage: "3.3V" }, pin10: {}, pin11: {}, pin12: {},
        pin13: { requiresGround: true }, pin14: { requiresGround: true },
        TD_POS: {}, TD_NEG: {}, RD_POS: {}, RD_NEG: {}, NC: { doNotConnect: true },
        SH1: { requiresGround: true }, SH2: { requiresGround: true },
      }}
      pcbX={25} pcbY={-22.85} schX={57.5} schY={-28} schWidth="2.055mm" />
    <RClamp0524P_TCT_MS name="U_ETH_ESD" pcbX={14} pcbY={-17} pcbRotation={90} schX={43} schY={-28} />
    <capacitor name="C_ETH_CT" capacitance="100nF" footprint="0402" supplierPartNumbers={JLC.c100n}
      pcbX={12} pcbY={-26} schX={48} schY={-34} schOrientation="vertical" />
    <pinheader name="J_RTC_BAT" pinCount={2} gender="male" doNotPlace pinLabels={{ pin1: "BAT_POS", pin2: "GND" }}
      pcbX={5} pcbY={-32} pcbOrientation="horizontal" schX={-60} schY={-58} />

    <diode name="D_RTC_SYS" schottky manufacturerPartNumber="BAT54WS-7-F" supplierPartNumbers={JLC.bat54}
      footprint="sod323" pcbX={-31} pcbY={21} schX={34} schY={-48} schRotation={180} />
    <diode name="D_RTC_BAT" schottky manufacturerPartNumber="BAT54WS-7-F" supplierPartNumbers={JLC.bat54}
      footprint="sod323" pcbX={-32} pcbY={0} schX={-56} schY={-60} />
    <capacitor name="C_RTC" capacitance="100nF" footprint="0402" supplierPartNumbers={JLC.c100n}
      pcbX={-27} pcbY={21} schX={-44} schY={-55} schOrientation="vertical" />
    <resistor name="R_NPOR" resistance="1k" footprint="0402" supplierPartNumbers={JLC.r1k}
      pcbX={12} pcbY={9} schX={39} schY={-48} />
    <capacitor name="C_NPOR" capacitance="10nF" footprint="0402" supplierPartNumbers={JLC.c10n}
      pcbX={14} pcbY={9} schX={44} schY={-48} schOrientation="vertical" />
    <resistor name="R_RESET_SER" resistance="100" footprint="0402" supplierPartNumbers={JLC.r100}
      pcbX={17} pcbY={9} schX={49} schY={-48} />
    <ESD5Z5V0 name="D_RESET_ESD" pcbX={20} pcbY={13} schX={54} schY={-45} schWidth="0.8mm" />
    <TSB019A2516A name="SW_RESET" pcbX={23} pcbY={8} schX={58} schY={-48} />

    <resistor name="R_REC_PU" resistance="10k" footprint="0402" supplierPartNumbers={JLC.r10k}
      pcbX={12} pcbY={3} schX={38.85} schY={-58} />
    <capacitor name="C_REC" capacitance="1nF" footprint="0402" supplierPartNumbers={JLC.c1n}
      pcbX={14} pcbY={3} schX={44} schY={-58} schOrientation="vertical" />
    <resistor name="R_REC_SER" resistance="100" footprint="0402" supplierPartNumbers={JLC.r100}
      pcbX={17} pcbY={3} schX={49.15} schY={-58} />
    <ESD5Z5V0 name="D_REC_ESD" pcbX={10} pcbY={5} schX={54} schY={-55} schWidth="0.8mm" />
    <TSB019A2516A name="SW_RECOVERY" pcbX={23} pcbY={1} schX={58} schY={-58} />
    <resistor name="R_LED" resistance="1k" footprint="0402" supplierPartNumbers={JLC.r1k}
      pcbX={12} pcbY={-2} schX={42} schY={-66} />
    <F_0603_00025_P2_0603G1TS2_06T_002 name="LED_USER" color="green"
      pcbX={16} pcbY={-2} schX={48} schY={-66} schRotation={180} />

    <testpoint name="TP_SYS5" footprintVariant="pad" padDiameter="1.5mm" pcbX={10} pcbY={-9} schX={-6} schY={-70} />
    <testpoint name="TP_CORE3V3" footprintVariant="pad" padDiameter="1.5mm" pcbX={13} pcbY={-9} schX={-2} schY={-70} />
    <testpoint name="TP_CORE1V8" footprintVariant="pad" padDiameter="1.5mm" pcbX={16} pcbY={-9} schX={2} schY={-70} />
    <testpoint name="TP_GND" footprintVariant="pad" padDiameter="1.5mm" pcbX={19} pcbY={-9} schX={6} schY={-70} />

    <hole name="H1" diameter="3.2mm" pcbX={-46} pcbY={32} />
    <hole name="H2" diameter="3.2mm" pcbX={46} pcbY={32} />
    <hole name="H3" diameter="3.2mm" pcbX={-46} pcbY={-32} />
    <hole name="H4" diameter="3.2mm" pcbX={46} pcbY={-32} />

    <silkscreentext text="CORE1106 RV1106G2 CARRIER" pcbX={-7} pcbY={-34} fontSize="1.2mm" />
    <silkscreentext text="USB-C DEVICE / FLASH" pcbX={-38} pcbY={-17} fontSize="0.8mm" />
    <silkscreentext text="J_PWR: 5V 1.5A INPUT" pcbX={-27} pcbY={-28} fontSize="0.7mm" />
    <silkscreentext text="GPIO 5V PINS: OUTPUT ONLY" pcbX={34} pcbY={-34} fontSize="0.65mm" />
    <silkscreentext text="CAMERA: 1.8V IO" pcbX={-4} pcbY={27} fontSize="0.8mm" />
    <silkscreentext text="10/100 ETHERNET - HR911105A" pcbX={25} pcbY={-12.5} fontSize="0.65mm" />
    <silkscreentext text="SPI DISPLAY" pcbX={-35} pcbY={28.7} fontSize="0.7mm" />
    <silkscreentext text="RECOVERY" pcbX={25} pcbY={1} fontSize="0.7mm" />
    <silkscreentext text="RESET" pcbX={24} pcbY={8} fontSize="0.7mm" />

    {GROUND_PINS.map((pin) => <trace key={`gnd_${pin}`} from={`.U_CORE > .pin${pin}`} to="net.GND" width="0.2mm" />)}
    {[79, 80, 81].map((pin) => <trace key={`sys5_${pin}`} from={`.U_CORE > .pin${pin}`} to="net.SYS5V" width="0.4mm" />)}
    <trace from=".U_CORE > .pin77" to="net.CORE_1V8" />
    <trace from=".U_CORE > .pin78" to="net.CORE_3V3" />
    <trace from=".U_CORE > .pin76" to="net.RTC_VCC" />

    {[1, 2, 3, 4, 13, 14].map((pin) => <trace key={`usb_gnd_${pin}`} from={`.J_USB > .pin${pin}`} to="net.GND" width="0.2mm" maxViaCount={0} />)}
    {[15, 16].map((pin) => <trace key={`usb_vbus_${pin}`} from={`.J_USB > .pin${pin}`} to="net.VBUS_RAW" width="0.7mm" />)}
    <trace from=".J_USB > .pin6" to=".R_CC1 > .pin1" pcbStraightLine />
    <trace from=".R_CC1 > .pin2" to="net.GND" />
    <trace from=".J_USB > .pin12" to=".R_CC2 > .pin1" pcbStraightLine />
    <trace from=".R_CC2 > .pin2" to="net.GND" />
    <trace from="net.VBUS_RAW" to=".F1 > .pin1" width="0.7mm" />
    <trace from=".F1 > .pin2" to="net.VBUS_FUSED" width="0.7mm" />
    <trace from="net.VBUS_FUSED" to=".U_USB_IDEAL > .VIN" width="0.7mm" />
    <trace from=".U_USB_IDEAL > .VOUT" to=".C_SYS_BULK > .pin1" width="0.8mm" />
    <trace from=".U_USB_IDEAL > .GND" to="net.GND" />
    <trace from=".U_USB_IDEAL > .CE" to=".U_USB_IDEAL > .VOUT" />
    <trace from="net.VBUS_RAW" to=".C_VBUS > .pin1" />
    <trace from=".C_VBUS > .pin2" to="net.GND" />
    <trace from="net.SYS5V" to=".C_SYS_BULK > .pin1" width="0.4mm" />
    <trace from=".C_SYS_BULK > .pin2" to="net.GND" />
    <trace from="net.SYS5V" to=".C_SYS_HF > .pin1" />
    <trace from=".C_SYS_HF > .pin2" to="net.GND" />
    <trace from="net.VBUS_RAW" to=".R_VBUS_TOP > .pin1" />
    <trace from=".R_VBUS_TOP > .pin2" to=".U_CORE > .pin24" />
    <trace from=".U_CORE > .pin24" to=".R_VBUS_BOTTOM > .pin1" />
    <trace from=".R_VBUS_BOTTOM > .pin2" to="net.GND" />
    <trace from=".U_CORE > .pin24" to=".C_VBUS_DET > .pin1" />
    <trace from=".C_VBUS_DET > .pin2" to="net.GND" />

    <trace from=".J_USB > .pin8" to=".U_USB_ESD > .pin1" width="0.18mm" maxViaCount={0} />
    <trace from=".J_USB > .pin10" to=".U_USB_ESD > .pin1" width="0.18mm" maxViaCount={0} />
    <trace name="USB_P_MAIN" from=".U_USB_ESD > .pin6" to=".U_CORE > .pin23" width="0.18mm" maxViaCount={1} />
    <trace from=".J_USB > .pin7" to=".U_USB_ESD > .pin3" width="0.18mm" maxViaCount={0} />
    <trace from=".J_USB > .pin9" to=".U_USB_ESD > .pin3" width="0.18mm" maxViaCount={0} />
    <trace name="USB_N_MAIN" from=".U_USB_ESD > .pin4" to=".U_CORE > .pin22" width="0.18mm" maxViaCount={1} />
    <trace from=".U_USB_ESD > .GND" to="net.GND" />
    <trace from=".U_USB_ESD > .VBUS" to="net.VBUS_RAW" />

    <trace from=".J_PWR > .pin1" to="net.AUX5_RAW" width="0.7mm" />
    <trace from=".J_PWR > .pin2" to="net.GND" width="0.2mm" />
    <trace from="net.AUX5_RAW" to=".C_AUX_IN > .pin1" />
    <trace from=".C_AUX_IN > .pin2" to="net.GND" />
    <trace from="net.AUX5_RAW" to=".F2 > .pin1" width="0.7mm" />
    <trace from=".F2 > .pin2" to="net.AUX5_FUSED" width="0.7mm" />
    <trace from="net.AUX5_FUSED" to=".U_AUX_IDEAL > .VIN" width="0.7mm" />
    <trace from=".U_AUX_IDEAL > .VOUT" to=".C_SYS_BULK > .pin1" width="0.8mm" />
    <trace from=".U_AUX_IDEAL > .GND" to="net.GND" />
    <trace from=".U_AUX_IDEAL > .CE" to=".U_AUX_IDEAL > .VOUT" />

    <trace from="net.SYS5V" to=".U_REG3V3 > .VIN" width="0.5mm" />
    <trace from="net.SYS5V" to=".U_REG3V3 > .EN" />
    <trace from=".U_REG3V3 > .GND" to="net.GND" />
    <trace from=".U_REG3V3 > .SW" to=".L_3V3 > .pin1" width="0.5mm" />
    <trace from=".L_3V3 > .pin2" to=".C_3V3_OUT > .pin1" width="0.6mm" />
    <trace from="net.EXT_3V3" to=".R_3V3_FB_TOP > .pin1" />
    <trace from=".R_3V3_FB_TOP > .pin2" to=".U_REG3V3 > .FB" />
    <trace from=".U_REG3V3 > .FB" to=".R_3V3_FB_BOTTOM > .pin1" />
    <trace from=".R_3V3_FB_BOTTOM > .pin2" to="net.GND" />
    <trace from="net.EXT_3V3" to=".C_3V3_FF > .pin1" />
    <trace from=".C_3V3_FF > .pin2" to=".U_REG3V3 > .FB" />
    <trace from="net.SYS5V" to=".C_3V3_IN > .pin1" />
    <trace from=".C_3V3_IN > .pin2" to="net.GND" />
    <trace from="net.EXT_3V3" to=".C_3V3_OUT > .pin1" />
    <trace from=".C_3V3_OUT > .pin2" to="net.GND" />
    <trace from="net.EXT_3V3" to=".U_REG1V8 > .pin1" width="0.35mm" />
    <trace from="net.EXT_3V3" to=".U_REG1V8 > .pin3" />
    <trace from=".U_REG1V8 > .pin2" to="net.GND" />
    <trace from=".U_REG1V8 > .pin5" to="net.EXT_1V8" width="0.35mm" />
    <trace from="net.EXT_3V3" to=".C_1V8_IN > .pin1" />
    <trace from=".C_1V8_IN > .pin2" to="net.GND" />
    <trace from="net.EXT_1V8" to=".C_1V8_OUT > .pin1" />
    <trace from=".C_1V8_OUT > .pin2" to="net.GND" />

    {CAMERA_CONNECTIONS.map(([ffcPin, target]) => {
      const targetSelector = typeof target === "number" ? `.U_CORE > .pin${target}` : `net.${target}`
      const traceName = typeof target === "number" && target <= 12 ? `MIPI_${target}` : undefined
      return <trace key={`cam_${ffcPin}`} name={traceName} from={`.J_CAM > .pin${ffcPin}`} to={targetSelector}
        width={typeof target === "number" && target <= 12 ? "0.15mm" : undefined}
        maxViaCount={typeof target === "number" && target <= 12 ? 0 : undefined} />
    })}
    {/* Pair names are preserved in the netlist. Apply 100-ohm differential
        constraints and final lane tuning after stack-up selection in KiCad. */}
    <resistor name="R_CAM_SCL" resistance="4.7k" footprint="0402" supplierPartNumbers={JLC.r4k7}
      pcbX={9} pcbY={24} schX={-58.2} schY={36} />
    <resistor name="R_CAM_SDA" resistance="4.7k" footprint="0402" supplierPartNumbers={JLC.r4k7}
      pcbX={11} pcbY={24} schX={-53.8} schY={36} />
    <trace from=".U_CORE > .pin16" to=".R_CAM_SCL > .pin1" />
    <trace from=".R_CAM_SCL > .pin2" to="net.EXT_1V8" />
    <trace from=".U_CORE > .pin17" to=".R_CAM_SDA > .pin1" />
    <trace from=".R_CAM_SDA > .pin2" to="net.EXT_1V8" />

    {SD_SERIES.map(([name, corePin, cardPin]) => <group key={`sd_trace_${name}`}>
      <trace from={`.U_CORE > .pin${corePin}`} to={`.${name} > .pin1`} />
      <trace from={`.${name} > .pin2`} to={`.J_SD > .pin${cardPin}`} />
    </group>)}
    {SD_PULLUPS.map(([name, cardPin]) => <group key={`sd_pu_trace_${name}`}>
      <trace from={`.${name} > .pin1`} to={`.J_SD > .pin${cardPin}`} />
      <trace from={`.${name} > .pin2`} to="net.EXT_3V3" />
    </group>)}
    <trace from=".U_CORE > .pin48" to=".J_SD > .pin9" />
    <trace from=".J_SD > .pin9" to=".R_SD_DET_PU > .pin1" />
    <trace from=".R_SD_DET_PU > .pin2" to="net.EXT_3V3" />
    <trace from=".J_SD > .pin11" to="net.GND" />
    {[10, 12, 13, 14].map((pin) => <trace key={`sd_shield_${pin}`} from={`.J_SD > .pin${pin}`} to="net.GND" />)}
    <trace from=".J_SD > .pin4" to="net.EXT_3V3" width="0.35mm" />
    <trace from=".J_SD > .pin6" to="net.GND" />
    <trace from="net.EXT_3V3" to=".C_SD_BULK > .pin1" />
    <trace from=".C_SD_BULK > .pin2" to="net.GND" />
    <trace from="net.EXT_3V3" to=".C_SD_HF > .pin1" />
    <trace from=".C_SD_HF > .pin2" to="net.GND" />

    {GPIO40_CONNECTIONS.map(([headerPin, target]) => <trace key={`gpio40_${headerPin}`} from={`.J_GPIO > .pin${headerPin}`} to={target} />)}

    <trace from=".J_I2C > .pin1" to="net.GND" />
    <trace from=".J_I2C > .pin2" to="net.EXT_3V3" />
    <trace from=".J_I2C > .pin3" to=".U_CORE > .pin64" />
    <trace from=".J_I2C > .pin4" to=".U_CORE > .pin63" />
    <trace from=".R_I2C_SDA > .pin1" to=".U_CORE > .pin64" />
    <trace from=".R_I2C_SDA > .pin2" to="net.EXT_3V3" />
    <trace from=".R_I2C_SCL > .pin1" to=".U_CORE > .pin63" />
    <trace from=".R_I2C_SCL > .pin2" to="net.EXT_3V3" />
    <trace from=".J_ADC > .pin1" to="net.GND" />
    <trace from=".J_ADC > .pin2" to="net.EXT_1V8" />
    <trace from=".J_ADC > .pin3" to=".U_CORE > .pin26" />
    <trace from=".J_ADC > .pin4" to=".U_CORE > .pin27" />
    <trace from=".U_CORE > .pin30" to=".C_LINEOUT > .pin1" />
    <trace from=".C_LINEOUT > .pin2" to=".R_LINEOUT > .pin1" />
    <trace from=".R_LINEOUT > .pin2" to=".J_AUDIO > .pin2" />
    <trace from=".R_LINEOUT > .pin2" to=".D_LINEOUT_ESD > .C" />
    <trace from=".D_LINEOUT_ESD > .A" to="net.GND" />
    <trace from=".J_AUDIO > .pin1" to="net.GND" />
    <trace from=".J_AUDIO > .pin3" to=".U_CORE > .pin31" />
    <trace from=".J_AUDIO > .pin4" to=".U_CORE > .pin33" />
    <trace from=".J_AUDIO > .pin5" to=".U_CORE > .pin32" />
    <trace from=".J_AUDIO > .pin6" to="net.GND" />
    <trace from=".J_I2S > .pin1" to="net.GND" />
    <trace from=".J_I2S > .pin2" to="net.EXT_3V3" />
    {[102, 103, 104, 105, 106, 107].map((corePin, index) => <trace key={`i2s_${corePin}`} from={`.J_I2S > .pin${index + 3}`} to={`.U_CORE > .pin${corePin}`} />)}
    <trace from=".J_SPI_DISPLAY > .pin1" to="net.GND" />
    <trace from=".J_SPI_DISPLAY > .pin2" to="net.EXT_3V3" />
    {SPI_DISPLAY_SERIES.map(([name, corePin, connectorPin]) => <group key={`spi_trace_${name}`}>
      <trace from={`.U_CORE > .pin${corePin}`} to={`.${name} > .pin1`} />
      <trace from={`.${name} > .pin2`} to={`.J_SPI_DISPLAY > .pin${connectorPin}`} />
    </group>)}

    <trace name="ETH_TXP_MAIN" from=".U_CORE > .pin88" to=".U_ETH_ESD > .pin1" width="0.15mm" maxViaCount={1} />
    <trace from=".U_ETH_ESD > .pin10" to=".J_ETH_PHY > .pin1" width="0.15mm" />
    <trace name="ETH_TXN_MAIN" from=".U_CORE > .pin87" to=".U_ETH_ESD > .pin2" width="0.15mm" maxViaCount={1} />
    <trace from=".U_ETH_ESD > .pin9" to=".J_ETH_PHY > .pin2" width="0.15mm" />
    <trace name="ETH_RXP_MAIN" from=".U_CORE > .pin86" to=".U_ETH_ESD > .pin4" width="0.15mm" maxViaCount={1} />
    <trace from=".U_ETH_ESD > .pin7" to=".J_ETH_PHY > .pin3" width="0.15mm" />
    <trace name="ETH_RXN_MAIN" from=".U_CORE > .pin85" to=".U_ETH_ESD > .pin5" width="0.15mm" maxViaCount={1} />
    <trace from=".U_ETH_ESD > .pin6" to=".J_ETH_PHY > .pin6" width="0.15mm" />
    <trace from=".U_ETH_ESD > .pin3" to="net.GND" />
    <trace from=".U_ETH_ESD > .pin8" to="net.GND" />
    <trace from=".J_ETH_PHY > .pin4" to=".C_ETH_CT > .pin1" />
    <trace from=".J_ETH_PHY > .pin5" to=".C_ETH_CT > .pin1" />
    <trace from=".C_ETH_CT > .pin2" to="net.GND" />
    <trace from=".J_ETH_PHY > .pin8" to="net.GND" />
    <trace from=".J_ETH_PHY > .pin13" to="net.GND" />
    <trace from=".J_ETH_PHY > .pin14" to="net.GND" />

    <trace from=".D_RTC_SYS > .anode" to="net.CORE_3V3" />
    <trace from=".D_RTC_SYS > .cathode" to="net.RTC_VCC" />
    <trace from=".J_RTC_BAT > .pin1" to=".D_RTC_BAT > .anode" />
    <trace from=".D_RTC_BAT > .cathode" to="net.RTC_VCC" />
    <trace from=".J_RTC_BAT > .pin2" to="net.GND" />
    <trace from="net.RTC_VCC" to=".C_RTC > .pin1" />
    <trace from=".C_RTC > .pin2" to="net.GND" />
    <trace from="net.CORE_3V3" to=".R_NPOR > .pin1" />
    <trace from=".R_NPOR > .pin2" to=".U_CORE > .pin74" />
    <trace from=".U_CORE > .pin74" to=".C_NPOR > .pin1" />
    <trace from=".C_NPOR > .pin2" to="net.GND" />
    <trace from=".U_CORE > .pin74" to=".R_RESET_SER > .pin1" />
    <trace from=".R_RESET_SER > .pin2" to=".SW_RESET > .pin1" />
    <trace from=".R_RESET_SER > .pin2" to=".D_RESET_ESD > .C" />
    <trace from=".D_RESET_ESD > .A" to="net.GND" />
    <trace from=".SW_RESET > .pin2" to="net.GND" />
    <trace from="net.CORE_1V8" to=".R_REC_PU > .pin1" />
    <trace from=".R_REC_PU > .pin2" to=".U_CORE > .pin26" />
    <trace from=".U_CORE > .pin26" to=".C_REC > .pin1" />
    <trace from=".C_REC > .pin2" to="net.GND" />
    <trace from=".U_CORE > .pin26" to=".R_REC_SER > .pin1" />
    <trace from=".R_REC_SER > .pin2" to=".SW_RECOVERY > .pin1" />
    <trace from=".R_REC_SER > .pin2" to=".D_REC_ESD > .C" />
    <trace from=".D_REC_ESD > .A" to="net.GND" />
    <trace from=".SW_RECOVERY > .pin2" to="net.GND" />
    <trace from=".U_CORE > .pin60" to=".R_LED > .pin1" />
    <trace from=".R_LED > .pin2" to=".LED_USER > .anode" />
    <trace from=".LED_USER > .cathode" to="net.GND" />

    <trace from=".TP_SYS5 > .pin1" to="net.SYS5V" />
    <trace from=".TP_CORE3V3 > .pin1" to="net.CORE_3V3" />
    <trace from=".TP_CORE1V8 > .pin1" to="net.CORE_1V8" />
    <trace from=".TP_GND > .pin1" to="net.GND" />

    <copperpour name="GND_TOP" layer="top" connectsTo="net.GND" padMargin="0.4mm" traceMargin="0.4mm" />
    <copperpour name="GND_INNER1" layer="inner1" connectsTo="net.GND" padMargin="0.25mm" traceMargin="0.2mm" />
    <copperpour name="GND_INNER2" layer="inner2" connectsTo="net.GND" padMargin="0.25mm" traceMargin="0.2mm" />
    <copperpour name="GND_BOTTOM" layer="bottom" connectsTo="net.GND" padMargin="0.25mm" traceMargin="0.2mm" />
  </board>
)