Skip to content

feat(rp): add PIO RX lifecycle backend - #3663

Merged
zackees merged 1 commit into
masterfrom
feat/rp2040-phase1-pio-rx
Jul 15, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/rp2040-phase1-pio-rx

Conversation

@zackees

@zackees zackees commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add RxBackend::PIO and RxDeviceType::PIO
  • select a real RP PIO RX lifecycle device for RP platform default
  • claim/release PIO state machine, DMA channel, and input pin transactionally
  • support rebegin, wait, raw-edge reads, injected-edge decode, and host factory coverage

Validation

  • bash test tests/fl/channels/rx.cpp
  • uv run --no-sync python ci/lint_cpp/run_all_checkers.py --no-rust

fbuild build-only validation is currently blocked by the separately documented daemon stall in FastLED/fbuild#1040; no alternate build tool was used.

Closes #3654

Summary by CodeRabbit

  • New Features

    • Added PIO as a receiver and capture backend option.
    • Added PIO-based signal capture support for RP2040/RP2350 devices.
    • RP platforms now select PIO as the default receiver backend.
    • Added edge capture, decoding, lifecycle controls, and raw timing access for PIO receivers.
  • Tests

    • Added coverage for PIO channel configuration, lifecycle handling, edge injection, and captured timing data.

@zackees
zackees merged commit 7b58298 into master Jul 15, 2026
8 of 11 checks passed
@zackees
zackees deleted the feat/rp2040-phase1-pio-rx branch July 15, 2026 11:33
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6c990ec6-bad5-41bf-8b61-f9b1ce44c7a6

📥 Commits

Reviewing files that changed from the base of the PR and between a878e2c and d531525.

📒 Files selected for processing (8)
  • src/fl/channels/rx.cpp.hpp
  • src/fl/channels/rx.h
  • src/fl/channels/rx/channel.cpp.hpp
  • src/fl/channels/rx/types.h
  • src/platforms/arm/rp/rpcommon/_build.cpp.hpp
  • src/platforms/arm/rp/rpcommon/rx_pio_channel.cpp.hpp
  • src/platforms/arm/rp/rpcommon/rx_pio_channel.h
  • tests/fl/channels/rx.cpp

📝 Walkthrough

Walkthrough

Adds a PIO RX backend enum and factory path, routes RP platforms to RpPioRxDevice, implements RP PIO/DMA lifecycle and edge handling, wires the unity build, and adds host lifecycle tests.

Changes

RP PIO RX backend

Layer / File(s) Summary
PIO backend contract and dispatch
src/fl/channels/rx/types.h, src/fl/channels/rx.h, src/fl/channels/rx/channel.cpp.hpp, src/fl/channels/rx.cpp.hpp
Adds PIO backend identifiers, string conversions, factory creation, RP platform-default routing, and backend dispatch.
RP PIO device lifecycle and capture
src/platforms/arm/rp/rpcommon/rx_pio_channel.h, src/platforms/arm/rp/rpcommon/rx_pio_channel.cpp.hpp, src/platforms/arm/rp/rpcommon/_build.cpp.hpp
Defines and implements RpPioRxDevice with PIO/DMA/GPIO resource handling, lifecycle control, waiting, edge injection, raw edge access, and decoding.
PIO lifecycle validation
tests/fl/channels/rx.cpp
Tests PIO backend selection and stub edge injection, completion, and retrieval behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

  • FastLED/FastLED issue 3656 — Specifies production DMA/FIFO behavior for the same RP PIO RX implementation.
  • FastLED/FastLED issue 3647 — Covers the RP2040 PIO-based RxChannel to RxDevice capture backend.
  • FastLED/FastLED issue 3655 — Focuses on qualifying the RpPioRxDevice edge-detection implementation and tests.
  • FastLED/FastLED issue 3653 — Establishes the PIO/DMA resource manager used by RpPioRxDevice.
  • FastLED/FastLED issue 3631 — Proposes PIO loopback and timing validation enabled by this backend.

Possibly related PRs

  • FastLED/FastLED#3662 — Refactors centralized PIO/DMA/GPIO ownership through RpPioDmaResourceManager, which this backend uses.

Sequence Diagram(s)

sequenceDiagram
  participant RxChannel
  participant RpPioRxDevice
  participant RpPioDmaResourceManager
  participant decodeWs2812Edges
  RxChannel->>RpPioRxDevice: begin(RxConfig)
  RpPioRxDevice->>RpPioDmaResourceManager: claim PIO, DMA, and GPIO
  RpPioDmaResourceManager-->>RpPioRxDevice: resource handles
  RxChannel->>RpPioRxDevice: wait(timeout_ms)
  RxChannel->>RpPioRxDevice: decode(timing, out)
  RpPioRxDevice->>decodeWs2812Edges: decode stored edge timestamps
  decodeWs2812Edges-->>RpPioRxDevice: decoded result
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/rp2040-phase1-pio-rx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feat(rp2040): phase 1 — instantiate PIO RX backend

1 participant