Skip to content

feat: v2.4.0 — Basic Endpoint Types II: I2C, UART, ADC, PWM_OUT, PWM_IN - #41

Merged
SoundMatt merged 1 commit into
mainfrom
feat/v2.4.0-basic-endpoints-ii
Jul 28, 2026
Merged

SoundMatt merged 1 commit into
mainfrom
feat/v2.4.0-basic-endpoints-ii

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

Implements ROADMAP.md milestone 48 ("Basic Endpoint Types II — I2C, UART, ADC, PWM_OUT, PWM_IN", v2.4.0), building on milestone 47's (v2.3.0) endpoint-registration/request-dispatch scaffolding (rcp/endpoint.hpp, rcp/gpio.hpp, rcp/spi.hpp).

  • I2C (rcp/i2c.hpp, ep_type 0x04): controller-only raw byte-stream transfer with address bytes included, compound_wait_matches_bits (an arbitrary-bit-sequence match, distinct from SPI's fixed 4-of-20-byte truncation), and i2c_mode_of deliberately decoding only the coarse hs high-speed bit — the finer i2c_mode speed-grade mapping is flagged as an explicit open item in comments rather than guessed at, per the roadmap's own instruction.
  • UART (rcp/uart.hpp, ep_type 0x05): independent TX/RX queues, RX FIFO fill/drain, read_size-or-uart_timeout read completion, payload-less "pure" reads, and sub-octet bit-width padding. The RX FIFO and read_size are bounded to a documented single-AVTPDU accepted limitation, tied explicitly to milestone 52's already-final fragmentation no-go decision.
  • ADC (rcp/adc.hpp, ep_type 0x09): the three-level averaging model (adc_sample_interval → adc_avg_intervals_per_request → adc_combine_avg_values), request-driven sampling only, two self-triggering cadence patterns (SelfTimed and ExternalTrigger, the latter keyed to PWM_IN's mid-pulse signal), and a no-signal error path analogous to PWM_IN_NO_SIGNAL.
  • PWM_OUT / PWM_IN (rcp/pwm.hpp, ep_type 0x07/0x08): a shared period/active_duration payload; PwmOutEndpoint reuses rcp::endpoint::apply_bitmask_write directly (so GPIO's saturating add/subtract rule applies without re-derivation); PwmInEndpoint is a response-only read model with PWM_IN_NO_SIGNAL and a mid-pulse trigger signal.

rcp/endpoint.hpp gains real EndpointTypeId constants for all five types, replacing the comment placeholder left by v2.3.0. Version bumped to 2.4.0. ROADMAP.md milestone 48 gets a Done (v2.4.0): summary in the same style as milestone 47's.

No spec text is reproduced anywhere — comments describe behavior only, citing "OPEN Alliance TC18 Remote Control Protocol Specification v0.5.1_RC" by name per this project's existing convention.

Test plan

  • cmake --build build --parallel — full clean build with Apple clang (/usr/bin/clang++), 0 errors
  • ctest --test-dir build — 52/52 tests pass (100%), including the 4 new suites (test_i2c, test_uart, test_adc, test_pwm)
  • cpfusa check / lint / cyber / trace --req-coverage 100 — all exit 0, 0 errors (new REQ-I2C-/REQ-UART-/REQ-ADC-/REQ-PWM- entries added to .fusa-reqs.json, all traced impl+test)
  • cpfusa verify — 52/52 tests, .fusa-evidence.json written successfully
  • relay conform --strict build/cpp-rcp — PASS (§12.1/§12.2/§12.3), CLI untouched by this change
  • CI (GitHub Actions) — pending, will monitor after opening this PR

…IN (§Phase 13 milestone 48)

Adds rcp/i2c.hpp, rcp/uart.hpp, rcp/adc.hpp, and rcp/pwm.hpp on top of the
endpoint-registration/request-dispatch scaffolding established in v2.3.0
(rcp/endpoint.hpp, rcp/gpio.hpp, rcp/spi.hpp):

- I2C (ep_type 0x04): controller-only raw byte-stream transfer with address
  bytes included, an arbitrary-bit-sequence compound-wait match distinct
  from SPI's fixed truncation rule, and the i2c_mode high-speed enum
  ambiguity flagged as an explicit open item rather than guessed at.
- UART (ep_type 0x05): independent TX/RX queues, RX FIFO fill/drain,
  read_size-or-uart_timeout read completion, payload-less pure reads, and
  sub-octet bit-width padding; RX FIFO and read_size are bounded to a
  documented single-AVTPDU accepted limitation tying back to the
  fragmentation no-go decision (milestone 52).
- ADC (ep_type 0x09): the three-level averaging model, request-driven
  sampling only, two self-triggering cadence patterns (SelfTimed and
  ExternalTrigger, the latter keyed to PWM_IN's mid-pulse signal), and a
  no-signal error path analogous to PWM_IN_NO_SIGNAL.
- PWM_OUT (ep_type 0x07) / PWM_IN (ep_type 0x08): a shared period/
  active-duration payload; PWM_OUT reuses endpoint.hpp's write-semantics
  and saturating add/subtract directly; PWM_IN is a response-only read
  model with PWM_IN_NO_SIGNAL and a mid-pulse trigger signal.

endpoint.hpp gains real EndpointTypeId constants for all five types.
New coverage: tests/test_i2c.cpp, test_uart.cpp, test_adc.cpp, test_pwm.cpp
(REQ-I2C-*/REQ-UART-*/REQ-ADC-*/REQ-PWM-*, traced in .fusa-reqs.json).
Bumps kVersion/project version to 2.4.0. Updates ROADMAP.md with a
Done (v2.4.0) summary for milestone 48.

Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt merged commit d064c10 into main Jul 28, 2026
20 checks passed
@SoundMatt
SoundMatt deleted the feat/v2.4.0-basic-endpoints-ii branch July 28, 2026 17:37
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