Open Lighting Architecture: plugins/spi/SPIPort.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
SPIPort.h
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Library General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15 *
16 * SPIPort.h
17 * An OLA SPI Port. This simply wraps the SPIOutput.
18 * Copyright (C) 2013 Simon Newton
19 */
20
21#ifndef PLUGINS_SPI_SPIPORT_H_
22#define PLUGINS_SPI_SPIPORT_H_
23
24#include <string>
25#include "ola/DmxBuffer.h"
26#include "olad/Port.h"
27#include "plugins/spi/SPIDevice.h"
28#include "plugins/spi/SPIOutput.h"
29
30namespace ola {
31namespace plugin {
32namespace spi {
33
34 class SPIOutputPort: public BasicOutputPort {
35 public:
36 SPIOutputPort(SPIDevice *parent, class SPIBackendInterface *backend,
37 const ola::rdm::UID &uid, const SPIOutput::Options &options);
38 ~SPIOutputPort() {}
39
40 std::string GetDeviceLabel() const;
41 bool SetDeviceLabel(const std::string &device_label);
42 uint8_t GetPersonality() const;
43 bool SetPersonality(uint16_t personality);
44 uint16_t GetStartAddress() const;
45 bool SetStartAddress(uint16_t start_address);
46 unsigned int PixelCount() const;
47
48 std::string Description() const;
49 bool WriteDMX(const DmxBuffer &buffer, uint8_t priority);
50
51 void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback);
52 void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback);
53 void SendRDMRequest(ola::rdm::RDMRequest *request,
54 ola::rdm::RDMCallback *callback);
55
56 private:
57 SPIOutput m_spi_output;
58};
59} // namespace spi
60} // namespace plugin
61} // namespace ola
62#endif // PLUGINS_SPI_SPIPORT_H_
DmxBuffer.h
A class used to hold a single universe of DMX data.
ola::BasicOutputPort::BasicOutputPort
BasicOutputPort(AbstractDevice *parent, unsigned int port_id, bool start_rdm_discovery_on_patch=false, bool supports_rdm=false)
Create a new BasicOutputPort.
Definition Port.cpp:120
ola::DmxBuffer
Used to hold a single universe of DMX data.
Definition DmxBuffer.h:49
ola::plugin::spi::SPIBackendInterface
Definition SPIBackend.h:40
ola::plugin::spi::SPIDevice
Definition SPIDevice.h:40
ola::plugin::spi::SPIOutput
Definition SPIOutput.h:39
ola::plugin::spi::SPIOutputPort::Description
std::string Description() const
Fetch the string description for a Port.
Definition SPIPort.cpp:75
ola::plugin::spi::SPIOutputPort::SendRDMRequest
void SendRDMRequest(ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
Handle an RDMRequest, subclasses can implement this to support RDM.
Definition SPIPort.cpp:91
ola::plugin::spi::SPIOutputPort::RunIncrementalDiscovery
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition SPIPort.cpp:87
ola::plugin::spi::SPIOutputPort::RunFullDiscovery
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition SPIPort.cpp:83
ola::plugin::spi::SPIOutputPort::WriteDMX
bool WriteDMX(const DmxBuffer &buffer, uint8_t priority)
Write DMX data to this port.
Definition SPIPort.cpp:79
ola::rdm::RDMRequest
RDM Commands that represent requests (GET, SET or DISCOVER).
Definition RDMCommand.h:234
ola::rdm::UID
Represents a RDM UID.
Definition UID.h:57
ola::plugin::spi
Code for SPI devices.
ola::plugin
Code for supported devices and protocols.
ola::rdm::RDMCallback
ola::BaseCallback1< void, RDMReply * > RDMCallback
The callback run when a RDM request completes.
Definition RDMControllerInterface.h:52
ola::rdm::RDMDiscoveryCallback
ola::BaseCallback1< void, const ola::rdm::UIDSet & > RDMDiscoveryCallback
The callback run when a discovery operation completes.
Definition RDMControllerInterface.h:68
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44
ola::plugin::spi::SPIOutput::Options
Definition SPIOutput.h:41