Treehopper C# API
Max7219 Class Reference

Maxim MAX7219 SPI 8x8 matrix LED driver More...

Inheritance diagram for Max7219:
LedDriver ILedDriver IFlushable

Public Member Functions

 Max7219 (Spi SpiModule, SpiChipSelectPin LoadPin, int Address=0, double SpeedMHz=6)
 Construct a new instance of a Max7219 device More...
 
override async Task FlushAsync (bool force=false)
 Flush data to the display More...
 
async Task Clear ()
 Clear the display More...
 

Protected Attributes

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

Properties

bool Test [get, set]
 Gets or sets whether the display is in test mode or not. More...
 
byte DecodeMode [get, set]
 Gets or sets a bit pattern indicating whether each digit should be decoded on-chip or not. More...
 
bool Shutdown [get, set]
 Gets or sets whether the display should be shut down or not More...
 
byte ScanLimit [get, set]
 Gets or sets the maximum digit index (from 0 to 7) that should be scanned More...
 
bool UseNativeLedOrder = false [get, set]
 If true, LED segments are ordered G-A, DP. More...
 
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

Maxim MAX7219 SPI 8x8 matrix LED driver

Constructor & Destructor Documentation

◆ Max7219()

Max7219 ( Spi  SpiModule,
SpiChipSelectPin  LoadPin,
int  Address = 0,
double  SpeedMHz = 6 
)

Construct a new instance of a Max7219 device

Parameters
SpiModuleA reference to the Treehopper SPI module
LoadPinThe pin attached tot he LOAD input
AddressThe index of the Max7219 device attached to this bus
SpeedMHzThe SPI speed to use. The maximum is 10 MHz.

Member Function Documentation

◆ FlushAsync()

override async Task FlushAsync ( bool  force = false)
virtual

Flush data to the display

Parameters
forceWhether to force all data to be sent, even if it appears unchanged
Returns
An awaitable task that completes when finished

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

◆ Test

bool Test
getset

Gets or sets whether the display is in test mode or not.

◆ DecodeMode

byte DecodeMode
getset

Gets or sets a bit pattern indicating whether each digit should be decoded on-chip or not.

◆ Shutdown

bool Shutdown
getset

Gets or sets whether the display should be shut down or not

◆ ScanLimit

byte ScanLimit
getset

Gets or sets the maximum digit index (from 0 to 7) that should be scanned

◆ UseNativeLedOrder

bool UseNativeLedOrder = false
getset

If true, LED segments are ordered G-A, DP.

If False, this library will use segment ordering of A-DP.

All Treehopper LED driver libraries are, by default, standardized so that the LSB of the driver corresponds with segment "A", the 7th bit corresponds with "G" and the MSB corresponds to the "DP" segment. This allows easy consumption of display libraries that require ordered collections of segments. However, you may choose to work with this library using the native LED ordering, where the LSB corresponds with segment "G", the 7th bit corresponds to segment "A" and the MSB corresponds to segment "DP".

◆ 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: