Skip to content

docs: fix TC18.txt citation drift in gpio.rs/i2c.rs/lifecycle.rs/lin.rs/pwm.rs/timestamp.rs doc comments (issue #164 batch 2) - #166

Merged
SoundMatt merged 1 commit into
mainfrom
docs/tc18-citation-drift-batch2
Aug 20, 2026
Merged

docs: fix TC18.txt citation drift in gpio.rs/i2c.rs/lifecycle.rs/lin.rs/pwm.rs/timestamp.rs doc comments (issue #164 batch 2)#166
SoundMatt merged 1 commit into
mainfrom
docs/tc18-citation-drift-batch2

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

Batch 2 of #164: re-verifies every TC18.txt line-number and table/figure-number citation in src/gpio.rs, src/i2c.rs, src/lifecycle.rs, src/lin.rs, src/pwm.rs, src/timestamp.rs doc comments (///, //!, and adjacent // test comments) against the current canonical TC18.txt (6095 lines), individually — not a uniform line-shift, mirroring #165 (batch 1: acf.rs/avtp.rs/can.rs).

Method: for each citation, the quoted/paraphrased spec text was located in current TC18.txt by exact-text grep, and the citation's line/table/figure number checked against what that number currently means in the spec (not just where the text moved to), to catch genuine renumbers, not only line shifts.

Doc-comment-only change — no behavior, test, or .fusa-reqs.json changes.

Before / after table

All line numbers below are 1-indexed absolute lines in the canonical TC18.txt at /Users/matt/Coding/SoundMatt/TC18.txt (6095 lines).

src/gpio.rs (~408-409-line drift + 2 genuine renumbers)

Old citation New citation Proof snippet (grep -n on TC18.txt)
TC18.txt line 4381 ("Each GPIO endpoint can handle up to 32 IOs") TC18.txt line 4789 4789: 5 Each GPIO endpoint can handle up to 32 IOs.
Figure 24 / TC18.txt lines 4389-4398 ("Each GPIO pin can be assigned to a bit position...") Figure 25 / TC18.txt lines 4797-4808 4797:13 Each GPIO pin can be assigned to a bit position of the byte_msg_payload: ... 4808:19 Figure 25 - GPIO request (example for EP with 24 pins). Genuine renumber: current Figure 24 is 4764:25 Figure 24 - SPI request (example to write 20 bytes...) — SPI's figure, not GPIO's.
TC18.txt line 4480 ("A request with data '0x0000 0000' and evt[2:0] = 0x001 (OR) results in 'no change'") TC18.txt line 4889 4889:11 A request with data "0x0000 0000" and evt[2:0] = 0x001 (OR) results in "no change".
TC18.txt lines 4403-4404 ("Generating a pulse for a defined time is NOT a function...") TC18.txt lines 4811-4812 4811:21 Generating a pulse for a defined time is NOT a function of the GPIO endpoint... 4812:22 Client (i.e. sending two commands...)
TC18.txt line 4402 ("(NAND, OR, XOR)") TC18.txt line 4810 4810:20 Output pins can be set to a defined state...by a logical operation (NAND, OR, XOR).
Table 30 / TC18.txt lines 3699-3702 (evt[2:0]=010b AND rule + worked example) Table 33 / TC18.txt lines 4098-4101 4116: 7 Table 33: EP specific usage of evt-field; row: 4098: 010b The "byte_msg_payload" bitwise AND "current interface status" ... 4100:...with a byte_msg_payload of 0xFFFF FFFE the first IO pin will be reset, 4101: while other IO pins remain unchanged). Genuine renumber: current Table 30 (3624 area / §13.4) is a removed section (<section removed, since content restructured>), not this table.
Table 30 (bare mentions, no line #, ×5: enum-variant doc, test docs, in-body test comments) Table 33 same proof as above

src/i2c.rs (~411-line drift + 1 genuine renumber)

Old citation New citation Proof snippet
Table 46 / TC18.txt lines 4815-4817 (i2c_mode: Standard/Fast/Fast-plus rows) Table 49 / TC18.txt lines 5226-5228 5235:12 Table 49: i2c functional configuration; rows 5226: 0: Standard Mode 100kbit/s, 5227: 1: Fast Mode 400kbit/s, 5228: ...2: Fast Mode plus 1Mbit/s. Genuine renumber: current Table 46 is 5012: 6 Table 46: pwmo functional configuration — PWM_OUT's table, not I²C's.
Table 46 / TC18.txt lines 4818-4819 (i2c_mode: duplicated High-speed rows) Table 49 / TC18.txt lines 5229-5230 5229: 3: High-speed mode 1.7Mbit/s, 5230: 3: High-speed mode 3.4Mbit/s
TC18.txt line 4830 ("The byte msg payload is the I2C payload including the address...") TC18.txt lines 5241-5242 5241:16 The byte msg payload is the I2C payload including the address. The I2C endpoint does not know whether there is a 7- or 5242:17 10-bit address, since the endpoint is just transparent.
(Figure 29) for I2C's own 10-bit-address/5-byte worked example (Figure 30) 5257: 2 Figure 30 – i2c request format, preceded by 5243:18 The example below shows a payload for an I2C transfer with 10bit address and 5 bytes data.Figure 29 is 5177: 7 Figure 29 – pwmi request format, PWM_IN's figure, not I2C's.

src/lifecycle.rs (~375-376-line drift, all clean once hand-verified)

Old citation New citation Proof snippet
TC18.txt line 2059 (×2 instances: RcServerState::INITIAL doc + test doc, quoting "After a power cycle or restart...shall start in the life-cycle state it is actually configured in" / "...may incorporate default settings...advanced state") TC18.txt line 2434 2434: 4 After a power cycle or restart, depending on the RC Server's implementation, the RC Server shall start in the life-cycle ... 2437: 7 but may incorporate default settings which allow it to be also starting in an advanced state.
TC18.txt lines 2065-2067 (three state-name bullets) TC18.txt lines 2440-2442 2440: 9 • HW_UNCONFIGURED 2441:10 • HW_CONFIGURED 2442:11 • RCP_CONFIGURED
TC18.txt line 2168 (is_transition_defined doc, quoting only "a request to advance the state directly to RCP_CONFIGURED will be rejected with an error response") TC18.txt line 2544 2544:13 HW_CONFIGURED. A request to advance the state directly to RCP_CONFIGURED will be rejected with an error response.
TC18.txt line 2168 (test doc, quoting both sentences: "per write request...svr_lifecycle_state...advanced to HW_CONFIGURED. A request to advance...") TC18.txt lines 2543-2544 2543:12 Per write request to the server functional configuration entry svr_lifecycle_state the life-cycle state can be advanced to 2544:13 HW_CONFIGURED. A request to advance the state directly to RCP_CONFIGURED will be rejected with an error response.

Note: the original audit (#164) flagged 3 of these as "not found." Hand-verification found all of them present and correctly quoted in current TC18.txt — the audit script's substring search couldn't match the spliced/paraphrased quotes (ellipses joining two separate sentences). No content was actually missing.

src/lin.rs (~416-line drift + 1 genuine renumber, LIN Table 33 Row-2 material from prior PR untouched)

Old citation New citation Proof snippet
TC18.txt line 5304 (×3 instances: module doc, encode() doc, test comment — "the Byte Msg Payload is the payload to be used on the Lin bus") TC18.txt line 5720 5720:15 The Byte Msg Payload is the payload to be used on the Lin bus.
Figure 38 (×2, module doc + test doc: LIN's own "Lin payload + padding" wire layout) Figure 39 5736:18 Figure 39 – lin request format. Genuine renumber: current Figure 38 is 5671:14 Figure 38 – adc response frame format — ADC's figure, not LIN's (LIN's own already-correct bare Figure 39 mention elsewhere in this file, with no line number, was left untouched).
TC18.txt lines 5276-5277 (evt[2:0]/op=0 match-and-reply, not implemented) TC18.txt lines 5692-5693 5692: 5 ...the LIN endpoint checks each received message against 5693: 6 the byte_msg_payload and if a match under the conditions given by evt[2:0] is found a reply is sent if op = 0.
TC18.txt line 5278 (trigger-on-finalize, not implemented) TC18.txt line 5694 5694: 7 The LIN EP issues a trigger when a transmission has been finalized, and the configured trailing time has expired...
TC18.txt line 5279 (cyclic-trigger pattern, not implemented) TC18.txt line 5695 5695: 8 configured with a repeated trigger request on its own trigger can be used to cyclically send messages on the Lin bus.
Table 52 / TC18.txt lines 5287-5298 (LIN functional-config register layout) Table 55 / TC18.txt lines 5697-5714 5714:11 Table 55: lin functional configuration, section starts 5697: 9 13.7.10.2 LIN EP functional configuration. Genuine renumber: current Table 52 is 5421:21 Table 52: uart trigger signals — UART's table, not LIN's.
Figure 39's own worked example (bare, no line #) unchanged — already correct 5736:18 Figure 39 – lin request format confirms this was already right

src/pwm.rs (~408-411-line drift + 1 genuine renumber)

Old citation New citation Proof snippet
Table 45 / TC18.txt line 4721 (pwmi_err_on_max_period=0b: "invalidate measurement and wait for new active phase of signal") Table 48 / TC18.txt lines 5129-5131 5149: 4 Table 48: pwmi functional configuration; 5129: 0b: if MAX PERIOD is exceeded, 5130: invalidate measurement and wait for 5131: new active phase of signal. Genuine renumber: current Table 45 is 4947:16 Table 45: pwmo trigger outputs — PWM_OUT's table, not PWM_IN's.
Table 45 / TC18.txt line 4735 (pwmi_max_period, relative address 0x000A, 16-bit) Table 48 / TC18.txt line 5146 5146: 0x000A pwmi_max_period 16 bit R/W exceeded measurement is invalid - err
TC18.txt line 4758 ("both measured values are 16-bit") TC18.txt line 5169 5169: 3 The PWM_IN request and response contain two 16 bit values in the payload.

Figure 29 (bare, no line #, PWM_IN's own request format) was already correct — confirmed 5177: 7 Figure 29 – pwmi request format — left unchanged.

src/timestamp.rs (~376-377-line drift, all clean)

Old citation New citation Proof snippet
TC18.txt lines 1952-1953 (AvtpTimestamp doc, avtp_timestamp formula, "rolls over every 4 seconds") TC18.txt lines 2328-2329 2328:11 avtp_timestamp = (AS_sec × 10^9 + AS_ns) mod 2^32 where AS_sec is the gPTP seconds field and AS_ns is the 2329:12 gPTP nanoseconds field (thus rolls over every 4 seconds)
TC18.txt lines 1954-1955 (MessageTimestamp doc, message_timestamp formula, "rolls over every 584,9 years") TC18.txt lines 2331-2332 2331:14 used. message_timestamp = (AS_sec × 10^9 + AS_ns) mod 2^64 where AS_sec is the gPTP seconds field and 2332:15 AS_ns is the gPTP nanoseconds field (thus rolls over every 584,9 years)
TC18.txt lines 1952-1955 (test doc, both moduli) TC18.txt lines 2328-2332 union of the two ranges above (covers the intervening "2. For capture time stamps..." sentence at line 2330)

Unresolved citations

None. Every citation in these six files was individually re-located in current TC18.txt with the quoted text matching verbatim (aside from immaterial apostrophe/quote-glyph encoding differences). No genuine content removal or RC4→RC5 rewording was found in this batch's scope — that pattern is confirmed to exist in e2e.rs instead, which is explicitly out of scope for this batch per #164.

Verification

  • cargo build: clean.
  • cargo test --lib: 1168 passed; 0 failed (same count as batch 1's baseline in docs: fix TC18.txt citation drift in acf.rs/avtp.rs/can.rs doc comments (issue #164 batch 1) #165 — doc-comment-only change, no behavior affected).
  • cargo fmt --check: clean.
  • git diff --stat against main: only the six target files changed (src/gpio.rs, src/i2c.rs, src/lifecycle.rs, src/lin.rs, src/pwm.rs, src/timestamp.rs) — 52 insertions / 52 deletions total.
  • No .fusa-reqs.json changes, no public API changes.

Scope note

Per #164, the following remain explicitly out of scope for this batch and are left for later batches: discovery.rs/request.rs (smaller, distinctly-sized drift), e2e.rs (needs close reading for genuine RC4→RC5 content rewording), and mdio.rs's one remaining stale citation.

Not merging this myself — leaving open for independent review, since the reviewer is expected to re-check every citation above against the same canonical TC18.txt.

…rs/pwm.rs/timestamp.rs doc comments (issue #164 batch 2)

Batch 2 of issue #164: re-verifies every TC18.txt line-number and
table/figure-number citation in these six files' doc comments (///,
//!, and adjacent // test comments) against the current canonical
TC18.txt, individually — not a uniform line-shift.

- src/gpio.rs: 6 line citations updated (~408-409-line drift,
  confirmed). Two genuine renumbers found and fixed: Figure 24 (now
  SPI's own request-format figure) -> Figure 25 for GPIO's request
  figure; Table 30 (now GPIO's own AND/pin-reset row lives at a
  different location) -> Table 33 for the per-endpoint evt-field
  table, fixed everywhere it's mentioned in this file (doc comments
  and adjacent test-body comments), including two more Figure 24
  mentions the initial pass missed.
- src/i2c.rs: 3 line citations updated (~411-line drift, confirmed).
  Table 46 -> Table 49 (i2c functional configuration table renumbered,
  not just shifted — Table 46 is now pwmo functional configuration).
  Also fixed a mislabeled worked-example figure reference: "(Figure
  29)" for I2C's own 10-bit-address/5-byte worked example -> Figure
  30 (Figure 29 is PWM_IN's own request figure, not I2C's).
- src/lifecycle.rs: 5 citation instances (3 duplicate quotes of 2
  distinct line anchors, plus one list-range) updated, ~375-line
  drift confirmed for all. None were genuinely missing content —
  the issue's "3 not-found" flags were the audit script failing to
  match spliced/elided quotes ("After a power cycle ... configured
  in", "... may incorporate default settings ... advanced state"),
  not real content loss; hand-verified against current TC18.txt
  §12.3/§12.3.1.1 line by line.
- src/lin.rs: line citations updated (~416-line drift, confirmed).
  Table 52 -> Table 55 (LIN's functional-config table renumbered;
  Table 52 is now uart trigger signals). Figure 38 -> Figure 39 in
  two more places (Figure 38 is now ADC's response-frame figure, not
  LIN's request-format figure — LIN's own figure, already correctly
  cited elsewhere in this same file with no line number, is Figure
  39). The correct, already-existing LIN-specific Table 33 Row-2
  material from a prior PR is untouched.
- src/pwm.rs: line citations updated (~408-411-line drift, confirmed).
  Table 45 -> Table 48 (Table 45 is now pwmo trigger outputs, not the
  PWM_IN functional-config table pwmi_err_on_max_period/
  pwmi_max_period live in).
- src/timestamp.rs: all 3 citations updated (~376-377-line drift,
  confirmed) for the avtp_timestamp/message_timestamp rollover-period
  formulas in TC18 §11.4.1.

Not resolved / nothing left unresolved: every citation in these six
files was individually re-locatable in current TC18.txt with the
quoted text matching verbatim (module apostrophe-encoding aside);
no genuine content removal or rewording was found in this batch's
scope (unlike e2e.rs's RC4->RC5 rewording, out of scope here).

Doc-comment-only change: cargo build/cargo test --lib unaffected
(1168 tests pass, unchanged count from batch 1), cargo fmt --check
clean, no public API surface change.

Signed-off-by: SoundMatt <47545907+SoundMatt@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: SoundMatt <47545907+SoundMatt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant