McuPinMap
中文文档
McuPinMap is a lightweight VS Code extension for exploring MCU GPIO alternate
functions and planning pin assignments. It focuses on the logical Pin Map first:
choose a chip, inspect what each IO can do, search for peripheral signals, assign
functions, and export the result for firmware or hardware notes.
Screenshot
Features
- Browse GPIO alternate functions by chip.
- Search by pin name, alternate function, peripheral, or signal.
- View pins grouped by GPIO port in a logical Pin Map.
- Inspect package pinout data for LQFP and BGA packages.
- Assign alternate functions to pins.
- Detect duplicate pin usage and duplicate peripheral-signal assignments.
- Export assignments as JSON or Markdown.
- Download curated chip data on demand instead of bundling CSV data in the VSIX.
- Import local CSV data for private, experimental, or vendor-specific chips.
Usage
Open the Pin Map workspace from VS Code:
- Install or run the McuPinMap extension.
- Open the command palette with
Ctrl+Shift+P.
- Run
McuPinMap: Open Pin Map.
You can also open the McuPinMap activity bar view and use the Pin Map entry
there. In development, choose Run Extension and Open Pin Map from the VS Code
Run and Debug panel to start an Extension Development Host and open the Pin Map
automatically.
Once the workspace is open:
- Select or download a chip from the chip library.
- Search for a pin, peripheral, signal, or alternate function.
- Review supported functions in the Pin Detail panel.
- Assign functions to pins and resolve any reported conflicts.
- Export the assignment plan as JSON or Markdown.
Data Model
The extension package is intentionally small. Curated chip source data is kept in
the external data repository:
https://github.com/GYM-png/mcupinfunc-data
By default, McuPinMap reads the remote chip index from:
https://raw.githubusercontent.com/GYM-png/mcupinfunc-data/main/index.json
The URL can be changed with the VS Code setting:
mcupinmap.remoteIndexUrl
Chip source data is organized as:
chips/<vendor>/<family>/<part-number>/source/
Runtime chip data is generated as chip.json next to the source directory in
the data repository. Downloaded chips are cached in VS Code global storage for
the extension.
Release VSIX packages exclude generated/** and external-data/**.
GPIO alternate-function CSV files use a fixed AF0 to AF15 table:
PinName,AF0,AF1,AF2,AF3,AF4,AF5,AF6,AF7,AF8,AF9,AF10,AF11,AF12,AF13,AF14,AF15
LQFP pinout CSV files use:
PadNumber,PinName,PinType
BGA pinout CSV files use:
BallName,PinName,PinType
PinType must be one of:
gpio, power, ground, reset, clock, boot, nc
Development
Install dependencies:
npm install
Run tests:
npm test
Build the extension host and Webview:
npm run build
Build only the extension host and Webview:
npm run build:extension-only
Package a lightweight VSIX without bundled chip data:
npm run package:light
External Data Workflow
Use a local checkout of the data repository at:
external-data/mcupinfunc-data/
Validate the external data checkout:
npm run validate:remote-data
Build per-chip chip.json files and the root index.json:
npm run build:remote-data
Verify release data when the data repository tooling is available:
npm run verify:remote-data
Project Layout
src/extension/ VS Code extension host integration
src/shared/ Shared validation, parsing, indexing, search, and assignment logic
src/webview/ React and Zustand Webview UI
scripts/ Data validation and build scripts
test/ Vitest test suites
resources/ Extension icons and static assets
Do not commit local build output, dependency folders, generated chip data, or
the external data checkout.
Debugging in VS Code
Use the launch configurations under .vscode/:
Run Extension
Run Extension and Open Pin Map
The second configuration starts the Extension Development Host and attempts to
open the Pin Map view automatically. If it does not open, run
McuPinMap: Open Pin Map from the command palette.
License
MIT