FastLED 3.9.15
Loading...
Searching...
No Matches
ifastled.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stl/span.h"
4#include "fl/stl/stdint.h"
5#include "fl/stl/noexcept.h"
6
7namespace fl {
8
24class IFastLED {
25public:
26 virtual ~IFastLED() FL_NOEXCEPT = default;
27
28 // LED array access
29
34 virtual fl::span<CRGB> getLEDs() = 0;
35
40 virtual size_t getNumLEDs() const = 0;
41
42 // Output control
43
48 virtual void show() = 0;
49
54 virtual void show(u8 brightness) = 0;
55
60 virtual void clear(bool writeToStrip = false) = 0;
61
62 // Brightness
63
68 virtual void setBrightness(u8 brightness) = 0;
69
74 virtual u8 getBrightness() const = 0;
75
76 // Color correction
77
82 virtual void setCorrection(CRGB correction) = 0;
83
88 virtual void setTemperature(CRGB temperature) = 0;
89
90 // Timing
91
96 virtual void delay(unsigned long ms) = 0;
97
102 virtual void setMaxRefreshRate(u16 fps) = 0;
103
108 virtual u16 getMaxRefreshRate() const = 0;
109
110 // Advanced features (segment support for WLED)
111
120 virtual void setSegment(size_t start, size_t end) = 0;
121
125 virtual void clearSegment() = 0;
126};
127
128} // namespace fl
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
virtual void show()=0
Send the LED data to the strip Uses the current brightness setting.
virtual void setBrightness(u8 brightness)=0
Set the global brightness.
virtual void clear(bool writeToStrip=false)=0
Clear all LEDs (set to black)
virtual size_t getNumLEDs() const =0
Get the number of LEDs.
virtual void delay(unsigned long ms)=0
Delay for a specified number of milliseconds.
virtual u8 getBrightness() const =0
Get the current global brightness.
virtual void clearSegment()=0
Clear the segment range (operate on full LED array)
virtual void setMaxRefreshRate(u16 fps)=0
Set the maximum refresh rate.
virtual void setTemperature(CRGB temperature)=0
Set color temperature.
virtual void setSegment(size_t start, size_t end)=0
Set a segment range for subsequent operations.
virtual fl::span< CRGB > getLEDs()=0
Get the LED array as a span.
virtual void setCorrection(CRGB correction)=0
Set color correction.
virtual ~IFastLED() FL_NOEXCEPT=default
virtual u16 getMaxRefreshRate() const =0
Get the maximum refresh rate.
Pure virtual interface for FastLED operations.
Definition ifastled.h:24
unsigned char u8
Definition stdint.h:131
constexpr T * end(T(&array)[N]) FL_NOEXCEPT
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Definition crgb.h:38