Skip to content

feat: v2.3.0 — GPIO & SPI endpoints (§Phase 13 milestone 47) - #40

Merged
SoundMatt merged 1 commit into
mainfrom
feat/milestone-47-gpio-spi
Jul 28, 2026
Merged

SoundMatt merged 1 commit into
mainfrom
feat/milestone-47-gpio-spi

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

Implements ROADMAP.md milestone 47, "Basic Endpoint Types I — GPIO & SPI (v2.3.0)" — the first two concrete endpoint types on top of the v2.0.0-v2.2.0 wire/lifecycle/regmap/discovery core, and the milestone that establishes the reusable endpoint-registration/request-dispatch pattern every later endpoint type (v2.4.0, v2.7.0) is expected to reuse.

  • include/rcp/endpoint.hpp (new): shared scaffolding — ep_type id constants, the 8-way evt[2:0] write-semantics decode (Replace/Or/And/Xor/Reserved/Add/Subtract/Reconfigure), the saturating add/subtract helpers GPIO and PWM_OUT (v2.4.0) share, apply_bitmask_write for the six value-combining semantics, and a generic TriggerRegistry trigger-signal table.
  • include/rcp/gpio.hpp (new): GPIO (ep_type 0x02) — 4-byte big-endian pin bitmask payload, apply_gpio_write completing the 8-way semantics (Reconfigure retargets a pin-direction mask), per-pin change/rising/falling trigger signals, a functional-config codec against regmap::EndpointFunctionalConfig's opaque blob, and GpioEndpoint.
  • include/rcp/spi.hpp (new): SPI (ep_type 0x03) — channel_of decoding evt[2:0] as a 0-5 channel selector, SpiEndpoint::transfer for raw full-duplex PICO-out/POCI-in byte exchange with CsAssert/TransferComplete/CsDeassert trigger signals, and compound_wait_matches implementing the compound-wait status-byte truncation rule (scaffolding for v2.5.0).
  • New tests: tests/test_endpoint.cpp (REQ-ENDPOINT-001..006), tests/test_gpio.cpp (REQ-GPIO-001..008), tests/test_spi.cpp (REQ-SPI-001..005) — 19 new .fusa-reqs.json entries, all traced.
  • Version bump to 2.3.0 (version.hpp, CMakeLists.txt), and ROADMAP.md milestone 47 now carries a "Done (v2.3.0)" note following the milestone 44-46 precedent.

Per the legal constraint on the confidential OPEN Alliance TC18 spec PDF, all behavior above is this implementation's own original encoding — no spec text is reproduced in code, comments, or this description.

Test plan

  • cmake --build (Debug, C++17, clang) — full project builds clean
  • ctest — all 48 test binaries pass, including the 3 new ones (rcp_endpoint, rcp_gpio, rcp_spi)
  • cpp-rcp CLI target still builds (RELAY_BUILD_CLI=ON) — unaffected, since it doesn't touch the new headers
  • CI (GitHub Actions): build-and-test matrix, relay-conform, clang-tidy, coverage, cpp-FuSa suite (check/lint/analyze/cyber/trace/verify/qualify/vuln/impact/report)

Adds rcp/endpoint.hpp: shared endpoint-registration and request-dispatch
scaffolding for every combinable-payload endpoint type — ep_type id
constants, the 8-way evt[2:0] write-semantics decode
(Replace/Or/And/Xor/Reserved/Add/Subtract/Reconfigure), saturating
add/subtract helpers generic over the caller's unsigned integer width,
apply_bitmask_write covering the six value-combining semantics, and
TriggerRegistry, a generic enable/notify/drain trigger-signal table.

Adds rcp/gpio.hpp: GPIO (ep_type 0x02) — a 4-byte big-endian pin bitmask
payload, apply_gpio_write completing the 8-way semantics (Reconfigure
retargets a separate pin-direction mask instead of the pin-value bitmask),
per-pin change/rising/falling trigger signals over TriggerRegistry, a
functional-config codec interpreting regmap::EndpointFunctionalConfig's
previously-opaque blob, and GpioEndpoint tying it into one request-dispatch
entry point.

Adds rcp/spi.hpp: SPI (ep_type 0x03) — channel_of decoding evt[2:0] as a
0-5 channel selector (SPI's own repurposing of that field, distinct from
GPIO's write-semantics use of it), SpiEndpoint::transfer recording a raw
full-duplex PICO-out/POCI-in byte exchange per channel and firing
CsAssert/TransferComplete/CsDeassert trigger signals in observation order,
and compound_wait_matches implementing the compound-wait status-byte
truncation rule (first 4 of up to 20 status bytes) as forward-looking
scaffolding for the v2.5.0 compound-wait request kind.

New coverage in tests/test_endpoint.cpp (REQ-ENDPOINT-001..006),
tests/test_gpio.cpp (REQ-GPIO-001..008), and tests/test_spi.cpp
(REQ-SPI-001..005), traced in .fusa-reqs.json.

Bumps version.hpp and the CMake project version to 2.3.0, and adds
ROADMAP.md milestone 47's "Done (v2.3.0)" note following the milestone
44-46 precedent.

Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt merged commit 59d6f58 into main Jul 28, 2026
38 of 39 checks passed
@SoundMatt
SoundMatt deleted the feat/milestone-47-gpio-spi branch July 28, 2026 17:05
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