34template <
bool PLATFORM_DEFAULT = !FL_PLATFORM_HAS_LARGE_MEMORY>
36#ifdef FL_SLIM_BRIDGE_DIRECT_SHOW
37 static constexpr bool value = (FL_SLIM_BRIDGE_DIRECT_SHOW != 0);
44template <
typename Traits>
46 Traits::rejectLegacyFrame();
49template <
typename Traits>
52template <
typename Traits>
57template <
typename Traits>
67template <
bool DIRECT_SHOW,
bool BATCHED = false>
72template <
bool BATCHED>
74 template <
typename DriverTraits>
84 template <
typename DriverTraits>
92 template <
typename DriverTraits>
97 template <
typename DriverTraits>
106 template <
typename DriverTraits>
153 bool BATCHED_DIRECT_SHOW =
false>
164 XTRA0, DIRECT_SHOW, BATCHED_DIRECT_SHOW>;
172 if (WAIT_TIME > 0 &&
static_cast<u32
>(WAIT_TIME) > timing.
reset_us) {
173 timing.
reset_us =
static_cast<u32
>(WAIT_TIME);
182 mData->setExtraZeroBitsPerByte(
static_cast<u8>(XTRA0));
187 Policy::template attach<DriverTraits>();
196 Policy::template endShow<DriverTraits>();
209 if (!Policy::enabled(DriverTraits::instance())) {
210 fallback = Policy::fallback(
mData);
215 <<
"' is not enabled and no enabled driver can take this strip - dropping frame. "
216 "Fix: FastLED.setDriverEnabled(\"" << wanted.
getName().
c_str()
217 <<
"\", true), or drop the setExclusiveDriver() that disabled it.");
221 <<
"' is not enabled - falling back to '" << fallback->getName().c_str()
222 <<
"'. Fix: FastLED.setDriverEnabled(\"" << wanted.
getName().
c_str()
223 <<
"\", true), or name the enabled bus in addLeds<..., fl::Bus::X>().");
225 IChannelDriver& driver = fallback ? *fallback : DriverTraits::instance();
230 if (
mData->isInUse()) {
232 FL_WARN_ONCE(
"SlimBridgeController: driver '" << driver.
getName().
c_str() <<
"' did not become ready in time - dropping frame");
241 }
else if (this->
getRgbw().active()) {
247 const int pixelCount = pixels.size();
249 if (pixelCount < 0 || bytesPerPixel == 0 ||
250 static_cast<fl::size
>(pixelCount) >
static_cast<fl::size
>(-1) / bytesPerPixel) {
252 FL_WARN_ONCE(
"SlimBridgeController: invalid encoded frame size - dropping frame");
255 const fl::size expectedSize =
static_cast<fl::size
>(pixelCount) * bytesPerPixel;
256 auto &encoded =
mData->getData();
260 encoded.reserve(expectedSize);
261 if (encoded.capacity() < expectedSize) {
263 FL_WARN_ONCE(
"SlimBridgeController: cannot allocate encoded frame - dropping frame");
276 if (encoded.size() != expectedSize) {
279 FL_WARN_ONCE(
"SlimBridgeController: incomplete encoded frame - dropping frame");
284 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)
fl::shared_ptr< IChannelDriver > selectEnabledDriverForChannel(const ChannelDataPtr &data) const FL_NO_EXCEPT
Highest-priority enabled driver that can handle data, or null.
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.
SlimBridgeController< DATA_PIN, TIMING, RGB_ORDER, WAIT_TIME, typename fl::conditional< B==Bus::AUTO, DriverTraits, BusTraits< B > >::type, XTRA0, DIRECT_SHOW, BATCHED_DIRECT_SHOW > WithBus
Rebind only the bus; retain the compile-time chipset timing and slim storage rather than constructing...
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(...)
#define FL_WARN_EVERY(MILLIS,...)
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.
Primary template — intentionally undefined.
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 fl::shared_ptr< IChannelDriver > fallback(const ChannelDataPtr &data) FL_NO_EXCEPT
An enabled driver that can take data, in priority order.
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 fl::shared_ptr< IChannelDriver > fallback(const ChannelDataPtr &) FL_NO_EXCEPT
static void endShow() FL_NO_EXCEPT
static void afterEnqueue(IChannelDriver &) FL_NO_EXCEPT