Open Lighting Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 <vector>
26 #include "ola/DmxBuffer.h"
27 #include "olad/Port.h"
28 #include "plugins/spi/SPIDevice.h"
29 #include "plugins/spi/SPIOutput.h"
30 
31 namespace ola {
32 namespace plugin {
33 namespace spi {
34 
36  public:
37  SPIOutputPort(SPIDevice *parent, class SPIBackendInterface *backend,
38  const UID &uid, const SPIOutput::Options &options);
39  ~SPIOutputPort() {}
40 
41  uint8_t GetPersonality() const;
42  bool SetPersonality(uint16_t personality);
43  uint16_t GetStartAddress() const;
44  bool SetStartAddress(uint16_t start_address);
45  unsigned int PixelCount() const;
46 
47  string Description() const;
48  bool WriteDMX(const DmxBuffer &buffer, uint8_t priority);
49 
50  void RunFullDiscovery(RDMDiscoveryCallback *callback);
51  void RunIncrementalDiscovery(RDMDiscoveryCallback *callback);
52  void SendRDMRequest(const ola::rdm::RDMRequest *request,
53  ola::rdm::RDMCallback *callback);
54 
55  private:
56  SPIOutput m_spi_output;
57 };
58 } // namespace spi
59 } // namespace plugin
60 } // namespace ola
61 #endif // PLUGINS_SPI_SPIPORT_H_