summaryrefslogtreecommitdiff
path: root/daemon/src/Gpio.h
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-10-16 14:51:29 +0200
committerAki <please@ignore.pl>2021-10-16 14:51:29 +0200
commit48cfa84671048346f64236dedb53b61e27156ad9 (patch)
tree4601501a3090200285b82109b58b2321da3902ba /daemon/src/Gpio.h
parente811b2f7a084ee34e37b6eb79b9dc2f14d9d1dac (diff)
downloadhwd-48cfa84671048346f64236dedb53b61e27156ad9.zip
hwd-48cfa84671048346f64236dedb53b61e27156ad9.tar.gz
hwd-48cfa84671048346f64236dedb53b61e27156ad9.tar.bz2
Extended Gpio class with real functionality
Diffstat (limited to 'daemon/src/Gpio.h')
-rw-r--r--daemon/src/Gpio.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/daemon/src/Gpio.h b/daemon/src/Gpio.h
index ef77631..e3941f6 100644
--- a/daemon/src/Gpio.h
+++ b/daemon/src/Gpio.h
@@ -1,5 +1,7 @@
#pragma once
+#include <array>
+
#include <rpc/server.h>
#include "Assembly.h"
@@ -9,4 +11,12 @@ class Gpio
{
public:
void apply(AssemblyContext ctx);
+private:
+ static constexpr unsigned SIZE {24};
+ std::array<short, SIZE> mode_of;
+ std::array<short, SIZE> value_of;
+
+ void set_mode(const unsigned port, const short mode);
+ void write(const unsigned port, const short value);
+ short read(const unsigned port) const;
};