1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Copyright (C) 2026 Piers Finlayson <piers@piers.rocks>
//
// MIT License
//! Physical jumper-header descriptor for One ROM boards.
//!
//! Describes the jumper / programming header at the top edge of a One ROM
//! board, column by column, so host tools (e.g. the web ROM Slot Builder) can
//! draw an accurate wireframe of which pads to jumper for image selection,
//! rather than assuming a single fixed layout that is wrong for older or
//! differently-shaped board revisions.
//!
//! The data is emitted as `const` board data by the build script and returned
//! by [`Board::jumper_header`](crate::hw::Board::jumper_header). It is purely a
//! description of the *physical* header; the electrical assignments (image-
//! select GPIOs, the SWD-multiplexed select pins, the X pins) continue to live
//! in the MCU pin arrays, and are cross-checked against this descriptor at
//! build time so the two cannot silently drift apart.
//!
//! # Model
//!
//! The header is a 2×N pin block: a top row and a bottom row of pads, grouped
//! into [`HeaderColumn`]s numbered from 1 at the board's left edge. Some boards
//! add an extra third-row pad below specific columns (the X pins), captured by
//! [`HeaderColumn::row3`]. Absent columns (e.g. a revision missing its
//! left-most 5V/GND pair) are simply omitted, so the columns that *are* present
//! keep their absolute positions and stay aligned across revisions when drawn.
/// A function carried by a single physical header pad.
///
/// A pad may carry up to two roles at once where a signal is multiplexed onto
/// it — for example an image-select line that doubles as an SWD debug pin.
/// The state of one pad position (row) within a [`HeaderColumn`].
/// One column of the header: a top/bottom pad pair, plus an optional third-row
/// pad on boards that have one.
///
/// Columns are numbered from 1 at the left edge of the board. [`Self::row1`] is
/// the top pad and [`Self::row2`] the bottom pad of the standard 2×N header;
/// [`Self::row3`] is an extra pad sitting below the column on boards with X
/// pins, and is `None` where no such pad physically exists.
/// Physical description of a board's jumper header.