gpio: add mmap enable function to cpp headers
authorThomas Ingleby <thomas.c.ingleby@intel.com>
Wed, 25 Jun 2014 10:14:20 +0000 (11:14 +0100)
committerThomas Ingleby <thomas.c.ingleby@intel.com>
Wed, 25 Jun 2014 10:14:20 +0000 (11:14 +0100)
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
api/mraa/gpio.hpp

index b40f050..110d7c3 100644 (file)
@@ -165,6 +165,15 @@ class Gpio {
         mraa_result_t write(int value) {
             return mraa_gpio_write(m_gpio, value);
         }
+        /**
+         * Enable use of mmap i/o if available.
+         *
+         * @param enable true to use mmap
+         * @return Result of operation
+         */
+        mraa_result_t useMmap(bool enable) {
+            return mraa_gpio_use_mmaped(m_gpio, (mraa_boolean_t) enable);
+        }
     private:
         mraa_gpio_context m_gpio;
 };