muwerk mupplet Display Library
muwerk applets; mupplets: functional units that support specific hardware or reusable applications
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
ustd::Max72XX Class Reference

The MAX72XX Controller Class. More...

#include <max72xx.h>

Public Types

enum  OP {
  noop = 0 , digit0 = 1 , digit1 = 2 , digit2 = 3 ,
  digit3 = 4 , digit4 = 5 , digit5 = 6 , digit6 = 7 ,
  digit7 = 8 , decodemode = 9 , intensity = 10 , scanlimit = 11 ,
  shutdown = 12 , displaytest = 15
}
 

Public Member Functions

 Max72XX (uint8_t csPin, uint8_t chainLen)
 
void begin ()
 
uint8_t getChainLen () const
 
void setDecodeMode (uint8_t mode)
 
void setIntensity (uint8_t intensity)
 
void setScanLimit (uint8_t scanlimit)
 
void setPowerSave (bool powersave)
 
void setTestMode (bool testmode)
 
void sendCommand (OP opcode, uint8_t data)
 
void sendBlock (uint8_t *buffer, uint8_t size)
 

Detailed Description

The MAX72XX Controller Class.

This class implements the communication interface to a maxim MAX7219 or MAX7221 Serially Interfaced, 8-Digit, LED Display Drivers See https://datasheets.maximintegrated.com/en/ds/MAX7219-MAX7221.pdf

Member Enumeration Documentation

◆ OP

The maxim 7219/7221 operation modes

Enumerator
noop 

No operation.

digit0 

Digit 0.

digit1 

Digit 1.

digit2 

Digit 2.

digit3 

Digit 3.

digit4 

Digit 4.

digit5 

Digit 5.

digit6 

Digit 6.

digit7 

Digit 7.

decodemode 

Decode Mode (0,1,15,255)

intensity 

Intensity (0-15)

scanlimit 

Scan-Limit (0-7)

shutdown 

Shutdown Mode (0 or 1)

displaytest 

Display Test (0 or 1)

Constructor & Destructor Documentation

◆ Max72XX()

ustd::Max72XX::Max72XX ( uint8_t  csPin,
uint8_t  chainLen 
)
inline

Instantiate a Max72XX instance

Parameters
csPinThe chip select pin
chainLenThe length of the device chain

Member Function Documentation

◆ begin()

void ustd::Max72XX::begin ( )
inline

Start the driver class

◆ getChainLen()

uint8_t ustd::Max72XX::getChainLen ( ) const
inline

Get the number of devices in the chain

Returns
The number ofdevices in the chain

◆ sendBlock()

void ustd::Max72XX::sendBlock ( uint8_t *  buffer,
uint8_t  size 
)
inline

Sends a block of data

Parameters
bufferBuffer to send
sizeSize in bytes of the buffer to send

◆ sendCommand()

void ustd::Max72XX::sendCommand ( OP  opcode,
uint8_t  data 
)
inline

Sends a command to all devices

Parameters
opcodeOperation register
dataOperation parameter

◆ setDecodeMode()

void ustd::Max72XX::setDecodeMode ( uint8_t  mode)
inline

Sets the BCD code B (0-9, E, H, L, P, and -) or no-decode operation for each digit

Parameters
modeThe bitmask specifying the decode mode for each digit.

◆ setIntensity()

void ustd::Max72XX::setIntensity ( uint8_t  intensity)
inline

Set the brightness of all devices

Parameters
intensityThe brightness of the devices. (0..15)

◆ setPowerSave()

void ustd::Max72XX::setPowerSave ( bool  powersave)
inline

Set the power saving mode for all devices

Parameters
powersaveIf true the device goes into power-down mode. Set to false for normal operation.

◆ setScanLimit()

void ustd::Max72XX::setScanLimit ( uint8_t  scanlimit)
inline

The scan-limit register sets how many digits are displayed, from 1 to 8

Parameters
scanLimitNumber of digits to show from 1 to 8

◆ setTestMode()

void ustd::Max72XX::setTestMode ( bool  testmode)
inline

Set the test mode for all devices

In Test mode all leds are turned on in order to check for correct function.

Parameters
testmodeIf true the devices goes into test mode. Set to false for normal operation.

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