OceanDirect  2.4.0
OceanDirect 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  static GpioAPI *getInstance();
49 
50  static void shutdown();
51 
52  /* GPIO capabilities */
58  int getNumberOfGPIO(long deviceID, int *errorCode);
65  void setOutputEnable(long deviceID, int *errorCode, std::uint32_t bitPosition, bool isOutput);
71  void setOutputEnable(long deviceID, int *errorCode, std::uint32_t bitmask);
72 
79  bool getOutputEnable(long deviceID, int *errorCode, int bit);
85  std::uint32_t getOutputEnable(long deviceID, int *errorCode);
86 
93  void setValue(long deviceID, int *errorCode, std::uint32_t bitPosition, bool isHigh);
99  void setValue(long deviceID, int *errorCode, std::uint32_t bitmask);
100 
107  bool getValue(long deviceID, int *errorCode, int bit);
113  uint32_t getValue(long deviceID, int *errorCode);
114 
125  void setOutputAlternate(long deviceID, int* errorCode, int bit, bool isAlternate);
126 
136  void setOutputAlternate(long deviceID, int* errorCode, uint32_t bitMask);
137 
148  bool getOutputAlternate(long deviceID, int* errorCode, int bit);
149 
159  uint32_t getOutputAlternate(long deviceID, int* errorCode);
160 
161  private:
162  static GpioAPI *instance;
163 
164  };
165  }
166 }
167 #endif /* GPIOAPI_H */
Definition: GpioAPI.h:45
void setOutputEnable(long deviceID, int *errorCode, std::uint32_t bitPosition, bool isOutput)
uint32_t getOutputAlternate(long deviceID, int *errorCode)
int getNumberOfGPIO(long deviceID, int *errorCode)
void setOutputAlternate(long deviceID, int *errorCode, int bit, bool isAlternate)
bool getValue(long deviceID, int *errorCode, int bit)
void setOutputEnable(long deviceID, int *errorCode, std::uint32_t bitmask)
bool getOutputAlternate(long deviceID, int *errorCode, int bit)
std::uint32_t getOutputEnable(long deviceID, int *errorCode)
void setOutputAlternate(long deviceID, int *errorCode, uint32_t bitMask)
uint32_t getValue(long deviceID, int *errorCode)
void setValue(long deviceID, int *errorCode, std::uint32_t bitmask)
void setValue(long deviceID, int *errorCode, std::uint32_t bitPosition, bool isHigh)
bool getOutputEnable(long deviceID, int *errorCode, int bit)
This is an interface to OceanDirect that allows the user to connect to devices over USB and other bus...
Definition: OceanDirectAPI.h:144