Abgabe
This commit is contained in:
34
kawaii/gpio.hpp
Normal file
34
kawaii/gpio.hpp
Normal 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
|
||||
Reference in New Issue
Block a user