@dheerajsom/pinhub 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,152 @@
1
+ # pinhub — pinout diagrams in your terminal
2
+
3
+ `pinhub` installs a tiny cross-platform command, **`ph`**, that draws hardware
4
+ board pinout diagrams straight in your terminal — pin numbers, GPIO names,
5
+ power/ground rails, and the safety warnings that matter, sourced from official
6
+ vendor documentation.
7
+
8
+ ```text
9
+ $ ph rpi5
10
+
11
+ Raspberry Pi 5 — Raspberry Pi
12
+ Source: Raspberry Pi GPIO documentation (official) — see ph raspberry-pi-5 --source
13
+ ⚠ GPIO uses 3.3 V logic. Do not apply 5 V to any GPIO pin.
14
+
15
+ 40-pin GPIO header (J8)
16
+ ┌────────────────────┬────┬────┬───────────────────┐
17
+ │ 3V3 │ 1 │ 2 │ 5V │
18
+ │ GPIO2 / SDA1 │ 3 │ 4 │ 5V │
19
+ │ GPIO3 / SCL1 │ 5 │ 6 │ GND │
20
+ │ GPIO4 / GPCLK0 │ 7 │ 8 │ GPIO14 / TXD0 │
21
+ │ GND │ 9 │ 10 │ GPIO15 / RXD0 │
22
+ │ … │ … │ … │ … │
23
+ └────────────────────┴────┴────┴───────────────────┘
24
+ ```
25
+
26
+ Works on Windows (PowerShell, Windows Terminal), macOS (Terminal, iTerm2), and
27
+ Linux. No network access, no telemetry — all board data ships in the package.
28
+
29
+ ## Install
30
+
31
+ Requires Node.js 18.18 or newer.
32
+
33
+ ```bash
34
+ npm install -g pinhub
35
+ ph rpi5
36
+ ```
37
+
38
+ See [SETUP.md](SETUP.md) for step-by-step setup, installing from source, and
39
+ troubleshooting.
40
+
41
+ Planned package-manager support: Homebrew, winget/Scoop/Chocolatey, Fedora
42
+ RPM/dnf, and Debian/Ubuntu deb/apt.
43
+
44
+ ## Usage
45
+
46
+ ```bash
47
+ ph <board> # render a pinout diagram
48
+ ph list # all boards in the catalog
49
+ ph search <query> # find boards by name, alias, or manufacturer
50
+ ph info <board> # description, headers, warnings, sources, aliases
51
+ ph help # usage help
52
+ ph --version # version
53
+ ```
54
+
55
+ Board names are forgiving: `ph rpi5`, `ph pi5`, `ph raspberry-pi-5`, and
56
+ `ph raspberry pi 5` all resolve to the same board, case-insensitively.
57
+
58
+ ### Output flags
59
+
60
+ | Flag | Effect |
61
+ | --- | --- |
62
+ | `--compact` | Tighter, borderless layout for small terminals |
63
+ | `--ascii` | ASCII-only borders and symbols (no Unicode) |
64
+ | `--no-color` | Disable ANSI colors |
65
+ | `--json` | Emit the board's full data as JSON (stdout is pure JSON) |
66
+ | `--source` | Print the board's documentation source links |
67
+ | `--width <n>` | Override the detected terminal width |
68
+
69
+ Examples:
70
+
71
+ ```bash
72
+ ph rpi5
73
+ ph esp32
74
+ ph pico --compact
75
+ ph rpi5 --ascii --no-color
76
+ ph uno --json | jq '.headers[].name'
77
+ ph rpi5 --source
78
+ ```
79
+
80
+ ## Boards
81
+
82
+ | Board | Try |
83
+ | --- | --- |
84
+ | Raspberry Pi 5 (40-pin GPIO header) | `ph rpi5` |
85
+ | Raspberry Pi Pico | `ph pico` |
86
+ | Raspberry Pi Pico W | `ph pico-w` |
87
+ | Arduino UNO R3 | `ph uno` |
88
+ | ESP32 DevKit V1 (DOIT, 30-pin) | `ph esp32` |
89
+
90
+ ## Color and accessibility
91
+
92
+ - Pin categories are color-coded (power red/yellow, ground gray, GPIO green,
93
+ communication cyan, analog blue, reserved magenta), but color is never the
94
+ only signal — labels, category names, and the `*` reserved marker survive
95
+ `--no-color` and piping.
96
+ - The [`NO_COLOR`](https://no-color.org/) environment variable is honored, as
97
+ is `--no-color`.
98
+ - When output is piped or redirected (not a TTY), color is disabled
99
+ automatically and the layout stays stable.
100
+ - `--ascii` avoids all Unicode for legacy terminals and screen readers that
101
+ struggle with box-drawing characters.
102
+ - On narrow terminals the diagram degrades gracefully: full bordered table →
103
+ compact pairs → vertical list. Warnings and source lines are never truncated.
104
+
105
+ ## Hardware safety disclaimer
106
+
107
+ Pinout data is hardware-critical. Every board in the catalog cites its
108
+ sources (`ph <board> --source`), preferring official vendor documentation;
109
+ third-party sources are explicitly marked. Board *variants and revisions can
110
+ differ* — especially ESP32 dev boards — so always verify against your exact
111
+ board's silkscreen and vendor documentation before wiring anything.
112
+ Miswiring power pins can permanently damage your hardware. Use at your own
113
+ risk.
114
+
115
+ ## Contributing boards
116
+
117
+ Board data lives in `src/boards/`, one module per board, using the typed model
118
+ in `src/model.ts`. To add a board:
119
+
120
+ 1. Create `src/boards/<board-id>.ts` exporting a `Board` object.
121
+ - Every pin needs a `physical` number, a grid `position`, a `label`, and a
122
+ `category`.
123
+ - Include at least one **official** source URL (datasheet, schematic, or
124
+ vendor pinout). Third-party sources are allowed only when official
125
+ documentation is unavailable and must be marked `official: false`.
126
+ - Include the safety warnings that apply (logic level, strapping pins,
127
+ reserved pins, revision differences).
128
+ 2. Register it in `src/boards/index.ts` and add aliases people actually type.
129
+ 3. Run `npm test` — catalog invariant tests check sources, warnings, alias
130
+ uniqueness, and pin-grid consistency.
131
+
132
+ ## Development
133
+
134
+ ```bash
135
+ cd cli
136
+ npm install
137
+ npm run dev -- rpi5 # run from TypeScript source
138
+ npm test # vitest suite (alias, JSON, rendering, snapshots)
139
+ npm run lint # eslint
140
+ npm run build # compile to dist/
141
+ npm run package:check # npm pack --dry-run
142
+ ```
143
+
144
+ The CLI entry point is `src/cli.ts`; `src/run.ts` contains the whole command
145
+ surface as a testable function that writes to captured buffers. Renderers live
146
+ in `src/render/` behind a small abstraction (`dual-row` bordered table,
147
+ compact pairs, and vertical list), so new header layouts can be added without
148
+ touching board data. CI runs lint, tests, build, and a smoke test on Windows,
149
+ macOS, and Linux via GitHub Actions.
150
+
151
+ To publish: `npm publish` from `cli/` (the `prepublishOnly` hook lints, tests,
152
+ and builds; the `files` allowlist ships only `dist/`).
package/SETUP.md ADDED
@@ -0,0 +1,126 @@
1
+ # Setting up the PinHub CLI (`ph`)
2
+
3
+ This guide walks you through installing the `pinhub` package so the `ph`
4
+ command is available in your terminal, on Windows, macOS, or Linux.
5
+
6
+ ## 1. Prerequisites
7
+
8
+ The only requirement is **Node.js 18.18 or newer** (which includes npm).
9
+
10
+ Check what you have:
11
+
12
+ ```bash
13
+ node --version
14
+ npm --version
15
+ ```
16
+
17
+ If you need Node.js:
18
+
19
+ - **Windows:** `winget install OpenJS.NodeJS.LTS`, or download from
20
+ [nodejs.org](https://nodejs.org/).
21
+ - **macOS:** `brew install node`, or download from
22
+ [nodejs.org](https://nodejs.org/).
23
+ - **Linux:** use your distribution's package manager or
24
+ [nodesource](https://github.com/nodesource/distributions), e.g.
25
+ `sudo dnf install nodejs` / `sudo apt install nodejs npm`.
26
+
27
+ No `sudo` is required to *run* `ph`, and the CLI itself never touches the
28
+ network — all board data is bundled.
29
+
30
+ ## 2. Install from npm (recommended)
31
+
32
+ ```bash
33
+ npm install -g pinhub
34
+ ```
35
+
36
+ Then verify:
37
+
38
+ ```bash
39
+ ph --version
40
+ ph rpi5
41
+ ```
42
+
43
+ If `ph` prints a pinout diagram, you're done.
44
+
45
+ > **Note on `sudo npm install -g` (macOS/Linux):** if global installs fail
46
+ > with a permissions error, prefer fixing your npm prefix over using sudo:
47
+ > `npm config set prefix ~/.npm-global` and add `~/.npm-global/bin` to your
48
+ > `PATH`.
49
+
50
+ ## 3. Install from source (this repository)
51
+
52
+ ```bash
53
+ git clone https://github.com/<your-org>/PinHub.git
54
+ cd PinHub/cli
55
+ npm install
56
+ npm run build
57
+ npm install -g .
58
+ ```
59
+
60
+ `npm install -g .` links the built CLI into your global npm bin, giving you
61
+ the same `ph` command as an npm install. Alternatively, run it in place
62
+ without installing:
63
+
64
+ ```bash
65
+ node dist/cli.js rpi5
66
+ # or straight from TypeScript during development:
67
+ npm run dev -- rpi5
68
+ ```
69
+
70
+ ## 4. First steps
71
+
72
+ ```bash
73
+ ph list # see every board in the catalog
74
+ ph rpi5 # Raspberry Pi 5 GPIO header
75
+ ph pico # Raspberry Pi Pico
76
+ ph uno # Arduino UNO R3
77
+ ph esp32 # ESP32 DevKit V1 (DOIT, 30-pin)
78
+ ph search raspberry # find boards
79
+ ph info esp32 # warnings, sources, aliases
80
+ ph rpi5 --source # official documentation links
81
+ ```
82
+
83
+ Useful flags: `--compact` (small terminals), `--ascii` (no Unicode),
84
+ `--no-color`, `--json` (script-friendly), `--width <n>`.
85
+
86
+ Board names are forgiving — `ph rpi5`, `ph pi5`, and `ph raspberry pi 5` all
87
+ work. If you guess wrong, `ph` suggests the closest matches.
88
+
89
+ ## 5. Troubleshooting
90
+
91
+ **`ph` is not recognized / command not found**
92
+ The npm global bin directory is not on your `PATH`.
93
+
94
+ - Find it with `npm prefix -g`. On Windows that directory itself (e.g.
95
+ `C:\Users\you\AppData\Roaming\npm`) must be on `PATH`; on macOS/Linux it's
96
+ `<prefix>/bin`.
97
+ - Open a *new* terminal after installing — `PATH` changes don't apply to
98
+ already-open sessions.
99
+
100
+ **Boxes render as `?` or garbled characters**
101
+ Your terminal or font doesn't support Unicode box-drawing. Use `ph <board>
102
+ --ascii`. On legacy Windows consoles, Windows Terminal is recommended;
103
+ `chcp 65001` can also help with piped output.
104
+
105
+ **No colors, or you want no colors**
106
+ Color is automatically disabled when output is piped or when the
107
+ [`NO_COLOR`](https://no-color.org/) environment variable is set. Force it off
108
+ per-invocation with `--no-color`.
109
+
110
+ **The diagram looks cramped or wraps badly**
111
+ `ph` adapts to terminal width and falls back to a compact layout, but you can
112
+ control it: widen the terminal, or use `--compact`, or `--width 100`.
113
+
114
+ **Uninstall**
115
+
116
+ ```bash
117
+ npm uninstall -g pinhub
118
+ ```
119
+
120
+ ## 6. A note on hardware safety
121
+
122
+ `ph` shows each board's voltage levels, reserved pins, and boot-strap pins,
123
+ and cites its documentation sources — but board revisions differ (ESP32
124
+ boards especially). Always cross-check your exact board's silkscreen and the
125
+ official documentation (`ph <board> --source`) before wiring. 3.3 V GPIO does
126
+ not forgive 5 V.
@@ -0,0 +1,2 @@
1
+ import type { Board } from "../model.js";
2
+ export declare const arduinoUnoR3: Board;
@@ -0,0 +1,133 @@
1
+ function col(physical, label, category, extra = {}) {
2
+ return {
3
+ physical,
4
+ position: { row: physical, column: 1 },
5
+ label,
6
+ category,
7
+ ...extra,
8
+ };
9
+ }
10
+ const V5 = { voltage: "5 V" };
11
+ export const arduinoUnoR3 = {
12
+ id: "arduino-uno-r3",
13
+ name: "Arduino UNO R3",
14
+ manufacturer: "Arduino",
15
+ aliases: ["uno", "uno-r3", "arduino-uno", "arduino-uno-r3", "arduino-uno-rev3"],
16
+ description: "Classic ATmega328P Arduino board with the reference UNO shield headers and 2×3 ICSP header. Digital IO is 5 V logic.",
17
+ revisionNote: "This is the ATmega328P UNO R3. The newer UNO R4 boards keep the shield shape but use a different microcontroller — check `docs.arduino.cc` for R4 pin functions.",
18
+ warnings: [
19
+ {
20
+ severity: "danger",
21
+ text: "Digital IO is 5 V logic. Level-shift 3.3 V-only sensors and modules.",
22
+ },
23
+ {
24
+ severity: "warning",
25
+ text: "The 3.3 V regulator output is current-limited (~50 mA); do not power large peripherals from it.",
26
+ },
27
+ {
28
+ severity: "info",
29
+ text: "A4/A5 double as I2C SDA/SCL and are internally connected to the dedicated SDA/SCL pins next to AREF.",
30
+ },
31
+ {
32
+ severity: "info",
33
+ text: "SPI is available on D10–D13 and on the ICSP header.",
34
+ },
35
+ ],
36
+ sources: [
37
+ {
38
+ title: "Arduino UNO Rev3 documentation",
39
+ url: "https://docs.arduino.cc/hardware/uno-rev3/",
40
+ official: true,
41
+ },
42
+ {
43
+ title: "Arduino UNO Rev3 full pinout PDF",
44
+ url: "https://content.arduino.cc/assets/A000066-full-pinout.pdf",
45
+ official: true,
46
+ },
47
+ {
48
+ title: "Arduino UNO Rev3 datasheet",
49
+ url: "https://docs.arduino.cc/resources/datasheets/A000066-datasheet.pdf",
50
+ official: true,
51
+ },
52
+ ],
53
+ headers: [
54
+ {
55
+ id: "digital-high",
56
+ name: "Digital header (SCL…D8)",
57
+ description: "Top edge, left to right with the USB port on the left.",
58
+ layout: { rows: 10, columns: 1 },
59
+ pins: [
60
+ col(1, "SCL", "communication", { functions: ["I2C SCL"], ...V5, notes: ["Connected to A5"] }),
61
+ col(2, "SDA", "communication", { functions: ["I2C SDA"], ...V5, notes: ["Connected to A4"] }),
62
+ col(3, "AREF", "analog", { notes: ["Analog reference voltage input"] }),
63
+ col(4, "GND", "ground"),
64
+ col(5, "D13", "communication", { gpio: "PB5", functions: ["SPI SCK", "LED_BUILTIN"], ...V5 }),
65
+ col(6, "D12", "communication", { gpio: "PB4", functions: ["SPI MISO"], ...V5 }),
66
+ col(7, "D11", "communication", { gpio: "PB3", functions: ["SPI MOSI", "PWM"], ...V5 }),
67
+ col(8, "D10", "communication", { gpio: "PB2", functions: ["SPI SS", "PWM"], ...V5 }),
68
+ col(9, "D9", "gpio", { gpio: "PB1", functions: ["PWM"], ...V5 }),
69
+ col(10, "D8", "gpio", { gpio: "PB0", ...V5 }),
70
+ ],
71
+ },
72
+ {
73
+ id: "digital-low",
74
+ name: "Digital header (D7…D0)",
75
+ description: "Top edge, continues right of the D8 header.",
76
+ layout: { rows: 8, columns: 1 },
77
+ pins: [
78
+ col(1, "D7", "gpio", { gpio: "PD7", ...V5 }),
79
+ col(2, "D6", "gpio", { gpio: "PD6", functions: ["PWM"], ...V5 }),
80
+ col(3, "D5", "gpio", { gpio: "PD5", functions: ["PWM"], ...V5 }),
81
+ col(4, "D4", "gpio", { gpio: "PD4", ...V5 }),
82
+ col(5, "D3", "gpio", { gpio: "PD3", functions: ["PWM", "INT1"], ...V5 }),
83
+ col(6, "D2", "gpio", { gpio: "PD2", functions: ["INT0"], ...V5 }),
84
+ col(7, "D1", "communication", { gpio: "PD1", functions: ["UART TX"], ...V5, notes: ["Shared with USB serial"] }),
85
+ col(8, "D0", "communication", { gpio: "PD0", functions: ["UART RX"], ...V5, notes: ["Shared with USB serial"] }),
86
+ ],
87
+ },
88
+ {
89
+ id: "power",
90
+ name: "Power header",
91
+ description: "Bottom edge, left to right with the barrel jack on the left.",
92
+ layout: { rows: 8, columns: 1 },
93
+ pins: [
94
+ col(1, "NC", "nc", { notes: ["Reserved, leave unconnected"] }),
95
+ col(2, "IOREF", "power", { ...V5, notes: ["IO reference voltage for shields"] }),
96
+ col(3, "RESET", "reserved", { notes: ["Active-low reset"] }),
97
+ col(4, "3V3", "power", { voltage: "3.3 V", notes: ["~50 mA regulator output"] }),
98
+ col(5, "5V", "power", { voltage: "5 V" }),
99
+ col(6, "GND", "ground"),
100
+ col(7, "GND", "ground"),
101
+ col(8, "VIN", "power", { voltage: "7–12 V recommended", notes: ["Unregulated input"] }),
102
+ ],
103
+ },
104
+ {
105
+ id: "analog",
106
+ name: "Analog input header",
107
+ description: "Bottom edge, right of the power header.",
108
+ layout: { rows: 6, columns: 1 },
109
+ pins: [
110
+ col(1, "A0", "analog", { gpio: "PC0", ...V5 }),
111
+ col(2, "A1", "analog", { gpio: "PC1", ...V5 }),
112
+ col(3, "A2", "analog", { gpio: "PC2", ...V5 }),
113
+ col(4, "A3", "analog", { gpio: "PC3", ...V5 }),
114
+ col(5, "A4", "analog", { gpio: "PC4", functions: ["I2C SDA"], ...V5 }),
115
+ col(6, "A5", "analog", { gpio: "PC5", functions: ["I2C SCL"], ...V5 }),
116
+ ],
117
+ },
118
+ {
119
+ id: "icsp",
120
+ name: "ICSP header (2×3)",
121
+ description: "Pin 1 (MISO) is marked with a dot on the silkscreen.",
122
+ layout: { rows: 3, columns: 2 },
123
+ pins: [
124
+ { physical: 1, position: { row: 1, column: 1 }, label: "MISO", category: "communication", functions: ["SPI MISO"], ...V5 },
125
+ { physical: 2, position: { row: 1, column: 2 }, label: "5V", category: "power", voltage: "5 V" },
126
+ { physical: 3, position: { row: 2, column: 1 }, label: "SCK", category: "communication", functions: ["SPI SCK"], ...V5 },
127
+ { physical: 4, position: { row: 2, column: 2 }, label: "MOSI", category: "communication", functions: ["SPI MOSI"], ...V5 },
128
+ { physical: 5, position: { row: 3, column: 1 }, label: "RESET", category: "reserved", notes: ["Active-low reset"] },
129
+ { physical: 6, position: { row: 3, column: 2 }, label: "GND", category: "ground" },
130
+ ],
131
+ },
132
+ ],
133
+ };
@@ -0,0 +1,2 @@
1
+ import type { Board } from "../model.js";
2
+ export declare const esp32DevkitV1: Board;
@@ -0,0 +1,143 @@
1
+ /**
2
+ * DOIT ESP32 DevKit V1, 30-pin variant. Physical numbering is positional
3
+ * (DOIT boards do not silkscreen pin numbers): 1–15 down the left side and
4
+ * 16–30 down the right side, viewed from above with the USB port at the
5
+ * bottom.
6
+ */
7
+ function pin(physical, label, category, extra = {}) {
8
+ const left = physical <= 15;
9
+ return {
10
+ physical,
11
+ position: { row: left ? physical : physical - 15, column: left ? 1 : 2 },
12
+ label,
13
+ category,
14
+ ...extra,
15
+ };
16
+ }
17
+ const V33 = { voltage: "3.3 V" };
18
+ const INPUT_ONLY = ["Input only — no output driver, no internal pull resistors"];
19
+ export const esp32DevkitV1 = {
20
+ id: "esp32-devkit-v1",
21
+ name: "ESP32 DevKit V1 (DOIT, 30-pin)",
22
+ manufacturer: "DOIT (ESP32-WROOM-32 module by Espressif)",
23
+ aliases: [
24
+ "esp32",
25
+ "esp32-devkit",
26
+ "esp32-devkit-v1",
27
+ "esp32-devkitv1",
28
+ "doit-esp32-devkit-v1",
29
+ "esp32-wroom-32",
30
+ "esp32-devkitc",
31
+ ],
32
+ description: "The ubiquitous 30-pin ESP32-WROOM-32 breadboard dev kit. Wi-Fi + Bluetooth, two breadboard-friendly headers, 3.3 V logic.",
33
+ revisionNote: "ESP32 dev boards vary a lot: 30-pin DevKit V1, 36-pin variants, and the 38-pin Espressif ESP32-DevKitC all have different headers. Verify the silkscreen of your exact board before wiring anything.",
34
+ warnings: [
35
+ {
36
+ severity: "danger",
37
+ text: "GPIO uses 3.3 V logic. Do not apply 5 V to any GPIO pin.",
38
+ },
39
+ {
40
+ severity: "danger",
41
+ text: "GPIO0, GPIO2, GPIO5, GPIO12 and GPIO15 are boot-strapping pins; external pull-ups/downs at reset can stop the board from booting or flashing.",
42
+ },
43
+ {
44
+ severity: "warning",
45
+ text: "GPIO34–GPIO39 (VP, VN, D34, D35) are input-only and have no internal pull resistors.",
46
+ },
47
+ {
48
+ severity: "warning",
49
+ text: "ADC2 channels cannot be used while Wi-Fi is active; prefer ADC1 (VP, VN, D32–D35) for analog reads.",
50
+ },
51
+ {
52
+ severity: "info",
53
+ text: "TX0/RX0 (GPIO1/GPIO3) carry the USB serial console and are used for flashing.",
54
+ },
55
+ ],
56
+ sources: [
57
+ {
58
+ title: "Espressif ESP32-WROOM-32 datasheet",
59
+ url: "https://www.espressif.com/sites/default/files/documentation/esp32-wroom-32_datasheet_en.pdf",
60
+ official: true,
61
+ },
62
+ {
63
+ title: "Espressif ESP32 series datasheet",
64
+ url: "https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf",
65
+ official: true,
66
+ },
67
+ {
68
+ title: "Last Minute Engineers — ESP32 DevKit pinout reference (third-party board layout)",
69
+ url: "https://lastminuteengineers.com/esp32-pinout-reference/",
70
+ official: false,
71
+ },
72
+ ],
73
+ headers: [
74
+ {
75
+ id: "main",
76
+ name: "30-pin breadboard headers",
77
+ description: "Viewed from above, USB port at the bottom. Pins numbered 1–15 down the left and 16–30 down the right (positional; not silkscreened).",
78
+ layout: { rows: 15, columns: 2 },
79
+ pins: [
80
+ pin(1, "EN", "reserved", { notes: ["Chip enable / reset (active low), wired to the EN button"], ...V33 }),
81
+ pin(2, "VP", "analog", { gpio: "GPIO36", functions: ["ADC1_CH0"], notes: INPUT_ONLY, ...V33 }),
82
+ pin(3, "VN", "analog", { gpio: "GPIO39", functions: ["ADC1_CH3"], notes: INPUT_ONLY, ...V33 }),
83
+ pin(4, "D34", "analog", { gpio: "GPIO34", functions: ["ADC1_CH6"], notes: INPUT_ONLY, ...V33 }),
84
+ pin(5, "D35", "analog", { gpio: "GPIO35", functions: ["ADC1_CH7"], notes: INPUT_ONLY, ...V33 }),
85
+ pin(6, "D32", "analog", { gpio: "GPIO32", functions: ["ADC1_CH4", "Touch9"], ...V33 }),
86
+ pin(7, "D33", "analog", { gpio: "GPIO33", functions: ["ADC1_CH5", "Touch8"], ...V33 }),
87
+ pin(8, "D25", "analog", { gpio: "GPIO25", functions: ["DAC1", "ADC2_CH8"], ...V33 }),
88
+ pin(9, "D26", "analog", { gpio: "GPIO26", functions: ["DAC2", "ADC2_CH9"], ...V33 }),
89
+ pin(10, "D27", "gpio", { gpio: "GPIO27", functions: ["ADC2_CH7", "Touch7"], ...V33 }),
90
+ pin(11, "D14", "gpio", { gpio: "GPIO14", functions: ["HSPI CLK", "ADC2_CH6"], ...V33 }),
91
+ pin(12, "D12", "gpio", {
92
+ gpio: "GPIO12",
93
+ functions: ["HSPI MISO", "ADC2_CH5"],
94
+ notes: ["Boot strap: must be low at reset"],
95
+ ...V33,
96
+ }),
97
+ pin(13, "D13", "gpio", { gpio: "GPIO13", functions: ["HSPI MOSI", "ADC2_CH4"], ...V33 }),
98
+ pin(14, "GND", "ground"),
99
+ pin(15, "VIN", "power", { voltage: "5 V", notes: ["5 V input when not powered over USB"] }),
100
+ pin(16, "D23", "communication", { gpio: "GPIO23", functions: ["VSPI MOSI"], ...V33 }),
101
+ pin(17, "D22", "communication", { gpio: "GPIO22", functions: ["I2C SCL"], ...V33 }),
102
+ pin(18, "TX0", "communication", {
103
+ gpio: "GPIO1",
104
+ functions: ["UART0 TX"],
105
+ notes: ["USB serial console / flashing"],
106
+ ...V33,
107
+ }),
108
+ pin(19, "RX0", "communication", {
109
+ gpio: "GPIO3",
110
+ functions: ["UART0 RX"],
111
+ notes: ["USB serial console / flashing"],
112
+ ...V33,
113
+ }),
114
+ pin(20, "D21", "communication", { gpio: "GPIO21", functions: ["I2C SDA"], ...V33 }),
115
+ pin(21, "D19", "communication", { gpio: "GPIO19", functions: ["VSPI MISO"], ...V33 }),
116
+ pin(22, "D18", "communication", { gpio: "GPIO18", functions: ["VSPI CLK"], ...V33 }),
117
+ pin(23, "D5", "communication", {
118
+ gpio: "GPIO5",
119
+ functions: ["VSPI CS"],
120
+ notes: ["Boot strap: outputs PWM at boot; keep high at reset"],
121
+ ...V33,
122
+ }),
123
+ pin(24, "TX2", "communication", { gpio: "GPIO17", functions: ["UART2 TX"], ...V33 }),
124
+ pin(25, "RX2", "communication", { gpio: "GPIO16", functions: ["UART2 RX"], ...V33 }),
125
+ pin(26, "D4", "gpio", { gpio: "GPIO4", functions: ["ADC2_CH0", "Touch0"], ...V33 }),
126
+ pin(27, "D2", "gpio", {
127
+ gpio: "GPIO2",
128
+ functions: ["ADC2_CH2", "Touch2"],
129
+ notes: ["Onboard LED; boot strap: must be floating or low at reset"],
130
+ ...V33,
131
+ }),
132
+ pin(28, "D15", "gpio", {
133
+ gpio: "GPIO15",
134
+ functions: ["ADC2_CH3", "HSPI CS"],
135
+ notes: ["Boot strap: keep high at reset to silence boot log"],
136
+ ...V33,
137
+ }),
138
+ pin(29, "GND", "ground"),
139
+ pin(30, "3V3", "power", { voltage: "3.3 V", notes: ["Regulator output"] }),
140
+ ],
141
+ },
142
+ ],
143
+ };
@@ -0,0 +1,2 @@
1
+ import type { Board } from "../model.js";
2
+ export declare const boards: Board[];
@@ -0,0 +1,12 @@
1
+ import { raspberryPi5 } from "./raspberry-pi-5.js";
2
+ import { raspberryPiPico } from "./raspberry-pi-pico.js";
3
+ import { raspberryPiPicoW } from "./raspberry-pi-pico-w.js";
4
+ import { arduinoUnoR3 } from "./arduino-uno-r3.js";
5
+ import { esp32DevkitV1 } from "./esp32-devkit-v1.js";
6
+ export const boards = [
7
+ raspberryPi5,
8
+ raspberryPiPico,
9
+ raspberryPiPicoW,
10
+ arduinoUnoR3,
11
+ esp32DevkitV1,
12
+ ];
@@ -0,0 +1,3 @@
1
+ import type { Header } from "../model.js";
2
+ export declare function picoEdgeHeader(): Header;
3
+ export declare function picoDebugHeader(swdName: string): Header;