FastLED 3.9.15
Loading...
Searching...
No Matches
fl::IChannelDriver Class Referenceabstract

Detailed Description

Minimal interface for LED channel transmission drivers.

Pure interface with no state management. Concrete implementations handle their own batching, error tracking, and cleanup logic.

State Machine Behavior: Typical flow: READY → BUSY → DRAINING → READY

Usage Pattern:

  1. Call enqueue() one or more times to submit LED data
  2. Call show() to trigger transmission
  3. Call poll() to check transmission status and perform cleanup

Implementation Guidelines:

  • enqueue(): Store channel data for later transmission
  • show(): Initiate transmission of enqueued data (may block if BUSY/DRAINING)
  • poll(): Return current hardware state and perform cleanup when complete

Definition at line 49 of file driver.h.

#include <driver.h>

+ Inheritance diagram for fl::IChannelDriver:

Classes

struct  Capabilities
 Driver capabilities. More...
 
struct  DriverState
 Driver state with optional error message. More...
 
struct  PollNeededCallback
 ISR-safe callback handle invoked when the manager should poll again. More...
 
class  PollNeededCallbackSlot
 ISR-safe storage for a poll-needed callback handle. More...
 

Public Member Functions

virtual ~IChannelDriver () FL_NOEXCEPT=default
 Virtual destructor.
 
virtual bool canHandle (const ChannelDataPtr &data) const FL_NOEXCEPT=0
 Check if this driver can handle the given channel data.
 
virtual void enqueue (ChannelDataPtr channelData) FL_NOEXCEPT=0
 Enqueue channel data for transmission.
 
virtual Capabilities getCapabilities () const FL_NOEXCEPT=0
 Get driver capabilities (clockless, SPI, or both)
 
virtual fl::string getName () const FL_NOEXCEPT
 Get the driver name for affinity binding.
 
virtual DriverState poll () FL_NOEXCEPT=0
 Query driver state and perform maintenance.
 
virtual void setPollNeededCallback (PollNeededCallback callback) FL_NOEXCEPT
 Install the manager-owned poll-needed callback for ISR wakeups.
 
virtual void show () FL_NOEXCEPT=0
 Trigger transmission of enqueued data.
 
virtual bool waitDone (u32 timeoutMs=1000) FL_NOEXCEPT
 Block until this driver finishes any in-flight transmit.
 
bool waitForReady (u32 timeoutMs=1000) FL_NOEXCEPT
 Wait for driver to become READY.
 
bool waitForReadyOrDraining (u32 timeoutMs=1000) FL_NOEXCEPT
 

Protected Member Functions

 IChannelDriver () FL_NOEXCEPT=default
 
 IChannelDriver (const IChannelDriver &) FL_NOEXCEPT=delete
 
 IChannelDriver (IChannelDriver &&) FL_NOEXCEPT=delete
 
IChannelDriveroperator= (const IChannelDriver &) FL_NOEXCEPT=delete
 
IChannelDriveroperator= (IChannelDriver &&) FL_NOEXCEPT=delete
 
template<typename Condition>
bool waitForCondition (Condition condition, u32 timeoutMs=1000) FL_NOEXCEPT
 

The documentation for this class was generated from the following files: