mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
01b5dcdd5c
Former-commit-id: 675c8f578de42d12e25162065c0d0381ad0e08f6
35 lines
571 B
C++
35 lines
571 B
C++
|
|
#pragma once
|
|
|
|
// Hyperion leddevice includes
|
|
#include "LedRs232Device.h"
|
|
|
|
class LedDeviceWs2812b : public LedRs232Device
|
|
{
|
|
public:
|
|
LedDeviceWs2812b();
|
|
|
|
virtual int write(const std::vector<ColorRgb> & ledValues);
|
|
|
|
virtual int switchOff();
|
|
|
|
private:
|
|
|
|
struct ByteSignal
|
|
{
|
|
uint8_t bit_12;
|
|
uint8_t bit_34;
|
|
uint8_t bit_56;
|
|
uint8_t bit_78;
|
|
};
|
|
std::vector<ByteSignal> _byte2signalTable;
|
|
|
|
void fillTable();
|
|
|
|
ByteSignal byte2Signal(const uint8_t byte) const;
|
|
|
|
uint8_t bits2Signal(const bool bit1, const bool bit2) const;
|
|
|
|
std::vector<ByteSignal> _ledBuffer;
|
|
};
|