Skip to content

feat(spi): implement multi-lane SpiHw2/4/8/16 init and transposition in SpiChannelEngineAdapter - #5509

Merged
zackees merged 1 commit into
masterfrom
feat/spi-channel-adapter-multi-lane
Dec 3, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/spi-channel-adapter-multi-lane

Conversation

@zackees

@zackees zackees commented Dec 3, 2026

Copy link
Copy Markdown
Member

Implements Item #25 of #5492:

  • Complete multi-lane controller initialization in SpiChannelEngineAdapter::initializeControllerIfNeeded() for SpiHw2, SpiHw4, SpiHw8, and SpiHw16 (mapping active data pins and setting unused lanes to -1, with i8 pin bounds validation).
  • Update groupByClockPin() and selectControllerForClockPin() to batch channels sharing (clockPin, clockSpeedHz, requestedBus) with distinct data pins up to the matching bus's max lane width, while preserving sequential 1-lane routing on single-lane hosts.
  • Bit-interleave multi-lane batches in transmitBatch() via SPITransposer::transpose2/4/8/16 with DMA size overflow protection and proper setInUse(false) cleanup on failure.
  • Add unit tests covering 2/4/8/16-lane pin configuration, transposed DMA payload verification, unused lane -1 sentinels, and mixed single/multi-lane explicit host routing.

Validated with bash lint and bash test spi_channel_adapter --debug (ASAN/LSAN/UBSAN).

@coderabbitai

coderabbitai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 30f5632 and 419e6be.

Files selected for processing: 3

  • src/fl/channels/adapters/spi_channel_adapter.cpp.hpp
  • src/fl/channels/adapters/spi_channel_adapter.h
  • tests/unit/fl/channels/adapters/spi_channel_adapter.cpp
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Memory usage (this PR vs. its merge base)

Change in examples/Blink per target. The left number is this PR's image flash / attributed RAM in bytes; the colored delta is the change from the merge base (red ↑ is larger, green ↓ is smaller, Same is unchanged).

Target FLASH [bytes] RAM [bytes]
attiny85 2,460 (Same) 136 (Same)

@zackees
zackees added this pull request to the merge queue Dec 3, 2026
Merged via the queue into master with commit a70fe25 Dec 3, 2026
132 checks passed
@zackees
zackees deleted the feat/spi-channel-adapter-multi-lane branch December 3, 2026 04:38
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