Skip to content

Conversation

@u20p17
Copy link
Member

@u20p17 u20p17 commented Jan 3, 2026

No description provided.

… & console

Core enums/types:
- Add LedProtocol: SK6812_RGBCCT, WS2814_RGBCCT, WS2805_RGBCCT (12V, 400kHz)
- Add ColorOrder: RGBCCT, GRBCCT, RGBCTW, GRBCTW
- Extend ProtocolHelper: isRGBCCT(), hasWhiteChannel(), hasDualWhiteChannel()
- Add getBytesPerLed(ColorOrder) overload (returns 5 for 5-channel orders)

Power management:
-Extend LedCurrentProfile with warmWhiteMA/coolWhiteMA (5-arg profiles)
-Add profiles: SK6812_RGBCCT, WS2814_RGBCCT, WS2805_RGBCCT, CONSERVATIVE_5CH
-Update current calculations and default profile selection for 5-channel LEDs

setPixel / getPixel API:
- Add 5-channel setPixel(index, r, g, b, ww, cw) to IHardwareDriver, VirtualStrip, PhysicalStrip, Segment
- Add getPixel(index, r, g, b, ww, cw) to VirtualStrip and Segment
- Add hasDualWhiteChannel() to VirtualStrip and PhysicalStrip

Hardware drivers:
- pio_neopixel_serial: implement 5-channel setPixel() + buffer mapping for all 5-channel color orders
- rmt_neopixel_serial: implement 5-channel setPixel() + buffer mapping for all 5-channel color orders

Effects & utilities:
- Add IHardwareDriver helpers: kelvinToWWCW(), wwcwToKelvin(), kelvinToWWCWWithBrightness()
- Extend Segment/EffectConfig with primaryCW/secondaryCW and ww()/cw() accessors
- Update EffectSolid to use 5-channel setPixel() for RGBCCT

Console & polish:
- Update NeoPixelConsole protocol/color-order handling, help text, buffer format, and virtual strip creation for RGBCCT
- Update comments/docs/API references to RGBCCT naming
- Add RGBCCT (RGB+WW+CW) support with streaming approach
- Use 32-bit autopull with bswap for 5-byte LED data
- Add explicit bswap=false for RGB/RGBW DMA configuration
- Update IHardwareDriver.h with RGBCCT helper functions and color temperature utilities
Add support for 5-channel RGB+WarmWhite+CoolWhite LED strips (WS2805, SK6812-RGBCCT, WS2814).

PIO Implementation:
- Add WS2805 PIO program with 4-step cadence (4 cycles/bit @ 917kHz)
- Separate from standard WS2812B program (10 cycles/bit @ 800kHz)
- Dynamic protocol detection and program selection

DMA Implementation:
- RGBCCT: Send byte buffer directly with bswap=true (no separate dmaBuffer)
- Dynamic transfer size: 32-bit if aligned, else 16-bit or 8-bit
- Autopull threshold matches DMA transfer size
- RGB/RGBW: Unchanged (32-bit packed, bswap=false)

VirtualStrip:
- Add RGBCCT detection using ProtocolHelper::hasDualWhiteChannel()
- Route 5-channel pixels to PhysicalStrip::setPixel(r,g,b,ww,cw)
- Rename w/ww variables for clarity
The dedicated 4-cycle WS2805 PIO program had a T1L (low time after "1" bit)
of only ~270ns, which violated WS2805 timing requirements and caused
random white flashes that worsened over time.

Changes:
- Remove WS2805 4-cycle PIO program entirely
- Use standard 10-cycle WS2812B program for all protocols including WS2805
- Change WS2805 frequency from 917kHz to 800kHz (standard timing)
- Fix DMA: set transfer count before each transfer (was 0 after first)
- Fix RGBCCT buffer alignment: use aligned_alloc(4, ...) for bswap DMA
- Add dma_channel_abort() before reconfiguring for safety
- Simplify destructor to use single program reference

The WS2812B timing (~700/600ns for "1" bit) provides robust T1L of ~600ns
which is well within WS2805 decoder tolerance.
- Update BreathingEffect, PulseEffect, StrobeEffect with WW/CW channels
- Update EffectWipe for 5-channel primary and background colors
- Update TheaterChaseEffect with 5-channel support including fade mode
- Add RGBCCTTestEffect: 10-phase test pattern for 5-channel strips
  (R, G, B, WW, CW, RGB mix, whites mix, full RGBCCT, CCT gradient, all fade)
- Register RGBCCTTestEffect in EffectPool
Use _inst->actual_bitrate (computed value) instead of _inst->frequency
(target) to show the real output frequency in debug logs.

changes back gpio_set_drive_strength and gpio_set_slew_rate to aggressive settings (was wrongly commited)
Extended setPixel and setAll methods to support 5-channel RGBCCT
(RGB + warm white + cool white). Segment brightness scaling now
applies to all 5 channels for consistent dimming behavior.
- Added 5-channel RGBCCT current profiles table (WS2805, SK6812_RGBCCT, WS2814_RGBCCT)
- Documented Power Limit Modes (GLOBAL, PER_CHANNEL, PER_LED)
- Added Soft-Limiting (threshold-based gradual dimming)
- Documented Auto Brightness Cap feature
- Added Slew Rate Control for smooth transitions
- Documented Power Monitoring (requested vs. actual power)
- Updated Key Features section with Power Management summary
- Updated Table of Contents
Segment Effect Transformations:
- Add grouping: multiple physical LEDs show same color
- Add spacing: skip LEDs between groups (turn them off)
- Add reverse direction: run effects backwards
- Add mirror effect: symmetrical center-outward animations
- Add offset: shift effect start position with wrap-around
- Implement virtual vs physical length separation for effects
- Add mapVirtualToPhysical() helper for pixel mapping

Implementation Details:
- Replace _length with _physicalLength and _virtualLength
- Add _grouping, _spacing, _offset, _reverse, _mirror members
- Update setPixel/getPixel to handle transformations
- Add recalculateVirtualLength() for dynamic length updates

Documentation (README.md):
- Add "Segment Transformations" to Key Features
- Add console commands: grouping, spacing, reverse, mirror, offset
- Document Segment API with new transformation methods
- Add comprehensive transformation documentation with examples:
  - Visual diagrams for each transformation
  - Use cases and practical applications
  - Combined example showing all features
  - Virtual vs physical length explanation
- Update callback signature from (r,g,b,w) to (r,g,b,ww,cw)
- Pass separate warm white and cool white pointers based on buffer type
- Fix setPixel RGB overload to pass both 0 values for ww and cw
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.

2 participants