Treehopper C# API
GpioLedDriver< TDigitalOutPin > Class Template Reference

An LedDriver implemented using plain digital output pins More...

Inheritance diagram for GpioLedDriver< TDigitalOutPin >:
LedDriver ILedDriver IFlushable

Public Member Functions

 GpioLedDriver (IList< TDigitalOutPin > Pins, bool useActiveLowOutput=false, IFlushable controller=null)
 Construct a new LedDriver using a collection of GPIO output pins More...
 
override async Task FlushAsync (bool force=false)
 Flush the data from LED driver to the GPIO bus More...
 
async Task Clear ()
 Clear the display 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

An LedDriver implemented using plain digital output pins

Template Parameters
TDigitalOutPinThe DigitalOutPin type that should be used.
Type Constraints
TDigitalOutPin :DigitalOut 

Constructor & Destructor Documentation

◆ GpioLedDriver()

GpioLedDriver ( IList< TDigitalOutPin >  Pins,
bool  useActiveLowOutput = false,
IFlushable  controller = null 
)

Construct a new LedDriver using a collection of GPIO output pins

Parameters
PinsThe list of digital output pins to use
useActiveLowOutputWhether a digital LOW value should be used to turn the LED on
controllerAn IFlushable controller where the GPIO resides

Member Function Documentation

◆ FlushAsync()

override async Task FlushAsync ( bool  force = false)
virtual

Flush the data from LED driver to the GPIO bus

Parameters
forceWhether all data should be flushed, even if it doesn't appear to have changed from the current value
Returns
An awaitable task that completes upon success

Implements LedDriver.

◆ Clear()

async Task Clear ( )
inherited

Clear the display

Returns
An awaitable task that completes when the display is cleared

Implements ILedDriver.

Member Data Documentation

◆ brightness

double brightness
protectedinherited

The internally-referenced global brightness of the LED driver

Property Documentation

◆ AutoFlush

bool AutoFlush = true
getsetinherited

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

◆ HasGlobalBrightnessControl

bool HasGlobalBrightnessControl
getprotected setinherited

Gets or sets whether this controller supports global brightness control.

◆ HasIndividualBrightnessControl

bool HasIndividualBrightnessControl
getinherited

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

◆ Brightness

double Brightness
getsetinherited

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

◆ Leds

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

The collection of LEDs that belong to this driver.

◆ Parent

IFlushable Parent
getprotected setinherited

Gets the parent device of this LED driver


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