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
Conversation
…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>
This was referenced Aug 20, 2026
docs: fix TC18.txt citation drift in discovery.rs/request.rs + mdio.rs:130 (issue #164 batch 3)
#167
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Batch 2 of #164: re-verifies every
TC18.txtline-number and table/figure-number citation insrc/gpio.rs,src/i2c.rs,src/lifecycle.rs,src/lin.rs,src/pwm.rs,src/timestamp.rsdoc comments (///,//!, and adjacent//test comments) against the current canonicalTC18.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.txtby 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.jsonchanges.Before / after table
All line numbers below are 1-indexed absolute lines in the canonical
TC18.txtat/Users/matt/Coding/SoundMatt/TC18.txt(6095 lines).src/gpio.rs (~408-409-line drift + 2 genuine renumbers)
TC18.txt line 4381("Each GPIO endpoint can handle up to 32 IOs")TC18.txt line 47894789: 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-48084797: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: currentFigure 24is4764: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 48894889: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-48124811: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 48104810: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-41014116: 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: currentTable 30(3624area / §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 33src/i2c.rs (~411-line drift + 1 genuine renumber)
Table 46/TC18.txt lines 4815-4817(i2c_mode: Standard/Fast/Fast-plus rows)Table 49/TC18.txt lines 5226-52285235:12 Table 49: i2c functional configuration; rows5226: 0: Standard Mode 100kbit/s,5227: 1: Fast Mode 400kbit/s,5228: ...2: Fast Mode plus 1Mbit/s. Genuine renumber: currentTable 46is5012: 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-52305229: 3: High-speed mode 1.7Mbit/s,5230: 3: High-speed mode 3.4Mbit/sTC18.txt line 4830("The byte msg payload is the I2C payload including the address...")TC18.txt lines 5241-52425241:16 The byte msg payload is the I2C payload including the address. The I2C endpoint does not know whether there is a 7- or5242: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 by5243:18 The example below shows a payload for an I2C transfer with 10bit address and 5 bytes data.—Figure 29is5177: 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)
TC18.txt line 2059(×2 instances:RcServerState::INITIALdoc + 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 24342434: 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-24422440: 9 • HW_UNCONFIGURED2441:10 • HW_CONFIGURED2442:11 • RCP_CONFIGUREDTC18.txt line 2168(is_transition_defineddoc, quoting only "a request to advance the state directly to RCP_CONFIGURED will be rejected with an error response")TC18.txt line 25442544: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-25442543:12 Per write request to the server functional configuration entry svr_lifecycle_state the life-cycle state can be advanced to2544: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)
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 57205720: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 395736:18 Figure 39 – lin request format. Genuine renumber: currentFigure 38is5671:14 Figure 38 – adc response frame format— ADC's figure, not LIN's (LIN's own already-correct bareFigure 39mention 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-56935692: 5 ...the LIN endpoint checks each received message against5693: 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 56945694: 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 56955695: 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-57145714:11 Table 55: lin functional configuration, section starts5697: 9 13.7.10.2 LIN EP functional configuration. Genuine renumber: currentTable 52is5421:21 Table 52: uart trigger signals— UART's table, not LIN's.Figure 39's own worked example(bare, no line #)5736:18 Figure 39 – lin request formatconfirms this was already rightsrc/pwm.rs (~408-411-line drift + 1 genuine renumber)
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-51315149: 4 Table 48: pwmi functional configuration;5129: 0b: if MAX PERIOD is exceeded,5130: invalidate measurement and wait for5131: new active phase of signal. Genuine renumber: currentTable 45is4947: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 51465146: 0x000A pwmi_max_period 16 bit R/W exceeded measurement is invalid - errTC18.txt line 4758("both measured values are 16-bit")TC18.txt line 51695169: 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 — confirmed5177: 7 Figure 29 – pwmi request format— left unchanged.src/timestamp.rs (~376-377-line drift, all clean)
TC18.txt lines 1952-1953(AvtpTimestampdoc, avtp_timestamp formula, "rolls over every 4 seconds")TC18.txt lines 2328-23292328:11 avtp_timestamp = (AS_sec × 10^9 + AS_ns) mod 2^32 where AS_sec is the gPTP seconds field and AS_ns is the2329:12 gPTP nanoseconds field (thus rolls over every 4 seconds)TC18.txt lines 1954-1955(MessageTimestampdoc, message_timestamp formula, "rolls over every 584,9 years")TC18.txt lines 2331-23322331:14 used. message_timestamp = (AS_sec × 10^9 + AS_ns) mod 2^64 where AS_sec is the gPTP seconds field and2332: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-2332Unresolved citations
None. Every citation in these six files was individually re-located in current
TC18.txtwith 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 ine2e.rsinstead, 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 --statagainstmain: 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..fusa-reqs.jsonchanges, 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), andmdio.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.