summaryrefslogtreecommitdiff
path: root/src/board_memory.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/board_memory.zig')
-rw-r--r--src/board_memory.zig46
1 files changed, 10 insertions, 36 deletions
diff --git a/src/board_memory.zig b/src/board_memory.zig
index ac567b34..4bee9e6e 100644
--- a/src/board_memory.zig
+++ b/src/board_memory.zig
@@ -351,43 +351,17 @@ pub fn poke(p: *Pardes, id: usize, argument: []const u8) !void {
/// JP1, the 26-pin header down the left edge of the JC-ESP32P4-M3-DEV, as the board wears it: two
/// columns, odd pins on the left, even on the right, pin 1 at the top.
///
-/// READ OFF THE VENDOR SCHEMATIC, sheet 2 "Expand IO"
-/// (`01-esp32p4-m3/docs/schematics/2_EXPAND_IO&BAT.png`), which is the only document that carries
-/// this mapping - the specification PDF's "Interface Description" page is a marketing render, and
-/// there is no board user guide. The sheet is a 872x1168 raster, so the assignment was taken from
-/// the drawing's own geometry rather than by eye: thirteen wires leave each side of the symbol, a
-/// net wire runs ~100 px to its label and a power stub ~21 px, which is what identifies pin 8 as
-/// unconnected rather than as the first of the GPIO4x labels. Cross-checked against a second,
-/// independent source: `05-zig-p4/build.zig` has always documented `-Dled=20` as "JP1 pin 17", and
-/// GPIO20 lands on pin 17 here.
+/// MOVED TO `src/board_pins.zig`, where the thirteen rows are DATA and this drawing is rendered
+/// from them at comptime. Not for tidiness: the board's 9P image (`src/esp32p4_9p.zig`) links no
+/// core, so it cannot import this file — this one imports `pardes.zig` — and that image serves this
+/// exact drawing as `gpio/pinout` while generating its per-pin directories from the same rows. The
+/// alternative was transcribing a schematic twice, which is two things to maintain and no test that
+/// could say which one was wrong. The provenance moved with the rows: which sheet of which
+/// schematic, how pin 8 was identified as unconnected, and what `--`, `C6_*` and `ES_I2C_*` mean.
///
-/// `--` is a pin the header brings out with nothing behind it. `C6_*` are the ESP32-C6 companion's
-/// pads, not the P4's, and toggling a P4 GPIO cannot reach them. `ES_I2C_*` is the audio codec's
-/// bus, shared - driving either one by hand while the codec is live is a collision, which is a
-/// reason to know the pin is there rather than a reason to hide it.
-const pinout =
- \\JP1 header - 26 pins, pin 1 top left.
- \\Every number here is DECIMAL.
- \\
- \\ +---------+
- \\ 3V3 | 1 | 2 | 5V
- \\ 3V3 | 3 | 4 | 5V
- \\ GND | 5 | 6 | GND
- \\ GPIO 1 | 7 | 8 | --
- \\ GPIO 2 | 9 | 10 | GPIO 47
- \\ GPIO 3 | 11 | 12 | GPIO 46
- \\ GPIO 4 | 13 | 14 | GPIO 45
- \\ GPIO 5 | 15 | 16 | GND
- \\ GPIO 20 | 17 | 18 | 3V3
- \\ GPIO 32 | 19 | 20 | C6_U0RXD
- \\ GPIO 33 | 21 | 22 | C6_U0TXD
- \\ES_I2C_SDA | 23 | 24 | C6_IO9
- \\ES_I2C_SCL | 25 | 26 | C6_CHIP_PU
- \\ +---------+
- \\
- \\Gpio <pin> flips one: 0->1 or 1->0.
- \\
-;
+/// The test below is unchanged, and it is still the check that matters HERE: whoever renders this
+/// drawing, the `Gpio` word's output has to fit the board's own grid in two aligned columns.
+const pinout = @import("board_pins.zig").jp1_text;
/// `Gpio <pin>` flips one pad and says what it did; `Gpio` alone draws JP1.
///