33#include "platforms/channel_poll_signal.h"
255 template<typename Condition>
325 constexpr int kExclusivePriority = 10000;
Compile-time identifier for an LED channel transmission bus.
Per-driver traits keyed on fl::Bus.
bool isDriverEnabled(const char *name) const FL_NOEXCEPT
Check if a driver is enabled by name.
void setDriverEnabled(const char *name, bool enabled) FL_NOEXCEPT
Enable or disable a driver by name at runtime.
bool removeDriver(fl::shared_ptr< IChannelDriver > driver) FL_NOEXCEPT
Remove a driver from the manager.
fl::shared_ptr< IChannelDriver > selectDriverForChannel(const ChannelDataPtr &data, const fl::string &affinity) FL_NOEXCEPT
Select best driver for channel data (used by Channel::showPixels)
const fl::string & exclusiveDriverName() const FL_NOEXCEPT
Get the currently-active exclusive-driver selection (if any).
void setExclusiveDriver() FL_NOEXCEPT
Register a single driver at a priority above the platform default and disable all others (compile-tim...
bool waitForPollNeededSignal(u32 timeoutMs) FL_NOEXCEPT
~ChannelManager() FL_NOEXCEPT override
Destructor - cleanup shared drivers (automatic via shared_ptr)
void reset() FL_NOEXCEPT
Reset bus manager state, clearing all enqueued and transmitting channels.
fl::shared_ptr< IChannelDriver > getDriverByName(const fl::string &name) const FL_NOEXCEPT
Get driver by name for affinity binding.
u32 pollNeededWaitSliceMs(u32 startTime, u32 timeoutMs) const FL_NOEXCEPT
IChannelDriver::PollNeededCallback mPollNeededCallback
Shared callback installed on drivers that can signal poll-needed events.
static void notifyPollNeededThunk(void *context) FL_NOEXCEPT
fl::shared_ptr< IChannelDriver > findDriverByName(const fl::string &name) const FL_NOEXCEPT
Silent counterpart to getDriverByName().
bool setDriverPriority(const fl::string &name, int priority) FL_NOEXCEPT
Change the priority of a registered driver.
fl::span< const DriverInfo > getDriverInfos() const FL_NOEXCEPT
Get full state of all registered drivers.
fl::size getDriverCount() const FL_NOEXCEPT
Get count of registered drivers (including unnamed ones)
void addDriver(int priority, fl::shared_ptr< IChannelDriver > driver) FL_NOEXCEPT
Add a driver with priority (higher priority = preferred)
bool waitForReady(u32 timeoutMs=1000) FL_NOEXCEPT
Wait for all drivers to become READY.
platforms::ChannelPollSignal mPollNeededSignal
Platform wait primitive owned by the manager.
void clearAllDrivers() FL_NOEXCEPT
Remove all drivers from the manager.
IChannelDriver::DriverState poll() FL_NOEXCEPT
Poll all registered drivers and return aggregate state.
fl::vector< DriverInfo > mCachedDriverInfo
Cached driver info for getDriverInfos() to avoid allocations.
DriverStatus
Registration status of a driver by name (silent lookup)
@ NOT_REGISTERED
No driver with that name is registered.
@ STATUS_ENABLED
Driver is registered and enabled.
@ STATUS_DISABLED
Driver is registered but disabled.
void onEndFrame() FL_NOEXCEPT override
Trigger transmission of batched channel data.
bool waitForReadyOrDraining(u32 timeoutMs=1000) FL_NOEXCEPT
fl::vector< EngineEntry > mDrivers
Shared drivers sorted by priority descending (higher values first)
bool waitForCondition(Condition condition, u32 timeoutMs=1000) FL_NOEXCEPT
Wait until a condition is met, with check-pump-delay logic.
fl::string mExclusiveDriver
Exclusive driver name (empty if no exclusive mode)
void onBeginFrame() FL_NOEXCEPT override
Poll drivers before frame starts to clear previous frame state.
ChannelManager() FL_NOEXCEPT
Constructor.
bool setExclusiveDriverByName(const char *name) FL_NOEXCEPT
Enable only one driver exclusively (disables all others) — by-name escape hatch.
IChannelDriver * selectDriver(const ChannelDataPtr &data=nullptr) FL_NOEXCEPT
Select driver for current operation.
void notifyPollNeeded() FL_NOEXCEPT
static ChannelManager & instance() FL_NOEXCEPT
Get the global singleton instance.
DriverStatus driverStatus(const fl::string &name) const FL_NOEXCEPT
Look up a driver's registration status without logging on miss.
Minimal interface for LED channel transmission drivers.
Channel transmission data - lightweight DTO for driver transmission.
FL_DISABLE_WARNING_PUSH unsigned char * B
Bus
Driver identifier for compile-time bus selection.
ChannelManager & channelManager()
Get the global ChannelManager singleton instance.
Base definition for an LED controller.
fl::string name
Driver name (empty for unnamed drivers)
bool enabled
Whether driver is currently enabled.
int priority
Driver priority (higher = preferred)
Driver state information for channel manager.
Primary template — intentionally undefined.
bool operator<(const EngineEntry &other) const FL_NOEXCEPT
Sort by priority descending (higher numbers first)
fl::string name
Engine name for runtime identification (e.g., "RMT", "SPI")
bool enabled
Runtime enable/disable flag.
fl::shared_ptr< IChannelDriver > driver
Engine registry entry (priority + shared pointer + runtime control)