Add support to set a GPIO either low or high
Change-Id: I07379f0cb63dc714cf538e4100f1a01077391f37
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/gpio.hpp b/gpio.hpp
index 2d3c6dd..04100da 100644
--- a/gpio.hpp
+++ b/gpio.hpp
@@ -75,12 +75,24 @@
*/
Value read();
+ /**
+ * Sets the GPIO value to low or high
+ *
+ * Requests the GPIO line if it hasn't been done already.
+ *
+ * @param[in] Value - the value to set
+ */
+ void set(Value value);
+
private:
/**
* Requests a GPIO line from the GPIO device
+ *
+ * @param[in] defaultValue - The default value, required for
+ * output GPIOs only.
*/
- void requestLine();
+ void requestLine(Value defaultValue = Value::high);
/**
* The GPIO device name, like /dev/gpiochip0