21 #ifndef PLUGINS_SPI_SPIOUTPUT_H_
22 #define PLUGINS_SPI_SPIOUTPUT_H_
31 #include "ola/rdm/ResponderPersonality.h"
42 uint8_t output_number;
44 explicit Options(uint8_t output_number)
46 output_number(output_number) {
55 uint8_t GetPersonality()
const;
56 bool SetPersonality(uint16_t personality);
57 uint16_t GetStartAddress()
const;
58 bool SetStartAddress(uint16_t start_address);
59 unsigned int PixelCount()
const {
return m_pixel_count; }
61 std::string Description()
const;
75 static RDMOps *Instance() {
77 instance =
new RDMOps();
82 RDMOps() : ola::rdm::ResponderOps<SPIOutput>(PARAM_HANDLERS) {}
84 static RDMOps *instance;
87 class SPIBackendInterface *m_backend;
88 const uint8_t m_output_number;
89 std::string m_spi_device_name;
91 const unsigned int m_pixel_count;
92 uint16_t m_start_address;
94 std::auto_ptr<ola::rdm::PersonalityCollection> m_personality_collection;
95 std::auto_ptr<ola::rdm::PersonalityManager> m_personality_manager;
96 ola::rdm::Sensors m_sensors;
99 bool InternalWriteDMX(
const DmxBuffer &buffer);
100 void IndividualWS2801Control(
const DmxBuffer &buffer);
101 void CombinedWS2801Control(
const DmxBuffer &buffer);
102 void IndividualLPD8806Control(
const DmxBuffer &buffer);
103 void CombinedLPD8806Control(
const DmxBuffer &buffer);
104 void IndividualP9813Control(
const DmxBuffer &buffer);
105 void CombinedP9813Control(
const DmxBuffer &buffer);
106 unsigned int LPD8806BufferSize()
const;
107 void WriteSPIData(
const uint8_t *data,
unsigned int length);
147 uint8_t P9813CreateFlag(uint8_t red, uint8_t green, uint8_t blue);
149 static const uint8_t SPI_MODE;
150 static const uint8_t SPI_BITS_PER_WORD;
151 static const uint16_t SPI_DELAY;
152 static const uint32_t SPI_SPEED;
153 static const uint16_t WS2801_SLOTS_PER_PIXEL;
154 static const uint16_t LPD8806_SLOTS_PER_PIXEL;
155 static const uint16_t P9813_SLOTS_PER_PIXEL;
156 static const uint16_t P9813_SPI_BYTES_PER_PIXEL;
164 #endif // PLUGINS_SPI_SPIOUTPUT_H_