hyperion.ng
LedDeviceWS281x.h
1 #pragma once
2 
3 #include <leddevice/LedDevice.h>
4 #include <ws2811.h>
5 
9 class LedDeviceWS281x : public LedDevice
10 {
11 public:
17  LedDeviceWS281x(const QJsonObject &deviceConfig);
18 
23 
29  bool init(const QJsonObject &deviceConfig);
30 
32  static LedDevice* construct(const QJsonObject &deviceConfig);
33 
34 private:
41  virtual int write(const std::vector<ColorRgb> &ledValues);
42 
43  ws2811_t _led_string;
44  int _channel;
45  RGBW::WhiteAlgorithm _whiteAlgorithm;
46  ColorRgbw _temp_rgbw;
47 };
Interface (pure virtual base class) for LedDevices.
Definition: LedDevice.h:32
static LedDevice * construct(const QJsonObject &deviceConfig)
constructs leddevice
Definition: LedDeviceWS281x.cpp:63
Implementation of the LedDevice interface for writing to Ws2812 led device via pwm.
Definition: LedDeviceWS281x.h:9
LedDeviceWS281x(const QJsonObject &deviceConfig)
Constructs specific LedDevice.
Definition: LedDeviceWS281x.cpp:5
bool init(const QJsonObject &deviceConfig)
Sets configuration.
Definition: LedDeviceWS281x.cpp:19
Plain-Old-Data structure containing the red-green-blue color specification.
Definition: ColorRgbw.h:13
~LedDeviceWS281x()
Destructor of the LedDevice, waits for DMA to complete and then cleans up.
Definition: LedDeviceWS281x.cpp:11