Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit bd9a5d1

Browse files
committed
Added APA102 Led Device headers
1 parent 0076d60 commit bd9a5d1

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

libsrc/leddevice/LedDeviceAPA102.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#pragma once
2+
3+
// STL includes
4+
#include <string>
5+
6+
// hyperion incluse
7+
#include "LedSpiDevice.h"
8+
9+
///
10+
/// Implementation of the LedDevice interface for writing to APA102 led device.
11+
///
12+
/// APA102 is
13+
///
14+
class LedDeviceAPA102 : public LedSpiDevice
15+
{
16+
public:
17+
///
18+
/// Constructs the LedDevice for a string containing leds of the type APA102
19+
///
20+
/// @param outputDevice The name of the output device (eg '/etc/SpiDev.0.0')
21+
/// @param baudrate The used baudrate for writing to the output device
22+
///
23+
LedDeviceAPA102(const std::string& outputDevice,
24+
const unsigned baudrate);
25+
26+
///
27+
/// Writes the led color values to the led-device
28+
///
29+
/// @param ledValues The color-value per led
30+
/// @return Zero on succes else negative
31+
///
32+
virtual int write(const std::vector<ColorRgb> &ledValues);
33+
34+
/// Switch the leds off
35+
virtual int switchOff();
36+
37+
private:
38+
39+
/// the number of leds (needed when switching off)
40+
size_t mLedCount;
41+
};

0 commit comments

Comments
 (0)