The MAX72XX Matrix Display Class.
More...
#include <max72xx_matrix.h>
Inherits Adafruit_GFX.
|
| Max72xxMatrix (uint8_t csPin, uint8_t hDisplays=1, uint8_t vDisplays=1, uint8_t rotation=0) |
|
void | begin () |
|
void | setPowerSave (bool powersave) |
|
void | setIntensity (uint8_t intensity) |
|
void | setTestMode (bool testmode) |
|
void | write () |
|
void | setPosition (uint8_t display, uint8_t x, uint8_t y) |
|
void | setRotation (uint8_t display, uint8_t rotation) |
|
bool | getTextWrap () const |
|
int16_t | getCursorX () const |
|
int16_t | getCursorY () const |
|
void | getCharBounds (unsigned char c, int16_t *x, int16_t *y, int16_t *minx, int16_t *miny, int16_t *maxx, int16_t *maxy) |
|
bool | printFormatted (int16_t x, int16_t y, int16_t w, int16_t align, String content, uint8_t baseLine, uint8_t yAdvance=0) |
|
virtual void | fillScreen (uint16_t color) |
|
void | drawPixel (int16_t xx, int16_t yy, uint16_t color) |
|
The MAX72XX Matrix Display Class.
This class derived from Adafruit's core graphics class provides an implementation of a dot matrix display based on 8x8 led modules driven by a maxim MAX7219 or MAX7221 controller connected over SPI.
◆ Max72xxMatrix()
ustd::Max72xxMatrix::Max72xxMatrix |
( |
uint8_t |
csPin, |
|
|
uint8_t |
hDisplays = 1 , |
|
|
uint8_t |
vDisplays = 1 , |
|
|
uint8_t |
rotation = 0 |
|
) |
| |
|
inline |
Instantiate a Max72xxMatrix instance
- Parameters
-
csPin | The chip select pin. |
hDisplays | Horizontal number of 8x8 display units. (default: 1) |
vDisplays | Vertical number of 8x8 display units. (default: 1) |
rotation | Define if and how the displays are rotated. The first display is the one closest to the Connections. rotation can be a numeric value from 0 to 3 representing respectively no rotation, 90 degrees clockwise, 180 degrees and 90 degrees counter clockwise. |
◆ begin()
void ustd::Max72xxMatrix::begin |
( |
| ) |
|
|
inline |
◆ drawPixel()
void ustd::Max72xxMatrix::drawPixel |
( |
int16_t |
xx, |
|
|
int16_t |
yy, |
|
|
uint16_t |
color |
|
) |
| |
|
inline |
Draw a pixel to the canvas framebuffer
- Parameters
-
xx | x coordinate |
yy | y coordinate |
color | 8-bit Color to fill with. Only lower byte of uint16_t is used. |
◆ fillScreen()
virtual void ustd::Max72xxMatrix::fillScreen |
( |
uint16_t |
color | ) |
|
|
inlinevirtual |
Fill the framebuffer completely with one color
- Parameters
-
color | Binary (on or off) color to fill with |
◆ getCharBounds()
void ustd::Max72xxMatrix::getCharBounds |
( |
unsigned char |
c, |
|
|
int16_t * |
x, |
|
|
int16_t * |
y, |
|
|
int16_t * |
minx, |
|
|
int16_t * |
miny, |
|
|
int16_t * |
maxx, |
|
|
int16_t * |
maxy |
|
) |
| |
|
inline |
Calculates the bounding box of a character
- Parameters
-
c | The ASCII character in question |
x | Pointer to x location of character. Value is modified by this function to advance to next character. |
y | Pointer to y location of character. Value is modified by this function to advance to next character. |
minx | Pointer to minimum X coordinate, passed in to AND returned by this function – this is used to incrementally build a bounding rectangle for a string. |
miny | Pointer to minimum Y coord, passed in AND returned. |
maxx | Pointer to maximum X coord, passed in AND returned. |
maxy | Pointer to maximum Y coord, passed in AND returned. |
◆ getCursorX()
int16_t ustd::Max72xxMatrix::getCursorX |
( |
| ) |
const |
|
inline |
Get text cursor X location
- Returns
- X coordinate in digit positions
◆ getCursorY()
int16_t ustd::Max72xxMatrix::getCursorY |
( |
| ) |
const |
|
inline |
Get text cursor Y location
- Returns
- Y coordinate in digit positions
◆ getTextWrap()
bool ustd::Max72xxMatrix::getTextWrap |
( |
| ) |
const |
|
inline |
Returns if too long text will be wrapped to the next line
- Returns
- Wrapping mode
◆ printFormatted()
bool ustd::Max72xxMatrix::printFormatted |
( |
int16_t |
x, |
|
|
int16_t |
y, |
|
|
int16_t |
w, |
|
|
int16_t |
align, |
|
|
String |
content, |
|
|
uint8_t |
baseLine, |
|
|
uint8_t |
yAdvance = 0 |
|
) |
| |
|
inline |
Prints a text at a specified location with a specified formatting
This method prints a text at the specified location with the specified length using left, right or centered alignment. All parameters are checked for plasibility and will be adapted to the current display size.
- Parameters
-
x | Top left corner x coordinate |
y | Top left corner y coordinate |
w | Width in digit positions |
align | Alignment of the string to display: 0 = left, 1 = center, 2 = right |
content | The string to print |
baseLine | The distance between baseline and topline |
yAdvance | The newline distance - If specified, the height of the calculated bounding box is adjusted to a multiple of this value |
- Returns
true
if the string fits the defined space, false
if output was truncated
◆ setIntensity()
void ustd::Max72xxMatrix::setIntensity |
( |
uint8_t |
intensity | ) |
|
|
inline |
Set the brightness of the display
- Parameters
-
intensity | The brightness of the display. (0..15) |
◆ setPosition()
void ustd::Max72xxMatrix::setPosition |
( |
uint8_t |
display, |
|
|
uint8_t |
x, |
|
|
uint8_t |
y |
|
) |
| |
|
inline |
Define how the displays are ordered.
- Parameters
-
display | Display index (0 is the first) |
x | Horizontal display index |
y | Vertical display index |
◆ setPowerSave()
void ustd::Max72xxMatrix::setPowerSave |
( |
bool |
powersave | ) |
|
|
inline |
Set the power saving mode for the display
- Parameters
-
powersave | If true the display goes into power-down mode. Set to false for normal operation. |
◆ setRotation()
void ustd::Max72xxMatrix::setRotation |
( |
uint8_t |
display, |
|
|
uint8_t |
rotation |
|
) |
| |
|
inline |
Define if and how the displays are rotated.
- Parameters
-
display | Display index (0 is the first) |
rotation | Rotation of the display: 0: no rotation 1: 90 degrees clockwise 2: 180 degrees 3: 90 degrees counter clockwise |
◆ setTestMode()
void ustd::Max72xxMatrix::setTestMode |
( |
bool |
testmode | ) |
|
|
inline |
Set the test mode for the display
- Parameters
-
testmode | If true the display goes into test mode. Set to false for normal operation. |
◆ write()
void ustd::Max72xxMatrix::write |
( |
| ) |
|
|
inline |
Flushes the frame buffer to the display
In order to implement flicker free double buffering, no graphic function has any immediate effect on the display. All graphic operations are buffered into a frame buffer. By calling this method, the current content of the frame buffer is displayed.
The documentation for this class was generated from the following file: