Skip to content

slim bridge: SAMD21/SAMD51 clocked SPI + clockless (channels API present; SAM excluded) #4593

Closed

Description

@zackees

Files:

  • src/platforms/arm/d21/clockless_arm_d21.h
  • src/platforms/arm/d51/clockless_arm_d51.h
  • src/platforms/arm/sam/clockless_arm_sam.h
  • src/platforms/arm/sam/clockless_block_arm_sam.h

FASTLED_HAS_CHANNELS is 1 for SAMD. Check whether a channel driver exists to back a Bridged conversion; otherwise use Direct.

Part of #4580. Follow the slim bridge format, the gap register (A1-A12) and the testing plan (T0-T4) there. Acceptance: the T1 conformance suite passes, a same-SHA bash bloat before/after is recorded, and AutoResearch evidence is included where hardware is available.

Activity

  1. zackees commented on Sep 25, 2026

    @zackees
    MemberAuthor

    Exempt per the decision recorded in #4590: this platform's legacy clockless path links no channel code, so the slim bridge has nothing to remove, and bridging would add ChannelManager. Reopen if its legacy controller adopts a channel driver.

  2. moved this from Triage to Done in FastLED Trackeron Sep 25, 2026
  3. zackees commented on Sep 25, 2026

    @zackees
    MemberAuthor

    Reopened under follow-up meta #4601. The exemption in #4590 is being re-evaluated per platform by measurement rather than applied as a blanket rule.

  4. zackees commented on Sep 25, 2026

    @zackees
    MemberAuthor

    Measured on origin/master e61aae4f0d, Blink, bash bloat <board> --build. The channel-symbol check greps .build/symbols/<board>/report.json for ChannelManager, fl::Channel::, ChannelData and IChannelDriver.

    Channel driver: no clockless one. FASTLED_HAS_CHANNELS is 1 for SAMD, but init_channel_driver_samd21.cpp.hpp and init_channel_driver_samd51.cpp.hpp register only the unified SPI adapter (SpiChannelEngineAdapter over SpiHw2/SpiHw4). No IChannelDriver or BusTraits exists for clockless on d21/d51/sam, and SAM (Due) has no channel support at all. The legacy clockless headers do not reference channel types. The shared BitBangChannelDriver (shared/bitbang) is not registered on any platform.

    Board Flash RAM Channel symbols
    samd21_zero 49,581 B 4,481 B none
    metro_m4 (SAMD51) 43,765 B 3,767 B none
    sam3x8e_due 5,334 B 2,298 B none

    Decision: keep as-is and close as not planned (per the #4601 rule). There is no channel engine to bridge onto, and no channel code is linked. The only option left is a "Direct" DriverTraits reshuffle of the same timing-critical bit-bang code. It would not save flash and could not be hardware-validated. Reopen if a hardware channel engine (DMA, PIO-like or UART) lands for this family.

  5. moved this from Triage to Done in FastLED Trackeron Sep 25, 2026
  6. zackees commented on Sep 25, 2026

    @zackees
    MemberAuthor

    Reopened: this platform has the channels API, so it moves to the slim bridge (maintainer decision; the earlier "exempt" closure only looked at clockless and missed the existing channel support). FASTLED_HAS_CHANNELS=1 here, and init_channel_driver_* registers a SPI channel adapter.

    Scope:

    1. Clocked SPI (APA102, SK9822, …). This currently uses the legacy SPIOutput, because FASTLED_SPI_USES_CHANNEL_API=0. Move it onto the slim SPI bridge (SlimSpiBridgeController, feat(spi): slim SPI bridge controller for clocked addLeds<> (#4585) #4613) over the existing SPI channel adapter.
    2. Clockless (WS2812, …). There is no clockless channel engine yet. Either wrap the platform's existing bit-bang controller as an IChannelDriver, or register the shared BitBangChannelDriver (platforms/shared/bitbang). Then use fl::SlimBridgeController.

    Acceptance: same-SHA bash bloat before and after for Blink and an APA102 example on a representative board, lint and tests pass, and the compile matrix passes. Hardware validation is deferred (#4623 pattern).

  7. moved this from Done to Triage in FastLED Trackeron Sep 25, 2026
  8. changed the title [-]slim bridge: SAMD21/SAMD51/SAM clockless[/-] [+]slim bridge: SAMD21/SAMD51 clocked SPI + clockless (channels API present; SAM excluded)[/+] on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions