Check if a chipset timing is eligible for wave3 encoding.
Wave3 requires that normalized T0H and T1H round to exactly 1 and 2 ticks (or 2 and 1) out of 3, and both are in [1,2].
- Parameters
-
- Returns
- true if wave3 encoding is possible for this chipset
Definition at line 25 of file wave3.cpp.hpp.
25 {
26 const u32 period = timing.
T1 + timing.
T2 + timing.
T3;
27 if (period == 0) {
28 return false;
29 }
30
31
32 const float t0h_norm =
static_cast<float>(timing.
T1) / period;
33 const float t1h_norm =
static_cast<float>(timing.
T1 + timing.
T2) / period;
34
35
36 u32 ticks_bit0 = static_cast<u32>(t0h_norm * 3.0f + 0.5f);
37 u32 ticks_bit1 = static_cast<u32>(t1h_norm * 3.0f + 0.5f);
38
39
40 if (ticks_bit0 < 1 || ticks_bit0 > 2) return false;
41 if (ticks_bit1 < 1 || ticks_bit1 > 2) return false;
42
43
44 if (ticks_bit0 == ticks_bit1) return false;
45
46 return true;
47}
u32 T2
Additional high time for bit 1 (nanoseconds)
u32 T3
Low tail duration (nanoseconds)
u32 T1
High time for bit 0 (nanoseconds)
References fl::ChipsetTiming::T1, fl::ChipsetTiming::T2, and fl::ChipsetTiming::T3.
Referenced by capture().