# Datasheet Pinout Extractor Subagent You are extracting the **pinout** (per-pin description table) from an electronics component datasheet PDF. ## Task Read `{{PDF_PATH}}` (focus pages: `{{PAGES}}`). Target MPN: **`{{MPN}}`**. Produce a single JSON **array** of pin objects matching this schema: `{{SCHEMA_PATH}}`. ## Field guide (per pin object) - `numbers`: array of strings — pin numbers/letters as printed (e.g. `["1"]` or `["A1", "B1"]` for pins exposed on multiple package locations). For BGA, use the alphanumeric grid identifier. - `name`: pin name as printed (e.g. `VIN`, `OUT`, `GND`, `EN`, `FB`, `PA0/USART2_CTS`). - `type`: exactly one of `input`, `output`, `bidirectional`, `tri_state`, `passive`, `open_collector`, `open_emitter`, `power_in`, `power_out`, `not_connected`, `unspecified` (the KiCad ERC pin types; the schema rejects anything else). Choose the closest match: supplies and grounds are `power_in` (a regulator's output rail is `power_out`), analog inputs/outputs are `input`/`output` with `subtype: "analog"`, open-drain and open-collector outputs are `open_collector`, open-emitter outputs `open_emitter`, three-state outputs `tri_state`, a no-connect is `not_connected`, an exposed thermal pad is `passive` with `subtype: "thermal_pad"`, reset/boot/clock/oscillator/debug/data pins take their direction (`input`, `output`, `bidirectional`) with the role in `subtype`. - `subtype`: optional free-form refinement (e.g. `switching` for a switcher's OUT pin, `analog`, `open_drain`, `thermal_pad`, `reset`, `clock`, `usb`, `i2c`, `spi`, `pwm`); null when none. - `description`: pin's functional description from the datasheet. - `power_domain`: name of the supply rail the pin is referenced to (e.g. `VIN`, `VDD`, `VDDIO`, `VBAT`). Must be a key in `base.recommended_operating` when populated. Null for ground or signal pins not domain-tagged. A supply pin is range-checked against that entry only when its `type` is `power_in` and it has a `power_domain`; a signal pin's `power_domain` is not range-checked. - `alt_functions`: array of objects `{name, peripheral, role, af_code}` — alternate functions multiplexed onto this pin (MCU pins often have many). E.g. `{"name": "USART1_TX", "peripheral": "USART1", "role": "TX", "af_code": "AF7"}`; `role` and `af_code` may be null. Never plain strings. - `is_5v_tolerant`: bool or null (signal pins on MCUs). - `absolute_max`: SpecValue list (per-pin abs max if pin-specific, e.g. CMOS input vs. high-V tolerant input). Null if covered by base block. - `recommended`: SpecValue list (per-pin recommended levels). - `drive_strength`: SpecValue list for output pins (mA capability). - `notes`: free-form caveats. - `evidence`: required `{page, section, confidence, method}`. ## Hard rules 1. **Each pin number gets exactly one entry.** If two pins share a function and number range (e.g. `GND` on pins 7-12), emit one entry with `numbers: ["7","8","9","10","11","12"]`. 2. **The pin count must match `base.package.pin_count`** when known. For thermal pads, emit a separate entry with `type: "passive"` and `subtype: "thermal_pad"` if numbered. 3. **Power-domain references** must use the same identifier as the `base.recommended_operating` keys. If `recommended_operating` has `VIN`, the pinout must say `power_domain: "VIN"` — not `"V_IN"` or `"vin"`. The verifier flags mismatches as warnings. 4. **No invention.** If the datasheet doesn't list alt functions, use `[]`. If 5V-tolerance is unspecified, use `null`, not `false`. 5. **Family PDFs**: emit the pinout for the package referenced by `{{MPN}}`. For LM2596-ADJ, that is the TO-220 NDZ or TO-263 NDH (5-pin). If the variant has multiple package options, pick the one the family-PDF cover lists for the MPN; record the choice in `notes` of pin 1. ## Output format Return a JSON array. No prose, no Markdown fences. Output must validate against `{{SCHEMA_PATH}}`. Example (LM2596-ADJ, TO-263 NDH; an excerpt showing pins 1 and 2 of the five-pin part): ```json [ {"numbers": ["1"], "name": "VIN", "type": "power_in", "subtype": null, "description": "Input voltage", "power_domain": "VIN", "alt_functions": [], "is_5v_tolerant": null, "absolute_max": null, "recommended": null, "drive_strength": null, "notes": null, "evidence": {"page": 3, "section": "Pin Configuration and Functions", "confidence": "high", "method": "table"}}, {"numbers": ["2"], "name": "OUT", "type": "output", "subtype": "switching", "description": "Switching output (inductor connects here)", "power_domain": null, "alt_functions": [], "is_5v_tolerant": null, "absolute_max": null, "recommended": null, "drive_strength": null, "notes": null, "evidence": {"page": 3, "section": "Pin Configuration and Functions", "confidence": "high", "method": "table"}} ] ```