ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
SmartMatrixHUB75.h
Go to the documentation of this file.
1/**
2 * @file SmartMatrixHUB75.h
3 * @brief Configuration file for SmartMatrix library with HUB75 panels and APA102 support.
4 *
5 * This file provides hardware-specific configurations and settings for SmartMatrix
6 * library usage with HUB75 LED panels and APA102 LED strips, including support for RBG panels.
7 *
8 * SmartMatrix Library - Hardware-Specific Header File (for SmartMatrix Shield for Teensy 4 V5)
9 *
10 * @date 22/12/2024
11 * @author Copyright (c) 2020 Louis Beaudoin (Pixelmatix)
12 */
13
14#pragma once
15
16#ifndef SMARTMATRIXHUB75
17#define SMARTMATRIXHUB75
18
19//#include <MatrixHardware_Teensy3_ShieldV4.h> // SmartLED Shield for Teensy 3 (V4)
20//#include <MatrixHardware_Teensy3_ShieldV1toV3.h> // SmartMatrix Shield for Teensy 3 V1-V3
21//#include <MatrixHardware_Teensy4_ShieldV4Adapter.h> // Teensy 4 Adapter attached to SmartLED Shield for Teensy 3 (V4)
22//#include <MatrixHardware_ESP32_V0.h> // This file contains multiple ESP32 hardware configurations, edit the file to define GPIOPINOUT (or add #define GPIOPINOUT with a hardcoded number before this #include)
23//#include "MatrixHardware_Custom.h" // Copy an existing MatrixHardware file to your Sketch directory, rename, customize, and you can include it like this
24#ifndef HUB75_RBG
25 #include <MatrixHardware_Teensy4_ShieldV5.h> // SmartLED Shield for Teensy 4 (V5)
26#else
27 #include "MatrixHardware_Teensy4_ShieldV5_RBG.h" // SmartLED Shield for Teensy 4 (V5) and panel with swapped green and blue channels (RBG color order)
28#endif
29
30#include <SmartMatrix.h>
31
32/**
33 * @def ENABLE_HUB75_REFRESH
34 * @brief Enables HUB75 refresh support.
35 */
36#define ENABLE_HUB75_REFRESH 1
37
38/**
39 * @def COLOR_DEPTH
40 * @brief Specifies the color depth used for storing pixels in the layers.
41 *
42 * Use 24 for most sketches. If the sketch uses type `rgb24` directly, set COLOR_DEPTH to 24.
43 */
44#define COLOR_DEPTH 24
45
46/**
47 * @var kMatrixWidth
48 * @brief Width of the HUB75 matrix.
49 */
50const uint16_t kMatrixWidth = 64;
51
52/**
53 * @var kMatrixHeight
54 * @brief Height of the HUB75 matrix.
55 */
56const uint16_t kMatrixHeight = 64;
57
58/**
59 * @var kRefreshDepth
60 * @brief Specifies the tradeoff between color quality and refresh rate for HUB75 matrices.
61 */
62const uint8_t kRefreshDepth = 36;
63
64/**
65 * @var kDmaBufferRows
66 * @brief Number of DMA buffer rows for HUB75 matrices.
67 */
68const uint8_t kDmaBufferRows = 4;
69
70/**
71 * @var kPanelType
72 * @brief Specifies the panel type for HUB75 matrices.
73 */
74const uint8_t kPanelType = SM_PANELTYPE_HUB75_32ROW_MOD16SCAN;
75
76/**
77 * @var kMatrixOptions
78 * @brief Options for HUB75 matrices.
79 */
80const uint32_t kMatrixOptions = (SM_HUB75_OPTIONS_NONE);
81
82/**
83 * @var kBackgroundLayerOptions
84 * @brief Background layer options for HUB75 matrices.
85 */
86const uint8_t kBackgroundLayerOptions = (SM_BACKGROUND_OPTIONS_NONE);
87
88/**
89 * @def ENABLE_APA102_REFRESH
90 * @brief Enables APA102 refresh support.
91 */
92#define ENABLE_APA102_REFRESH 1
93
94/**
95 * @var kApaMatrixWidth
96 * @brief Width of the APA matrix or strip.
97 */
98const uint16_t kApaMatrixWidth = 176;
99
100/**
101 * @var kApaMatrixHeight
102 * @brief Height of the APA matrix. Set to 1 for strips.
103 */
104const uint16_t kApaMatrixHeight = 1;
105
106/**
107 * @var kApaRefreshDepth
108 * @brief Not currently used for APA matrices.
109 */
110const uint8_t kApaRefreshDepth = 36;
111
112/**
113 * @var kApaDmaBufferRows
114 * @brief Not currently used for APA matrices.
115 */
116const uint8_t kApaDmaBufferRows = 1;
117
118/**
119 * @var kApaPanelType
120 * @brief Not currently used for APA matrices.
121 */
122const uint8_t kApaPanelType = 0;
123
124/**
125 * @var kApaMatrixOptions
126 * @brief Options for APA matrices, including color order.
127 */
128const uint32_t kApaMatrixOptions = (SM_APA102_OPTIONS_COLOR_ORDER_BGR);
129
130/**
131 * @var kApaBackgroundLayerOptions
132 * @brief Background layer options for APA matrices.
133 */
134const uint8_t kApaBackgroundLayerOptions = (SM_BACKGROUND_OPTIONS_NONE);
135
136#endif
const uint8_t kDmaBufferRows
Number of DMA buffer rows for HUB75 matrices.
const uint16_t kApaMatrixHeight
const uint8_t kApaPanelType
const uint32_t kApaMatrixOptions
const uint8_t kPanelType
Specifies the panel type for HUB75 matrices.
const uint8_t kApaRefreshDepth
const uint8_t kApaDmaBufferRows
const uint8_t kBackgroundLayerOptions
Background layer options for HUB75 matrices.
const uint8_t kRefreshDepth
Specifies the tradeoff between color quality and refresh rate for HUB75 matrices.
const uint16_t kMatrixWidth
Width of the HUB75 matrix.
const uint8_t kApaBackgroundLayerOptions
const uint32_t kMatrixOptions
Options for HUB75 matrices.
const uint16_t kMatrixHeight
Height of the HUB75 matrix.
const uint16_t kApaMatrixWidth