summaryrefslogtreecommitdiffstats
path: root/hal/pin.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hal/pin.hpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/hal/pin.hpp b/hal/pin.hpp
index bbb80dc..ab9d3ad 100644
--- a/hal/pin.hpp
+++ b/hal/pin.hpp
@@ -17,12 +17,19 @@ class gpio
public:
virtual ~gpio() {}
- // digital functions
+ // digital mode methods
virtual void set_mode(unsigned m) = 0;
+
+ // digital output methods
virtual void set(unsigned s) = 0;
- virtual unsigned read() const = 0;
+ virtual unsigned is_set() const = 0;
virtual void toggle() = 0;
+ // digital input methods
+ virtual unsigned read() const = 0;
+
+ // TODO: analog mode methods
+
protected:
gpio() {}
};
@@ -47,6 +54,7 @@ public:
void set_mode(mode m);
unsigned read() const;
+ unsigned is_set() const;
void set(unsigned s);
void set(state s);