feat(01-01): LED driver — dual strip initialization and output

- led_driver.h declares StripWand (NeoGrbwFeature/RMT) + StripSchrank (NeoWs2801Spi2MhzMethod)
- led_driver.cpp implements initStrips, showBothStrips, setAllWand/Schrank, applyBrightness helpers
- showBothStrips calls stripWand.Show() first (non-blocking DMA) then stripSchrank.Show() (blocking SPI)
- Brightness clamped to [0.0f, BRIGHTNESS_MAX] before scaling
This commit is contained in:
Claude
2026-04-03 13:15:41 +02:00
parent 6fe86bc310
commit 55aea7a46b
2 changed files with 77 additions and 0 deletions

18
firmware/src/led_driver.h Normal file
View File

@@ -0,0 +1,18 @@
#pragma once
#include <NeoPixelBus.h>
#include "config.h"
// SK6812: RGBW (4 bytes/LED) — MUST use NeoGrbwFeature, never NeoRgbFeature
using StripWand = NeoPixelBus<NeoGrbwFeature, NeoEsp32Rmt0Ws2812xMethod>;
// WS2801: RGB (3 bytes/LED), 2MHz SPI for cable-safe 5m run
using StripSchrank = NeoPixelBus<NeoRgbFeature, NeoWs2801Spi2MhzMethod>;
extern StripWand stripWand;
extern StripSchrank stripSchrank;
void initStrips();
void showBothStrips();
void setAllWand(RgbwColor color);
void setAllSchrank(RgbColor color);
RgbwColor applyBrightnessW(RgbwColor c, float factor);
RgbColor applyBrightnessR(RgbColor c, float factor);