FastLED 3.10.8
Loading...
Searching...
No Matches
wave3.h
Go to the documentation of this file.
2
3#pragma once
4
5// allow-include-after-namespace
6
7#include "fl/stl/align.h"
9#include "fl/stl/stdint.h"
10#include "fl/stl/noexcept.h"
11
12namespace fl {
13
14struct ChipsetTiming;
15
21struct Wave3Byte {
22 u8 data[3]; // 24 bits total (8 LED bits × 3 ticks each)
23};
24
32struct FL_ALIGNAS(4) Wave3BitExpansionLut {
33 u16 lut[16]; // nibble → 12-bit pattern in lower bits of u16
34};
35
43bool canUseWave3(const ChipsetTiming& timing) FL_NO_EXCEPT;
44
51u32 wave3ClockFrequencyHz(const ChipsetTiming& timing) FL_NO_EXCEPT;
52
60Wave3BitExpansionLut buildWave3ExpansionLUT(const ChipsetTiming& timing) FL_NO_EXCEPT;
61
62// Forward declaration; implementation is out-of-line in detail/wave3.cpp.hpp
63void wave3(u8 lane,
64 const Wave3BitExpansionLut& lut,
65 u8 (&FL_RESTRICT_PARAM output)[sizeof(Wave3Byte)]) FL_NO_EXCEPT;
66
67// Public transposition functions (implementations in wave3.cpp.hpp)
69 const u8 (&FL_RESTRICT_PARAM lanes)[2],
70 const Wave3BitExpansionLut& lut,
71 u8 (&FL_RESTRICT_PARAM output)[2 * sizeof(Wave3Byte)]) FL_NO_EXCEPT;
72
74 const u8 (&FL_RESTRICT_PARAM lanes)[4],
75 const Wave3BitExpansionLut& lut,
76 u8 (&FL_RESTRICT_PARAM output)[4 * sizeof(Wave3Byte)]) FL_NO_EXCEPT;
77
79 const u8 (&FL_RESTRICT_PARAM lanes)[8],
80 const Wave3BitExpansionLut& lut,
81 u8 (&FL_RESTRICT_PARAM output)[8 * sizeof(Wave3Byte)]) FL_NO_EXCEPT;
82
84 const u8 (&FL_RESTRICT_PARAM lanes)[16],
85 const Wave3BitExpansionLut& lut,
86 u8 (&FL_RESTRICT_PARAM output)[16 * sizeof(Wave3Byte)]) FL_NO_EXCEPT;
87
88// Untranspose functions (for testing - reverse the transpose operation)
90 const u8 (&FL_RESTRICT_PARAM transposed)[2 * sizeof(Wave3Byte)],
91 u8 (&FL_RESTRICT_PARAM output)[2 * sizeof(Wave3Byte)]) FL_NO_EXCEPT;
92
94 const u8 (&FL_RESTRICT_PARAM transposed)[4 * sizeof(Wave3Byte)],
95 u8 (&FL_RESTRICT_PARAM output)[4 * sizeof(Wave3Byte)]) FL_NO_EXCEPT;
96
98 const u8 (&FL_RESTRICT_PARAM transposed)[8 * sizeof(Wave3Byte)],
99 u8 (&FL_RESTRICT_PARAM output)[8 * sizeof(Wave3Byte)]) FL_NO_EXCEPT;
100
102 const u8 (&FL_RESTRICT_PARAM transposed)[16 * sizeof(Wave3Byte)],
103 u8 (&FL_RESTRICT_PARAM output)[16 * sizeof(Wave3Byte)]) FL_NO_EXCEPT;
104
105} // namespace fl
106
107// Include inline implementations for optimal performance
108// This must be after the namespace to avoid the include-after-namespace linter error
Alignment macros and utilities for FastLED.
#define FL_RESTRICT_PARAM
unsigned char u8
Definition stdint.h:131
FL_OPTIMIZE_FUNCTION FL_IRAM void wave3Transpose_2(const u8(&FL_RESTRICT_PARAM lanes)[2], const Wave3BitExpansionLut &lut, u8(&FL_RESTRICT_PARAM output)[2 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
unsigned char u8
Definition stdint.h:131
FL_OPTIMIZE_FUNCTION void wave3Untranspose_2(const u8(&FL_RESTRICT_PARAM transposed)[2 *sizeof(Wave3Byte)], u8(&FL_RESTRICT_PARAM output)[2 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
FL_OPTIMIZE_FUNCTION Wave3BitExpansionLut buildWave3ExpansionLUT(const ChipsetTiming &timing) FL_NO_EXCEPT
Build a Wave3BitExpansionLut from chipset timing data.
Definition wave3.cpp.hpp:70
FL_OPTIMIZE_FUNCTION u32 wave3ClockFrequencyHz(const ChipsetTiming &timing) FL_NO_EXCEPT
Calculate the clock frequency for wave3 encoding.
Definition wave3.cpp.hpp:55
FL_OPTIMIZE_FUNCTION FL_IRAM void wave3Transpose_16(const u8(&FL_RESTRICT_PARAM lanes)[16], const Wave3BitExpansionLut &lut, u8(&FL_RESTRICT_PARAM output)[16 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
FL_IRAM FL_OPTIMIZE_FUNCTION void wave3(u8 lane, const Wave3BitExpansionLut &lut, u8(&FL_RESTRICT_PARAM output)[sizeof(Wave3Byte)]) FL_NO_EXCEPT
Public single-lane wave3 encoder.
FL_OPTIMIZE_FUNCTION FL_IRAM void wave3Transpose_8(const u8(&FL_RESTRICT_PARAM lanes)[8], const Wave3BitExpansionLut &lut, u8(&FL_RESTRICT_PARAM output)[8 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
FL_OPTIMIZE_FUNCTION void wave3Untranspose_4(const u8(&FL_RESTRICT_PARAM transposed)[4 *sizeof(Wave3Byte)], u8(&FL_RESTRICT_PARAM output)[4 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
FL_OPTIMIZE_FUNCTION FL_IRAM void wave3Transpose_4(const u8(&FL_RESTRICT_PARAM lanes)[4], const Wave3BitExpansionLut &lut, u8(&FL_RESTRICT_PARAM output)[4 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
struct FL_ALIGNAS(4) Wave3BitExpansionLut
Lookup table for nibble-to-waveform expansion in wave3 format (32 bytes)
Definition wave3.h:32
FL_OPTIMIZE_FUNCTION void wave3Untranspose_16(const u8(&FL_RESTRICT_PARAM transposed)[16 *sizeof(Wave3Byte)], u8(&FL_RESTRICT_PARAM output)[16 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
FL_OPTIMIZE_FUNCTION bool canUseWave3(const ChipsetTiming &timing) FL_NO_EXCEPT
Check if a chipset timing is eligible for wave3 encoding.
Definition wave3.cpp.hpp:26
FL_OPTIMIZE_FUNCTION void wave3Untranspose_8(const u8(&FL_RESTRICT_PARAM transposed)[8 *sizeof(Wave3Byte)], u8(&FL_RESTRICT_PARAM output)[8 *sizeof(Wave3Byte)]) FL_NO_EXCEPT
Base definition for an LED controller.
Definition crgb.hpp:179
u8 data[3]
Definition wave3.h:22
Type-safe container for 3-byte wave pulse pattern (wave3 encoding)
Definition wave3.h:21
Generic chipset timing entry Provides T1, T2, T3 timing parameters in nanoseconds for any LED protoco...
Definition led_timing.h:86
#define FL_NO_EXCEPT