Repository navigation
feat(uart): waveN frame geometries — wave4 alongside wave10 with per-chipset selection (fixes #3574) - #3575
Conversation
…set selection (#3574) Generalize the UART clockless encoder from fixed wave10 (10-bit frame, 8 data bits, 5 pulses/LED-bit) to a geometry family selected per chipset timing. New wave8-frame geometry: 6 data bits + start/stop = 8-bit frame = 4 pulses/LED-bit at 20% lower baud. - Shared fitUartWave(timing, P) helper judges each geometry (baud cap, [1, P-1] pulse range, distinctness, 400 ns minimum symbol separation from #3572, quantization tolerance) — buildWave10Lut and canRepresentTiming can no longer drift apart. - Selection: lower total quantization error wins, with 50 ns hysteresis preferring wave10 so proven chipset shapes are stable: WS2812 / WS2812B-V5 / WS2811-400 unchanged; SK6812 upgrades to wave4 (T0H/T1H exact multiples of period/4 — 0 ns error vs 120 ns); LPD1886-class 1250 kHz chipsets become REPRESENTABLE (wave10 needs 6.25 Mbps > cap; wave4 fits at exactly 5.0 Mbps, 0 ns error). - Wave10Lut carries pulses_per_bit; baudRate()/dataBits() derive from the selected geometry. Driver re-inits the peripheral on word-length change; UartPeripheralConfig gains mDataBits (default 8); UartPeripheralEsp maps 5-8 data bits to UART_DATA_x_BITS. - AutoResearch: "SK6812" timing name added to runSingleTest resolution so the wave4 path is bench-testable. Bench (WROOM COM11, GPIO33->34): UART+WS2812B-V5 (wave10) 4/4 byte-exact; UART+SK6812 (wave4, 6 data bits @ 3.33 Mbps) 4/4 byte-exact — first wire-verified wave8-frame transmission. I2S/SPI regression 4/4 each. Host: 344/344, lint clean. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughGeneralizes the ESP32 UART clockless encoder from a fixed wave10 (P=5) frame geometry to support a second wave8-frame (P=4) geometry, selecting between them per-chipset via a shared feasibility/error-fitting helper. Propagates the selected UART data-bit width through the channel driver and peripheral, adds an SK6812 timing branch in an example, and updates tests. Estimated code review effort: 4 (Complex) | ~60 minutes ChangesUART waveN geometry generalization
Possibly related issues
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Fixes #3574. Follow-up to #3573 per bench review: wave10 (8 UART data bits = two LED bits × 4 controllable pulses, start/stop as fixed H/L bookends) is one point in a geometry family — this PR adds the wave4 sibling and picks per chipset.
What fits (investigated)
Concrete wins
Mechanics
Shared
fitUartWave(timing, P)judges each geometry (baud cap, pulse range [1, P−1], distinctness, the #3572 400 ns minimum symbol separation, quantization tolerance);buildWave10Lut()andcanRepresentTiming()both use it so admission and construction can't drift.Wave10Lutcarries the selectedpulses_per_bit; baud and UART word length derive from it; the driver re-inits the peripheral on geometry change;UartPeripheralEspmaps 5–8 data bits.Verification
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests