Treehopper C# API
LedDriver Class Referenceabstract

Base class that all LED drivers inherit from. More...

Inheritance diagram for LedDriver:
ILedDriver IFlushable GpioLedDriver< TDigitalOutPin > Ht16k33 Is31fl3218 Max7219 PwmLedDriver< TPwm > Tm1650

Public Member Functions

 LedDriver (int numLeds, bool HasGlobalBrightnessControl, bool HasIndividualBrightnessControl)
 Construct an LedDriver More...
 
async Task Clear ()
 Clear the display More...
 
abstract Task FlushAsync (bool force=false)
 Write out the current values of the LEDs immediately. More...
 

Protected Attributes

double brightness
 The internally-referenced global brightness of the LED driver More...
 

Properties

bool AutoFlush = true [get, set]
 Gets or sets whether the display should auto-flush whenever an LED state is changed More...
 
bool HasGlobalBrightnessControl [get, protected set]
 Gets or sets whether this controller supports global brightness control. More...
 
bool HasIndividualBrightnessControl [get]
 Gets or sets whether this controller's LEDs have individual brightness control (through PWM or otherwise). More...
 
double Brightness [get, set]
 The global brightness, from 0.0-1.0, of the LEDs attached to this driver More...
 
IList< LedLeds = new Collection<Led>() [get, set]
 The collection of LEDs that belong to this driver. More...
 
IFlushable Parent [get, protected set]
 Gets the parent device of this LED driver More...
 

Detailed Description

Base class that all LED drivers inherit from.

Constructor & Destructor Documentation

◆ LedDriver()

LedDriver ( int  numLeds,
bool  HasGlobalBrightnessControl,
bool  HasIndividualBrightnessControl 
)

Construct an LedDriver

Parameters
numLedsThe number of LEDs to construct
HasGlobalBrightnessControlWhether the controller can globally adjust the LED brightness.
HasIndividualBrightnessControlWhether the controller has individual LED brightness control

Member Function Documentation

◆ Clear()

async Task Clear ( )

Clear the display

Returns
An awaitable task that completes when the display is cleared

Implements ILedDriver.

◆ FlushAsync()

abstract Task FlushAsync ( bool  force = false)
pure virtual

Write out the current values of the LEDs immediately.

Parameters
forceWhether to write out all values, even if they appear unchanged.
Returns
An awaitable Task

Implements IFlushable.

Implemented in Max7219, Tm1650, Ht16k33, Is31fl3218, GpioLedDriver< TDigitalOutPin >, and PwmLedDriver< TPwm >.

Member Data Documentation

◆ brightness

double brightness
protected

The internally-referenced global brightness of the LED driver

Property Documentation

◆ AutoFlush

bool AutoFlush = true
getset

Gets or sets whether the display should auto-flush whenever an LED state is changed

◆ HasGlobalBrightnessControl

bool HasGlobalBrightnessControl
getprotected set

Gets or sets whether this controller supports global brightness control.

◆ HasIndividualBrightnessControl

bool HasIndividualBrightnessControl
get

Gets or sets whether this controller's LEDs have individual brightness control (through PWM or otherwise).

◆ Brightness

double Brightness
getset

The global brightness, from 0.0-1.0, of the LEDs attached to this driver

◆ Leds

IList<Led> Leds = new Collection<Led>()
getset

The collection of LEDs that belong to this driver.

◆ Parent

IFlushable Parent
getprotected set

Gets the parent device of this LED driver


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