18 lines
286 B
C++
18 lines
286 B
C++
#pragma once
|
|
#include <string>
|
|
|
|
class GPIO {
|
|
public:
|
|
explicit GPIO(int pin);
|
|
~GPIO();
|
|
void setDirection(const std::string& dir);
|
|
void setValue(int val);
|
|
int getValue() const;
|
|
|
|
private:
|
|
int _pin;
|
|
bool _exported;
|
|
void _export();
|
|
void _unexport();
|
|
};
|