Skip to content

feat(rp2040): add single-lane PIO channel TX - #3666

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

zackees merged 1 commit into
masterfrom
feat/rp2040-phase5-pio-tx

Conversation

@zackees

@zackees zackees commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Part of #3658.

Implements the single-lane PIO TX foundation:

  • Bus FLEX_IO instances 0/1 bind to physical PIO0/PIO1.
  • Atomic PIO-SM/DMA/GPIO acquisition and full PIO program cleanup.
  • Exact byte-to-autopull-word packing without partial LED padding.
  • DMA BUSY, terminal PIO DRAINING, reset/latch, then READY.
  • Terminal completion requires DMA idle, TX FIFO empty, and PC stalled at the next blocking out instruction, proving the prior T3 low tail completed.

Does not close #3658: compatible 2/4/8-lane batching and physical RX-oracle proof remain tracked there.

Validation: bash test channel_engine_rp_pio --debug; bash test channel_engine_rp_pio --cpp; unified C++ lint with --no-rust.

Summary by CodeRabbit

  • New Features

    • Added RP2040/RP2350 PIO-based transmission support for clockless LED devices.
    • Enabled two FLEX I/O channels for PIO-driven output.
    • Added DMA-backed transmission with resource management and cleanup.
    • Improved transmission status handling, including completion and error reporting.
  • Tests

    • Added coverage for data transmission, lifecycle states, cleanup, and error handling.

@zackees
zackees merged commit 2001c8b into master Jul 15, 2026
8 of 11 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 15, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done 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: 0ab18537-8def-46b4-8e42-480375bd251b

📥 Commits

Reviewing files that changed from the base of the PR and between f87a354 and f6db6ad.

📒 Files selected for processing (11)
  • src/fl/channels/bus.h
  • src/platforms/arm/rp/rpcommon/_build.cpp.hpp
  • src/platforms/arm/rp/rpcommon/channel_engine_rp_pio.cpp.hpp
  • src/platforms/arm/rp/rpcommon/channel_engine_rp_pio.h
  • src/platforms/arm/rp/rpcommon/init_channel_driver_rp.cpp.hpp
  • src/platforms/arm/rp/rpcommon/irp_pio_tx_peripheral.h
  • src/platforms/arm/rp/rpcommon/rp_pio_dma_resource_manager.h
  • src/platforms/arm/rp/rpcommon/rp_pio_tx_bus_traits.h
  • src/platforms/arm/rp/rpcommon/rp_pio_tx_peripheral.cpp.hpp
  • src/platforms/arm/rp/rpcommon/rp_pio_tx_peripheral.h
  • tests/platforms/arm/rp/rpcommon/channel_engine_rp_pio.cpp

📝 Walkthrough

Walkthrough

Adds RP2040/RP2350 PIO clockless transmission through two FLEX_IO lanes, with DMA-backed peripheral control, transactional resource claims, channel lifecycle management, bus registration, and host lifecycle tests.

Changes

RP PIO clockless transmission

Layer / File(s) Summary
PIO TX contracts and resource claims
src/platforms/arm/rp/rpcommon/irp_pio_tx_peripheral.h, src/platforms/arm/rp/rpcommon/rp_pio_dma_resource_manager.h
Defines the injectable PIO TX interface and atomically claims PIO, DMA, and GPIO resources with rollback on failure.
PIO peripheral and DMA transmission
src/platforms/arm/rp/rpcommon/rp_pio_tx_peripheral.h, src/platforms/arm/rp/rpcommon/rp_pio_tx_peripheral.cpp.hpp
Builds timing-derived PIO programs, configures DMA, detects terminal completion, and releases PIO resources during teardown.
Channel engine lifecycle
src/platforms/arm/rp/rpcommon/channel_engine_rp_pio.h, src/platforms/arm/rp/rpcommon/channel_engine_rp_pio.cpp.hpp
Filters compatible channels, packs bytes into DMA words, sequences queued transmissions, applies latch timing, and handles cleanup and errors.
FLEX_IO wiring and validation
src/fl/channels/bus.h, src/platforms/arm/rp/rpcommon/rp_pio_tx_bus_traits.h, src/platforms/arm/rp/rpcommon/init_channel_driver_rp.cpp.hpp, src/platforms/arm/rp/rpcommon/_build.cpp.hpp, tests/platforms/arm/rp/rpcommon/channel_engine_rp_pio.cpp
Exposes two FLEX_IO instances, registers PIO drivers, includes the implementation in the unity build, and tests busy, draining, ready, and error transitions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#3662 — Introduces the centralized resource-ownership manager extended here with atomic PIO, DMA, and pin claiming.

Sequence Diagram(s)

sequenceDiagram
  participant ChannelManager
  participant ChannelEngineRpPio
  participant RpPioTxPeripheral
  participant RpPioDmaResourceManager
  ChannelManager->>ChannelEngineRpPio: enqueue and show clockless channel
  ChannelEngineRpPio->>RpPioTxPeripheral: configure pin and timing
  RpPioTxPeripheral->>RpPioDmaResourceManager: claim PIO, DMA, and pin
  ChannelEngineRpPio->>RpPioTxPeripheral: startTxDma packed words
  RpPioTxPeripheral-->>ChannelEngineRpPio: report terminal completion
  ChannelEngineRpPio-->>ChannelManager: return READY or ERROR
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-phase5-pio-tx

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 5 — PIO clockless TX

1 participant