Treehopper C++ API
Dm632 Class Reference

Library for the SiTI DM632, DM633, and DM634 16-channel, 16-bit PWM-capable shift-register-type LED driver.

#include <Dm632.h>

Inheritance diagram for Dm632:
ChainableShiftRegisterOutput LedDriver Flushable Flushable

Public Member Functions

 Dm632 (Spi &spi, SpiChipSelectPin *lat, double speed=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 directly to an SPI port More...
 
virtual void flush (bool force=false)
 flush changed data to the port expander More...
 
virtual void updateFromCurrentValue ()
 Update internal data structures from current value More...
 
void write (uint8_t *value)
 Immediately update all the pins at once with the given value. More...
 
double brightness ()
 Gets the global brightness of the display. More...
 
void brightness (double value)
 Sets the global brightness of the display. More...
 

Public Attributes

uint8_t * currentValue
 The current value of the port. More...
 
int numBytes
 The number of bytes wide this port is. More...
 
vector< Ledleds
 The collection of LEDs that belong to this driver. More...
 
const bool hasGlobalBrightnessControl
 Gets or sets whether this controller supports global _brightness control. More...
 
const bool hasIndividualBrightnessControl
 Gets or sets whether this controller's LEDs have individual _brightness control (through PWM or otherwise). More...
 
bool autoFlush
 Whether this interface should automatically flush new values or not. More...
 
Flushableparent
 Gets or sets the parent flushable device (if it exists); if this property is set by this driver, it is expected that flushing the parent will also flush this device. More...
 

Constructor & Destructor Documentation

◆ Dm632() [1/2]

Dm632 ( Spi spi,
SpiChipSelectPin lat,
double  speed = 6 
)
Parameters
[in]spiThe SPI port this LED driver is attached to
[in]latThe GPIO pin attached to the LAT pin
[in]speedThe speed, in MHz, to use when communicating

◆ Dm632() [2/2]

Dm632 ( ChainableShiftRegisterOutput upstreamDevice)
Parameters
[in]upstreamDeviceThe upstream shift register this DM632 is attached to

Member Function Documentation

◆ brightness() [1/2]

double brightness ( )
inherited

◆ brightness() [2/2]

void brightness ( double  value)
inherited

If the display's hasGlobalBrightnessControl is true, native brightness control will be used. Otherwise, if the display's hasIndividualBrightnessControl is true, global brightness will be emulated by setting all

◆ flush()

virtual void flush ( bool  force = false)
virtual
Parameters
[in]forcewhether to flush all data to the port expander, even if it doesn't appear to have been changed

Implements Flushable.

◆ updateFromCurrentValue()

virtual void updateFromCurrentValue ( )
virtual

◆ write()

void write ( uint8_t *  value)
inherited

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.

Member Data Documentation

◆ autoFlush

bool autoFlush
inherited

◆ currentValue

uint8_t* currentValue
inherited

Note that this value is numBytes wide.

◆ hasGlobalBrightnessControl

const bool hasGlobalBrightnessControl
inherited

◆ hasIndividualBrightnessControl

const bool hasIndividualBrightnessControl
inherited

◆ leds

vector<Led> leds
inherited

◆ numBytes

int numBytes
inherited

◆ parent

Flushable* parent
inherited

This property is designed to make LED displays, which operate across groups of LEDs (and possibly groups of LED drivers), much more efficient to update. Many commonly-used LED drivers are shift registers that are chained together; since these cannot be individually addressed, any write to one must include a write to all the other ones. By properly setting the parent shift register in each chain, displays can optimize these updates.


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