Open Lighting Architecture  Latest Git
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
30 namespace ola {
31 namespace plugin {
32 namespace spi {
33 
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 
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_
bool WriteDMX(const DmxBuffer &buffer, uint8_t priority)
Write DMX data to this port.
Definition: SPIPort.cpp:79
Definition: SPIDevice.h:40
Definition: SPIOutput.h:62
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
std::string Description() const
Fetch the string description for a Port.
Definition: SPIPort.cpp:75
A class used to hold a single universe of DMX data.
Definition: SPIPort.h:34
Definition: SPIOutput.h:39
The base class for all 1 argument callbacks.
Definition: Callback.h:982
void RunFullDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition: SPIPort.cpp:83
void RunIncrementalDiscovery(ola::rdm::RDMDiscoveryCallback *callback)
This is a noop for ports that don't support RDM.
Definition: SPIPort.cpp:87
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)
Handle an RDMRequest, subclasses can implement this to support RDM.
Definition: SPIPort.cpp:91
Definition: Port.h:282