HF-WS2812 Driver 0.1.0-dev
HF-WS2812 ESP32 RMT Driver
Loading...
Searching...
No Matches
esp32_ws2812_test_config.hpp
Go to the documentation of this file.
1
15#pragma once
16
17#include <cstdint>
18
19//==============================================================================
20// COMPILE-TIME CONFIGURATION FLAGS
21//==============================================================================
22
37#ifndef ESP32_WS2812_ENABLE_DETAILED_LOGGING
38#define ESP32_WS2812_ENABLE_DETAILED_LOGGING 0
39#endif
40
42
48struct LedPins {
49 static constexpr uint8_t DATA_ = 8;
50};
51
57struct RMTConfig {
58 static constexpr uint8_t CHANNEL = 0;
59};
60
66struct StripSpecs {
67 static constexpr uint32_t NUM_LEDS = 16;
68 static constexpr uint8_t DEFAULT_BRIGHTNESS = 50;
69 static constexpr bool IS_RGBW = false;
70};
71
80 static constexpr uint16_t T0H_NS = 300;
81 static constexpr uint16_t T0L_NS = 900;
82 static constexpr uint16_t T1H_NS = 900;
83 static constexpr uint16_t T1L_NS = 300;
84 static constexpr uint16_t RESET_US = 280;
85};
86
93 static constexpr float VDD_MIN = 3.5f;
94 static constexpr float VDD_NOM = 5.0f;
95 static constexpr float VDD_MAX = 5.3f;
96};
97
104 static constexpr float CURRENT_PER_LED_MA = 60.0f;
105 static constexpr float IDLE_CURRENT_MA = 1.0f;
106};
107
114 static constexpr int16_t OPERATING_MIN = -25;
115 static constexpr int16_t OPERATING_MAX = 80;
116 static constexpr int16_t WARNING_THRESHOLD = 70;
117};
118
124struct Timing {
125 static constexpr uint16_t REFRESH_INTERVAL_MS = 16;
126 static constexpr uint16_t EFFECT_STEP_MS = 20;
127 static constexpr uint16_t POWER_ON_DELAY_MS = 10;
128};
129
136 static constexpr uint16_t POLL_INTERVAL_MS = 1000;
137 static constexpr uint8_t MAX_RETRY_COUNT = 3;
138};
139
146 static constexpr uint16_t TEST_DURATION_MS = 5000;
147 static constexpr uint16_t COLOR_CYCLE_DELAY_MS = 50;
148 static constexpr uint8_t TEST_BRIGHTNESS = 64;
149};
150
156struct AppConfig {
157 // Logging
158 static constexpr bool ENABLE_DEBUG_LOGGING = true;
159 static constexpr bool ENABLE_RMT_LOGGING = false;
160
161 // Performance
162 static constexpr bool ENABLE_PERFORMANCE_MONITORING = true;
163 static constexpr uint16_t STATS_REPORT_INTERVAL_MS = 10000;
164
165 // Error handling
166 static constexpr bool ENABLE_AUTO_RECOVERY = true;
167 static constexpr uint8_t MAX_ERROR_COUNT = 10;
168};
169
170} // namespace WS2812_TestConfig
171
177static_assert(WS2812_TestConfig::StripSpecs::NUM_LEDS > 0,
178 "Number of LEDs must be greater than 0");
179
180static_assert(WS2812_TestConfig::StripSpecs::DEFAULT_BRIGHTNESS <= 255,
181 "Brightness must be 0-255");
182
183static_assert(WS2812_TestConfig::SignalTiming::T0H_NS + WS2812_TestConfig::SignalTiming::T0L_NS > 0,
184 "Signal timing values must be positive");
185
186static_assert(WS2812_TestConfig::SignalTiming::T1H_NS + WS2812_TestConfig::SignalTiming::T1L_NS > 0,
187 "Signal timing values must be positive");
188
192#define WS2812_VALIDATE_GPIO(pin) \
193 static_assert((pin) >= 0 && (pin) < 30, "Invalid GPIO pin number for ESP32-C6")
Definition esp32_ws2812_test_config.hpp:41
Application-specific Configuration.
Definition esp32_ws2812_test_config.hpp:156
static constexpr bool ENABLE_RMT_LOGGING
Enable RMT transaction logs.
Definition esp32_ws2812_test_config.hpp:159
static constexpr bool ENABLE_DEBUG_LOGGING
Enable detailed debug logs.
Definition esp32_ws2812_test_config.hpp:158
static constexpr uint8_t MAX_ERROR_COUNT
Maximum errors before failsafe.
Definition esp32_ws2812_test_config.hpp:167
static constexpr uint16_t STATS_REPORT_INTERVAL_MS
Statistics reporting interval.
Definition esp32_ws2812_test_config.hpp:163
static constexpr bool ENABLE_PERFORMANCE_MONITORING
Enable performance metrics.
Definition esp32_ws2812_test_config.hpp:162
static constexpr bool ENABLE_AUTO_RECOVERY
Enable automatic error recovery.
Definition esp32_ws2812_test_config.hpp:166
Diagnostic Thresholds.
Definition esp32_ws2812_test_config.hpp:135
static constexpr uint8_t MAX_RETRY_COUNT
Maximum RMT init retries.
Definition esp32_ws2812_test_config.hpp:137
static constexpr uint16_t POLL_INTERVAL_MS
Diagnostic polling interval (ms)
Definition esp32_ws2812_test_config.hpp:136
LED Strip Pin Configuration for ESP32-C6.
Definition esp32_ws2812_test_config.hpp:48
static constexpr uint8_t DATA_
GPIO8 - WS2812 data pin.
Definition esp32_ws2812_test_config.hpp:49
Current Consumption Estimates.
Definition esp32_ws2812_test_config.hpp:103
static constexpr float CURRENT_PER_LED_MA
Max current per LED at full white (mA)
Definition esp32_ws2812_test_config.hpp:104
static constexpr float IDLE_CURRENT_MA
Current per LED when off (mA)
Definition esp32_ws2812_test_config.hpp:105
RMT Channel Configuration.
Definition esp32_ws2812_test_config.hpp:57
static constexpr uint8_t CHANNEL
RMT channel number.
Definition esp32_ws2812_test_config.hpp:58
WS2812 Signal Timing Parameters (nanoseconds)
Definition esp32_ws2812_test_config.hpp:79
static constexpr uint16_t T0L_NS
Logic 0, low time (ns)
Definition esp32_ws2812_test_config.hpp:81
static constexpr uint16_t T1H_NS
Logic 1, high time (ns)
Definition esp32_ws2812_test_config.hpp:82
static constexpr uint16_t T0H_NS
Logic 0, high time (ns)
Definition esp32_ws2812_test_config.hpp:80
static constexpr uint16_t T1L_NS
Logic 1, low time (ns)
Definition esp32_ws2812_test_config.hpp:83
static constexpr uint16_t RESET_US
Reset/latch time (μs)
Definition esp32_ws2812_test_config.hpp:84
LED Strip Specifications.
Definition esp32_ws2812_test_config.hpp:66
static constexpr uint32_t NUM_LEDS
Number of LEDs in the strip.
Definition esp32_ws2812_test_config.hpp:67
static constexpr uint8_t DEFAULT_BRIGHTNESS
Default brightness (0-255)
Definition esp32_ws2812_test_config.hpp:68
static constexpr bool IS_RGBW
true for RGBW strips, false for RGB
Definition esp32_ws2812_test_config.hpp:69
Supply Voltage Specifications (volts)
Definition esp32_ws2812_test_config.hpp:92
static constexpr float VDD_MIN
Minimum VDD voltage (V)
Definition esp32_ws2812_test_config.hpp:93
static constexpr float VDD_MAX
Maximum VDD voltage (V)
Definition esp32_ws2812_test_config.hpp:95
static constexpr float VDD_NOM
Nominal VDD voltage (V)
Definition esp32_ws2812_test_config.hpp:94
Temperature Specifications (celsius)
Definition esp32_ws2812_test_config.hpp:113
static constexpr int16_t OPERATING_MAX
Maximum operating temperature (°C)
Definition esp32_ws2812_test_config.hpp:115
static constexpr int16_t OPERATING_MIN
Minimum operating temperature (°C)
Definition esp32_ws2812_test_config.hpp:114
static constexpr int16_t WARNING_THRESHOLD
Temperature warning threshold (°C)
Definition esp32_ws2812_test_config.hpp:116
Test Configuration.
Definition esp32_ws2812_test_config.hpp:145
static constexpr uint8_t TEST_BRIGHTNESS
Brightness level for tests (0-255)
Definition esp32_ws2812_test_config.hpp:148
static constexpr uint16_t TEST_DURATION_MS
Test duration (ms)
Definition esp32_ws2812_test_config.hpp:146
static constexpr uint16_t COLOR_CYCLE_DELAY_MS
Color cycle step delay (ms)
Definition esp32_ws2812_test_config.hpp:147
Timing Parameters.
Definition esp32_ws2812_test_config.hpp:124
static constexpr uint16_t EFFECT_STEP_MS
Effect animation step (ms)
Definition esp32_ws2812_test_config.hpp:126
static constexpr uint16_t POWER_ON_DELAY_MS
Power-on stabilization delay (ms)
Definition esp32_ws2812_test_config.hpp:127
static constexpr uint16_t REFRESH_INTERVAL_MS
LED refresh interval (~60fps) (ms)
Definition esp32_ws2812_test_config.hpp:125