AnasSarkiz/magnetic-shutter-remote-r8

A USB‑C rechargeable battery-powered ESP32‑C3 wireless controller with Li‑ion charging, protected 3.3‑V buck‑boost regulation, thermal/safety monitoring, status LEDs, buttons, programming UART, crystal clock, and 2.4‑GHz antenna matching network.

Version
0.4.0-prototype
License
unset
Stars
0

src/remote-circuit.tsx

import { r9RootTracePaths } from "./r9-root-trace-paths";
import {
	r9UsbSinkGroundPaths,
	r9InputCapGroundPaths,
	r9ShutterGroundPaths,
	r9PairGroundPaths,
	r9LedGroundPaths,
	r9ProgramAdditionalGroundPaths,
	r9BootGroundPaths,
	r9ResetGroundPaths,
	r9PowerSwitchGroundPaths,
	r9EnableCapGroundPaths,
} from "./r9-ground-returns";
import { r9CoreTracePaths } from "./r9-core-trace-paths";
import {
	r9UsbTracePaths,
	r9UsbFanoutPaths,
	r9UsbFrameAnchor,
} from "./r9-usb-trace-paths";
import {
	r9MosfetTracePaths,
	r9UsbDisablePaths,
	r9ProgFilterFanoutPaths,
	r9PowerLoopFanoutPaths,
	r9PowerLoopAnchor,
	r9TsBiasTracePaths,
	r9SensorCapTracePaths,
	r9SensorTracePaths,
	r9BatteryGroundPaths,
	r9SwitchFramePaths,
	r9ChargeStatTracePaths,
	r9ChargeStatFanoutPaths,
	r9StatusLedFanoutPaths,
	r9ProgramGroundPaths,
	r9ChargeLedFanoutPaths,
	r9StatusLedTracePaths,
	r9StrapTracePaths,
} from "./r9-control-trace-paths";
import {
	r8RadioVccPaths,
	r8TempOkPaths,
	r8ColdGroundPaths,
	r8ShutterGroundPaths,
	r8RadioGroundPaths,
	r8SysReturnPaths,
	r8SupervisorGroundPaths,
	r8ResetPaths,
	r8RegEnablePaths,
	r8ChargeDisablePaths,
	r8TemperatureHotPaths,
	r8SupervisorVbatPaths,
	r8RadioCapPaths,
	r8ChargeStatPaths,
	r8ConnectorPaths,
	r8BootPaths,
	r8VsetPaths,
	r8VsetGroundPaths,
	r8UartRxPaths,
	r8BatteryOkPaths,
	r8CcPaths,
	r8BulkCapPaths,
	r8MosfetPaths,
	r8ProgRoutingPaths,
	r8ProgPaths,
	r8SysPaths,
	r8TsBiasPaths,
	r8PowerPaths,
	sensorEscapePaths,
	r8BatteryCapEscapePaths,
	sensorCapEscapePaths,
	usbEscapePaths,
	temperatureEscapePaths,
	chargerEscapePaths,
} from "./trace-paths";
import { SWPA3015S1R5NT } from "../imports/SWPA3015S1R5NT/SWPA3015S1R5NT";
import { FunctionalMarkings } from "./functional-markings";
import { SchematicComponentNotes } from "./schematic-component-notes";
import { ESP32_C3FH4 } from "../imports/ESP32_C3FH4/ESP32_C3FH4";
import { TXM40M0004252HBCEO00T } from "../imports/TXM40M0004252HBCEO00T/TXM40M0004252HBCEO00T";
import { ANT3216LL00R2400A } from "../imports/ANT3216LL00R2400A/ANT3216LL00R2400A";
import { CC0603JRNPO9BN270 } from "../imports/CC0603JRNPO9BN270/CC0603JRNPO9BN270";
import { CL10A105KB8NNNC } from "../imports/CL10A105KB8NNNC/CL10A105KB8NNNC";
import { CL05B103KB5NNNC } from "../imports/CL05B103KB5NNNC/CL05B103KB5NNNC";
import { GJM1555C1H1R5BB01D } from "../imports/GJM1555C1H1R5BB01D/GJM1555C1H1R5BB01D";
import { LQG15HN2N0B02D } from "../imports/LQG15HN2N0B02D/LQG15HN2N0B02D";
import { AHW2012C_24NJTF } from "../imports/AHW2012C_24NJTF/AHW2012C_24NJTF";
import { BQ25185DLHR } from "../imports/BQ25185DLHR";
import { TMP390A2DRLR } from "../imports/TMP390A2DRLR";
import { TPS3839G33DBZR } from "../imports/TPS3839G33DBZR";
import { A_0603WAF1303T5E } from "../imports/A_0603WAF1303T5E";
import { A_0603WAF1002T5E } from "../imports/A_0603WAF1002T5E";
import { A_0603WAF1621T5E } from "../imports/A_0603WAF1621T5E";
import { A_0603WAF1872T5E } from "../imports/A_0603WAF1872T5E";
import { CL21A106KAYNNNE } from "../imports/CL21A106KAYNNNE";
import { TCC0603COG470J500CT } from "../imports/TCC0603COG470J500CT";
import { TPS63031DSKR } from "../imports/TPS63031DSKR/TPS63031DSKR";
import { R9UsbFootprint } from "./r9-usb-footprint";
import { TYPE_C_31_M_12 } from "../imports/TYPE_C_31_M_12/TYPE_C_31_M_12";
import { SM02B_SRSS_TB_LF__SN_ } from "../imports/SM02B_SRSS_TB_LF__SN_/SM02B_SRSS_TB_LF__SN_";
import { BM03B_SRSS_TB_LF__SN_ } from "../imports/BM03B_SRSS_TB_LF__SN_/BM03B_SRSS_TB_LF__SN_";
import { MSK12C02 } from "../imports/MSK12C02";
import { TS_1088_AR02016 } from "../imports/TS_1088_AR02016";
import { TS24CA } from "../imports/TS24CA/TS24CA";
import { A_2N7002 } from "../imports/A_2N7002";
import { A_0603WAF5101T5E } from "../imports/A_0603WAF5101T5E";
import { A_0603WAF1001T5E } from "../imports/A_0603WAF1001T5E";
import { A_0603WAF1003T5E } from "../imports/A_0603WAF1003T5E";
import { CL10A475KO8NNNC } from "../imports/CL10A475KO8NNNC";
import { CC0603KRX7R9BB104 } from "../imports/CC0603KRX7R9BB104";
import { KT_0603R } from "../imports/KT_0603R";

function R9ThermalGroundVia({
	name,
	centerXMm,
	centerYMm,
}: {
	name: string;
	centerXMm: number;
	centerYMm: number;
}) {
	return (
		<via
			name={name}
			pcbX={centerXMm}
			pcbY={centerYMm}
			holeDiameter="0.3mm"
			outerDiameter="0.45mm"
			layers={["top", "bottom"]}
			connectsTo=".U1 > .pin33"
			tented="exposed"
		/>
	);
}

// R9 bare ESP32-C3 engineering prototype; frozen Nordic revisions are in baselines/.
export function RemoteCircuit({ routingEnabled }: { routingEnabled: boolean }) {
	return (
		<board
			title="Magnetic shutter remote R9 bare ESP32-C3 — engineering prototype"
			width="44mm"
			height="56mm"
			thickness="1mm"
			layers={2}
			material="fr4"
			isViaInPadAllowed
			// Explicit R9 filled/capped exposed-pad process; independent audit restricts it to four U1 GND vias.
			borderRadius="2mm"
			autorouter={{
				local: true,
				traceClearance: "0.30mm",
				allowViaInPad: false,
			}}
			routingDisabled={!routingEnabled}
			routeRemaining={false}
			autorouterVersion="beta_pipeline9"
			autorouterEffortLevel="5x"
			minTraceWidth="0.15mm"
			minTraceToPadEdgeClearance="0.15mm"
			minViaEdgeToPadEdgeClearance="0.35mm"
			minPadEdgeToPadEdgeClearance="0.15mm"
			minTraceToHoleEdgeClearance="0.30mm"
			minViaHoleEdgeToViaHoleEdgeClearance="0.50mm"
			minPlatedHoleDrillEdgeToDrillEdgeClearance="0.55mm"
			minViaHoleDiameter="0.3mm"
			minViaPadDiameter="0.45mm"
			pcbStyle={{ viaHoleDiameter: "0.3mm", viaPadDiameter: "0.45mm" }}
			schAutoLayoutEnabled={false}
			schLayout={{ layoutMode: "relative" }}
			fabricatorPreset="jlcpcb_standard_20260912"
			pcbSx={{
				"& footprint silkscreentext": { visibility: "hidden" },
				"& footprint silkscreenpath": { visibility: "hidden" },
				"& footprint silkscreencircle": { visibility: "hidden" },
			}}
			defaultTraceWidth="0.15mm"
		>
			<FunctionalMarkings />
			<autoroutingphase
				phaseIndex={0}
				pcbTracePaths={routingEnabled ? r9RootTracePaths : []}
			/>
			<net name="GND" isGroundNet routingPhaseIndex={5} />

			<autoroutingphase
				phaseIndex={5}
				autorouter="fanout"
				fanoutPourNetMap={{ bottom: "GND" }}
			/>
			<net name="TS_BIAS" routingPhaseIndex={0} />
			<net name="PROG" />
			<net name="CHARGE_LED_A" />
			<net name="SHUTTER" routingPhaseIndex={0} />
			<net name="PAIR" routingPhaseIndex={0} />
			<net name="STATUS_LED" routingPhaseIndex={0} />
			<net name="STATUS_LED_A" />
			<net name="UART_TX" routingPhaseIndex={0} />
			<net name="EN" routingPhaseIndex={0} />
			<net name="POWER_SWITCH" routingPhaseIndex={0} />
			<net name="REG_EN" routingPhaseIndex={0} />
			<net name="TEMP_SET_COLD" routingPhaseIndex={0} />
			<net name="TEMP_OK" routingPhaseIndex={0} />

			<net
				name="USB5V"
				routingPhaseIndex={0}
				isPowerNet
				nominalTraceWidth="0.3mm"
			/>
			<net
				name="VBAT"
				routingPhaseIndex={0}
				isPowerNet
				nominalTraceWidth="0.508mm"
			/>
			<net
				name="V3"
				routingPhaseIndex={0}
				isPowerNet
				nominalTraceWidth="0.508mm"
			/>
			<net name="RADIO_3V3" isPowerNet nominalTraceWidth="0.508mm" />
			<net name="FLASH_VDD" isPowerNet nominalTraceWidth="0.25mm" />
			<net name="RF_CHIP" nominalTraceWidth="0.15mm" />
			<net name="RF_50" nominalTraceWidth="0.15mm" />
			<net name="XTAL_P" />
			<net name="XTAL_LOAD_P" />
			<net name="XTAL_N" />
			<net name="STRAP_GPIO2" />
			<net name="STRAP_GPIO8" />
			<net name="INDUCTOR_L1" nominalTraceWidth="0.5mm" />
			<net name="INDUCTOR_L2" nominalTraceWidth="0.5mm" />
			<net name="CC2" />
			<net name="CC1" />
			<net name="CHARGER_SYS" routingPhaseIndex={0} />
			<net name="CHARGE_STAT" />
			<net name="BATTERY_OK" routingPhaseIndex={0} />
			<net name="UART_RX" routingPhaseIndex={0} />
			<net name="VSET" routingPhaseIndex={0} />
			<net name="BOOT" routingPhaseIndex={0} />
			<net name="TEMP_SET_HOT" routingPhaseIndex={0} />
			<net name="CHARGE_DISABLE" routingPhaseIndex={0} />
			{/* Solid connections; both planes clear the R9 upper-right antenna region. */}
			<copperpour
				name="GND_TOP"
				connectsTo="net.GND"
				layer="top"
				clearance="0.3mm"
				padMargin="0.31mm"
				boardEdgeMargin="0mm"
				outline={[
					{ x: -21, y: -27 },
					{ x: 21, y: -27 },
					{ x: 21, y: 21 },
					{ x: 12.25, y: 21 },
					{ x: 12.25, y: 27 },
					{ x: -21, y: 27 },
				]}
			/>
			<copperpour
				name="GND_BOTTOM"
				connectsTo="net.GND"
				layer="bottom"
				clearance="0.3mm"
				padMargin="0.31mm"
				boardEdgeMargin="0mm"
				outline={[
					{ x: -21, y: -27 },
					{ x: 21, y: -27 },
					{ x: 21, y: 21 },
					{ x: 12.25, y: 21 },
					{ x: 12.25, y: 27 },
					{ x: -21, y: 27 },
				]}
			/>
			{/* Intentional same-net overlap reserves solid TOP copper at the exposed
			    thermal land; all three native GND planes remain fitted. */}
			<copperpour
				name="CHARGER_GND_PLANE"
				unbroken={false}
				boardEdgeMargin="0mm"
				connectsTo="net.GND"
				layer="top"
				clearance="0.3mm"
				padMargin="0.31mm"
				outline={[
					{ x: -0.77, y: 12.53 },
					{ x: 0.77, y: 12.53 },
					{ x: 0.77, y: 13.47 },
					{ x: -0.77, y: 13.47 },
				]}
			/>
			<copperpour
				name="REGULATOR_GND_PLANE"
				connectsTo="net.GND"
				layer="top"
				clearance="0.2mm"
				boardEdgeMargin="0mm"
				unbroken={false}
				outline={[
					{ x: -11.49, y: 2.86 },
					{ x: -10.6, y: 2.86 },
					{ x: -10.6, y: 2 },
					{ x: -9.4, y: 2 },
					{ x: -9.4, y: 3.36 },
					{ x: -8.51, y: 3.36 },
					{ x: -8.51, y: 3.64 },
					{ x: -9.4, y: 3.64 },
					{ x: -9.4, y: 4 },
					{ x: -10.6, y: 4 },
					{ x: -10.6, y: 3.14 },
					{ x: -11.49, y: 3.14 },
				]}
			/>
			<copperpour
				name="CORE_GND_REFERENCE"
				layer="bottom"
				connectsTo="net.GND"
				unbroken
				clearance="0.3mm"
				padMargin="0.31mm"
				outline={[
					{ x: -3.5, y: -13.4 },
					{ x: 3.5, y: -13.4 },
					{ x: 3.5, y: -7.4 },
					{ x: -3.5, y: -7.4 },
				]}
			/>
			<copperpour
				name="CLOCK_GND_REFERENCE"
				layer="bottom"
				connectsTo="net.GND"
				unbroken
				clearance="0.3mm"
				padMargin="0.31mm"
				outline={[
					{ x: -5, y: -21.5 },
					{ x: 8.5, y: -21.5 },
					{ x: 8.5, y: -13.4 },
					{ x: -5, y: -13.4 },
				]}
			/>
			<copperpour
				name="RF_MATCH_GND_REFERENCE"
				layer="bottom"
				connectsTo="net.GND"
				unbroken
				clearance="0.3mm"
				padMargin="0.31mm"
				outline={[
					{ x: 3.5, y: -14 },
					{ x: 9.6, y: -14 },
					{ x: 9.6, y: -11.5 },
					{ x: 3.5, y: -11.5 },
				]}
			/>
			<copperpour
				name="RF_GND_REFERENCE"
				layer="bottom"
				connectsTo="net.GND"
				unbroken
				clearance="0.3mm"
				padMargin="0.31mm"
				outline={[
					{ x: 9.6, y: -13.6 },
					{ x: 12.4, y: -13.6 },
					{ x: 12.4, y: 17.342 },
					{ x: 16.058102, y: 21 },
					{ x: 12.098304, y: 21 },
					{ x: 9.6, y: 18.501796 },
				]}
			/>

			<schematicsheet
				name="Power"
				displayName="USB-C, charge and regulated power"
				sheetIndex={0}
				sheetSize="A4"
			>
				<SchematicComponentNotes sheet="Power" />
				<fanout
					fanoutPourNetMap={{}}
					name="USB_ESCAPE"
					pcbX={r9UsbFrameAnchor.x}
					pcbY={r9UsbFrameAnchor.y}
					width={10.0817325}
					height={9.0913522}
					pcbTracePaths={routingEnabled ? r9UsbFanoutPaths : []}
				>
					<TYPE_C_31_M_12
						footprint={<R9UsbFootprint />}
						standard="usb_c"
						schWidth={1.575}
						name="J1"
						pcbSx={{ "& smtpad": { solderMaskMargin: "0.04mm" } }}
						noConnect={["SBU1", "SBU2", "DN1", "DN2", "DP1", "DP2"]}
						pcbX={-r9UsbFrameAnchor.x}
						pcbY={23.9852 - r9UsbFrameAnchor.y}
						pcbRotation={180}
						schX={-8}
						schY={3}
						connections={{
							EH1: "net.GND",
							EH2: "net.GND",
							EH3: "net.GND",
							EH4: "net.GND",
							GND1: "net.GND",
							GND2: "net.GND",
							VBUS1: "net.USB5V",
							VBUS2: "net.USB5V",
							CC1: "net.CC1",
							CC2: "net.CC2",
						}}
					/>
					<A_0603WAF5101T5E
						name="R2"
						schRotation={-90}
						pcbX={-r9UsbFrameAnchor.x}
						pcbY={19 - r9UsbFrameAnchor.y}
						schX={-4}
						schY={2}
						connections={{ pin1: "net.CC2", pin2: "net.GND" }}
					/>
					<A_0603WAF5101T5E
						name="R1"
						schRotation={-90}
						pcbX={-4 - r9UsbFrameAnchor.x}
						pcbY={19 - r9UsbFrameAnchor.y}
						schX={-4}
						schY={4}
						connections={{ pin1: "net.CC1", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					fanoutPourNetMap={{}}
					name="CHARGER_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={
						routingEnabled
							? [
									...chargerEscapePaths,
									...r8ProgPaths,
									...r8ProgRoutingPaths,
									...r8BatteryCapEscapePaths,
								]
							: []
					}
				>
					<BQ25185DLHR
						name="U2"
						pcbSx={{
							"& smtpad": { solderPasteMargin: 0 },
							"& footprint smtpad[portHints='pin11']": {
								solderPasteMargin: "-0.1mm",
							},
						}}
						pinAttributes={{
							pin1: { isOutput: true },
							SYS: { isOutput: true },
							pin2: { isBidirectional: true },
							BAT: { isBidirectional: true },
							pin3: { isOutput: true },
							STAT2: { isOutput: true },
							pin4: { isInput: true },
							N_CE: { isInput: true },
							pin5: { requiresGround: true },
							GND: { requiresGround: true },
							pin6: { isInput: true },
							TS: { isInput: true },
							MR: { isInput: true },
							pin7: { isInput: true },
							ILIM: { isInput: true },
							VSET: { isInput: true },
							pin8: { isInput: true },
							ISET: { isInput: true },
							pin9: { isOutput: true },
							STAT1: { isOutput: true },
							pin10: { requiresPower: true },
							IN: { requiresPower: true },
							pin11: { requiresGround: true },
							EP: { requiresGround: true },
						}}
						pcbX="0mm"
						pcbY="13mm"
						schX={1}
						schY={4}
						connections={{
							pin1: "net.CHARGER_SYS",
							pin2: "net.VBAT",
							pin3: "net.CHARGE_STAT",
							pin4: "net.CHARGE_DISABLE",
							pin5: "net.GND",
							pin6: "net.TS_BIAS",
							pin7: "net.VSET",
							pin8: "net.PROG",
							pin10: "net.USB5V",
							pin11: "net.GND",
						}}
					/>

					<A_0603WAF1001T5E
						name="R3"
						schRotation={-90}
						pcbX="5.5mm"
						pcbY="9mm"
						schX={1}
						schY={1}
						connections={{ pin1: "net.PROG", pin2: "net.GND" }}
					/>

					<CL10A475KO8NNNC
						name="C2"
						schRotation={-90}
						pcbX="4.5mm"
						pcbY="11.5mm"
						schX={4}
						schY={6}
						connections={{ pin1: "net.VBAT", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					name="PROG_FILTER_ESCAPE"
					pcbX={-5}
					pcbY={11}
					width={2.4}
					height={1.1}
					fanoutPourNetMap={{}}
					pcbTracePaths={routingEnabled ? r9ProgFilterFanoutPaths : []}
				>
					<TCC0603COG470J500CT
						name="C9"
						schRotation={-90}
						pcbRotation={180}
						pcbX={0}
						pcbY={0}
						schX={1}
						schY={-3}
						connections={{ pin1: "net.PROG", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					name="CHARGE_LED_ESCAPE"
					pcbX={8}
					pcbY={16.5}
					width={2.6}
					height={1.2}
					fanoutPourNetMap={{}}
					pcbTracePaths={routingEnabled ? r9ChargeLedFanoutPaths : []}
				>
					<A_0603WAF1001T5E
						name="R4"
						schRotation={-90}
						pcbX={0}
						pcbY={0}
						schX={-2}
						schY={-1}
						connections={{ pin1: "net.VBAT", pin2: "net.CHARGE_LED_A" }}
					/>
				</fanout>
				<fanout
					name="C1_GROUND_ESCAPE"
					pcbX={6.7}
					pcbY={19.5}
					width={2.2000464}
					height={0.8999982}
					fanoutPourNetMap={{}}
					pcbTracePaths={routingEnabled ? r9InputCapGroundPaths : []}
				>
					<CL10A475KO8NNNC
						name="C1"
						pcbRotation={0}
						schRotation={-90}
						pcbX={0}
						pcbY={0}
						schX={-2}
						schY={6}
						connections={{ pin1: "net.USB5V", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					name="LED1_COMPLETE_ESCAPE"
					pcbX={8}
					pcbY={26}
					width={2.3001224}
					height={0.7999984}
					fanoutPourNetMap={{}}
					pcbTracePaths={routingEnabled ? r9ChargeStatFanoutPaths : []}
				>
					<KT_0603R
						name="LED1"
						pcbX={0}
						pcbY={0}
						schX={1}
						schY={-1}
						connections={{
							anode: "net.CHARGE_LED_A",
							cathode: "net.CHARGE_STAT",
						}}
					/>
				</fanout>

				<fanout
					name="BATTERY_GROUND_ESCAPE"
					pcbX={-18}
					pcbY={13}
					width={5.550027}
					height={4.7999396}
					fanoutPourNetMap={{}}
					pcbTracePaths={routingEnabled ? r9BatteryGroundPaths : []}
				>
					<SM02B_SRSS_TB_LF__SN_
						name="J2"
						schPinArrangement={{ leftSide: [2], rightSide: [1, 4, 3] }}
						pcbRotation={270}
						pcbX={0}
						pcbY={0}
						schX={8}
						schY={4}
						connections={{
							pin1: "net.GND",
							pin2: "net.VBAT",
							pin3: "net.GND",
							pin4: "net.GND",
						}}
					/>
				</fanout>

				<fanout
					fanoutPourNetMap={{}}
					name="VSET_GROUND_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={routingEnabled ? r8VsetGroundPaths : []}
				>
					<A_0603WAF1303T5E
						name="R8"
						schRotation={-90}
						pcbRotation={180}
						pcbX="-5mm"
						pcbY="16mm"
						schX={5}
						schY={0}
						connections={{ pin1: "net.VSET", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					fanoutPourNetMap={{}}
					name="TS_BIAS_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={routingEnabled ? r9TsBiasTracePaths : []}
				>
					<A_0603WAF1002T5E
						name="R9"
						schRotation={-90}
						pcbX="1mm"
						pcbY="17mm"
						schX={5}
						schY={-3}
						connections={{ pin1: "net.TS_BIAS", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					fanoutPourNetMap={{}}
					name="SYS_RETURN_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={routingEnabled ? r8SysReturnPaths : []}
				>
					<CL21A106KAYNNNE
						name="C8"
						pcbRotation={180}
						schRotation={-90}
						layer="top"
						pcbX="-5.5mm"
						pcbY="13.4mm"
						schX={-3}
						schY={-4}
						connections={{ pin1: "net.CHARGER_SYS", pin2: "net.GND" }}
					/>
				</fanout>
			</schematicsheet>
			<schematicsheet
				name="Radio"
				displayName="Bluetooth HID, controls and 3.3 V UART programming"
				sheetIndex={1}
				sheetSize="A4"
			>
				<SchematicComponentNotes sheet="Radio" />
				{/* Side-push shutter at the right edge(+X).
				    Contacts1/2 switch;3/4 are the separate internally connected frame. */}
				<fanout
					fanoutPourNetMap={{}}
					name="SHUTTER_FRAME_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={routingEnabled ? r9ShutterGroundPaths : []}
				>
					<TS24CA
						name="SW2"
						schRotation={-90}
						pcbX="20mm"
						pcbY="-8.5mm"
						pcbRotation={270}
						// Plastic actuator overhangs+X; every copper land stays on board.
						allowOffBoard
						schX={-7}
						schY={1}
						internallyConnectedPins={[[3, 4]]}
						connections={{
							pin1: "net.SHUTTER",
							pin2: "net.GND",
							pin3: "net.GND",
							pin4: "net.GND",
						}}
					/>
				</fanout>
				<netlabel
					net="GND"
					connection="SW2.pin2"
					schX={-7}
					schY={0}
					anchorSide="top"
				/>
				<fanout
					name="SW3_GROUND_ESCAPE"
					pcbX={18}
					pcbY={-3}
					width={5.599811}
					height={1.8599912}
					fanoutPourNetMap={{}}
					pcbTracePaths={routingEnabled ? r9PairGroundPaths : []}
				>
					<TS_1088_AR02016
						name="SW3"
						schRotation={-90}
						pcbX={0}
						pcbY={0}
						schX={-7}
						schY={-2}
						connections={{ pin1: "net.PAIR", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					name="R7_COMPLETE_ESCAPE"
					pcbX={-15}
					pcbY={-5}
					width={2.3132034}
					height={0.8640064}
					fanoutPourNetMap={{}}
					pcbTracePaths={routingEnabled ? r9StatusLedFanoutPaths : []}
				>
					<A_0603WAF1001T5E
						name="R7"
						pcbRotation={180}
						pcbX={0}
						pcbY={0}
						schX={6}
						schY={2}
						connections={{ pin1: "net.STATUS_LED", pin2: "net.STATUS_LED_A" }}
					/>
				</fanout>
				<fanout
					name="LED2_GROUND_ESCAPE"
					pcbX={-19}
					pcbY={-5}
					width={2.3001224}
					height={0.7999984}
					fanoutPourNetMap={{}}
					pcbTracePaths={routingEnabled ? r9LedGroundPaths : []}
				>
					<KT_0603R
						name="LED2"
						schRotation={-90}
						pcbX={0}
						pcbY={0}
						schX={9}
						schY={2}
						connections={{ anode: "net.STATUS_LED_A", cathode: "net.GND" }}
					/>
				</fanout>
				<fanout
					fanoutPourNetMap={{}}
					name="UART_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={
						routingEnabled
							? [...r9ProgramGroundPaths, ...r9ProgramAdditionalGroundPaths]
							: []
					}
				>
					<BM03B_SRSS_TB_LF__SN_
						name="J3"
						pcbRotation={0}
						pcbX={16.5}
						pcbY={16}
						schX={7}
						schY={-4}
						connections={{
							pin1: "net.UART_RX",
							pin2: "net.GND",
							pin3: "net.UART_TX",
							pin4: "net.GND",
							pin5: "net.GND",
						}}
					/>
				</fanout>
				<fanout
					name="SW4_GROUND_ESCAPE"
					pcbX={-19}
					pcbY={-9}
					width={5.599811}
					height={1.8599912}
					fanoutPourNetMap={{}}
					pcbTracePaths={routingEnabled ? r9BootGroundPaths : []}
				>
					<TS_1088_AR02016
						name="SW4"
						pcbX={0}
						pcbY={0}
						schX={-7}
						schY={-5}
						schRotation={-90}
						connections={{ pin1: "net.BOOT", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					fanoutPourNetMap={{}}
					name="RESET_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={routingEnabled ? r9ResetGroundPaths : []}
				>
					<TS_1088_AR02016
						name="SW5"
						pcbX="15.4mm"
						pcbY="11.5mm"
						schX={-7}
						schY={-8}
						schRotation={-90}
						connections={{ pin1: "net.EN", pin2: "net.GND" }}
					/>
				</fanout>
			</schematicsheet>

			<schematicsheet
				name="Protection"
				displayName="Battery cutoff and automatic charge temperature window"
				sheetIndex={2}
				sheetSize="A4"
			>
				<SchematicComponentNotes sheet="Protection" />
				<fanout
					name="POWER_SWITCH_FRAME_ESCAPE"
					pcbX={19}
					pcbY={5}
					width={4.5120433}
					height={8.3998816}
					fanoutPourNetMap={{}}
					pcbTracePaths={
						routingEnabled
							? [...r9SwitchFramePaths, ...r9PowerSwitchGroundPaths]
							: []
					}
				>
					<MSK12C02
						name="SW1"
						pcbX={0}
						pcbY={0}
						pcbRotation={90}
						schX={-7}
						schY={-5}
						connections={{
							pin1: "net.BATTERY_OK",
							pin2: "net.POWER_SWITCH",
							pin3: "net.GND",
							pin4: "net.GND",
						}}
					/>
				</fanout>
				<fanout
					fanoutPourNetMap={{}}
					name="USB_DISABLE_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={
						routingEnabled ? [...r9UsbDisablePaths, ...r8RegEnablePaths] : []
					}
				>
					<A_0603WAF1003T5E
						name="R5"
						pcbX="4mm"
						pcbY="3mm"
						pcbRotation={180}
						schX={-4}
						schY={-5}
						connections={{ pin1: "net.POWER_SWITCH", pin2: "net.REG_EN" }}
					/>
					<A_2N7002
						name="Q1"
						pinAttributes={{
							pin1: { isInput: true },
							G: { isInput: true },
							pin2: { requiresGround: true },
							S: { requiresGround: true },
							pin3: { isOutput: true },
							D: { isOutput: true },
						}}
						pcbX="-4mm"
						pcbY="1mm"
						schX={-1}
						schY={-5}
						connections={{
							pin1: "net.USB5V",
							pin2: "net.GND",
							pin3: "net.REG_EN",
						}}
					/>
					<A_0603WAF1003T5E
						name="R6"
						pcbRotation={180}
						schRotation={-90}
						pcbX="0mm"
						pcbY="1.5mm"
						schX={-1}
						schY={-8}
						connections={{ pin1: "net.USB5V", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					fanoutPourNetMap={{}}
					name="R8_POWER_LOOPS"
					pcbX={r9PowerLoopAnchor.x}
					pcbY={r9PowerLoopAnchor.y}
					width={9.1549995}
					height={10.85001}
					pcbTracePaths={routingEnabled ? r9PowerLoopFanoutPaths : []}
				>
					<TPS63031DSKR
						name="U3"
						pcbX={-10 - r9PowerLoopAnchor.x}
						pcbY={3 - r9PowerLoopAnchor.y}
						schX={4}
						schY={-4}
						pcbSx={{
							"& footprint smtpad[portHints='pin11']": {
								solderPasteMargin: "-0.0625mm",
							},
						}}
						connections={{
							pin1: "net.V3",
							pin2: "net.INDUCTOR_L2",
							pin3: "net.GND",
							pin4: "net.INDUCTOR_L1",
							pin5: "net.VBAT",
							pin6: "net.REG_EN",
							pin7: "net.GND",
							pin8: "net.VBAT",
							pin9: "net.GND",
							pin10: "net.V3",
							pin11: "net.GND",
						}}
					/>
					<netlabel
						net="VBAT"
						connection="U3.VIN"
						schX={2}
						schY={-3.5}
						anchorSide="bottom"
					/>
					<SWPA3015S1R5NT
						name="L1"
						pcbX={-14 - r9PowerLoopAnchor.x}
						pcbY={3 - r9PowerLoopAnchor.y}
						pcbRotation={90}
						schX={8}
						schY={-4}
						connections={{ pin1: "net.INDUCTOR_L2", pin2: "net.INDUCTOR_L1" }}
					/>
					<CL21A106KAYNNNE
						name="C11"
						pcbRotation={180}
						pcbX={-14 - r9PowerLoopAnchor.x}
						pcbY={-1 - r9PowerLoopAnchor.y}
						schX={7}
						schY={9}
						schRotation={-90}
						connections={{ pin1: "net.VBAT", pin2: "net.GND" }}
					/>
					<CL21A106KAYNNNE
						name="C12"
						pcbX={-10 - r9PowerLoopAnchor.x}
						pcbY={8.5 - r9PowerLoopAnchor.y}
						schX={9}
						schY={-8}
						schRotation={-90}
						connections={{ pin1: "net.V3", pin2: "net.GND" }}
					/>
					<CC0603KRX7R9BB104
						name="C13"
						pcbX={-7 - r9PowerLoopAnchor.x}
						pcbY={3 - r9PowerLoopAnchor.y}
						pcbRotation={90}
						schX={8.8}
						schY={9}
						schRotation={-90}
						connections={{ pin1: "net.VBAT", pin2: "net.GND" }}
					/>
					<CL21A106KAYNNNE
						name="C3"
						schRotation={-90}
						pcbX={-10 - r9PowerLoopAnchor.x}
						pcbY={0 - r9PowerLoopAnchor.y}
						schX={5.2}
						schY={9}
						connections={{ pin1: "net.VBAT", pin2: "net.GND" }}
					/>
					<CL21A106KAYNNNE
						name="C4"
						schRotation={-90}
						pcbX={-10 - r9PowerLoopAnchor.x}
						pcbY={6 - r9PowerLoopAnchor.y}
						schX={7.2}
						schY={-8}
						connections={{ pin1: "net.V3", pin2: "net.GND" }}
					/>
				</fanout>

				<fanout
					fanoutPourNetMap={{}}
					name="SUPERVISOR_VBAT_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={
						routingEnabled
							? [...r8SupervisorVbatPaths, ...r8SupervisorGroundPaths]
							: []
					}
				>
					<TPS3839G33DBZR
						name="U4"
						schWidth={2.15}
						pcbX="-18mm"
						pcbY="0mm"
						schX={-7}
						schY={7}
						connections={{
							pin1: "net.GND",
							pin2: "net.BATTERY_OK",
							pin3: "net.VBAT",
						}}
					/>
					<netlabel
						net="VBAT"
						connection="U4.VDD"
						schX={-5}
						schY={7.6}
						anchorSide="bottom"
					/>
					<CC0603KRX7R9BB104
						name="C6"
						schRotation={-90}
						pcbX="-18mm"
						pcbY="3mm"
						schX={2}
						schY={9}
						connections={{ pin1: "net.VBAT", pin2: "net.GND" }}
					/>
				</fanout>

				<fanout
					fanoutPourNetMap={{}}
					name="SENSOR_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={
						routingEnabled
							? [...r9SensorTracePaths, ...r9SensorCapTracePaths]
							: []
					}
				>
					<TMP390A2DRLR
						name="U5"
						schWidth={2.15}
						pcbX="0mm"
						pcbY="6mm"
						layer="top"
						schX={0}
						schY={2}
						connections={{
							pin1: "net.TEMP_SET_HOT",
							pin2: "net.TEMP_SET_COLD",
							pin3: "net.GND",
							pin4: "net.TEMP_OK",
							pin5: "net.USB5V",
							pin6: "net.TEMP_OK",
						}}
					/>
					<CC0603KRX7R9BB104
						name="C7"
						schRotation={-90}
						pcbX="1.5mm"
						pcbY="8.5mm"
						layer="top"
						schX={0}
						schY={6}
						connections={{ pin1: "net.USB5V", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					fanoutPourNetMap={{}}
					name="HOT_SET_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={routingEnabled ? temperatureEscapePaths : []}
				>
					<A_0603WAF1621T5E
						name="R10"
						pcbRotation={180}
						schRotation={-90}
						pcbX="-4.5mm"
						pcbY="6mm"
						layer="top"
						schX={-4}
						schY={3}
						connections={{ pin1: "net.TEMP_SET_HOT", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					fanoutPourNetMap={{}}
					name="COLD_GROUND_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={routingEnabled ? r8ColdGroundPaths : []}
				>
					<A_0603WAF1872T5E
						name="R11"
						schRotation={-90}
						pcbX="4.5mm"
						pcbY="5.5mm"
						layer="top"
						schX={-4}
						schY={1}
						connections={{ pin1: "net.TEMP_SET_COLD", pin2: "net.GND" }}
					/>
				</fanout>
				<fanout
					fanoutPourNetMap={{}}
					name="TEMP_OK_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={[]}
				>
					<A_0603WAF1003T5E
						name="R12"
						pcbRotation={90}
						schRotation={-90}
						layer="top"
						pcbX={9}
						pcbY={9.5}
						schX={4}
						schY={4}
						connections={{ pin1: "net.USB5V", pin2: "net.TEMP_OK" }}
					/>
				</fanout>
				<A_0603WAF1003T5E
					name="R13"
					schRotation={-90}
					layer="top"
					pcbRotation={180}
					pcbX="8mm"
					pcbY="12.2mm"
					schX={8}
					schY={4}
					connections={{ pin1: "net.USB5V", pin2: "net.CHARGE_DISABLE" }}
				/>
				<fanout
					fanoutPourNetMap={{}}
					name="TEMP_MOSFET_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={routingEnabled ? r9MosfetTracePaths : []}
				>
					<A_2N7002
						name="Q2"
						pinAttributes={{
							pin1: { isInput: true },
							G: { isInput: true },
							pin2: { requiresGround: true },
							S: { requiresGround: true },
							pin3: { isOutput: true },
							D: { isOutput: true },
						}}
						layer="top"
						pcbX="8mm"
						pcbY="6mm"
						schX={8}
						schY={0}
						connections={{
							pin1: "net.TEMP_OK",
							pin2: "net.GND",
							pin3: "net.CHARGE_DISABLE",
						}}
					/>
				</fanout>
			</schematicsheet>
			<schematicsheet
				name="RadioCore"
				displayName="Bare ESP32-C3, clock and RF"
				sheetIndex={3}
				sheetSize="A4"
			>
				<SchematicComponentNotes sheet="RadioCore" />
				<fanout
					fanoutPourNetMap={{}}
					name="R9_CORE_ESCAPE"
					pcbX={0}
					pcbY={0}
					pcbTracePaths={
						routingEnabled
							? [
									...r9CoreTracePaths,
									...r9StrapTracePaths,
									...r9EnableCapGroundPaths,
								]
							: []
					}
				>
					<ESP32_C3FH4
						name="U1"
						pcbRotation={180}
						pcbX={0}
						pcbY={-10.5}
						schX={0}
						schY={0}
						schWidth={2.015}
						schHeight={4.12}
						schPortArrangement={{
							leftSide: [7, 6, 14, 15, 9, 10, 12, 4, 5, 8, 13, 16],
							topSide: [2, 3, 11, 17, 31, 32],
							rightSide: [27, 28, 30, 29, 18, 19, 20, 21, 22, 23, 24, 25, 26],
							bottomSide: [1, 33],
						}}
						pinAttributes={{
							pin1: {},
							LNA_IN: {},
							pin2: { requiresPower: true },
							VDD3P31: { requiresPower: true },
							pin3: { requiresPower: true },
							VDD3P32: { requiresPower: true },
							pin4: {},
							XTAL_32K_P: {},
							pin5: {},
							XTAL_32K_N: {},
							pin6: {},
							GPIO2: {},
							pin7: {},
							CHIP_EN: {},
							pin8: {},
							GPIO3: {},
							pin9: {},
							MTMS: {},
							pin10: {},
							MTDI: {},
							pin11: { requiresPower: true },
							VDD3P3_RTC: { requiresPower: true },
							pin12: {},
							MTCK: {},
							pin13: {},
							MTDO: {},
							pin14: {},
							GPIO8: {},
							pin15: {},
							GPIO9: {},
							pin16: {},
							GPIO10: {},
							pin17: { requiresPower: true },
							VDD3P3_CPU: { requiresPower: true },
							pin18: { providesPower: true, isOutput: true },
							VDD_SPI: { providesPower: true, isOutput: true },
							pin19: {},
							SPIHD: {},
							pin20: {},
							SPIWP: {},
							pin21: {},
							SPICS0: {},
							pin22: {},
							SPICLK: {},
							pin23: {},
							SPID: {},
							pin24: {},
							SPIQ: {},
							pin25: {},
							GPIO18: {},
							pin26: {},
							GPIO19: {},
							pin27: {},
							U0RXD: {},
							pin28: {},
							U0TXD: {},
							pin29: {},
							XTAL_N: {},
							pin30: {},
							XTAL_P: {},
							pin31: { requiresPower: true },
							VDDA1: { requiresPower: true },
							pin32: { requiresPower: true },
							VDDA2: { requiresPower: true },
							pin33: { requiresGround: true },
							EP: { requiresGround: true },
						}}
						noConnect={[
							"pin4",
							"pin5",
							"pin8",
							"pin13",
							"pin16",
							"pin19",
							"pin20",
							"pin21",
							"pin22",
							"pin23",
							"pin24",
							"pin25",
							"pin26",
						]}
						connections={{
							pin1: "net.RF_CHIP",
							pin2: "net.RADIO_3V3",
							pin3: "net.RADIO_3V3",
							pin6: "net.STRAP_GPIO2",
							pin7: "net.EN",
							pin9: "net.SHUTTER",
							pin10: "net.PAIR",
							pin11: "net.V3",
							pin12: "net.STATUS_LED",
							pin14: "net.STRAP_GPIO8",
							pin15: "net.BOOT",
							pin17: "net.V3",
							pin18: "net.FLASH_VDD",
							pin27: "net.UART_RX",
							pin28: "net.UART_TX",
							pin29: "net.XTAL_N",
							pin30: "net.XTAL_P",
							pin31: "net.V3",
							pin32: "net.V3",
							pin33: "net.GND",
						}}
					/>
					<LQG15HN2N0B02D
						name="L2"
						schRotation={90}
						pinAttributes={{
							pin1: { isPassive: true },
							pin2: { isPassive: true },
						}}
						pcbRotation={180}
						pcbX={5.3}
						pcbY={-7.7}
						schX={-6}
						schY={8}
						connections={{ pin1: "net.V3", pin2: "net.RADIO_3V3" }}
					/>
					<CC0603KRX7R9BB104
						name="C5"
						pcbX={5.9}
						pcbY={-9.4}
						pcbRotation={0}
						schX={-4}
						schY={8}
						schRotation={-90}
						connections={{ pin1: "net.RADIO_3V3", pin2: "net.GND" }}
					/>
					<CL21A106KAYNNNE
						name="C10"
						pcbX={3.2}
						pcbY={-4.8}
						pcbRotation={90}
						schX={-2.5}
						schY={8}
						schRotation={-90}
						connections={{ pin1: "net.RADIO_3V3", pin2: "net.GND" }}
					/>
					<CC0603KRX7R9BB104
						name="C14"
						pcbX={0.7}
						pcbY={-5.5}
						pcbRotation={90}
						schX={4}
						schY={8}
						schRotation={-90}
						connections={{ pin1: "net.V3", pin2: "net.GND" }}
					/>
					<CC0603KRX7R9BB104
						name="C15"
						pcbX={-5.5}
						pcbY={-9}
						pcbRotation={270}
						schX={5.5}
						schY={8}
						schRotation={-90}
						connections={{ pin1: "net.V3", pin2: "net.GND" }}
					/>
					<CL10A105KB8NNNC
						name="C16"
						pcbX={-5.5}
						pcbY={-12.3}
						pcbRotation={270}
						schX={-0.5}
						schY={8}
						schRotation={-90}
						connections={{ pin1: "net.FLASH_VDD", pin2: "net.GND" }}
					/>
					<CL10A105KB8NNNC
						name="C17"
						pcbX={2.15}
						pcbY={-14.75}
						pcbRotation={0}
						schX={7}
						schY={8}
						schRotation={-90}
						connections={{ pin1: "net.V3", pin2: "net.GND" }}
					/>
					<CL05B103KB5NNNC
						name="C18"
						pcbX={4.1}
						pcbY={-15.1}
						pcbRotation={90}
						schX={8.5}
						schY={8}
						schRotation={-90}
						connections={{ pin1: "net.V3", pin2: "net.GND" }}
					/>
					<A_0603WAF1002T5E
						name="R14"
						pcbX={4.5}
						pcbY={-0.5}
						pcbRotation={90}
						schX={-6}
						schY={5}
						schRotation={-90}
						connections={{ pin1: "net.V3", pin2: "net.STRAP_GPIO2" }}
					/>
					<A_0603WAF1002T5E
						name="R15"
						pcbX={-2}
						pcbY={-5.5}
						pcbRotation={90}
						schX={-4}
						schY={5}
						schRotation={-90}
						connections={{ pin1: "net.V3", pin2: "net.STRAP_GPIO8" }}
					/>
					<A_0603WAF1002T5E
						name="R16"
						pcbX={-5.3}
						pcbY={-5.6}
						pcbRotation={90}
						schX={-2}
						schY={5}
						schRotation={-90}
						connections={{ pin1: "net.V3", pin2: "net.BOOT" }}
					/>
					<A_0603WAF1002T5E
						name="R17"
						pcbX={8.5}
						pcbY={-9.5}
						pcbRotation={90}
						schX={-6}
						schY={2}
						schRotation={-90}
						connections={{ pin1: "net.V3", pin2: "net.EN" }}
					/>
					<CL10A105KB8NNNC
						name="C23"
						pcbX={7.2}
						pcbY={-6.2}
						pcbRotation={90}
						schX={-4}
						schY={2}
						schRotation={-90}
						connections={{ pin1: "net.EN", pin2: "net.GND" }}
					/>

					<TXM40M0004252HBCEO00T
						loadCapacitance="15pF"
						name="Y1"
						pcbRotation={180}
						pcbX={0}
						pcbY={-18.5}
						schX={6}
						schY={1}
						connections={{
							pin1: "net.XTAL_LOAD_P",
							pin2: "net.GND",
							pin3: "net.XTAL_N",
							pin4: "net.GND",
						}}
					/>
					<AHW2012C_24NJTF
						name="L3"
						pcbRotation={0}
						pcbX={5.45}
						pcbY={-17.2}
						schX={4}
						schY={1}
						connections={{ pin1: "net.XTAL_P", pin2: "net.XTAL_LOAD_P" }}
					/>
					<CC0603JRNPO9BN270
						name="C19"
						pcbX={3}
						pcbY={-18.5}
						pcbRotation={270}
						schX={4}
						schY={-1}
						schRotation={-90}
						connections={{ pin1: "net.XTAL_LOAD_P", pin2: "net.GND" }}
					/>
					<CC0603JRNPO9BN270
						name="C20"
						pcbX={-3}
						pcbY={-18.5}
						pcbRotation={90}
						schX={8}
						schY={-1}
						schRotation={-90}
						connections={{ pin1: "net.XTAL_N", pin2: "net.GND" }}
					/>
					<GJM1555C1H1R5BB01D
						name="C21"
						pcbX={3.9}
						pcbY={-13.07}
						pcbRotation={270}
						schX={-6}
						schY={-5}
						schRotation={-90}
						connections={{ pin1: "net.RF_CHIP", pin2: "net.GND" }}
					/>
					<LQG15HN2N0B02D
						name="L4"
						pinAttributes={{
							pin1: { isPassive: true },
							pin2: { isPassive: true },
						}}
						pcbRotation={180}
						pcbX={5.7}
						pcbY={-12.65}
						schX={-3.5}
						schY={-4}
						connections={{ pin1: "net.RF_50", pin2: "net.RF_CHIP" }}
					/>
					<GJM1555C1H1R5BB01D
						name="C22"
						pcbX={7.5}
						pcbY={-13.07}
						pcbRotation={270}
						schX={-1}
						schY={-5}
						schRotation={-90}
						connections={{ pin1: "net.RF_50", pin2: "net.GND" }}
					/>
					<ANT3216LL00R2400A
						name="ANT1"
						pcbX={15.5}
						pcbY={24}
						pcbRotation={90}
						schX={2}
						schY={-4}
						noConnect={["pin2"]}
						connections={{ pin1: "net.RF_50" }}
					/>
				</fanout>
			</schematicsheet>

			{/* R9 bare QFN thermal return: explicitly placed through vias, requiring
     epoxy-filled/copper-capped processing under fabrication/r9-process.json.
     The automatic router remains forbidden from adding vias in other pads. */}
			{[
				[-0.5, -11],
				[0.5, -11],
				[-0.5, -10],
				[0.5, -10],
			].map(([x, y], index) => (
				<R9ThermalGroundVia
					key={index}
					name={`U1_EP_GND${index + 1}`}
					centerXMm={x}
					centerYMm={y}
				/>
			))}

			<hole name="H1" pcbX="-19mm" pcbY="25mm" diameter="2.2mm" />
			<hole name="H2" pcbX="19mm" pcbY="25mm" diameter="2.2mm" />
			<hole name="H3" pcbX="-19mm" pcbY="-14mm" diameter="2.2mm" />
			<hole name="H4" pcbX="19mm" pcbY="-14mm" diameter="2.2mm" />
			<keepout
				shape="rect"
				pcbX="19.75616435mm"
				pcbY="3.50013mm"
				width="2mm"
				height="2mm"
				layers={["top", "bottom"]}
				excludeRefs={[".SW1"]}
			/>
			<keepout
				shape="rect"
				pcbX="19.75616435mm"
				pcbY="6.500124mm"
				width="2mm"
				height="2mm"
				layers={["top", "bottom"]}
				excludeRefs={[".SW1"]}
			/>
			{/* Conservative mounting copper exclusions supplement the NPTH clearance rule. */}
			<keepout
				shape="rect"
				pcbX="-19mm"
				pcbY="25mm"
				width="3.6mm"
				height="3.6mm"
				layers={["top", "bottom"]}
			/>
			<keepout
				shape="rect"
				pcbX="19mm"
				pcbY="25mm"
				width="3.6mm"
				height="3.6mm"
				layers={["top", "bottom"]}
			/>
			<keepout
				shape="rect"
				pcbX="-19mm"
				pcbY="-14mm"
				width="3.6mm"
				height="3.6mm"
				layers={["top", "bottom"]}
			/>
			<keepout
				shape="rect"
				pcbX="19mm"
				pcbY="-14mm"
				width="3.6mm"
				height="3.6mm"
				layers={["top", "bottom"]}
			/>
			{/* All-layer antenna clearance. Native exceptions identify components;
                the independent RF audit must reject non-feed traces here. */}
			<keepout
				shape="rect"
				pcbX={15.5}
				pcbY={24.5}
				width={6.5}
				height={7}
				layers={["top", "bottom"]}
				excludeRefs={[".ANT1"]}
				allowTraces
			/>
		</board>
	);
}