LTPS C++ API
gpio.h
1 
6 #ifndef __LGPIO_H__
7 #define __LGPIO_H__
8 
27 struct GpioReturn
28 {
29  int msb;
30  int lsb;
31 };
32 
38 class Gpio
39 {
40 public:
41 
42  Gpio();
43 
44  virtual ~Gpio();
45 
47 
52  int setDirection(const char *pin, int direction);
53 
55 
61  void setDirections(int lsbPins, int msbPins, int lsbDirs, int msbDirs);
62 
64 
68  int getDirection(const char *pin);
69 
71 
75  void getDirections(int &lsbDirs, int &msbDirs);
76 
78 
82 
84 
89  int setValue(const char* pin, unsigned int value);
90 
92 
98  void setValues(int lsbPins, int msbPins, int lsbValues, int msbValues);
99 
101 
105  unsigned int getValue(const char *pin);
106 
108 
112  void getValues(int &lsbValues, int &msbValues);
113 
115 
119 
121 
125  unsigned int getPinNumber(const char* pin);
126 };
127 
128 #endif
Class for GPIO manipulations.
Definition: gpio.h:38
int getDirection(const char *pin)
Get direction.
void setValues(int lsbPins, int msbPins, int lsbValues, int msbValues)
Set values for all pins simultaneously (see bit arithmetic)
GpioReturn getValues()
Get directions for all pins simultaneously.
unsigned int getValue(const char *pin)
Get value.
void setDirections(int lsbPins, int msbPins, int lsbDirs, int msbDirs)
Set directions for all pins simultaneously (see bit arithmetic)
GpioReturn getDirections()
Get directions for all pins simultaneously.
int setValue(const char *pin, unsigned int value)
Set value.
unsigned int getPinNumber(const char *pin)
Get CPU pin number.
int setDirection(const char *pin, int direction)
Set direction.
Structure for return values.
Definition: gpio.h:27