Treehopper C# API
Dm632 Class Reference

SiTI DM632/DM633/DM634 16-channel, 16-bit PWM constant-current LED driver More...

Inheritance diagram for Dm632:
ChainableShiftRegisterOutput ILedDriver IFlushable IFlushable

Public Member Functions

 Dm632 (Spi SpiModule, SpiChipSelectPin LatchPin, double speedMhz=6)
 Construct a DM632 16-channel, 16-bit PWM LED controller attached directly to an SPI port More...
 
 Dm632 (ChainableShiftRegisterOutput upstreamDevice)
 Construct a DM632 16-channel, 16-bit PWM LED controller attached to the output of another shift register More...
 
Task Clear ()
 Clear the outputs of all LEDs More...
 
async Task FlushAsync (bool force=false)
 Flush data to the port More...
 
async Task Write (byte[] value)
 Immediately update all the pins at once with the given value. More...
 

Public Attributes

bool HasGlobalBrightnessControl => true
 Gets whether this display has global brightness control (Hint: it does!) More...
 
bool HasIndividualBrightnessControl => true
 Gets whether this display has individual brightness control (which it does!) More...
 

Protected Member Functions

override void updateFromCurrentValue ()
 Set the individual LED brightness values based on the direct value written to this register More...
 
async Task FlushIfAutoFlushEnabled ()
 Classes extending this class should call this function after the internal pin data structure is updated. More...
 

Properties

double Brightness [get, set]
 Gets or sets the brightness of the display More...
 
IList< LedLeds = new List<Led>() [get]
 Gets the list of LEDs associated with this driver More...
 
IList< ChainableShiftRegisterOutputChildren = new List<ChainableShiftRegisterOutput>() [get, set]
 
byte [] CurrentValue [get, protected set]
 The current value of the port More...
 
bool AutoFlush = true [get, set]
 Whether or not written data should automatically be flushed to the controller More...
 
IFlushable Parent [get, protected set]
 The parent shift register (if not null) this device is attached to More...
 

Detailed Description

SiTI DM632/DM633/DM634 16-channel, 16-bit PWM constant-current LED driver

Constructor & Destructor Documentation

◆ Dm632() [1/2]

Dm632 ( Spi  SpiModule,
SpiChipSelectPin  LatchPin,
double  speedMhz = 6 
)

Construct a DM632 16-channel, 16-bit PWM LED controller attached directly to an SPI port

Parameters
SpiModuleThe SPI module to use
LatchPinThe latch pin to use
speedMhzThe speed, in MHz, to use

◆ Dm632() [2/2]

Dm632 ( ChainableShiftRegisterOutput  upstreamDevice)

Construct a DM632 16-channel, 16-bit PWM LED controller attached to the output of another shift register

Parameters
upstreamDeviceThe shift register this DM632 is attached to

Member Function Documentation

◆ Clear()

Task Clear ( )

Clear the outputs of all LEDs

Returns
An awaitable task that completes upon success

Implements ILedDriver.

◆ updateFromCurrentValue()

override void updateFromCurrentValue ( )
protectedvirtual

Set the individual LED brightness values based on the direct value written to this register

Note that the state is always set to true when this is called; only the brightness is adjusted

Implements ChainableShiftRegisterOutput.

◆ FlushAsync()

async Task FlushAsync ( bool  force = false)
inherited

Flush data to the port

Parameters
forceWhether to flush all data to the port, even if it doesn't appear to have changed.
Returns
An awaitable task that completes when finished

Implements IFlushable.

◆ Write()

async Task Write ( byte []  value)
inherited

Immediately update all the pins at once with the given value.

Flush() will be implicity called.

Parameters
valueA value representing the data to write to the port
Returns
An awaitable task that completes upon successfully writing the value.

◆ FlushIfAutoFlushEnabled()

async Task FlushIfAutoFlushEnabled ( )
protectedinherited

Classes extending this class should call this function after the internal pin data structure is updated.

Returns

Member Data Documentation

◆ HasGlobalBrightnessControl

bool HasGlobalBrightnessControl => true

Gets whether this display has global brightness control (Hint: it does!)

◆ HasIndividualBrightnessControl

bool HasIndividualBrightnessControl => true

Gets whether this display has individual brightness control (which it does!)

Property Documentation

◆ Brightness

double Brightness
getset

Gets or sets the brightness of the display

The DM632 has no global brightness control, so this property emulates this functionality by scaling each LED's output value by this value.

◆ Leds

IList<Led> Leds = new List<Led>()
get

Gets the list of LEDs associated with this driver

◆ Children

IList<ChainableShiftRegisterOutput> Children = new List<ChainableShiftRegisterOutput>()
getsetinherited

◆ CurrentValue

byte [] CurrentValue
getprotected setinherited

The current value of the port

◆ AutoFlush

bool AutoFlush = true
getsetinherited

Whether or not written data should automatically be flushed to the controller

◆ Parent

IFlushable Parent
getprotected setinherited

The parent shift register (if not null) this device is attached to


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