21 #ifndef PLUGINS_SPI_SPIOUTPUT_H_ 22 #define PLUGINS_SPI_SPIOUTPUT_H_ 32 #include "ola/rdm/ResponderPersonality.h" 49 enum SPI_PERSONALITY {
50 PERS_WS2801_INDIVIDUAL = 1,
51 PERS_WS2801_COMBINED = 2,
52 PERS_LDP8806_INDIVIDUAL = 3,
53 PERS_LDP8806_COMBINED = 4,
54 PERS_P9813_INDIVIDUAL = 5,
55 PERS_P9813_COMBINED = 6,
56 PERS_APA102_INDIVIDUAL = 7,
57 PERS_APA102_COMBINED = 8,
58 PERS_APA102_PB_INDIVIDUAL,
59 PERS_APA102_PB_COMBINED,
63 std::string device_label;
65 uint8_t output_number;
67 explicit Options(uint8_t output_number,
const std::string &spi_device_name)
68 : device_label(
"SPI Device - " + spi_device_name),
70 output_number(output_number) {
79 std::string GetDeviceLabel()
const;
80 bool SetDeviceLabel(
const std::string &device_label);
81 uint8_t GetPersonality()
const;
82 bool SetPersonality(uint16_t personality);
83 uint16_t GetStartAddress()
const;
84 bool SetStartAddress(uint16_t start_address);
85 unsigned int PixelCount()
const {
return m_pixel_count; }
87 std::string Description()
const;
101 static RDMOps *Instance() {
103 instance =
new RDMOps();
110 static RDMOps *instance;
114 const uint8_t m_output_number;
115 std::string m_spi_device_name;
117 const unsigned int m_pixel_count;
118 std::string m_device_label;
119 uint16_t m_start_address;
120 bool m_identify_mode;
121 std::auto_ptr<ola::rdm::PersonalityCollection> m_personality_collection;
122 std::auto_ptr<ola::rdm::PersonalityManager> m_personality_manager;
123 ola::rdm::Sensors m_sensors;
124 std::auto_ptr<ola::rdm::NetworkManagerInterface> m_network_manager;
127 bool InternalWriteDMX(
const DmxBuffer &buffer);
129 void IndividualWS2801Control(
const DmxBuffer &buffer);
130 void CombinedWS2801Control(
const DmxBuffer &buffer);
131 void IndividualLPD8806Control(
const DmxBuffer &buffer);
132 void CombinedLPD8806Control(
const DmxBuffer &buffer);
133 void IndividualP9813Control(
const DmxBuffer &buffer);
134 void CombinedP9813Control(
const DmxBuffer &buffer);
135 void IndividualAPA102Control(
const DmxBuffer &buffer);
136 void CombinedAPA102Control(
const DmxBuffer &buffer);
137 void IndividualAPA102ControlPixelBrightness(
const DmxBuffer &buffer);
138 void CombinedAPA102ControlPixelBrightness(
const DmxBuffer &buffer);
140 unsigned int LPD8806BufferSize()
const;
141 void WriteSPIData(
const uint8_t *data,
unsigned int length);
200 uint8_t P9813CreateFlag(uint8_t red, uint8_t green, uint8_t blue);
201 static uint8_t CalculateAPA102LatchBytes(uint16_t pixel_count);
202 static uint8_t CalculateAPA102PixelBrightness(uint8_t brightness);
204 static const uint8_t SPI_MODE;
205 static const uint8_t SPI_BITS_PER_WORD;
206 static const uint16_t SPI_DELAY;
207 static const uint32_t SPI_SPEED;
208 static const uint16_t WS2801_SLOTS_PER_PIXEL;
209 static const uint16_t LPD8806_SLOTS_PER_PIXEL;
210 static const uint16_t P9813_SLOTS_PER_PIXEL;
211 static const uint16_t P9813_SPI_BYTES_PER_PIXEL;
212 static const uint16_t APA102_SLOTS_PER_PIXEL;
213 static const uint16_t APA102_PB_SLOTS_PER_PIXEL;
214 static const uint16_t APA102_SPI_BYTES_PER_PIXEL;
215 static const uint16_t APA102_START_FRAME_BYTES;
216 static const uint8_t APA102_LEDFRAME_START_MARK;
224 #endif // PLUGINS_SPI_SPIOUTPUT_H_ Definitions and Interfaces to implement an RDMController that sends a single message at a time...
An RDM Command that represents responses (GET, SET or DISCOVER).
Definition: RDMCommand.h:457
Definition: SPIOutput.h:62
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start an incremental discovery operation.
Definition: SPIOutput.cpp:344
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
Used to hold a single universe of DMX data.
Definition: DmxBuffer.h:49
A RDM unique identifier (UID).
Holds the information about a sensor.
A class used to hold a single universe of DMX data.
the structure that defines the behaviour for a specific PID.o
Definition: ResponderOps.h:76
A class which dispatches RDM requests to registered PID handlers.
Definition: ResponderOps.h:60
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
Start a full discovery operation.
Definition: SPIOutput.cpp:337
Definition: SPIOutput.h:39
The base class for all 1 argument callbacks.
Definition: Callback.h:982
Helper functions for STL classes.
A framework for building RDM responders.
Represents a RDM UID.
Definition: UID.h:57
Definition: SPIBackend.h:40
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
Send a RDM command.
Definition: SPIOutput.cpp:352
Gets/sets real config about a network.