-
Notifications
You must be signed in to change notification settings - Fork 0
/
GPIOClass.h
25 lines (23 loc) · 921 Bytes
/
GPIOClass.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef GPIO_CLASS_H
#define GPIO_CLASS_H
#include <string>
using namespace std;
/* GPIO Class
* Purpose: Each object instantiated from this class will control a GPIO pin
* The GPIO pin number must be passed to the overloaded class constructor
*/
class GPIOClass
{
public:
GPIOClass(); // create a GPIO object that controls GPIO4 (default
GPIOClass(string x); // create a GPIO object that controls GPIOx, where x is passed to this constructor
int export_gpio(); // exports GPIO
int unexport_gpio(); // unexport GPIO
int setdir_gpio(string dir); // Set GPIO Direction
int setval_gpio(string val); // Set GPIO Value (putput pins)
int getval_gpio(string& val); // Get GPIO Value (input/ output pins)
string get_gpionum(); // return the GPIO number associated with the instance of an object
private:
string gpionum; // GPIO number associated with the instance of an object
};
#endif