The MAX72XX Controller Class.
More...
#include <max72xx.h>
|
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
} |
|
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
◆ 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)
|
◆ Max72XX()
ustd::Max72XX::Max72XX |
( |
uint8_t |
csPin, |
|
|
uint8_t |
chainLen |
|
) |
| |
|
inline |
Instantiate a Max72XX instance
- Parameters
-
csPin | The chip select pin |
chainLen | The length of the device chain |
◆ begin()
void ustd::Max72XX::begin |
( |
| ) |
|
|
inline |
◆ 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
-
buffer | Buffer to send |
size | Size 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
-
opcode | Operation register |
data | Operation 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
-
mode | The bitmask specifying the decode mode for each digit. |
◆ setIntensity()
void ustd::Max72XX::setIntensity |
( |
uint8_t |
intensity | ) |
|
|
inline |
Set the brightness of all devices
- Parameters
-
intensity | The brightness of the devices. (0..15) |
◆ setPowerSave()
void ustd::Max72XX::setPowerSave |
( |
bool |
powersave | ) |
|
|
inline |
Set the power saving mode for all devices
- Parameters
-
powersave | If 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
-
scanLimit | Number 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
-
testmode | If true the devices goes into test mode. Set to false for normal operation. |
The documentation for this class was generated from the following file: