This commit is contained in:
2017-06-28 20:40:01 +02:00
parent 76dd61f48b
commit 8d2b664149
41 changed files with 5225 additions and 0 deletions

34
kawaii/gpio.hpp Normal file
View File

@@ -0,0 +1,34 @@
#ifndef GPIO_HPP_
#define GPIO_HPP_
class gpio
{
public:
enum class pin_direction
{
INPUT,
OUTPUT
};
enum class pin_type
{
HIGH_ON,
LOW_ON
};
private:
int pin;
pin_direction direction;
pin_type type;
bool current_state;
void set_value(bool on, bool use_cache);
public:
gpio(int pin, pin_direction, pin_type=pin_type::HIGH_ON, bool default_state=false);
gpio(const gpio&) = delete;
gpio(gpio&&);
~gpio();
void set_value(bool on);
bool get_value();
int get_pin() const;
};
#endif