MaxMatrix
Drive chained 8x8 LED dot matrix modules with MAX7219.
Loading...
Searching...
No Matches
MaxMatrixConfig.h
Go to the documentation of this file.
1// Copyright 2020 Andreas Burnickl
2// SPDX-License-Identifier: GPL-3.0-or-later
3
11
12#ifndef MAXMATRIX_SRC_MAXMATRIXCONFIG_H_
13#define MAXMATRIX_SRC_MAXMATRIXCONFIG_H_
14
15// Not Arduino.h: the control program on the host reads the sizes of a module
16// too, without the core.
17#include <stddef.h>
18#include <stdint.h>
19
21
22/*
23 * The configuration. Each parameter can be given on the compiler command line
24 * instead, which is how the tests build both the bit banging and the SPI
25 * variant. The Arduino IDE does not pass a sketch's defines to a library, so
26 * for a sketch they are changed here.
27 */
28
33#ifndef MAXMATRIX_USE_SPI
34#define MAXMATRIX_USE_SPI STD_OFF
35#endif
36
38#ifndef MAXMATRIX_SPI_CLOCK_SPEED
39// NOLINTNEXTLINE(cppcoreguidelines-macro-usage): T-6, a sketch sets it
40#define MAXMATRIX_SPI_CLOCK_SPEED 10000000
41#endif
42
45#ifndef MAXMATRIX_SPACE_BETWEEN_CHARS_INIT_VALUE
46// NOLINTNEXTLINE(cppcoreguidelines-macro-usage): T-6, a sketch sets it
47#define MAXMATRIX_SPACE_BETWEEN_CHARS_INIT_VALUE 1
48#endif
49
51#ifndef MAXMATRIX_INTENSITY_INIT_VALUE
52// NOLINTNEXTLINE(cppcoreguidelines-macro-usage): T-6, a sketch sets it
53#define MAXMATRIX_INTENSITY_INIT_VALUE 5
54#endif
55
58#ifndef MAXMATRIX_COMMAND_LINE_LENGTH
59// NOLINTNEXTLINE(cppcoreguidelines-macro-usage): T-6, a sketch sets it
60#define MAXMATRIX_COMMAND_LINE_LENGTH 64
61#endif
62
67#ifndef MAXMATRIX_SHIFT_INTERVAL_INIT_VALUE
68// NOLINTNEXTLINE(cppcoreguidelines-macro-usage): T-6, a sketch sets it
69#define MAXMATRIX_SHIFT_INTERVAL_INIT_VALUE 50
70#endif
71
72// STD_ON reports every error to ReportError(), see MaxMatrixError.h.
73// Not a block: the Doxyfile sets it, so that the report is in the reference,
74// and the README's table has it.
75#ifndef MAXMATRIX_DEV_ERROR_DETECT
76#define MAXMATRIX_DEV_ERROR_DETECT STD_OFF
77#endif
78
79namespace max_matrix {
80
82constexpr uint8_t kColumnNumberOfModule{8};
83
85constexpr uint8_t kRowNumberOfModule{8};
86
92constexpr uint8_t kMaxNumberOfModules{31};
93
100constexpr size_t BufferSize(size_t modules) {
101 return modules * kColumnNumberOfModule;
102}
103
104} // namespace max_matrix
105
106#endif // MAXMATRIX_SRC_MAXMATRIXCONFIG_H_
constexpr uint8_t kMaxNumberOfModules
The most modules a chain may have: a column is counted in a byte throughout, as an index into the buf...
Definition MaxMatrixConfig.h:92
constexpr uint8_t kColumnNumberOfModule
The columns of one module.
Definition MaxMatrixConfig.h:82
constexpr size_t BufferSize(size_t modules)
The bytes of the buffer of a chain, one per column.
Definition MaxMatrixConfig.h:100
constexpr uint8_t kRowNumberOfModule
The rows of one module, and of the matrix.
Definition MaxMatrixConfig.h:85
The values of a switch of the configuration, and the end of a text.