Table of Contents

Class Max7219

Namespace
Iot.Device.Max7219
Assembly
Iot.Device.Max7219.dll

Max7219 LED matrix driver

public class Max7219
Inheritance
Max7219

Constructors

Max7219(SpiDevice, int, RotationType)

Creates a Max7219 Device given a to communicate over and the number of devices that are cascaded.

public Max7219(SpiDevice spiDevice, int cascadedDevices = 1, RotationType rotation = RotationType.None)

Parameters

spiDevice SpiDevice
cascadedDevices int
rotation RotationType

Fields

NumDigits

Number of digits Register per Module

public const int NumDigits = 8

Field Value

int

SpiClockFrequency

MAX7219 Spi Clock Frequency

public const int SpiClockFrequency = 10000000

Field Value

int

SpiMode

MAX7219 SPI Mode

public const SpiMode SpiMode = Mode0

Field Value

SpiMode

Properties

CascadedDevices

Number of cascaded devices

public int CascadedDevices { get; }

Property Value

int

this[DeviceIdDigit]

Gets or Sets the value to the digit value for a given device and digit position

public byte this[DeviceIdDigit device] { get; set; }

Parameters

device DeviceIdDigit

Property Value

byte

this[int]

Gets or Sets the value to the digit value for a given absolute index

public byte this[int index] { get; set; }

Parameters

index int

Property Value

byte

Length

Gets the total number of digits (cascaded devices * num digits)

public int Length { get; }

Property Value

int

Rotation

The Rotation to be applied (when modules are assembled rotated way)

public RotationType Rotation { get; set; }

Property Value

RotationType

Methods

Brightness(int)

Sets the brightness of all cascaded devices to the same intensity level.

public void Brightness(int intensity)

Parameters

intensity int

intensity level ranging from 0..15.

Clear(int, int, bool)

Clears the buffer from the given start to end (exclusive) and flushes

public void Clear(int start, int end, bool flush = true)

Parameters

start int
end int
flush bool

ClearAll(bool)

Clears the buffer from the given start to end and flushes

public void ClearAll(bool flush = true)

Parameters

flush bool

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Flush()

Writes all the Values to the devices.

public void Flush()

Init()

Standard initialization routine.

public void Init()

WriteBuffer(byte[][])

Writes a two dimensional buffer containing all the values to the devices.

public void WriteBuffer(byte[][] buffer)

Parameters

buffer byte[][]