FastLED 3.9.15
Loading...
Searching...
No Matches
chipset_timing_config.h
Go to the documentation of this file.
1
8
9#pragma once
10
11#include "fl/stl/stdint.h"
14#include "fl/stl/noexcept.h"
15
16namespace fl {
17
24 : t1_ns(0), t2_ns(0), t3_ns(0), reset_us(0), name("UNSET") {}
25 constexpr ChipsetTimingConfig(u32 t1, u32 t2, u32 t3, u32 reset,
26 const char* name = "UNNAMED CHIPSET") FL_NOEXCEPT
27 : t1_ns(t1), t2_ns(t2), t3_ns(t3), reset_us(reset), name(name) {}
28
29 u32 t1_ns;
30 u32 t2_ns;
31 u32 t3_ns;
33 const char* name;
34
36 constexpr u32 total_period_ns() const FL_NOEXCEPT {
37 return t1_ns + t2_ns + t3_ns;
38 }
39
41 constexpr bool operator==(const ChipsetTimingConfig& other) const FL_NOEXCEPT {
42 return t1_ns == other.t1_ns &&
43 t2_ns == other.t2_ns &&
44 t3_ns == other.t3_ns &&
45 reset_us == other.reset_us;
46 }
47
49 constexpr bool operator!=(const ChipsetTimingConfig& other) const FL_NOEXCEPT {
50 return !(*this == other);
51 }
52};
53
62template <typename CHIPSET>
64 return {
65 CHIPSET::T1, // t1_ns
66 CHIPSET::T2, // t2_ns
67 CHIPSET::T3, // t3_ns
68 CHIPSET::RESET, // reset_us
69 "CHIPSET" // name (generic placeholder)
70 };
71}
72
73} // namespace fl
Encoding pipeline selector for clockless LED chipsets.
Centralized LED chipset timing definitions with nanosecond precision.
constexpr ChipsetTimingConfig makeTimingConfig() FL_NOEXCEPT
Convert compile-time CHIPSET type to runtime timing config.
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT
u32 t1_ns
T0H: High time for bit 0 (nanoseconds)
constexpr bool operator==(const ChipsetTimingConfig &other) const FL_NOEXCEPT
Equality operator (all timing fields participate; name ignored)
u32 t2_ns
T1H-T0H: Additional high time for bit 1 (nanoseconds)
constexpr bool operator!=(const ChipsetTimingConfig &other) const FL_NOEXCEPT
Inequality operator.
u32 reset_us
Reset/latch time (microseconds)
const char * name
Human-readable chipset name.
constexpr u32 total_period_ns() const FL_NOEXCEPT
Get total bit period (T1 + T2 + T3)
u32 t3_ns
T0L: Low tail duration (nanoseconds)
constexpr ChipsetTimingConfig(u32 t1, u32 t2, u32 t3, u32 reset, const char *name="UNNAMED CHIPSET") FL_NOEXCEPT
constexpr ChipsetTimingConfig() FL_NOEXCEPT
Runtime bit-period timing for a clockless chipset.