Create 4-phase RX timing from 3-phase chipset timing with tolerance.
Converts FastLED's 3-phase timing (T1, T2, T3) to 4-phase RX timing with configurable tolerance for signal variations.
3-phase encoding (FastLED chipset timing):
- T1: High time for bit 0
- T2: Additional high time for bit 1 (T1H = T1 + T2)
- T3: Low time for bit 1 (T1L = T3) Note: Bit 0 low time is derived as T0L = T2 + T3
4-phase decoding (actual encoder output):
- Bit 0: T0H (T1 high) + T0L ((T2+T3) low)
- Bit 1: T1H ((T1+T2) high) + T1L (T3 low)
4-phase decoding thresholds with tolerance:
- T0H: [T1 - tolerance_ns, T1 + tolerance_ns]
- T0L: [(T2+T3) - tolerance_ns, (T2+T3) + tolerance_ns]
- T1H: [(T1+T2) - tolerance_ns, (T1+T2) + tolerance_ns]
- T1L: [T3 - tolerance_ns, T3 + tolerance_ns]
- Parameters
-
| timing_3phase | 3-phase chipset timing configuration |
| tolerance_ns | Tolerance for all timings (default: 150ns, accounts for jitter/drift) |
- Returns
- ChipsetTiming4Phase 4-phase RX timing structure
Example:
ChipsetTiming4Phase make4PhaseTiming(const ChipsetTiming &timing_3phase, u32 tolerance_ns) FL_NOEXCEPT
Create 4-phase RX timing from 3-phase chipset timing with tolerance.
Generic chipset timing entry Provides T1, T2, T3 timing parameters in nanoseconds for any LED protoco...
Definition at line 51 of file rx.cpp.hpp.
52 {
53
54
55
56
57 u32 t0h = timing_3phase.
T1;
58 u32 t0l = timing_3phase.
T2 + timing_3phase.
T3;
59 u32 t1h = timing_3phase.
T1 + timing_3phase.
T2;
60 u32 t1l = timing_3phase.
T3;
61
63
64
65 result.t0h_min_ns = (t0h > tolerance_ns) ? (t0h - tolerance_ns) : 0;
66 result.t0h_max_ns = t0h + tolerance_ns;
67 result.t0l_min_ns = (t0l > tolerance_ns) ? (t0l - tolerance_ns) : 0;
68 result.t0l_max_ns = t0l + tolerance_ns;
69
70
71 result.t1h_min_ns = (t1h > tolerance_ns) ? (t1h - tolerance_ns) : 0;
72 result.t1h_max_ns = t1h + tolerance_ns;
73 result.t1l_min_ns = (t1l > tolerance_ns) ? (t1l - tolerance_ns) : 0;
74 result.t1l_max_ns = t1l + tolerance_ns;
75
76
78
79
80
82}
expected< T, E > result
Alias for expected (Rust-style naming)
u32 RESET
Reset/latch time (microseconds)
u32 T2
Additional high time for bit 1 (nanoseconds)
u32 T3
Low tail duration (nanoseconds)
u32 T1
High time for bit 0 (nanoseconds)
4-phase RX timing thresholds for chipset detection
References FL_NOEXCEPT.
Referenced by autoResearchLowMemorySetup(), capture(), and AutoResearchRemoteControl::registerFunctions().