21 #ifndef PLUGINS_SPI_SPIOUTPUT_H_
22 #define PLUGINS_SPI_SPIOUTPUT_H_
32 #include "ola/rdm/ResponderPersonality.h"
42 std::string device_label;
44 uint8_t output_number;
46 explicit Options(uint8_t output_number,
const std::string &spi_device_name)
47 : device_label(
"SPI Device - " + spi_device_name),
49 output_number(output_number) {
58 std::string GetDeviceLabel()
const;
59 bool SetDeviceLabel(
const std::string &device_label);
60 uint8_t GetPersonality()
const;
61 bool SetPersonality(uint16_t personality);
62 uint16_t GetStartAddress()
const;
63 bool SetStartAddress(uint16_t start_address);
64 unsigned int PixelCount()
const {
return m_pixel_count; }
66 std::string Description()
const;
80 static RDMOps *Instance() {
82 instance =
new RDMOps();
87 RDMOps() : ola::rdm::ResponderOps<SPIOutput>(PARAM_HANDLERS) {}
89 static RDMOps *instance;
92 class SPIBackendInterface *m_backend;
93 const uint8_t m_output_number;
94 std::string m_spi_device_name;
96 const unsigned int m_pixel_count;
97 std::string m_device_label;
98 uint16_t m_start_address;
100 std::auto_ptr<ola::rdm::PersonalityCollection> m_personality_collection;
101 std::auto_ptr<ola::rdm::PersonalityManager> m_personality_manager;
102 ola::rdm::Sensors m_sensors;
103 std::auto_ptr<ola::rdm::NetworkManagerInterface> m_network_manager;
106 bool InternalWriteDMX(
const DmxBuffer &buffer);
107 void IndividualWS2801Control(
const DmxBuffer &buffer);
108 void CombinedWS2801Control(
const DmxBuffer &buffer);
109 void IndividualLPD8806Control(
const DmxBuffer &buffer);
110 void CombinedLPD8806Control(
const DmxBuffer &buffer);
111 void IndividualP9813Control(
const DmxBuffer &buffer);
112 void CombinedP9813Control(
const DmxBuffer &buffer);
113 unsigned int LPD8806BufferSize()
const;
114 void WriteSPIData(
const uint8_t *data,
unsigned int length);
171 uint8_t P9813CreateFlag(uint8_t red, uint8_t green, uint8_t blue);
173 static const uint8_t SPI_MODE;
174 static const uint8_t SPI_BITS_PER_WORD;
175 static const uint16_t SPI_DELAY;
176 static const uint32_t SPI_SPEED;
177 static const uint16_t WS2801_SLOTS_PER_PIXEL;
178 static const uint16_t LPD8806_SLOTS_PER_PIXEL;
179 static const uint16_t P9813_SLOTS_PER_PIXEL;
180 static const uint16_t P9813_SPI_BYTES_PER_PIXEL;
188 #endif // PLUGINS_SPI_SPIOUTPUT_H_