hyperion.ng
LedDevicePiBlaster.h
1 #pragma once
2 
3 // Hyperion-Leddevice includes
4 #include <leddevice/LedDevice.h>
5 
9 
11 {
12 public:
18  LedDevicePiBlaster(const QJsonObject &deviceConfig);
19 
20  virtual ~LedDevicePiBlaster();
21 
27  bool init(const QJsonObject &deviceConfig);
28 
30  static LedDevice* construct(const QJsonObject &deviceConfig);
31 
38  int open();
39 
40 private:
48  int write(const std::vector<ColorRgb> &ledValues);
49 
51  QString _deviceName;
52 
53  int _gpio_to_led[64];
54  char _gpio_to_color[64];
55 
57  FILE * _fid;
58 
59 };
Interface (pure virtual base class) for LedDevices.
Definition: LedDevice.h:32
Implementation of the LedDevice interface for writing to pi-blaster based PWM LEDs.
Definition: LedDevicePiBlaster.h:10
int open()
Attempts to open the piblaster-device.
Definition: LedDevicePiBlaster.cpp:80
static LedDevice * construct(const QJsonObject &deviceConfig)
constructs leddevice
Definition: LedDevicePiBlaster.cpp:75
LedDevicePiBlaster(const QJsonObject &deviceConfig)
Constructs specific LedDevice.
Definition: LedDevicePiBlaster.cpp:12
bool init(const QJsonObject &deviceConfig)
Sets configuration.
Definition: LedDevicePiBlaster.cpp:43