{"data":{"slug":"discovered-f8804e34c7e65bdfafc44e1be8f783bfc9917726383911a6","title":"Hw Interface","summary":"Write firmware's pin needs from hardware specs, check board.json against them, and ensure requirement IDs follow REQ-<AREA>-<NNN> format for traceability with the board repo.","url":"https:\/\/skillshunter.net\/skills\/discovered-f8804e34c7e65bdfafc44e1be8f783bfc9917726383911a6","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-f8804e34c7e65bdfafc44e1be8f783bfc9917726383911a6","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-f8804e34c7e65bdfafc44e1be8f783bfc9917726383911a6.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-f8804e34c7e65bdfafc44e1be8f783bfc9917726383911a6\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before running `trace.py --firmware`, ensure all `REQ-*` IDs cited in the board repo's `docs\/requirements.md` are defined in this repository. Also, copy the board repo's `board.json` to `hardware\/board.json` and run the validation script before modifying any driver code.","instructions":"---\nname: hw-interface\ndescription: Keep the firmware and its board in step with a hardware-agent-kit board repo. Write the firmware's pin needs from the roadmap specs, check the board's board.json against them, and keep requirement IDs in the REQ-<AREA>-<NNN> form the board traces to. Use when a spec touches pins, buses or interrupts, or when the board repo exports a new board.json.\n---\n\nKeep the hardware interface between this firmware and its board repo. The board repo follows hardware-agent-kit:\nits `trace.py --firmware` checks each `REQ-*` it cites, and its `pins.py` assigns pins from the firmware's needs.\n\n## Files\n\n| File | Owner | Content |\n|---|---|---|\n| `hardware\/pin-needs.txt` | firmware | One function per line: `FUNCTION  SIGNALS  [GROUP]`. The board repo copies it to `pin-data\/pin-needs.txt`. |\n| `hardware\/board.json` | board repo | Copy of the board repo's `pin-data\/board.json` (`pins.py export`): pins, signals, peripherals, interrupt lines, rails, revision, hardware ID. Do not edit it. |\n\n## Steps\n\n1. Read the specs in `roadmap\/` that touch hardware: their *Interfaces* (peripheral, pins, bus speed) and *Behaviour*.\n2. Write one line per function in `hardware\/pin-needs.txt`. Name the function as the schematic net will be named\n   (`IMU_SCK`, `MOTOR_PWM_A`). Give the signals the function can use, alternatives separated by `|`:\n   - an alternate-function name, with `*` and `{x}` placeholders: `SPI{n}_SCK`, `ADC1_IN*`;\n   - `GPIO` (any I\/O pin), `EXTI` (any pin with its own interrupt line), or an exact pin (`PA13`).\n   Give the functions of one bus the same group, so one peripheral instance serves the whole bus.\n3. Give `hardware\/pin-needs.txt` to the board repo. Do not choose pins: the board picks them from the placement.\n4. When the board repo exports a new `board.json`, copy it to `hardware\/board.json`. Run\n   `python3 .claude\/skills\/hw-interface\/hw_interface.py check hardware\/pin-needs.txt hardware\/board.json`.\n   Fix each error before you change a driver.\n5. Configure each driver's pins, peripheral instance and interrupt line from `hardware\/board.json`.\n   Do not copy a pin by hand into a source file without a check that reads `board.json`.\n6. Run `python3 .claude\/skills\/hw-interface\/hw_interface.py ids .`. Fix each error.\n7. Report changed files, the `check` and `ids` results, and each warning.\n\n## Requirement IDs\n\n- Each requirement has one ID: `REQ-<AREA>-<NNN>`. AREA is capital letters and digits (`MOTOR`, `BLE`, `PWR`).\n  NNN is three digits.\n- Define each ID once: in the first cell of its table row, or at the start of its heading.\n- Never reuse or renumber an ID. A removed requirement keeps its ID, marked *Deleted*.\n- The board repo cites these IDs in `docs\/requirements.md`. `trace.py --firmware <this repo>` fails on an ID that\n  this repository does not contain.\n\n## Rules\n\n- `board.json` describes one revision (`revision`, `hardware_id`). Firmware that supports several revisions\n  reads the hardware ID at start-up (the board's straps or ADC ladder) and selects the pin set.\n- A board function that no need names is a warning: confirm that the board repo did not add a function the firmware\n  does not drive.\n","use_cases":["Define firmware pin requirements from hardware specs","Validate board.json against firmware pin needs","Ensure requirement IDs are correctly formatted and referenced"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/embedded-pro\/embedded-agent-kit\/blob\/25b3baf222edcd427aa6cfbbc1429151ddd5bb33\/skills\/hw-interface\/SKILL.md","source_commit":"25b3baf222edcd427aa6cfbbc1429151ddd5bb33","license":null,"version":null,"listing_approved_at":"2026-12-02","created_at":"2026-11-30T09:04:07.000000Z","updated_at":"2026-12-02T09:15:52.000000Z","seo_title":"Hardware Interface Management for Firmware and Board Repo Sync","seo_description":"Ensure firmware and board repos are in sync by defining pin needs, validating board.json, and maintaining requirement IDs for traceability.","seo_keywords":["firmware pin needs","board repo sync","requirement ID format","hardware interface management","traceability with board repo"]}}