hyperion.ng
LedDeviceWs2812SPI.h
1 #pragma once
2 
3 // hyperion incluse
4 #include "ProviderSpi.h"
5 
10 {
11 public:
17  LedDeviceWs2812SPI(const QJsonObject &deviceConfig);
18 
20  static LedDevice* construct(const QJsonObject &deviceConfig);
21 
27  virtual bool init(const QJsonObject &deviceConfig);
28 
29 private:
36  virtual int write(const std::vector<ColorRgb> &ledValues);
37 
38  const int SPI_BYTES_PER_COLOUR;
39 
40  const int SPI_FRAME_END_LATCH_BYTES;
41 
42  uint8_t bitpair_to_byte[4];
43 };
static LedDevice * construct(const QJsonObject &deviceConfig)
constructs leddevice
Definition: LedDeviceWs2812SPI.cpp:51
Implementation of the LedDevice interface for writing to Ws2812 led device via spi.
Definition: LedDeviceWs2812SPI.h:9
Interface (pure virtual base class) for LedDevices.
Definition: LedDevice.h:32
virtual bool init(const QJsonObject &deviceConfig)
Sets configuration.
Definition: LedDeviceWs2812SPI.cpp:56
The ProviderSpi implements an abstract base-class for LedDevices using the SPI-device.
Definition: ProviderSpi.h:12
LedDeviceWs2812SPI(const QJsonObject &deviceConfig)
Constructs specific LedDevice.
Definition: LedDeviceWs2812SPI.cpp:37