OceanDirectLighthouseC++  3.1.1
OceanDirect Lighthouse C++/C API
GpioAPI.h
1 /*****************************************************
2  * @file GpioAPI.h
3  * @date July 2019
4  * @author Ocean Optics, Inc.
5  *
6  * This is an interface to OceanDirect that allows
7  * the user to connect to devices over USB and other buses.
8  * This is intended as a usable and extensible API.
9  */
10  /************************************************************************
11  *
12  * OCEAN INSIGHT CONFIDENTIAL
13  * __________________
14  *
15  * [2018] - [2020] Ocean Insight Incorporated
16  * All Rights Reserved.
17  *
18  * NOTICE: All information contained herein is, and remains
19  * the property of Ocean Insight Incorporated and its suppliers,
20  * if any. The intellectual and technical concepts contained
21  * herein are proprietary to Ocean Insight Incorporated
22  * and its suppliers and may be covered by U.S. and Foreign Patents,
23  * patents in process, and are protected by trade secret or copyright law.
24  * Dissemination of this information or reproduction of this material
25  * is strictly forbidden unless prior written permission is obtained
26  * from Ocean Insight Incorporated.
27  *
28  **************************************************************************/
29 
30 #ifndef GPIOAPI_H
31 #define GPIOAPI_H
32 
33 #include "api/DllDecl.h"
34 #include <cstdint>
35 
42 namespace oceandirect {
43  namespace api {
44 
45  class DLL_DECL GpioAPI {
46  public:
47  GpioAPI();
48  virtual ~GpioAPI() = default;
49  static GpioAPI *getInstance();
50 
51  static void shutdown();
52 
53  /* GPIO capabilities */
59  virtual int getNumberOfGPIO(long deviceID, int *errorCode);
67  virtual void setOutputEnable(long deviceID, int *errorCode, std::uint32_t bitPosition, bool isOutput);
73  virtual void setOutputEnable(long deviceID, int *errorCode, std::uint32_t bitmask);
74 
83  virtual bool getOutputEnable(long deviceID, int *errorCode, int bit);
89  virtual std::uint32_t getOutputEnable(long deviceID, int *errorCode);
90 
99  virtual void setValue(long deviceID, int *errorCode, std::uint32_t bitPosition, bool isHigh);
105  virtual void setValue(long deviceID, int *errorCode, std::uint32_t bitmask);
106 
115  virtual bool getValue(long deviceID, int *errorCode, int bit);
121  virtual uint32_t getValue(long deviceID, int *errorCode);
122 
133  virtual void setOutputAlternate(long deviceID, int* errorCode, int bit, bool isAlternate);
134 
144  virtual void setOutputAlternate(long deviceID, int* errorCode, uint32_t bitMask);
145 
156  virtual bool getOutputAlternate(long deviceID, int* errorCode, int bit);
157 
167  virtual uint32_t getOutputAlternate(long deviceID, int* errorCode);
168 
169  protected:
170  static GpioAPI *instance;
171 
172  };
173  }
174 }
175 #endif /* GPIOAPI_H */
Definition: GpioAPI.h:45
virtual void setValue(long deviceID, int *errorCode, std::uint32_t bitPosition, bool isHigh)
virtual uint32_t getValue(long deviceID, int *errorCode)
virtual void setOutputEnable(long deviceID, int *errorCode, std::uint32_t bitPosition, bool isOutput)
virtual bool getOutputEnable(long deviceID, int *errorCode, int bit)
virtual bool getOutputAlternate(long deviceID, int *errorCode, int bit)
virtual int getNumberOfGPIO(long deviceID, int *errorCode)
virtual void setValue(long deviceID, int *errorCode, std::uint32_t bitmask)
virtual std::uint32_t getOutputEnable(long deviceID, int *errorCode)
virtual uint32_t getOutputAlternate(long deviceID, int *errorCode)
virtual void setOutputEnable(long deviceID, int *errorCode, std::uint32_t bitmask)
virtual void setOutputAlternate(long deviceID, int *errorCode, uint32_t bitMask)
virtual bool getValue(long deviceID, int *errorCode, int bit)
virtual void setOutputAlternate(long deviceID, int *errorCode, int bit, bool isAlternate)
This is an interface to OceanDirect that allows the user to connect to devices over USB and other bus...
Definition: OceanDirectAPI.h:147