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();
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);
108 void IndividualWS2801Control(
const DmxBuffer &buffer);
109 void CombinedWS2801Control(
const DmxBuffer &buffer);
110 void IndividualLPD8806Control(
const DmxBuffer &buffer);
111 void CombinedLPD8806Control(
const DmxBuffer &buffer);
112 void IndividualP9813Control(
const DmxBuffer &buffer);
113 void CombinedP9813Control(
const DmxBuffer &buffer);
114 void IndividualAPA102Control(
const DmxBuffer &buffer);
115 void CombinedAPA102Control(
const DmxBuffer &buffer);
117 unsigned int LPD8806BufferSize()
const;
118 void WriteSPIData(
const uint8_t *data,
unsigned int length);
175 uint8_t P9813CreateFlag(uint8_t red, uint8_t green, uint8_t blue);
176 static uint8_t CalculateAPA102LatchBytes(uint16_t pixel_count);
178 static const uint8_t SPI_MODE;
179 static const uint8_t SPI_BITS_PER_WORD;
180 static const uint16_t SPI_DELAY;
181 static const uint32_t SPI_SPEED;
182 static const uint16_t WS2801_SLOTS_PER_PIXEL;
183 static const uint16_t LPD8806_SLOTS_PER_PIXEL;
184 static const uint16_t P9813_SLOTS_PER_PIXEL;
185 static const uint16_t P9813_SPI_BYTES_PER_PIXEL;
186 static const uint16_t APA102_SLOTS_PER_PIXEL;
187 static const uint16_t APA102_SPI_BYTES_PER_PIXEL;
188 static const uint16_t APA102_START_FRAME_BYTES;
A class used to hold a single universe of DMX data.
Gets/sets real config about a network.
Definitions and Interfaces to implement an RDMController that sends a single message at a time.
A framework for building RDM responders.
Holds the information about a sensor.
Helper functions for STL classes.
A RDM unique identifier (UID).
The base class for all 1 argument callbacks.
Definition Callback.h:982
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
Definition SPIBackend.h:40
Definition SPIOutput.h:39
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
Send a RDM command.
Definition SPIOutput.cpp:287
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start an incremental discovery operation.
Definition SPIOutput.cpp:279
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start a full discovery operation.
Definition SPIOutput.cpp:272
The interface that can send RDM commands, as well as perform discovery operations.
Definition RDMControllerInterface.h:104
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition RDMCommand.h:234
An RDM Command that represents responses (GET, SET or DISCOVER).
Definition RDMCommand.h:457
A class which dispatches RDM requests to registered PID handlers.
Definition ResponderOps.h:60
ResponderOps(const ParamHandler param_handlers[], bool include_required_pids=false)
Definition ResponderOpsPrivate.h:49
Represents a RDM UID.
Definition UID.h:57
The namespace containing all OLA symbols.
Definition Credentials.cpp:44
Definition SPIOutput.h:41
the structure that defines the behaviour for a specific PID.o
Definition ResponderOps.h:76