8x8 Led Matrix Library 1.0.0
This is a library for the 8x8 Led Matrix by Soldered
Loading...
Searching...
No Matches
MD_MAX72xx_lib.h
Go to the documentation of this file.
1/*
2MD_MAX72xx - Library for using a MAX7219/7221 LED matrix controller
3
4See header file for comments
5
6This file contains library related definitions and is not visible
7to user code.
8
9Copyright (C) 2012-14 Marco Colli. All rights reserved.
10
11This library is free software; you can redistribute it and/or
12modify it under the terms of the GNU Lesser General Public
13License as published by the Free Software Foundation; either
14version 2.1 of the License, or (at your option) any later version.
15
16This library is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19Lesser General Public License for more details.
20
21You should have received a copy of the GNU Lesser General Public
22License along with this library; if not, write to the Free Software
23Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25#pragma once
26
27#include "MD_MAX72xx.h"
28
34#define MAX_DEBUG 0
35
36#if MAX_DEBUG
37#define PRINT(s, v) \
38 { \
39 Serial.print(F(s)); \
40 Serial.print(v); \
41 }
42#define PRINTX(s, v) \
43 { \
44 Serial.print(F(s)); \
45 Serial.print(v, HEX); \
46 }
47#define PRINTB(s, v) \
48 { \
49 Serial.print(F(s)); \
50 Serial.print(v, BIN); \
51 }
52#define PRINTS(s) \
53 { \
54 Serial.print(F(s)); \
55 }
56#else
57#define PRINT(s, v)
58#define PRINTX(s, v)
59#define PRINTB(s, v)
60#define PRINTS(s)
61#endif
62
63// Opcodes for the MAX7221 and MAX7219
64// All OP_DIGITn are offsets from OP_DIGIT0
65#define OP_NOOP 0
66#define OP_DIGIT0 1
67#define OP_DIGIT1 2
68#define OP_DIGIT2 3
69#define OP_DIGIT3 4
70#define OP_DIGIT4 5
71#define OP_DIGIT5 6
72#define OP_DIGIT6 7
73#define OP_DIGIT7 8
74#define OP_DECODEMODE 9
75#define OP_INTENSITY 10
76#define OP_SCANLIMIT 11
77#define OP_SHUTDOWN 12
78#define OP_DISPLAYTEST 15
79
80#define ALL_CHANGED 0xff
81#define ALL_CLEAR 0x00
82
83#define FONT_FILE_INDICATOR 'F'
84
85// Shortcuts
86#define SPI_DATA_SIZE (sizeof(uint8_t) * _maxDevices * 2)
87#define SPI_OFFSET(i, x) (((LAST_BUFFER - (i)) * 2) + (x))
88
89#define FIRST_BUFFER 0
90#define LAST_BUFFER (_maxDevices - 1)
91
92// Macros to map reversed ROW and COLUMN coordinates
93#define HW_ROW(r) (_hwRevRows ? (ROW_SIZE - 1 - (r)) : (r))
94#define HW_COL(c) (_hwRevCols ? (COL_SIZE - 1 - (c)) : (c))
95
96// variables shared in the library
97extern const uint8_t PROGMEM _sysfont[];
98
const uint8_t numeric7Seg[] PROGMEM
Definition Font_Data.h:4
Main header file for the MD_MAX72xx library.
const uint8_t PROGMEM _sysfont[]
System variable pitch font table.
Definition MD_MAX72xx_font.cpp:217