33template <
bool PLATFORM_DEFAULT = !FL_PLATFORM_HAS_LARGE_MEMORY>
35#ifdef FL_SLIM_BRIDGE_DIRECT_SHOW
36 static constexpr bool value = (FL_SLIM_BRIDGE_DIRECT_SHOW != 0);
43template <
typename Traits>
45 Traits::rejectLegacyFrame();
48template <
typename Traits>
51template <
typename Traits>
56template <
typename Traits>
66template <
bool DIRECT_SHOW,
bool BATCHED = false>
71template <
bool BATCHED>
73 template <
typename DriverTraits>
79 template <
typename DriverTraits>
87 template <
typename DriverTraits>
91 template <
typename DriverTraits>
100 template <
typename DriverTraits>
147 bool BATCHED_DIRECT_SHOW =
false>
158 if (WAIT_TIME > 0 &&
static_cast<u32
>(WAIT_TIME) > timing.
reset_us) {
159 timing.
reset_us =
static_cast<u32
>(WAIT_TIME);
167 mData->setExtraZeroBitsPerByte(
static_cast<u8>(XTRA0));
171 Policy::template attach<DriverTraits>();
180 Policy::template endShow<DriverTraits>();
194 if (!Policy::enabled(driver)) {
202 if (
mData->isInUse()) {
204 FL_WARN_ONCE(
"SlimBridgeController: driver '" << driver.
getName().
c_str() <<
"' did not become ready in time - dropping frame");
213 }
else if (this->
getRgbw().active()) {
219 const int pixelCount = pixels.size();
221 if (pixelCount < 0 || bytesPerPixel == 0 ||
222 static_cast<fl::size
>(pixelCount) >
static_cast<fl::size
>(-1) / bytesPerPixel) {
224 FL_WARN_ONCE(
"SlimBridgeController: invalid encoded frame size - dropping frame");
227 const fl::size expectedSize =
static_cast<fl::size
>(pixelCount) * bytesPerPixel;
228 auto &encoded =
mData->getData();
232 encoded.reserve(expectedSize);
233 if (encoded.capacity() < expectedSize) {
235 FL_WARN_ONCE(
"SlimBridgeController: cannot allocate encoded frame - dropping frame");
248 if (encoded.size() != expectedSize) {
251 FL_WARN_ONCE(
"SlimBridgeController: incomplete encoded frame - dropping frame");
256 Policy::afterEnqueue(driver);
Per-driver traits keyed on fl::Bus.
CPixelLEDController(RegistrationMode mode) FL_NO_EXCEPT
Protected constructor with registration mode.
Rgbww getRgbww() const FL_NO_EXCEPT
VIRTUAL_IF_NOT_AVR void endShowLeds(void *data) FL_NO_EXCEPT
Rgbw getRgbw() const FL_NO_EXCEPT
static ChannelDataPtr create(const ChipsetVariant &chipset, fl::vector_psram< u8 > &&encodedData=fl::vector_psram< u8 >(), ChannelPixelFormat pixelFormat=ChannelPixelFormat::RGB) FL_NO_EXCEPT
Create channel transmission data (modern variant-based API)
static ChannelManager & registry() FL_NO_EXCEPT
Get the singleton WITHOUT registering platform default drivers.
bool isDriverEnabled(const char *name) const FL_NO_EXCEPT
Check if a driver is enabled by name.
virtual fl::string getName() const FL_NO_EXCEPT
Get the driver name for affinity binding.
virtual void enqueue(ChannelDataPtr channelData) FL_NO_EXCEPT=0
Enqueue channel data for transmission.
virtual void show() FL_NO_EXCEPT=0
Trigger transmission of enqueued data.
bool waitForReady(u32 timeoutMs=1000) FL_NO_EXCEPT
Wait for driver to become READY.
Minimal interface for LED channel transmission drivers.
void writeWS2812(CONTAINER_UIN8_T *out) FL_NO_EXCEPT
void endShowLeds(void *data) FL_NO_EXCEPT override
SlimBridgeController() FL_NO_EXCEPT
const ChannelDataPtr & channelData() const FL_NO_EXCEPT
Expose the underlying ChannelDataPtr for conformance tests.
SlimBridgeShowPolicy< DIRECT_SHOW, BATCHED_DIRECT_SHOW > Policy
virtual void onBeforeEncode(PixelController< RGB_ORDER > &pixels) FL_NO_EXCEPT
Called once per accepted frame, after the enabled/ready gates pass and BEFORE the frame is encoded an...
void showPixels(PixelController< RGB_ORDER > &pixels) FL_NO_EXCEPT override
void init() FL_NO_EXCEPT override
Initialize the LED controller.
const char * c_str() const FL_NO_EXCEPT
defines the templated version of the CLEDController class
Channel transmission data - lightweight DTO for driver transmission.
Non-templated low level pixel data writing class.
#define FL_WARN_ONCE(...)
Centralized logging categories for FastLED hardware interfaces and subsystems.
Unified manager for channel drivers with priority-based fallback.
auto reject_legacy_frame(int) FL_NO_EXCEPT -> decltype(Traits::rejectLegacyFrame(), void())
auto show_batched_legacy(int) FL_NO_EXCEPT -> decltype(Traits::showLegacy(), void())
void enable_clockless() FL_NO_EXCEPT
Compile-time linker keep-alive hook for a single fl::Bus.
u8 u8 fract8 blur_amount FL_NO_EXCEPT
constexpr ChipsetTimingConfig makeTimingConfig() FL_NO_EXCEPT
Convert compile-time CHIPSET type to runtime timing config.
@ PLATFORM_DEFAULT
Use the recommended backend for the active platform (RMT on ESP32; FlexPWM on Teensy 4....
u8 channelPixelFormatBytesPerPixel(ChannelPixelFormat format) FL_NO_EXCEPT
Base definition for an LED controller.
How a SlimBridgeController reaches its driver.
#define FL_STATIC_ASSERT(...)
Portable compile-time assertion wrapper.
u32 reset_us
Reset/latch time (microseconds)
Runtime bit-period timing for a clockless chipset.
static constexpr bool value
Preserve explicit build overrides while allowing a backend to choose its legacy default without chang...
static void afterEnqueue(IChannelDriver &) FL_NO_EXCEPT
static void endShow() FL_NO_EXCEPT
static void attach() FL_NO_EXCEPT
static bool enabled(IChannelDriver &driver) FL_NO_EXCEPT
static void attach() FL_NO_EXCEPT
static bool enabled(IChannelDriver &) FL_NO_EXCEPT
static void endShow() FL_NO_EXCEPT
static void afterEnqueue(IChannelDriver &driver) FL_NO_EXCEPT
static void endShow() FL_NO_EXCEPT
static void afterEnqueue(IChannelDriver &) FL_NO_EXCEPT