mraa: rename from maa to mraa
authorThomas Ingleby <thomas.c.ingleby@intel.com>
Tue, 24 Jun 2014 16:24:54 +0000 (17:24 +0100)
committerThomas Ingleby <thomas.c.ingleby@intel.com>
Tue, 24 Jun 2014 16:24:54 +0000 (17:24 +0100)
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
74 files changed:
CMakeLists.txt
Doxyfile.in
README.md
api/mraa.h [moved from api/maa.h with 91% similarity]
api/mraa.hpp [moved from api/maa.hpp with 89% similarity]
api/mraa/aio.h [moved from api/maa/aio.h with 88% similarity]
api/mraa/aio.hpp [moved from api/maa/aio.hpp with 89% similarity]
api/mraa/common.h [moved from api/maa/common.h with 65% similarity]
api/mraa/gpio.h [moved from api/maa/gpio.h with 72% similarity]
api/mraa/gpio.hpp [moved from api/maa/gpio.hpp with 79% similarity]
api/mraa/i2c.h [moved from api/maa/i2c.h with 82% similarity]
api/mraa/i2c.hpp [moved from api/maa/i2c.hpp with 80% similarity]
api/mraa/pwm.h [moved from api/maa/pwm.h with 81% similarity]
api/mraa/pwm.hpp [moved from api/maa/pwm.hpp with 78% similarity]
api/mraa/spi.h [moved from api/maa/spi.h with 79% similarity]
api/mraa/spi.hpp [moved from api/maa/spi.hpp with 80% similarity]
api/mraa/types.h [moved from api/maa/types.h with 50% similarity]
cmake/modules/CPackDeb.cmake
docs/building.md
docs/contributing.md
docs/galileorevd.md
docs/index.md
examples/CMakeLists.txt
examples/analogin_a0.c
examples/blink-io.c
examples/blink_onboard.c
examples/c++/AioA0.cpp
examples/c++/Blink-IO.cpp
examples/c++/CMakeLists.txt
examples/c++/I2c-compass.cpp
examples/c++/Pwm3-cycle.cpp
examples/c++/Spi-pot.cpp
examples/cycle-pwm3.c
examples/gpio_read6.c
examples/hellomraa.c [moved from examples/hellomaa.c with 93% similarity]
examples/i2c_HMC5883L.c
examples/isr_pin6.c
examples/javascript/example.js
examples/mmap-io2.c
examples/python/aio.py
examples/python/blink-io8.py
examples/python/cycle-pwm3.py
examples/python/hello_gpio.py
examples/python/hello_isr.py
examples/python/rgblcd.py
examples/spi_mcp4261.c
include/intel_galileo_rev_d.h
include/intel_galileo_rev_g.h
include/mraa_internal.h [moved from include/maa_internal.h with 88% similarity]
src/CMakeLists.txt
src/aio/aio.c
src/gpio/gpio.c
src/i2c/i2c.c
src/intel_galileo_rev_d.c
src/intel_galileo_rev_g.c
src/javascript/CMakeLists.txt
src/javascript/maajs.i [deleted file]
src/javascript/mraajs.i [new file with mode: 0644]
src/javascript/package.json
src/mraa.c [moved from src/maa.c with 58% similarity]
src/mraa.i [moved from src/maa.i with 69% similarity]
src/mraa.pc.cmake [moved from src/maa.pc.cmake with 75% similarity]
src/pwm/pwm.c
src/python/CMakeLists.txt
src/python/docs/CMakeLists.txt
src/python/docs/conf.py.in
src/python/docs/example.rst
src/python/docs/index.rst
src/python/docs/pymraa.rst [moved from src/python/docs/pymaa.rst with 65% similarity]
src/python/pymaa.i [deleted file]
src/python/pymraa.i [new file with mode: 0644]
src/spi/spi.c
tests/CMakeLists.txt
tests/mraa_test.cxx [moved from tests/maa_test.cxx with 60% similarity]

index 2920b19..16c8f3c 100644 (file)
@@ -1,5 +1,5 @@
 cmake_minimum_required (VERSION 2.8)
 cmake_minimum_required (VERSION 2.8)
-project (maa)
+project (mraa)
 
 FIND_PACKAGE (Threads)
 
 
 FIND_PACKAGE (Threads)
 
@@ -13,11 +13,11 @@ set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_
 include (GetGitRevisionDescription)
 git_describe (VERSION "--tags")
 if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND")
 include (GetGitRevisionDescription)
 git_describe (VERSION "--tags")
 if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND")
-  message (WARNING " - Install git to compile a production libmaa!")
+  message (WARNING " - Install git to compile a production libmraa!")
   set (VERSION "v0.3.1-dirty")
 endif ()
 
   set (VERSION "v0.3.1-dirty")
 endif ()
 
-message (INFO " - MAA Version ${VERSION}")
+message (INFO " - MRAA Version ${VERSION}")
 
 #parse the version information into pieces.
 string (REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION}")
 
 #parse the version information into pieces.
 string (REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${VERSION}")
@@ -35,10 +35,10 @@ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/version.c.in
                 ${CMAKE_CURRENT_BINARY_DIR}/src/version.c)
 
 # this is the library version, independant of git revision
                 ${CMAKE_CURRENT_BINARY_DIR}/src/version.c)
 
 # this is the library version, independant of git revision
-set (maa_VERSION_MAJOR ${VERSION_MAJOR})
-set (maa_VERSION_MINOR ${VERSION_MINOR})
-set (maa_VERSION_PATCH ${VERSION_PATCH})
-set (maa_VERSION_STRING ${maa_VERSION_MAJOR}.${maa_VERSION_MINOR}.${maa_VERSION_PATCH})
+set (mraa_VERSION_MAJOR ${VERSION_MAJOR})
+set (mraa_VERSION_MINOR ${VERSION_MINOR})
+set (mraa_VERSION_PATCH ${VERSION_PATCH})
+set (mraa_VERSION_STRING ${mraa_VERSION_MAJOR}.${mraa_VERSION_MINOR}.${mraa_VERSION_PATCH})
 
 set (CMAKE_SWIG_FLAGS "")
 
 
 set (CMAKE_SWIG_FLAGS "")
 
@@ -76,17 +76,17 @@ if (IPK)
   set(OPKG_ARCH ${DETECTED_ARCH})
   set(CPACK_BINARY_DIR ${CMAKE_BINARY_DIR})
   set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Intel IoT-Devkit") #required
   set(OPKG_ARCH ${DETECTED_ARCH})
   set(CPACK_BINARY_DIR ${CMAKE_BINARY_DIR})
   set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Intel IoT-Devkit") #required
-  set(maa_PACKAGE_ON_TAG ".")
+  set(mraa_PACKAGE_ON_TAG ".")
   if ("${VERSION_COMMIT}" STREQUAL "")
   if ("${VERSION_COMMIT}" STREQUAL "")
-    set(maa_PACKAGE_ON_TAG "")
+    set(mraa_PACKAGE_ON_TAG "")
   endif()
   set(CPACK_PACKAGE_VERSION 
   endif()
   set(CPACK_PACKAGE_VERSION 
-      "${maa_VERSION_MAJOR}.${maa_VERSION_MINOR}.${maa_VERSION_PATCH}${maa_PACKAGE_ON_TAG}${VERSION_COMMIT}")
-  set(CPACK_PACKAGE_NAME "libmaa${maa_VERSION_MAJOR}")
+      "${mraa_VERSION_MAJOR}.${mraa_VERSION_MINOR}.${mraa_VERSION_PATCH}${mraa_PACKAGE_ON_TAG}${VERSION_COMMIT}")
+  set(CPACK_PACKAGE_NAME "libmraa${mraa_VERSION_MAJOR}")
   set(CPACK_DEBIAN_PACKAGE_SECTION "libs")
   set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${DETECTED_ARCH})
   set(CPACK_SYSTEM_NAME ${DETECTED_ARCH})
   set(CPACK_DEBIAN_PACKAGE_SECTION "libs")
   set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${DETECTED_ARCH})
   set(CPACK_SYSTEM_NAME ${DETECTED_ARCH})
-  set(CPACK_DEBIAN_PACKAGE_PROVIDES "libmaa-dev, libmaa-dbg, libmaa-doc")
+  set(CPACK_DEBIAN_PACKAGE_PROVIDES "libmraa-dev, libmraa-dbg, libmraa-doc")
   set(CPACK_DEBIAN_PACKAGE_REPLACES ${CPACK_DEBIAN_PACKAGE_PROVIDES})
   set(CPACK_DEBIAN_PACKAGE_CONFLICTS ${CPACK_DEBIAN_PACKAGE_PROVIDES})
   set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
   set(CPACK_DEBIAN_PACKAGE_REPLACES ${CPACK_DEBIAN_PACKAGE_PROVIDES})
   set(CPACK_DEBIAN_PACKAGE_CONFLICTS ${CPACK_DEBIAN_PACKAGE_PROVIDES})
   set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
index 528b3ab..1529ac7 100644 (file)
@@ -32,13 +32,13 @@ DOXYFILE_ENCODING      = UTF-8
 # title of most generated pages and in a few other places.
 # The default value is: My Project.
 
 # title of most generated pages and in a few other places.
 # The default value is: My Project.
 
-PROJECT_NAME           = maa
+PROJECT_NAME           = mraa
 
 # The PROJECT_NUMBER tag can be used to enter a project or revision number. This
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
 
 # The PROJECT_NUMBER tag can be used to enter a project or revision number. This
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER         = @maa_VERSION_STRING@
+PROJECT_NUMBER         = @mraa_VERSION_STRING@
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a
@@ -754,7 +754,7 @@ WARN_LOGFILE           =
 # Note: If this tag is empty the current directory is searched.
 
 INPUT                  = @CMAKE_CURRENT_SOURCE_DIR@/api/ \
 # Note: If this tag is empty the current directory is searched.
 
 INPUT                  = @CMAKE_CURRENT_SOURCE_DIR@/api/ \
-                         @CMAKE_CURRENT_SOURCE_DIR@/api/maa/ \
+                         @CMAKE_CURRENT_SOURCE_DIR@/api/mraa/ \
                          @CMAKE_CURRENT_SOURCE_DIR@/docs/
 
 # This tag can be used to specify the character encoding of the source files
                          @CMAKE_CURRENT_SOURCE_DIR@/docs/
 
 # This tag can be used to specify the character encoding of the source files
index fed2172..b4c5a90 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-MAA - Low Level Skeleton Library for Communication on Intel platforms
+MRAA - Low Level Skeleton Library for Communication on Intel platforms
 ==============
 
 Library in C/C++ to interface with Galileo & other Intel platforms, in a
 ==============
 
 Library in C/C++ to interface with Galileo & other Intel platforms, in a
similarity index 91%
rename from api/maa.h
rename to api/mraa.h
index 933bbe3..175da12 100644 (file)
--- a/api/maa.h
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
-#include "maa/pwm.h"
-#include "maa/aio.h"
-#include "maa/gpio.h"
-#include "maa/spi.h"
-#include "maa/i2c.h"
+#include "mraa/pwm.h"
+#include "mraa/aio.h"
+#include "mraa/gpio.h"
+#include "mraa/spi.h"
+#include "mraa/i2c.h"
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }
similarity index 89%
rename from api/maa.hpp
rename to api/mraa.hpp
index df1ae84..4ad155c 100644 (file)
@@ -24,9 +24,9 @@
 
 #pragma once
 
 
 #pragma once
 
-#include "maa/common.h"
-#include "maa/pwm.hpp"
-#include "maa/aio.hpp"
-#include "maa/gpio.hpp"
-#include "maa/i2c.hpp"
-#include "maa/spi.hpp"
+#include "mraa/common.h"
+#include "mraa/pwm.hpp"
+#include "mraa/aio.hpp"
+#include "mraa/gpio.hpp"
+#include "mraa/i2c.hpp"
+#include "mraa/spi.hpp"
similarity index 88%
rename from api/maa/aio.h
rename to api/mraa/aio.h
index e9197fa..d7703bc 100644 (file)
@@ -27,7 +27,7 @@
  * @file
  * @brief Analog input/output
  *
  * @file
  * @brief Analog input/output
  *
- * AIO is the anlog input & output interface to libmaa. It is used to read or
+ * AIO is the anlog input & output interface to libmraa. It is used to read or
  * set the voltage applied to an AIO pin.
  *
  * @snippet analogin_a0.c Interesting
  * set the voltage applied to an AIO pin.
  *
  * @snippet analogin_a0.c Interesting
@@ -51,7 +51,7 @@ extern "C" {
  * Opaque pointer definition to the internal struct _aio. This context refers
  * to one single AIO pin on the board.
  */
  * Opaque pointer definition to the internal struct _aio. This context refers
  * to one single AIO pin on the board.
  */
-typedef struct _aio* maa_aio_context;
+typedef struct _aio* mraa_aio_context;
 
 /**
  * Initialise an Analog input device, connected to the specified pin
 
 /**
  * Initialise an Analog input device, connected to the specified pin
@@ -59,7 +59,7 @@ typedef struct _aio* maa_aio_context;
  * @param pin Channel number to read ADC inputs
  * @returns aio context or NULL
  */
  * @param pin Channel number to read ADC inputs
  * @returns aio context or NULL
  */
-maa_aio_context maa_aio_init(unsigned int pin);
+mraa_aio_context mraa_aio_init(unsigned int pin);
 
 /**
  * Read the input voltage
 
 /**
  * Read the input voltage
@@ -67,7 +67,7 @@ maa_aio_context maa_aio_init(unsigned int pin);
  * @param dev The AIO context
  * @returns The current input voltage, normalised to a 16-bit value
  */
  * @param dev The AIO context
  * @returns The current input voltage, normalised to a 16-bit value
  */
-uint16_t maa_aio_read(maa_aio_context dev);
+uint16_t mraa_aio_read(mraa_aio_context dev);
 
 /**
  * Close the analog input context, this will free the memory for the context
 
 /**
  * Close the analog input context, this will free the memory for the context
@@ -75,7 +75,7 @@ uint16_t maa_aio_read(maa_aio_context dev);
  * @param dev The AIO context
  * @return Result of operation
  */
  * @param dev The AIO context
  * @return Result of operation
  */
-maa_result_t maa_aio_close(maa_aio_context dev);
+mraa_result_t mraa_aio_close(mraa_aio_context dev);
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }
similarity index 89%
rename from api/maa/aio.hpp
rename to api/mraa/aio.hpp
index dd145d7..8f31bb8 100644 (file)
 
 #include "aio.h"
 
 
 #include "aio.h"
 
-namespace maa {
+namespace mraa {
 
 /**
  * @brief C++ API to Analog IO
  *
 
 /**
  * @brief C++ API to Analog IO
  *
- * This file defines the aio C++ interface for libmaa
+ * This file defines the aio C++ interface for libmraa
  *
  * @snippet examples/c++/AioA0.cpp Interesting
  */
  *
  * @snippet examples/c++/AioA0.cpp Interesting
  */
@@ -44,13 +44,13 @@ class Aio {
          * @param pin channel number to read ADC inputs
          */
         Aio(unsigned int pin) {
          * @param pin channel number to read ADC inputs
          */
         Aio(unsigned int pin) {
-            m_aio = maa_aio_init(pin);
+            m_aio = mraa_aio_init(pin);
         }
         /**
          * Aio destructor
          */
         ~Aio() {
         }
         /**
          * Aio destructor
          */
         ~Aio() {
-            maa_aio_close(m_aio);
+            mraa_aio_close(m_aio);
         }
         /**
          * Read a value from the AIO pin. Note this value can never be outside
         }
         /**
          * Read a value from the AIO pin. Note this value can never be outside
@@ -60,10 +60,10 @@ class Aio {
          */
         int read() {
             // Use basic types to make swig code generation simpler
          */
         int read() {
             // Use basic types to make swig code generation simpler
-            return (int) maa_aio_read(m_aio);
+            return (int) mraa_aio_read(m_aio);
         }
     private:
         }
     private:
-        maa_aio_context m_aio;
+        mraa_aio_context m_aio;
 };
 
 }
 };
 
 }
similarity index 65%
rename from api/maa/common.h
rename to api/mraa/common.h
index d1451a1..cc32622 100644 (file)
@@ -28,7 +28,7 @@
 
 /** @file
  *
 
 /** @file
  *
- * This file defines the basic shared values for libmaa
+ * This file defines the basic shared values for libmraa
  */
 
 #ifdef __cplusplus
  */
 
 #ifdef __cplusplus
@@ -36,38 +36,38 @@ extern "C" {
 #endif
 
 /**
 #endif
 
 /**
- * MAA boolean type
+ * MRAA boolean type
  * 1 For TRUE
  */
  * 1 For TRUE
  */
-typedef unsigned int maa_boolean_t;
+typedef unsigned int mraa_boolean_t;
 
 /**
  * Enum representing different possible modes for a pin.
  */
 typedef enum {
 
 /**
  * Enum representing different possible modes for a pin.
  */
 typedef enum {
-    MAA_PIN_VALID       = 0, /**< Pin Valid */
-    MAA_PIN_GPIO        = 1, /**< General Purpose IO */
-    MAA_PIN_PWM         = 2, /**< Pulse Width Modulation */
-    MAA_PIN_FAST_GPIO   = 3, /**< Faster GPIO */
-    MAA_PIN_SPI         = 4, /**< SPI */
-    MAA_PIN_I2C         = 5, /**< I2C */
-    MAA_PIN_AIO         = 6  /**< Analog in */
-} maa_pinmodes_t;
+    MRAA_PIN_VALID       = 0, /**< Pin Valid */
+    MRAA_PIN_GPIO        = 1, /**< General Purpose IO */
+    MRAA_PIN_PWM         = 2, /**< Pulse Width Modulation */
+    MRAA_PIN_FAST_GPIO   = 3, /**< Faster GPIO */
+    MRAA_PIN_SPI         = 4, /**< SPI */
+    MRAA_PIN_I2C         = 5, /**< I2C */
+    MRAA_PIN_AIO         = 6  /**< Analog in */
+} mraa_pinmodes_t;
 
 /**
  * A bitfield representing the capabilities of a pin.
  */
 typedef struct {
     /*@{*/
 
 /**
  * A bitfield representing the capabilities of a pin.
  */
 typedef struct {
     /*@{*/
-    maa_boolean_t valid:1;     /**< Is the pin valid at all */
-    maa_boolean_t gpio:1;      /**< Is the pin gpio capable */
-    maa_boolean_t pwm:1;       /**< Is the pin pwm capable */
-    maa_boolean_t fast_gpio:1; /**< Is the pin fast gpio capable */
-    maa_boolean_t spi:1;       /**< Is the pin spi capable */
-    maa_boolean_t i2c:1;       /**< Is the pin i2c capable */
-    maa_boolean_t aio:1;       /**< Is the pin analog input capable */
+    mraa_boolean_t valid:1;     /**< Is the pin valid at all */
+    mraa_boolean_t gpio:1;      /**< Is the pin gpio capable */
+    mraa_boolean_t pwm:1;       /**< Is the pin pwm capable */
+    mraa_boolean_t fast_gpio:1; /**< Is the pin fast gpio capable */
+    mraa_boolean_t spi:1;       /**< Is the pin spi capable */
+    mraa_boolean_t i2c:1;       /**< Is the pin i2c capable */
+    mraa_boolean_t aio:1;       /**< Is the pin analog input capable */
     /*@}*/
     /*@}*/
-} maa_pincapabilities_t;
+} mraa_pincapabilities_t;
 
 /**
  * A Structure representing a multiplexer and the required value
 
 /**
  * A Structure representing a multiplexer and the required value
@@ -77,36 +77,36 @@ typedef struct {
     unsigned int pin;   /**< Raw GPIO pin id */
     unsigned int value; /**< Raw GPIO value */
     /*@}*/
     unsigned int pin;   /**< Raw GPIO pin id */
     unsigned int value; /**< Raw GPIO value */
     /*@}*/
-} maa_mux_t;
+} mraa_mux_t;
 
 typedef struct {
 
 typedef struct {
-    maa_boolean_t complex_pin:1;
-    maa_boolean_t output_en:1;
-    maa_boolean_t output_en_high:1;
-    maa_boolean_t pullup_en:1;
-    maa_boolean_t pullup_en_hiz:1;
-} maa_pin_cap_complex_t;
+    mraa_boolean_t complex_pin:1;
+    mraa_boolean_t output_en:1;
+    mraa_boolean_t output_en_high:1;
+    mraa_boolean_t pullup_en:1;
+    mraa_boolean_t pullup_en_hiz:1;
+} mraa_pin_cap_complex_t;
 
 typedef struct {
     /*@{*/
     unsigned int pinmap; /**< sysfs pin */
     unsigned int parent_id; /** parent chip id */
     unsigned int mux_total; /** Numfer of muxes needed for operation of pin */
 
 typedef struct {
     /*@{*/
     unsigned int pinmap; /**< sysfs pin */
     unsigned int parent_id; /** parent chip id */
     unsigned int mux_total; /** Numfer of muxes needed for operation of pin */
-    maa_mux_t mux[6]; /** Array holding information about mux */
+    mraa_mux_t mux[6]; /** Array holding information about mux */
     unsigned int output_enable; /** Output Enable GPIO, for level shifting */
     unsigned int pullup_enable; /** Pull-Up enable GPIO, inputs */
     unsigned int output_enable; /** Output Enable GPIO, for level shifting */
     unsigned int pullup_enable; /** Pull-Up enable GPIO, inputs */
-    maa_pin_cap_complex_t complex_cap;
+    mraa_pin_cap_complex_t complex_cap;
     /*@}*/
     /*@}*/
-} maa_pin_t;
+} mraa_pin_t;
 
 typedef struct {
     /*@{*/
     char mem_dev[32]; /**< Memory device to use /dev/uio0 etc */
     unsigned int mem_sz; /** Size of memory to map */
     unsigned int bit_pos; /** Position of value bit */
 
 typedef struct {
     /*@{*/
     char mem_dev[32]; /**< Memory device to use /dev/uio0 etc */
     unsigned int mem_sz; /** Size of memory to map */
     unsigned int bit_pos; /** Position of value bit */
-    maa_pin_t gpio; /** GPio context containing none mmap info */
+    mraa_pin_t gpio; /** GPio context containing none mmap info */
     /*@}*/
     /*@}*/
-} maa_mmap_pin_t;
+} mraa_mmap_pin_t;
 
 /**
  * A Structure representing a physical Pin.
 
 /**
  * A Structure representing a physical Pin.
@@ -114,15 +114,15 @@ typedef struct {
 typedef struct {
     /*@{*/
     char name[8];                      /**< Pin's real world name */
 typedef struct {
     /*@{*/
     char name[8];                      /**< Pin's real world name */
-    maa_pincapabilities_t capabilites; /**< Pin Capabiliites */
-    maa_pin_t gpio; /**< GPIO structure */
-    maa_pin_t pwm;  /**< PWM structure */
-    maa_pin_t aio;  /**< Anaglog Pin */
-    maa_mmap_pin_t mmap; /**< GPIO through memory */
-    maa_pin_t i2c;  /**< i2c bus/pin */
-    maa_pin_t spi;  /**< spi bus/pin */
+    mraa_pincapabilities_t capabilites; /**< Pin Capabiliites */
+    mraa_pin_t gpio; /**< GPIO structure */
+    mraa_pin_t pwm;  /**< PWM structure */
+    mraa_pin_t aio;  /**< Anaglog Pin */
+    mraa_mmap_pin_t mmap; /**< GPIO through memory */
+    mraa_pin_t i2c;  /**< i2c bus/pin */
+    mraa_pin_t spi;  /**< spi bus/pin */
     /*@}*/
     /*@}*/
-} maa_pininfo_t;
+} mraa_pininfo_t;
 
 /**
  * A Structure representing the physical properties of a i2c bus.
 
 /**
  * A Structure representing the physical properties of a i2c bus.
@@ -133,7 +133,7 @@ typedef struct {
     unsigned int scl; /**< i2c SCL */
     unsigned int sda; /**< i2c SDA */
     /*@}*/
     unsigned int scl; /**< i2c SCL */
     unsigned int sda; /**< i2c SDA */
     /*@}*/
-} maa_i2c_bus_t;
+} mraa_i2c_bus_t;
 
 /**
  * A Structure representing the physical properties of a spi bus.
 
 /**
  * A Structure representing the physical properties of a spi bus.
@@ -142,13 +142,13 @@ typedef struct {
     /*@{*/
     unsigned int bus_id; /**< The Bus ID as exposed to the system. */
     unsigned int slave_s; /**< Slave select */
     /*@{*/
     unsigned int bus_id; /**< The Bus ID as exposed to the system. */
     unsigned int slave_s; /**< Slave select */
-    maa_boolean_t three_wire; /**< Is the bus only a three wire system */
+    mraa_boolean_t three_wire; /**< Is the bus only a three wire system */
     unsigned int sclk; /**< Serial Clock */
     unsigned int mosi; /**< Master Out, Slave In. */
     unsigned int miso; /**< Master In, Slave Out. */
     unsigned int cs; /**< Chip Select, used when the board is a spi slave */
     /*@}*/
     unsigned int sclk; /**< Serial Clock */
     unsigned int mosi; /**< Master Out, Slave In. */
     unsigned int miso; /**< Master In, Slave Out. */
     unsigned int cs; /**< Chip Select, used when the board is a spi slave */
     /*@}*/
-} maa_spi_bus_t;
+} mraa_spi_bus_t;
 
 /**
  * A Structure representing a platform/board.
 
 /**
  * A Structure representing a platform/board.
@@ -159,29 +159,29 @@ typedef struct {
     unsigned int gpio_count; /**< GPIO Count */
     unsigned int aio_count;  /**< Analog side Count */
     unsigned int i2c_bus_count; /**< Usable i2c Count */
     unsigned int gpio_count; /**< GPIO Count */
     unsigned int aio_count;  /**< Analog side Count */
     unsigned int i2c_bus_count; /**< Usable i2c Count */
-    maa_i2c_bus_t  i2c_bus[6]; /**< Array of i2c */
+    mraa_i2c_bus_t  i2c_bus[6]; /**< Array of i2c */
     unsigned int def_i2c_bus; /**< Position in array of default i2c bus */
     unsigned int spi_bus_count; /**< Usable spi Count */
     unsigned int def_i2c_bus; /**< Position in array of default i2c bus */
     unsigned int spi_bus_count; /**< Usable spi Count */
-    maa_spi_bus_t spi_bus[6];       /**< Array of spi */
+    mraa_spi_bus_t spi_bus[6];       /**< Array of spi */
     unsigned int def_spi_bus; /**< Position in array of defult spi bus */
     unsigned int def_spi_bus; /**< Position in array of defult spi bus */
-    maa_pininfo_t* pins;     /**< Pointer to pin array */
+    mraa_pininfo_t* pins;     /**< Pointer to pin array */
     /*@}*/
     /*@}*/
-} maa_board_t;
+} mraa_board_t;
 
 /**
 
 /**
- * Initialise MAA
+ * Initialise MRAA
  *
  * Detects running platform and attempts to use included pinmap
  *
  * @return Result of operation
  */
 #ifndef SWIG
  *
  * Detects running platform and attempts to use included pinmap
  *
  * @return Result of operation
  */
 #ifndef SWIG
-// this sets a compiler attribute (supported by GCC & clang) to have maa_init()
+// this sets a compiler attribute (supported by GCC & clang) to have mraa_init()
 // be called as a constructor make sure your libc supports this!  uclibc needs
 // to be compiled with UCLIBC_CTOR_DTOR
 // be called as a constructor make sure your libc supports this!  uclibc needs
 // to be compiled with UCLIBC_CTOR_DTOR
-maa_result_t maa_init() __attribute__((constructor));
+mraa_result_t mraa_init() __attribute__((constructor));
 #else
 #else
-maa_result_t maa_init();
+mraa_result_t mraa_init();
 #endif
 
 /**
 #endif
 
 /**
@@ -191,7 +191,7 @@ maa_result_t maa_init();
  * @param mode the mode to be tested.
  * @return boolean if the mode is supported, 0=false.
  */
  * @param mode the mode to be tested.
  * @return boolean if the mode is supported, 0=false.
  */
-maa_boolean_t maa_pin_mode_test(int pin, maa_pinmodes_t mode);
+mraa_boolean_t mraa_pin_mode_test(int pin, mraa_pinmodes_t mode);
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }
similarity index 72%
rename from api/maa/gpio.h
rename to api/mraa/gpio.h
index 75ffbd5..85d8e87 100644 (file)
@@ -28,7 +28,7 @@
  * @file
  * @brief General Purpose IO
  *
  * @file
  * @brief General Purpose IO
  *
- * Gpio is the General Purpose IO interface to libmaa. It's features depends on
+ * Gpio is the General Purpose IO interface to libmraa. It's features depends on
  * the board type used, it can use gpiolibs (exported via a kernel module
  * through sysfs), or memory mapped IO via a /dev/uio device or /dev/mem
  * depending again on the board configuratio, or memory mapped IO via a
  * the board type used, it can use gpiolibs (exported via a kernel module
  * through sysfs), or memory mapped IO via a /dev/uio device or /dev/mem
  * depending again on the board configuratio, or memory mapped IO via a
@@ -53,34 +53,34 @@ extern "C" {
 /**
  * Opaque pointer definition to the internal struct _gpio
  */
 /**
  * Opaque pointer definition to the internal struct _gpio
  */
-typedef struct _gpio* maa_gpio_context;
+typedef struct _gpio* mraa_gpio_context;
 
 /**
  * Gpio Output modes
  */
 typedef enum {
 
 /**
  * Gpio Output modes
  */
 typedef enum {
-    MAA_GPIO_STRONG     = 0, /**< Default. Strong high and low */
-    MAA_GPIO_PULLUP     = 1, /**< Resistive High */
-    MAA_GPIO_PULLDOWN   = 2, /**< Resistive Low */
-    MAA_GPIO_HIZ        = 3  /**< High Z State */
+    MRAA_GPIO_STRONG     = 0, /**< Default. Strong high and low */
+    MRAA_GPIO_PULLUP     = 1, /**< Resistive High */
+    MRAA_GPIO_PULLDOWN   = 2, /**< Resistive Low */
+    MRAA_GPIO_HIZ        = 3  /**< High Z State */
 } gpio_mode_t;
 
 /**
  * Gpio Direction options
  */
 typedef enum {
 } gpio_mode_t;
 
 /**
  * Gpio Direction options
  */
 typedef enum {
-    MAA_GPIO_OUT    = 0, /**< Output. A Mode can also be set */
-    MAA_GPIO_IN     = 1  /**< Input */
+    MRAA_GPIO_OUT    = 0, /**< Output. A Mode can also be set */
+    MRAA_GPIO_IN     = 1  /**< Input */
 } gpio_dir_t;
 
 /**
  * Gpio Edge types for interupts
  */
 typedef enum {
 } gpio_dir_t;
 
 /**
  * Gpio Edge types for interupts
  */
 typedef enum {
-    MAA_GPIO_EDGE_NONE    = 0, /**< No interrupt on Gpio */
-    MAA_GPIO_EDGE_BOTH    = 1, /**< Interupt on rising & falling */
-    MAA_GPIO_EDGE_RISING  = 2, /**< Interupt on rising only */
-    MAA_GPIO_EDGE_FALLING = 3  /**< Interupt on falling only */
+    MRAA_GPIO_EDGE_NONE    = 0, /**< No interrupt on Gpio */
+    MRAA_GPIO_EDGE_BOTH    = 1, /**< Interupt on rising & falling */
+    MRAA_GPIO_EDGE_RISING  = 2, /**< Interupt on rising only */
+    MRAA_GPIO_EDGE_FALLING = 3  /**< Interupt on falling only */
 } gpio_edge_t;
 
 /**
 } gpio_edge_t;
 
 /**
@@ -89,7 +89,7 @@ typedef enum {
  *  @param pin Pin number read from the board, i.e IO3 is 3
  *  @returns gpio context or NULL
  */
  *  @param pin Pin number read from the board, i.e IO3 is 3
  *  @returns gpio context or NULL
  */
-maa_gpio_context maa_gpio_init(int pin);
+mraa_gpio_context mraa_gpio_init(int pin);
 
 /**
  * Initialise gpio context without any mapping to a pin
 
 /**
  * Initialise gpio context without any mapping to a pin
@@ -97,7 +97,7 @@ maa_gpio_context maa_gpio_init(int pin);
  * @param gpiopin gpio pin as listed in SYSFS
  * @return gpio context or NULL
  */
  * @param gpiopin gpio pin as listed in SYSFS
  * @return gpio context or NULL
  */
-maa_gpio_context maa_gpio_init_raw(int gpiopin);
+mraa_gpio_context mraa_gpio_init_raw(int gpiopin);
 
 /**
  * Set the edge mode on the gpio
 
 /**
  * Set the edge mode on the gpio
@@ -106,7 +106,7 @@ maa_gpio_context maa_gpio_init_raw(int gpiopin);
  * @param mode The edge mode to set the gpio into
  * @return Result of operation
  */
  * @param mode The edge mode to set the gpio into
  * @return Result of operation
  */
-maa_result_t maa_gpio_edge_mode(maa_gpio_context dev, gpio_edge_t mode);
+mraa_result_t mraa_gpio_edge_mode(mraa_gpio_context dev, gpio_edge_t mode);
 
 /**
  * Set an interupt on pin
 
 /**
  * Set an interupt on pin
@@ -118,16 +118,16 @@ maa_result_t maa_gpio_edge_mode(maa_gpio_context dev, gpio_edge_t mode);
  * @param args Arguments passed to the interrupt handler (fptr)
  * @return Result of operation
  */
  * @param args Arguments passed to the interrupt handler (fptr)
  * @return Result of operation
  */
-maa_result_t maa_gpio_isr(maa_gpio_context dev, gpio_edge_t edge, void (*fptr)(void *), void * args);
+mraa_result_t mraa_gpio_isr(mraa_gpio_context dev, gpio_edge_t edge, void (*fptr)(void *), void * args);
 
 /**
  * Stop the current interupt watcher on this Gpio, and set the Gpio edge mode
 
 /**
  * Stop the current interupt watcher on this Gpio, and set the Gpio edge mode
- * to MAA_GPIO_EDGE_NONE
+ * to MRAA_GPIO_EDGE_NONE
  *
  * @param dev The Gpio context
  * @return Result of operation
  */
  *
  * @param dev The Gpio context
  * @return Result of operation
  */
-maa_result_t maa_gpio_isr_exit(maa_gpio_context dev);
+mraa_result_t mraa_gpio_isr_exit(mraa_gpio_context dev);
 
 /**
  * Set Gpio Output Mode,
 
 /**
  * Set Gpio Output Mode,
@@ -136,7 +136,7 @@ maa_result_t maa_gpio_isr_exit(maa_gpio_context dev);
  * @param mode The Gpio Output Mode
  * @return Result of operation
  */
  * @param mode The Gpio Output Mode
  * @return Result of operation
  */
-maa_result_t maa_gpio_mode(maa_gpio_context dev, gpio_mode_t mode);
+mraa_result_t mraa_gpio_mode(mraa_gpio_context dev, gpio_mode_t mode);
 
 /**
  * Set Gpio direction
 
 /**
  * Set Gpio direction
@@ -145,7 +145,7 @@ maa_result_t maa_gpio_mode(maa_gpio_context dev, gpio_mode_t mode);
  * @param dir The direction of the Gpio
  * @return Result of operation
  */
  * @param dir The direction of the Gpio
  * @return Result of operation
  */
-maa_result_t maa_gpio_dir(maa_gpio_context dev, gpio_dir_t dir);
+mraa_result_t mraa_gpio_dir(mraa_gpio_context dev, gpio_dir_t dir);
 
 /**
  * Close the Gpio context
 
 /**
  * Close the Gpio context
@@ -154,7 +154,7 @@ maa_result_t maa_gpio_dir(maa_gpio_context dev, gpio_dir_t dir);
  * @param dev The Gpio context
  * @return Result of operation
  */
  * @param dev The Gpio context
  * @return Result of operation
  */
-maa_result_t maa_gpio_close(maa_gpio_context dev);
+mraa_result_t mraa_gpio_close(mraa_gpio_context dev);
 
 /**
  * Read the Gpio value.
 
 /**
  * Read the Gpio value.
@@ -162,7 +162,7 @@ maa_result_t maa_gpio_close(maa_gpio_context dev);
  * @param dev The Gpio context
  * @return Result of operation
  */
  * @param dev The Gpio context
  * @return Result of operation
  */
-int maa_gpio_read(maa_gpio_context dev);
+int mraa_gpio_read(mraa_gpio_context dev);
 
 /**
  * Write to the Gpio Value.
 
 /**
  * Write to the Gpio Value.
@@ -171,7 +171,7 @@ int maa_gpio_read(maa_gpio_context dev);
  * @param value Integer value to write
  * @return Result of operation
  */
  * @param value Integer value to write
  * @return Result of operation
  */
-maa_result_t maa_gpio_write(maa_gpio_context dev, int value);
+mraa_result_t mraa_gpio_write(mraa_gpio_context dev, int value);
 
 /**
  * Change ownership of the context.
 
 /**
  * Change ownership of the context.
@@ -180,7 +180,7 @@ maa_result_t maa_gpio_write(maa_gpio_context dev, int value);
  * @param owner Does this context own the pin
  * @return Result of operation
  */
  * @param owner Does this context own the pin
  * @return Result of operation
  */
-maa_result_t maa_gpio_owner(maa_gpio_context dev, maa_boolean_t owner);
+mraa_result_t mraa_gpio_owner(mraa_gpio_context dev, mraa_boolean_t owner);
 
 /**
  * Enable using memory mapped io instead of sysfs
 
 /**
  * Enable using memory mapped io instead of sysfs
@@ -189,7 +189,7 @@ maa_result_t maa_gpio_owner(maa_gpio_context dev, maa_boolean_t owner);
  * @param mmap Use mmap instead of sysfs
  * @return Result of operation
  */
  * @param mmap Use mmap instead of sysfs
  * @return Result of operation
  */
-maa_result_t maa_gpio_use_mmaped(maa_gpio_context dev, maa_boolean_t mmap);
+mraa_result_t mraa_gpio_use_mmaped(mraa_gpio_context dev, mraa_boolean_t mmap);
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }
similarity index 79%
rename from api/maa/gpio.hpp
rename to api/mraa/gpio.hpp
index e538268..b40f050 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "gpio.h"
 
 
 #include "gpio.h"
 
-namespace maa {
+namespace mraa {
 
 // These enums must match the enums in gpio.h
 
 
 // These enums must match the enums in gpio.h
 
@@ -61,7 +61,7 @@ typedef enum {
 /**
  * @brief C++ API to General Purpose IO
  *
 /**
  * @brief C++ API to General Purpose IO
  *
- * This file defines the gpio C++ interface for libmaa
+ * This file defines the gpio C++ interface for libmraa
  *
  * @snippet Blink-IO.cpp Interesting
  */
  *
  * @snippet Blink-IO.cpp Interesting
  */
@@ -81,18 +81,18 @@ class Gpio {
          */
         Gpio(int pin, bool owner=true, bool raw=false) {
             if (raw)
          */
         Gpio(int pin, bool owner=true, bool raw=false) {
             if (raw)
-                m_gpio = maa_gpio_init_raw(pin);
+                m_gpio = mraa_gpio_init_raw(pin);
             else
             else
-                m_gpio = maa_gpio_init(pin);
+                m_gpio = mraa_gpio_init(pin);
             if (!owner)
             if (!owner)
-                maa_gpio_owner(m_gpio, 0);
+                mraa_gpio_owner(m_gpio, 0);
         }
         /**
          * Gpio object destructor, this will only unexport the gpio if we where
          * the owner
          */
         ~Gpio() {
         }
         /**
          * Gpio object destructor, this will only unexport the gpio if we where
          * the owner
          */
         ~Gpio() {
-            maa_gpio_close(m_gpio);
+            mraa_gpio_close(m_gpio);
         }
         /**
          * Set the edge mode for ISR
         }
         /**
          * Set the edge mode for ISR
@@ -100,12 +100,12 @@ class Gpio {
          * @param mode The edge mode to set
          * @return Result of operation
          */
          * @param mode The edge mode to set
          * @return Result of operation
          */
-        maa_result_t edge(Edge mode) {
-            return maa_gpio_edge_mode(m_gpio, (gpio_edge_t) mode);
+        mraa_result_t edge(Edge mode) {
+            return mraa_gpio_edge_mode(m_gpio, (gpio_edge_t) mode);
         }
 #if defined(SWIGPYTHON)
         }
 #if defined(SWIGPYTHON)
-        maa_result_t isr(Edge mode, PyObject *pyfunc, PyObject* args) {
-            return maa_gpio_isr(m_gpio, (gpio_edge_t) mode, (void (*) (void *)) pyfunc, (void *) args);
+        mraa_result_t isr(Edge mode, PyObject *pyfunc, PyObject* args) {
+            return mraa_gpio_isr(m_gpio, (gpio_edge_t) mode, (void (*) (void *)) pyfunc, (void *) args);
         }
 #else
         /**
         }
 #else
         /**
@@ -117,8 +117,8 @@ class Gpio {
          * @param args Arguments passed to the interrupt handler (fptr)
          * @return Result of operation
          */
          * @param args Arguments passed to the interrupt handler (fptr)
          * @return Result of operation
          */
-        maa_result_t isr(Edge mode, void (*fptr)(void *), void * args) {
-            return maa_gpio_isr(m_gpio, (gpio_edge_t) mode, fptr, args);
+        mraa_result_t isr(Edge mode, void (*fptr)(void *), void * args) {
+            return mraa_gpio_isr(m_gpio, (gpio_edge_t) mode, fptr, args);
         }
 #endif
         /**
         }
 #endif
         /**
@@ -127,8 +127,8 @@ class Gpio {
          *
          * @return Result of operation
          */
          *
          * @return Result of operation
          */
-        maa_result_t isrExit() {
-            return maa_gpio_isr_exit(m_gpio);
+        mraa_result_t isrExit() {
+            return mraa_gpio_isr_exit(m_gpio);
         }
         /**
          * Change Gpio mode
         }
         /**
          * Change Gpio mode
@@ -136,8 +136,8 @@ class Gpio {
          * @param mode The mode to change the gpio into
          * @return Result of operation
          */
          * @param mode The mode to change the gpio into
          * @return Result of operation
          */
-        maa_result_t mode(Mode mode) {
-            return maa_gpio_mode(m_gpio, (gpio_mode_t) mode);
+        mraa_result_t mode(Mode mode) {
+            return mraa_gpio_mode(m_gpio, (gpio_mode_t) mode);
         }
         /**
          * Change Gpio direction
         }
         /**
          * Change Gpio direction
@@ -145,8 +145,8 @@ class Gpio {
          * @param dir The direction to change the gpio into
          * @return Result of operation
          */
          * @param dir The direction to change the gpio into
          * @return Result of operation
          */
-        maa_result_t dir(Dir dir) {
-            return maa_gpio_dir(m_gpio, (gpio_dir_t) dir);
+        mraa_result_t dir(Dir dir) {
+            return mraa_gpio_dir(m_gpio, (gpio_dir_t) dir);
         }
         /**
          * Read value from Gpio
         }
         /**
          * Read value from Gpio
@@ -154,7 +154,7 @@ class Gpio {
          * @return Gpio value
          */
         int read() {
          * @return Gpio value
          */
         int read() {
-            return maa_gpio_read(m_gpio);
+            return mraa_gpio_read(m_gpio);
         }
         /**
          * Write value to Gpio
         }
         /**
          * Write value to Gpio
@@ -162,11 +162,11 @@ class Gpio {
          * @param value Value to write to Gpio
          * @return Result of operation
          */
          * @param value Value to write to Gpio
          * @return Result of operation
          */
-        maa_result_t write(int value) {
-            return maa_gpio_write(m_gpio, value);
+        mraa_result_t write(int value) {
+            return mraa_gpio_write(m_gpio, value);
         }
     private:
         }
     private:
-        maa_gpio_context m_gpio;
+        mraa_gpio_context m_gpio;
 };
 
 }
 };
 
 }
similarity index 82%
rename from api/maa/i2c.h
rename to api/mraa/i2c.h
index 4678953..2b0cf2b 100644 (file)
@@ -28,7 +28,7 @@
  * @file
  * @brief Inter-Integrated Circuit
  *
  * @file
  * @brief Inter-Integrated Circuit
  *
- * This file defines the i2c/Iic interface for libmaa. A context represents a
+ * This file defines the i2c/Iic interface for libmraa. A context represents a
  * bus and that bus may contain multiple addresses or i2c slaves. It is
  * considered best practice to make sure the address is correct before doing
  * any calls on i2c, in case another application or even thread changed the
  * bus and that bus may contain multiple addresses or i2c slaves. It is
  * considered best practice to make sure the address is correct before doing
  * any calls on i2c, in case another application or even thread changed the
@@ -52,7 +52,7 @@ extern "C" {
 /**
  * Opaque pointer definition to the internal struct _i2c
  */
 /**
  * Opaque pointer definition to the internal struct _i2c
  */
-typedef struct _i2c* maa_i2c_context;
+typedef struct _i2c* mraa_i2c_context;
 
 /**
  * Initialise i2c context, using board defintions
 
 /**
  * Initialise i2c context, using board defintions
@@ -60,7 +60,7 @@ typedef struct _i2c* maa_i2c_context;
  * @param bus i2c bus to use
  * @return i2c context or NULL
  */
  * @param bus i2c bus to use
  * @return i2c context or NULL
  */
-maa_i2c_context maa_i2c_init(int bus);
+mraa_i2c_context mraa_i2c_init(int bus);
 
 /**
  * Initialise i2c context, passing in spi bus to use.
 
 /**
  * Initialise i2c context, passing in spi bus to use.
@@ -68,7 +68,7 @@ maa_i2c_context maa_i2c_init(int bus);
  * @param bus The i2c bus to use i.e. /dev/i2c-2 would be "2"
  * @return i2c context or NULL
  */
  * @param bus The i2c bus to use i.e. /dev/i2c-2 would be "2"
  * @return i2c context or NULL
  */
-maa_i2c_context maa_i2c_init_raw(unsigned int bus);
+mraa_i2c_context mraa_i2c_init_raw(unsigned int bus);
 
 /**
  * Sets the frequency of the i2c context
 
 /**
  * Sets the frequency of the i2c context
@@ -77,7 +77,7 @@ maa_i2c_context maa_i2c_init_raw(unsigned int bus);
  * @param hz The bus frequency in hertz
  * @return Result of operation
  */
  * @param hz The bus frequency in hertz
  * @return Result of operation
  */
-maa_result_t maa_i2c_frequency(maa_i2c_context dev, int hz);
+mraa_result_t mraa_i2c_frequency(mraa_i2c_context dev, int hz);
 
 /**
  * Read from an i2c context
 
 /**
  * Read from an i2c context
@@ -87,7 +87,7 @@ maa_result_t maa_i2c_frequency(maa_i2c_context dev, int hz);
  * @param length max number of bytes to read
  * @return length of the read in bytes or 0
  */
  * @param length max number of bytes to read
  * @return length of the read in bytes or 0
  */
-int maa_i2c_read(maa_i2c_context dev, uint8_t *data, int length);
+int mraa_i2c_read(mraa_i2c_context dev, uint8_t *data, int length);
 
 /**
  * Read a single byte from the i2c context
 
 /**
  * Read a single byte from the i2c context
@@ -95,7 +95,7 @@ int maa_i2c_read(maa_i2c_context dev, uint8_t *data, int length);
  * @param dev The i2c context
  * @return The result of the read or -1 if failed
  */
  * @param dev The i2c context
  * @return The result of the read or -1 if failed
  */
-uint8_t maa_i2c_read_byte(maa_i2c_context dev);
+uint8_t mraa_i2c_read_byte(mraa_i2c_context dev);
 
 /**
  * Write to an i2c context
 
 /**
  * Write to an i2c context
@@ -105,7 +105,7 @@ uint8_t maa_i2c_read_byte(maa_i2c_context dev);
  * @param length the number of bytes to transmit
  * @return Result of operation
  */
  * @param length the number of bytes to transmit
  * @return Result of operation
  */
-maa_result_t maa_i2c_write(maa_i2c_context dev, const uint8_t *data, int length);
+mraa_result_t mraa_i2c_write(mraa_i2c_context dev, const uint8_t *data, int length);
 
 /**
  * Write a single byte to an i2c context
 
 /**
  * Write a single byte to an i2c context
@@ -114,7 +114,7 @@ maa_result_t maa_i2c_write(maa_i2c_context dev, const uint8_t *data, int length)
  * @param data The byte to write
  * @return Result of operation
  */
  * @param data The byte to write
  * @return Result of operation
  */
-maa_result_t maa_i2c_write_byte(maa_i2c_context dev, const uint8_t data);
+mraa_result_t mraa_i2c_write_byte(mraa_i2c_context dev, const uint8_t data);
 
 /**
  * Sets the i2c context address.
 
 /**
  * Sets the i2c context address.
@@ -125,15 +125,15 @@ maa_result_t maa_i2c_write_byte(maa_i2c_context dev, const uint8_t data);
  *   general call address.
  * @return Result of operation
  */
  *   general call address.
  * @return Result of operation
  */
-maa_result_t maa_i2c_address(maa_i2c_context dev, int address);
+mraa_result_t mraa_i2c_address(mraa_i2c_context dev, int address);
 
 /**
 
 /**
- * De-inits an maa_i2c_context device
+ * De-inits an mraa_i2c_context device
  *
  * @param dev The i2c context
  * @return Result of operation
  */
  *
  * @param dev The i2c context
  * @return Result of operation
  */
-maa_result_t maa_i2c_stop(maa_i2c_context dev);
+mraa_result_t mraa_i2c_stop(mraa_i2c_context dev);
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }
similarity index 80%
rename from api/maa/i2c.hpp
rename to api/mraa/i2c.hpp
index c971662..7a3e599 100644 (file)
 
 #include "i2c.h"
 
 
 #include "i2c.h"
 
-namespace maa {
+namespace mraa {
 
 /**
  * @brief C++ API to Inter-Integrated Circuit
  *
 
 /**
  * @brief C++ API to Inter-Integrated Circuit
  *
- * This file defines the I2c C++ interface for libmaa
+ * This file defines the I2c C++ interface for libmraa
  *
  * @snippet I2c-compass.cpp Interesting
  */
  *
  * @snippet I2c-compass.cpp Interesting
  */
@@ -47,9 +47,9 @@ class I2c {
          */
         I2c(int bus, bool raw=false) {
             if (raw)
          */
         I2c(int bus, bool raw=false) {
             if (raw)
-                m_i2c = maa_i2c_init_raw(bus);
+                m_i2c = mraa_i2c_init_raw(bus);
             else
             else
-                m_i2c = maa_i2c_init(bus);
+                m_i2c = mraa_i2c_init(bus);
         }
         /**
          * Closes the I2c Bus used. This does not guarrantee the bus will not
         }
         /**
          * Closes the I2c Bus used. This does not guarrantee the bus will not
@@ -57,7 +57,7 @@ class I2c {
          * slaves.
          */
         ~I2c() {
          * slaves.
          */
         ~I2c() {
-            maa_i2c_stop(m_i2c);
+            mraa_i2c_stop(m_i2c);
         }
         /**
          * Sets the i2c Frequency for communication. Your board may not support
         }
         /**
          * Sets the i2c Frequency for communication. Your board may not support
@@ -67,8 +67,8 @@ class I2c {
          * @param hz Frequency to set the bus to in hz
          * @return Result of operation
          */
          * @param hz Frequency to set the bus to in hz
          * @return Result of operation
          */
-        maa_result_t frequency(int hz) {
-            return maa_i2c_frequency(m_i2c, hz);
+        mraa_result_t frequency(int hz) {
+            return mraa_i2c_frequency(m_i2c, hz);
         }
         /**
          * Set the slave to talk to, typically called before every read/write
         }
         /**
          * Set the slave to talk to, typically called before every read/write
@@ -77,8 +77,8 @@ class I2c {
          * @param address Communicate to the i2c slave on this address
          * @return Result of operation
          */
          * @param address Communicate to the i2c slave on this address
          * @return Result of operation
          */
-        maa_result_t address(int address) {
-            return maa_i2c_address(m_i2c, address);
+        mraa_result_t address(int address) {
+            return mraa_i2c_address(m_i2c, address);
         }
         /**
          * Read exactly one byte from the bus
         }
         /**
          * Read exactly one byte from the bus
@@ -86,7 +86,7 @@ class I2c {
          * @return Char read from the bus
          */
         unsigned char readByte() {
          * @return Char read from the bus
          */
         unsigned char readByte() {
-            return (unsigned char) maa_i2c_read_byte(m_i2c);
+            return (unsigned char) mraa_i2c_read_byte(m_i2c);
         }
         /**
          * Read mutliple bytes from the bus
         }
         /**
          * Read mutliple bytes from the bus
@@ -96,7 +96,7 @@ class I2c {
          * @return length of the read or 0 if failed
          */
         int read(unsigned char * data, int length) {
          * @return length of the read or 0 if failed
          */
         int read(unsigned char * data, int length) {
-            return maa_i2c_read(m_i2c, data, length);
+            return mraa_i2c_read(m_i2c, data, length);
         }
         /**
          * Write one byte to the bus
         }
         /**
          * Write one byte to the bus
@@ -105,8 +105,8 @@ class I2c {
          * @param length Size of buffer to send
          * @return Result of operation
          */
          * @param length Size of buffer to send
          * @return Result of operation
          */
-        maa_result_t write(const unsigned char* data, int length) {
-            return maa_i2c_write(m_i2c, data, length);
+        mraa_result_t write(const unsigned char* data, int length) {
+            return mraa_i2c_write(m_i2c, data, length);
         }
 
         /**
         }
 
         /**
@@ -116,9 +116,9 @@ class I2c {
          * @param data Value to write to register
          * @return Result of operation
          */
          * @param data Value to write to register
          * @return Result of operation
          */
-        maa_result_t writeReg(const unsigned char reg, const unsigned char data) {
+        mraa_result_t writeReg(const unsigned char reg, const unsigned char data) {
             const unsigned char buf[2] = {reg, data};
             const unsigned char buf[2] = {reg, data};
-            return maa_i2c_write(m_i2c, buf, 2);
+            return mraa_i2c_write(m_i2c, buf, 2);
         }
 
         /**
         }
 
         /**
@@ -127,11 +127,11 @@ class I2c {
          * @param data The byte to send on the bus
          * @return Result of operation
          */
          * @param data The byte to send on the bus
          * @return Result of operation
          */
-        maa_result_t write(const unsigned char data) {
-            return maa_i2c_write_byte(m_i2c, data);
+        mraa_result_t write(const unsigned char data) {
+            return mraa_i2c_write_byte(m_i2c, data);
         }
     private:
         }
     private:
-        maa_i2c_context m_i2c;
+        mraa_i2c_context m_i2c;
 };
 
 }
 };
 
 }
similarity index 81%
rename from api/maa/pwm.h
rename to api/mraa/pwm.h
index 6345b04..9f32f05 100644 (file)
@@ -28,7 +28,7 @@
  * @file
  * @brief Pulse Width Modulation module
  *
  * @file
  * @brief Pulse Width Modulation module
  *
- * PWM is the Pulse Width Modulation interface to libmaa. It allows the
+ * PWM is the Pulse Width Modulation interface to libmraa. It allows the
  * generation of a signal on a pin. Some boards may have higher or lower levels
  * of resolution so make sure you check the board & pin you are using before
  * hand.
  * generation of a signal on a pin. Some boards may have higher or lower levels
  * of resolution so make sure you check the board & pin you are using before
  * hand.
@@ -45,7 +45,7 @@ extern "C" {
 
 #include "common.h"
 
 
 #include "common.h"
 
-typedef struct _pwm* maa_pwm_context;
+typedef struct _pwm* mraa_pwm_context;
 
 /**
  * Initialise pwm_context, uses board mapping
 
 /**
  * Initialise pwm_context, uses board mapping
@@ -53,7 +53,7 @@ typedef struct _pwm* maa_pwm_context;
  * @param pin The PWM PIN
  * @return pwm context or NULL
  */
  * @param pin The PWM PIN
  * @return pwm context or NULL
  */
-maa_pwm_context maa_pwm_init(int pin);
+mraa_pwm_context mraa_pwm_init(int pin);
 
 /**
  * Initialise pwm_context, raw mode
 
 /**
  * Initialise pwm_context, raw mode
@@ -62,7 +62,7 @@ maa_pwm_context maa_pwm_init(int pin);
  * @param pin The PWM PIN.
  * @return pwm context or NULL
  */
  * @param pin The PWM PIN.
  * @return pwm context or NULL
  */
-maa_pwm_context maa_pwm_init_raw(int chipid, int pin);
+mraa_pwm_context mraa_pwm_init_raw(int chipid, int pin);
 
 /**
  * Set the ouput duty-cycle percentage, as a float
 
 /**
  * Set the ouput duty-cycle percentage, as a float
@@ -73,7 +73,7 @@ maa_pwm_context maa_pwm_init_raw(int chipid, int pin);
  *    Values above or below this range will be set at either 0.0f or 1.0f
  * @return Result of operation
  */
  *    Values above or below this range will be set at either 0.0f or 1.0f
  * @return Result of operation
  */
-maa_result_t maa_pwm_write(maa_pwm_context dev, float percentage);
+mraa_result_t mraa_pwm_write(mraa_pwm_context dev, float percentage);
 
 /**
  * Read the ouput duty-cycle percentage, as a float
 
 /**
  * Read the ouput duty-cycle percentage, as a float
@@ -83,7 +83,7 @@ maa_result_t maa_pwm_write(maa_pwm_context dev, float percentage);
  *    The value should lie between 0.0f (representing on 0%) and 1.0f
  *    Values above or below this range will be set at either 0.0f or 1.0f
  */
  *    The value should lie between 0.0f (representing on 0%) and 1.0f
  *    Values above or below this range will be set at either 0.0f or 1.0f
  */
-float maa_pwm_read(maa_pwm_context dev);
+float mraa_pwm_read(mraa_pwm_context dev);
 
 /**
  * Set the PWM period as seconds represented in a float
 
 /**
  * Set the PWM period as seconds represented in a float
@@ -92,7 +92,7 @@ float maa_pwm_read(maa_pwm_context dev);
  * @param seconds Period represented as a float in seconds
  * @return Result of operation
  */
  * @param seconds Period represented as a float in seconds
  * @return Result of operation
  */
-maa_result_t maa_pwm_period(maa_pwm_context dev, float seconds);
+mraa_result_t mraa_pwm_period(mraa_pwm_context dev, float seconds);
 
 /**
  * Set period, milliseconds.
 
 /**
  * Set period, milliseconds.
@@ -101,7 +101,7 @@ maa_result_t maa_pwm_period(maa_pwm_context dev, float seconds);
  * @param ms Milliseconds for period
  * @return Result of operation
  */
  * @param ms Milliseconds for period
  * @return Result of operation
  */
-maa_result_t maa_pwm_period_ms(maa_pwm_context dev, int ms);
+mraa_result_t mraa_pwm_period_ms(mraa_pwm_context dev, int ms);
 
 /**
  * Set period, microseconds
 
 /**
  * Set period, microseconds
@@ -110,7 +110,7 @@ maa_result_t maa_pwm_period_ms(maa_pwm_context dev, int ms);
  * @param us Microseconds as period
  * @return Result of operation
  */
  * @param us Microseconds as period
  * @return Result of operation
  */
-maa_result_t maa_pwm_period_us(maa_pwm_context dev, int us);
+mraa_result_t mraa_pwm_period_us(mraa_pwm_context dev, int us);
 
 /**
  * Set pulsewidth, As represnted by seconds in a (float)
 
 /**
  * Set pulsewidth, As represnted by seconds in a (float)
@@ -119,7 +119,7 @@ maa_result_t maa_pwm_period_us(maa_pwm_context dev, int us);
  * @param seconds The duration of a pulse
  * @return Result of operation
  */
  * @param seconds The duration of a pulse
  * @return Result of operation
  */
-maa_result_t maa_pwm_pulsewidth(maa_pwm_context dev, float seconds);
+mraa_result_t mraa_pwm_pulsewidth(mraa_pwm_context dev, float seconds);
 
 /**
  * Set pulsewidth, milliseconds
 
 /**
  * Set pulsewidth, milliseconds
@@ -128,7 +128,7 @@ maa_result_t maa_pwm_pulsewidth(maa_pwm_context dev, float seconds);
  * @param ms Milliseconds for pulsewidth
  * @return Result of operation
  */
  * @param ms Milliseconds for pulsewidth
  * @return Result of operation
  */
-maa_result_t maa_pwm_pulsewidth_ms(maa_pwm_context dev, int ms);
+mraa_result_t mraa_pwm_pulsewidth_ms(mraa_pwm_context dev, int ms);
 
 /**
  * Set pulsewidth, microseconds
 
 /**
  * Set pulsewidth, microseconds
@@ -137,7 +137,7 @@ maa_result_t maa_pwm_pulsewidth_ms(maa_pwm_context dev, int ms);
  * @param us Microseconds for pulsewidth
  * @return Result of operation
  */
  * @param us Microseconds for pulsewidth
  * @return Result of operation
  */
-maa_result_t maa_pwm_pulsewidth_us(maa_pwm_context dev, int us);
+mraa_result_t mraa_pwm_pulsewidth_us(mraa_pwm_context dev, int us);
 
 /**
  * Set the enable status of the PWM pin. None zero will assume on with output being driven.
 
 /**
  * Set the enable status of the PWM pin. None zero will assume on with output being driven.
@@ -147,7 +147,7 @@ maa_result_t maa_pwm_pulsewidth_us(maa_pwm_context dev, int us);
  * @param enable Toggle status of pin
  * @return Result of operation.
  */
  * @param enable Toggle status of pin
  * @return Result of operation.
  */
-maa_result_t maa_pwm_enable(maa_pwm_context dev, int enable);
+mraa_result_t mraa_pwm_enable(mraa_pwm_context dev, int enable);
 
 /**
  * Change ownership of context
 
 /**
  * Change ownership of context
@@ -156,7 +156,7 @@ maa_result_t maa_pwm_enable(maa_pwm_context dev, int enable);
  * @param owner Ownership boolean
  * @return Result of operation
  */
  * @param owner Ownership boolean
  * @return Result of operation
  */
-maa_result_t maa_pwm_owner(maa_pwm_context dev, maa_boolean_t owner);
+mraa_result_t mraa_pwm_owner(mraa_pwm_context dev, mraa_boolean_t owner);
 
 /**
  * Close and unexport the PWM pin
 
 /**
  * Close and unexport the PWM pin
@@ -164,7 +164,7 @@ maa_result_t maa_pwm_owner(maa_pwm_context dev, maa_boolean_t owner);
  * @param dev The pwm context to use
  * @return Result of operation
  */
  * @param dev The pwm context to use
  * @return Result of operation
  */
-maa_result_t maa_pwm_close(maa_pwm_context dev);
+mraa_result_t mraa_pwm_close(mraa_pwm_context dev);
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }
similarity index 78%
rename from api/maa/pwm.hpp
rename to api/mraa/pwm.hpp
index a897841..32eb87d 100644 (file)
 
 #include "pwm.h"
 
 
 #include "pwm.h"
 
-namespace maa {
+namespace mraa {
 
 /**
  * @brief C++ API to Pulse Width Modulation
  *
 
 /**
  * @brief C++ API to Pulse Width Modulation
  *
- * This file defines the PWM C++ interface for libmaa
+ * This file defines the PWM C++ interface for libmraa
  *
  * @snippet Pwm3-cycle.cpp Interesting
  */
  *
  * @snippet Pwm3-cycle.cpp Interesting
  */
@@ -48,17 +48,17 @@ class Pwm {
          */
         Pwm(int pin, int chipid=-1, bool owner = true) {
             if (chipid == -1)
          */
         Pwm(int pin, int chipid=-1, bool owner = true) {
             if (chipid == -1)
-                m_pwm = maa_pwm_init(pin);
+                m_pwm = mraa_pwm_init(pin);
             else
             else
-                m_pwm = maa_pwm_init_raw(pin, chipid);
+                m_pwm = mraa_pwm_init_raw(pin, chipid);
             if (!owner)
             if (!owner)
-                maa_pwm_owner(m_pwm, 0);
+                mraa_pwm_owner(m_pwm, 0);
         }
         /**
          * Pwm destructor
          */
         ~Pwm() {
         }
         /**
          * Pwm destructor
          */
         ~Pwm() {
-            maa_pwm_close(m_pwm);
+            mraa_pwm_close(m_pwm);
         }
         /**
          * Set the output duty-cycle percentage, as a float
         }
         /**
          * Set the output duty-cycle percentage, as a float
@@ -69,8 +69,8 @@ class Pwm {
          * 1.0f
          * @return Result of operation
          */
          * 1.0f
          * @return Result of operation
          */
-        maa_result_t write(float percentage) {
-            return maa_pwm_write(m_pwm, percentage);
+        mraa_result_t write(float percentage) {
+            return mraa_pwm_write(m_pwm, percentage);
         }
         /**
          * Read the ouput duty-cycle percentage, as a float
         }
         /**
          * Read the ouput duty-cycle percentage, as a float
@@ -81,7 +81,7 @@ class Pwm {
          * 1.0f
          */
         float read() {
          * 1.0f
          */
         float read() {
-            return maa_pwm_read(m_pwm);
+            return mraa_pwm_read(m_pwm);
         }
         /**
          * Set the PWM period as seconds represented in a float
         }
         /**
          * Set the PWM period as seconds represented in a float
@@ -89,8 +89,8 @@ class Pwm {
          * @param period Period represented as a float in seconds
          * @return Result of operation
          */
          * @param period Period represented as a float in seconds
          * @return Result of operation
          */
-        maa_result_t period(float period) {
-            return maa_pwm_period(m_pwm, period);
+        mraa_result_t period(float period) {
+            return mraa_pwm_period(m_pwm, period);
         }
         /**
          * Set period, milliseconds
         }
         /**
          * Set period, milliseconds
@@ -98,8 +98,8 @@ class Pwm {
          * @param ms milliseconds for period
          * @return Result of operation
          */
          * @param ms milliseconds for period
          * @return Result of operation
          */
-        maa_result_t period_ms(int ms) {
-            return maa_pwm_period_ms(m_pwm, ms);
+        mraa_result_t period_ms(int ms) {
+            return mraa_pwm_period_ms(m_pwm, ms);
         }
         /**
          * Set period, microseconds
         }
         /**
          * Set period, microseconds
@@ -107,8 +107,8 @@ class Pwm {
          * @param us microseconds as period
          * @return Result of operation
          */
          * @param us microseconds as period
          * @return Result of operation
          */
-        maa_result_t period_us(int us) {
-            return maa_pwm_period_us(m_pwm, us);
+        mraa_result_t period_us(int us) {
+            return mraa_pwm_period_us(m_pwm, us);
         }
         /**
          * Set pulsewidth, As represnted by seconds in a (float)
         }
         /**
          * Set pulsewidth, As represnted by seconds in a (float)
@@ -116,8 +116,8 @@ class Pwm {
          * @param seconds The duration of a pulse
          * @return Result of operation
          */
          * @param seconds The duration of a pulse
          * @return Result of operation
          */
-        maa_result_t pulsewidth(float seconds) {
-            return maa_pwm_pulsewidth(m_pwm, seconds);
+        mraa_result_t pulsewidth(float seconds) {
+            return mraa_pwm_pulsewidth(m_pwm, seconds);
         }
         /**
          * Set pulsewidth, milliseconds
         }
         /**
          * Set pulsewidth, milliseconds
@@ -125,8 +125,8 @@ class Pwm {
          * @param ms milliseconds for pulsewidth
          * @return Result of operation
          */
          * @param ms milliseconds for pulsewidth
          * @return Result of operation
          */
-        maa_result_t pulsewidth_ms(int ms) {
-            return maa_pwm_pulsewidth_ms(m_pwm, ms);
+        mraa_result_t pulsewidth_ms(int ms) {
+            return mraa_pwm_pulsewidth_ms(m_pwm, ms);
         }
         /**
          * The pulsewidth, microseconds
         }
         /**
          * The pulsewidth, microseconds
@@ -134,8 +134,8 @@ class Pwm {
          * @param us microseconds for pulsewidth
          * @return Result of operation
          */
          * @param us microseconds for pulsewidth
          * @return Result of operation
          */
-        maa_result_t pulsewidth_us(int us) {
-            return maa_pwm_pulsewidth_us(m_pwm, us);
+        mraa_result_t pulsewidth_us(int us) {
+            return mraa_pwm_pulsewidth_us(m_pwm, us);
         }
         /**
          * Set the enable status of the PWM pin. None zero will assume on with
         }
         /**
          * Set the enable status of the PWM pin. None zero will assume on with
@@ -144,14 +144,14 @@ class Pwm {
          * @param enable enable status of pin
          * @return Result of operation
          */
          * @param enable enable status of pin
          * @return Result of operation
          */
-        maa_result_t enable(bool enable) {
+        mraa_result_t enable(bool enable) {
             if (enable)
             if (enable)
-                return maa_pwm_enable(m_pwm, 1);
+                return mraa_pwm_enable(m_pwm, 1);
             else
             else
-                return maa_pwm_enable(m_pwm, 0);
+                return mraa_pwm_enable(m_pwm, 0);
         }
     private:
         }
     private:
-        maa_pwm_context m_pwm;
+        mraa_pwm_context m_pwm;
 };
 
 }
 };
 
 }
similarity index 79%
rename from api/maa/spi.h
rename to api/mraa/spi.h
index 6700d74..4a91e72 100644 (file)
@@ -28,7 +28,7 @@
  * @file
  * @brief System Packet Interface
  *
  * @file
  * @brief System Packet Interface
  *
- * This file defines the spi interface for libmaa
+ * This file defines the spi interface for libmraa
  *
  * @snippet spi_mcp4261.c Interesting
  */
  *
  * @snippet spi_mcp4261.c Interesting
  */
@@ -46,7 +46,7 @@ extern "C" {
 /**
  * Opaque pointer definition to the internal struct _spi
  */
 /**
  * Opaque pointer definition to the internal struct _spi
  */
-typedef struct _spi* maa_spi_context;
+typedef struct _spi* mraa_spi_context;
 
 /**
  * Initialise SPI_context, uses board mapping. Sets the muxes
 
 /**
  * Initialise SPI_context, uses board mapping. Sets the muxes
@@ -54,7 +54,7 @@ typedef struct _spi* maa_spi_context;
  * @param bus Bus to use, as listed in platform definition, normally 0
  * @return Spi context or NULL
  */
  * @param bus Bus to use, as listed in platform definition, normally 0
  * @return Spi context or NULL
  */
-maa_spi_context maa_spi_init(int bus);
+mraa_spi_context mraa_spi_init(int bus);
 
 /**
  * Set the SPI device mode. see spidev 0-3.
 
 /**
  * Set the SPI device mode. see spidev 0-3.
@@ -63,15 +63,15 @@ maa_spi_context maa_spi_init(int bus);
  * @param mode The SPI mode, See Linux spidev
  * @return Spi context or NULL
  */
  * @param mode The SPI mode, See Linux spidev
  * @return Spi context or NULL
  */
-maa_result_t maa_spi_mode(maa_spi_context dev,unsigned short mode);
+mraa_result_t mraa_spi_mode(mraa_spi_context dev,unsigned short mode);
 
 /** Set the SPI device operating clock frequency.
  *
  * @param dev the Spi context
  * @param hz the frequency in hz
 
 /** Set the SPI device operating clock frequency.
  *
  * @param dev the Spi context
  * @param hz the frequency in hz
- * @return maa_spi_context The returned initialised SPI context
+ * @return mraa_spi_context The returned initialised SPI context
  */
  */
-maa_result_t maa_spi_frequency(maa_spi_context dev, int hz);
+mraa_result_t mraa_spi_frequency(mraa_spi_context dev, int hz);
 
 /** Write Single Byte to the SPI device.
  *
 
 /** Write Single Byte to the SPI device.
  *
@@ -79,7 +79,7 @@ maa_result_t maa_spi_frequency(maa_spi_context dev, int hz);
  * @param data Data to send
  * @return Data received on the miso line
  */
  * @param data Data to send
  * @return Data received on the miso line
  */
-uint8_t maa_spi_write(maa_spi_context dev, uint8_t data);
+uint8_t mraa_spi_write(mraa_spi_context dev, uint8_t data);
 
 /** Write Buffer of bytes to the SPI device. The pointer return has to be
  * free'd by the caller.
 
 /** Write Buffer of bytes to the SPI device. The pointer return has to be
  * free'd by the caller.
@@ -89,7 +89,7 @@ uint8_t maa_spi_write(maa_spi_context dev, uint8_t data);
  * @param length elements within buffer, Max 4096
  * @return Data received on the miso line, same length as passed in
  */
  * @param length elements within buffer, Max 4096
  * @return Data received on the miso line, same length as passed in
  */
-uint8_t* maa_spi_write_buf(maa_spi_context dev, uint8_t* data, int length);
+uint8_t* mraa_spi_write_buf(mraa_spi_context dev, uint8_t* data, int length);
 
 /**
  * Change the SPI lsb mode
 
 /**
  * Change the SPI lsb mode
@@ -98,7 +98,7 @@ uint8_t* maa_spi_write_buf(maa_spi_context dev, uint8_t* data, int length);
  * @param lsb Use least significant bit transmission. 0 for msbi
  * @return Result of operation
  */
  * @param lsb Use least significant bit transmission. 0 for msbi
  * @return Result of operation
  */
-maa_result_t maa_spi_lsbmode(maa_spi_context dev, maa_boolean_t lsb);
+mraa_result_t mraa_spi_lsbmode(mraa_spi_context dev, mraa_boolean_t lsb);
 
 /**
  * Set bits per mode on transaction, defaults at 8
 
 /**
  * Set bits per mode on transaction, defaults at 8
@@ -107,15 +107,15 @@ maa_result_t maa_spi_lsbmode(maa_spi_context dev, maa_boolean_t lsb);
  * @param bits bits per word
  * @return Result of operation
  */
  * @param bits bits per word
  * @return Result of operation
  */
-maa_result_t maa_spi_bit_per_word(maa_spi_context dev, unsigned int bits);
+mraa_result_t mraa_spi_bit_per_word(mraa_spi_context dev, unsigned int bits);
 
 /**
 
 /**
- * De-inits an maa_spi_context device
+ * De-inits an mraa_spi_context device
  *
  * @param dev The Spi context
  * @return Result of operation
  */
  *
  * @param dev The Spi context
  * @return Result of operation
  */
-maa_result_t maa_spi_stop(maa_spi_context dev);
+mraa_result_t mraa_spi_stop(mraa_spi_context dev);
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }
similarity index 80%
rename from api/maa/spi.hpp
rename to api/mraa/spi.hpp
index 1d45567..e7dda85 100644 (file)
 
 #include "spi.h"
 
 
 #include "spi.h"
 
-namespace maa {
+namespace mraa {
 
 /**
  * @brief C++ API to System Packet Interface
  *
 
 /**
  * @brief C++ API to System Packet Interface
  *
- * This file defines the SPI C++ interface for libmaa
+ * This file defines the SPI C++ interface for libmraa
  *
  * @snippet Spi-pot.cpp Interesting
  */
  *
  * @snippet Spi-pot.cpp Interesting
  */
@@ -43,13 +43,13 @@ class Spi {
          * @param bus to use, as listed in the platform definition, normally 0
          */
         Spi(int bus) {
          * @param bus to use, as listed in the platform definition, normally 0
          */
         Spi(int bus) {
-            m_spi = maa_spi_init(bus);
+            m_spi = mraa_spi_init(bus);
         }
         /**
          * Closes spi bus
          */
         ~Spi() {
         }
         /**
          * Closes spi bus
          */
         ~Spi() {
-            maa_spi_stop(m_spi);
+            mraa_spi_stop(m_spi);
         }
         /**
          * Set the SPI device mode. see spidev0-3
         }
         /**
          * Set the SPI device mode. see spidev0-3
@@ -57,8 +57,8 @@ class Spi {
          * @param mode the mode. See Linux spidev doc
          * @return Result of operation
          */
          * @param mode the mode. See Linux spidev doc
          * @return Result of operation
          */
-        maa_result_t mode(unsigned short mode) {
-            return maa_spi_mode(m_spi, mode);
+        mraa_result_t mode(unsigned short mode) {
+            return mraa_spi_mode(m_spi, mode);
         }
         /**
          * Set the SPI device operating clock frequency
         }
         /**
          * Set the SPI device operating clock frequency
@@ -66,8 +66,8 @@ class Spi {
          * @param hz the frequency to set in hz
          * @return Result of operation
          */
          * @param hz the frequency to set in hz
          * @return Result of operation
          */
-        maa_result_t frequency(int hz) {
-            return maa_spi_frequency(m_spi, hz);
+        mraa_result_t frequency(int hz) {
+            return mraa_spi_frequency(m_spi, hz);
         }
         /**
          * Write single byte to the SPI device
         }
         /**
          * Write single byte to the SPI device
@@ -76,7 +76,7 @@ class Spi {
          * @return data received on the miso line
          */
         unsigned char write(uint8_t data) {
          * @return data received on the miso line
          */
         unsigned char write(uint8_t data) {
-            return (unsigned char) maa_spi_write(m_spi, data);
+            return (unsigned char) mraa_spi_write(m_spi, data);
         }
         /**
          * Write buffer of bytes to SPI device
         }
         /**
          * Write buffer of bytes to SPI device
@@ -86,7 +86,7 @@ class Spi {
          * @return char* data received on the miso line. Same length as passed in
          */
         unsigned char* write(uint8_t* data, int length) {
          * @return char* data received on the miso line. Same length as passed in
          */
         unsigned char* write(uint8_t* data, int length) {
-            return (unsigned char*) maa_spi_write_buf(m_spi, data, length);
+            return (unsigned char*) mraa_spi_write_buf(m_spi, data, length);
         }
         /**
          * Change the SPI lsb mode
         }
         /**
          * Change the SPI lsb mode
@@ -94,8 +94,8 @@ class Spi {
          * @param lsb Use least significant bit transmission - 0 for msbi
          * @return Result of operation
          */
          * @param lsb Use least significant bit transmission - 0 for msbi
          * @return Result of operation
          */
-        maa_result_t lsbmode(bool lsb) {
-            return maa_spi_lsbmode(m_spi, (maa_boolean_t) lsb);
+        mraa_result_t lsbmode(bool lsb) {
+            return mraa_spi_lsbmode(m_spi, (mraa_boolean_t) lsb);
         }
         /**
          * Set bits per mode on transaction, default is 8
         }
         /**
          * Set bits per mode on transaction, default is 8
@@ -103,10 +103,10 @@ class Spi {
          * @param bits bits per word
          * @return Result of operation
          */
          * @param bits bits per word
          * @return Result of operation
          */
-        maa_result_t bitPerWord(unsigned int bits) {
-            return maa_spi_bit_per_word(m_spi, bits);
+        mraa_result_t bitPerWord(unsigned int bits) {
+            return mraa_spi_bit_per_word(m_spi, bits);
         }
             private:
         }
             private:
-                maa_spi_context m_spi;
+                mraa_spi_context m_spi;
         };
 }
         };
 }
similarity index 50%
rename from api/maa/types.h
rename to api/mraa/types.h
index 7d36af5..9dba83c 100644 (file)
@@ -25,7 +25,7 @@
 
 /** @file
  *
 
 /** @file
  *
- * This file defines the basic shared types for libmaa
+ * This file defines the basic shared types for libmraa
  * this file is different to common.h in that swig takes this as an input
  */
 
  * this file is different to common.h in that swig takes this as an input
  */
 
@@ -34,38 +34,38 @@ extern "C" {
 #endif
 
 /**
 #endif
 
 /**
- * MAA supported platform types
+ * MRAA supported platform types
  */
 typedef enum {
  */
 typedef enum {
-    MAA_INTEL_GALILEO_GEN1 = 0, /**< The Generation 1 Galileo platform (RevD) */
-    MAA_INTEL_GALILEO_GEN2 = 1, /**< The Generation 2 Galileo platform (RevG/H) */
+    MRAA_INTEL_GALILEO_GEN1 = 0, /**< The Generation 1 Galileo platform (RevD) */
+    MRAA_INTEL_GALILEO_GEN2 = 1, /**< The Generation 2 Galileo platform (RevG/H) */
 
 
-    MAA_UNKNOWN_PLATFORM = 99 /**< An unknown platform type, typically will load INTEL_GALILEO_GEN1 */
-} maa_platform_t;
+    MRAA_UNKNOWN_PLATFORM = 99 /**< An unknown platform type, typically will load INTEL_GALILEO_GEN1 */
+} mraa_platform_t;
 
 /**
 
 /**
- * MAA return codes
+ * MRAA return codes
  */
 typedef enum {
  */
 typedef enum {
-    MAA_SUCCESS                              =  0, /**< Expected response */
-    MAA_ERROR_FEATURE_NOT_IMPLEMENTED        =  1, /**< Feature TODO */
-    MAA_ERROR_FEATURE_NOT_SUPPORTED          =  2, /**< Feature not supported by HW */
-    MAA_ERROR_INVALID_VERBOSITY_LEVEL        =  3, /**< Verbosity level wrong */
-    MAA_ERROR_INVALID_PARAMETER              =  4, /**< Parameter invalid */
-    MAA_ERROR_INVALID_HANDLE                 =  5, /**< Handle invalid */
-    MAA_ERROR_NO_RESOURCES                   =  6, /**< No resource of that type avail */
-    MAA_ERROR_INVALID_RESOURCE               =  7, /**< Resource invalid */
-    MAA_ERROR_INVALID_QUEUE_TYPE             =  8, /**< Queue type incorrect */
-    MAA_ERROR_NO_DATA_AVAILABLE              =  9, /**< No data available */
-    MAA_ERROR_INVALID_PLATFORM               = 10, /**< Platform not recognised */
-    MAA_ERROR_PLATFORM_NOT_INITIALISED       = 11, /**< Board information not initialised */
-    MAA_ERROR_PLATFORM_ALREADY_INITIALISED   = 12, /**< Board is already initialised */
+    MRAA_SUCCESS                              =  0, /**< Expected response */
+    MRAA_ERROR_FEATURE_NOT_IMPLEMENTED        =  1, /**< Feature TODO */
+    MRAA_ERROR_FEATURE_NOT_SUPPORTED          =  2, /**< Feature not supported by HW */
+    MRAA_ERROR_INVALID_VERBOSITY_LEVEL        =  3, /**< Verbosity level wrong */
+    MRAA_ERROR_INVALID_PARAMETER              =  4, /**< Parameter invalid */
+    MRAA_ERROR_INVALID_HANDLE                 =  5, /**< Handle invalid */
+    MRAA_ERROR_NO_RESOURCES                   =  6, /**< No resource of that type avail */
+    MRAA_ERROR_INVALID_RESOURCE               =  7, /**< Resource invalid */
+    MRAA_ERROR_INVALID_QUEUE_TYPE             =  8, /**< Queue type incorrect */
+    MRAA_ERROR_NO_DATA_AVAILABLE              =  9, /**< No data available */
+    MRAA_ERROR_INVALID_PLATFORM               = 10, /**< Platform not recognised */
+    MRAA_ERROR_PLATFORM_NOT_INITIALISED       = 11, /**< Board information not initialised */
+    MRAA_ERROR_PLATFORM_ALREADY_INITIALISED   = 12, /**< Board is already initialised */
 
 
-    MAA_ERROR_UNSPECIFIED                    = 99 /**< Unknown Error */
-} maa_result_t;
+    MRAA_ERROR_UNSPECIFIED                    = 99 /**< Unknown Error */
+} mraa_result_t;
 
 /**
 
 /**
- * This function attempts to set the maa process to a given priority and the
+ * This function attempts to set the mraa process to a given priority and the
  * scheduler to SCHED_RR. Highest * priority is typically 99 and minimum is 0.
  * This function * will set to MAX if * priority is > MAX. Function will return
  * -1 on failure.
  * scheduler to SCHED_RR. Highest * priority is typically 99 and minimum is 0.
  * This function * will set to MAX if * priority is > MAX. Function will return
  * -1 on failure.
@@ -73,30 +73,30 @@ typedef enum {
  * @param priority Value from typically 0 to 99
  * @return The priority value set
  */
  * @param priority Value from typically 0 to 99
  * @return The priority value set
  */
-int maa_set_priority(const unsigned int priority);
+int mraa_set_priority(const unsigned int priority);
 
 
-/** Get the version string of maa autogenerated from git tag
+/** Get the version string of mraa autogenerated from git tag
  *
  * The version returned may not be what is expected however it is a reliable
  * number associated with the git tag closest to that version at build time
  *
  * @return version string from version.h
  */
  *
  * The version returned may not be what is expected however it is a reliable
  * number associated with the git tag closest to that version at build time
  *
  * @return version string from version.h
  */
-const char* maa_get_version();
+const char* mraa_get_version();
 
 /**
 
 /**
- * Print a textual representation of the maa_result_t
+ * Print a textual representation of the mraa_result_t
  *
  * @param result the result to print
  */
  *
  * @param result the result to print
  */
-void maa_result_print(maa_result_t result);
+void mraa_result_print(mraa_result_t result);
 
 /**
  * Get platform type, board must be initialised.
  *
 
 /**
  * Get platform type, board must be initialised.
  *
- * @return maa_platform_t Platform type enum
+ * @return mraa_platform_t Platform type enum
  */
  */
-maa_platform_t maa_get_platform_type();
+mraa_platform_t mraa_get_platform_type();
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }
index 851b4f9..e924f54 100644 (file)
@@ -197,7 +197,7 @@ Depends:
 Provides: ${CPACK_DEBIAN_PACKAGE_PROVIDES}
 Replaces: ${CPACK_DEBIAN_PACKAGE_REPLACES}
 Conflicts: ${CPACK_DEBIAN_PACKAGE_CONFLICTS}
 Provides: ${CPACK_DEBIAN_PACKAGE_PROVIDES}
 Replaces: ${CPACK_DEBIAN_PACKAGE_REPLACES}
 Conflicts: ${CPACK_DEBIAN_PACKAGE_CONFLICTS}
-Source: https://github.com/intel-iot-devkit/maa
+Source: https://github.com/intel-iot-devkit/mraa
 #Essential: no
 ")
 
 #Essential: no
 ")
 
index 923610a..dbf90d9 100644 (file)
@@ -1,7 +1,7 @@
-Building libmaa                         {#building}
+Building libmraa                         {#building}
 ===============
 
 ===============
 
-libmaa uses cmake in order to make compilation relatively painless. Cmake runs
+libmraa uses cmake in order to make compilation relatively painless. Cmake runs
 build out of tree so the recommended way is to clone from git and make a build/ directory.
 
 ~~~~~~~~~~~~~{.sh}
 build out of tree so the recommended way is to clone from git and make a build/ directory.
 
 ~~~~~~~~~~~~~{.sh}
index f295473..c668316 100644 (file)
@@ -1,7 +1,7 @@
-Contributing to libmaa                           {#contributing} 
+Contributing to libmraa                           {#contributing} 
 ======================
 
 ======================
 
-libmaa is an opensource project and we are actively looking for people to help
+libmraa is an opensource project and we are actively looking for people to help
 with:
 
 - Writing platform supports for all types of embedded boards running linux
 with:
 
 - Writing platform supports for all types of embedded boards running linux
index dca6174..90a1828 100644 (file)
@@ -4,7 +4,7 @@ Galileo Rev D                            {#galileorevd}
 Galileo is a microcontroller board based on the Intel® Quark SoC X1000
 Application Processor, a 32-bit Intel Pentium-class system on a chip.
 
 Galileo is a microcontroller board based on the Intel® Quark SoC X1000
 Application Processor, a 32-bit Intel Pentium-class system on a chip.
 
-The rev D board has the following limitations in libmaa:
+The rev D board has the following limitations in libmraa:
 
 - gpio register access via /dev/uio is limited to pin2 and 3
 - gpio interupts will only work on GPIO_EDGE_BOTH
 
 - gpio register access via /dev/uio is limited to pin2 and 3
 - gpio interupts will only work on GPIO_EDGE_BOTH
index 991ee9f..964ff6d 100644 (file)
@@ -1,4 +1,4 @@
-MAA - Low Level Skeleton Library for Communication on Intel platforms
+MRAA - Low Level Skeleton Library for Communication on Intel platforms
 ==============
 
 Library in C/C++ to interface with Galileo & other Intel platforms, in a
 ==============
 
 Library in C/C++ to interface with Galileo & other Intel platforms, in a
@@ -11,23 +11,23 @@ low level communication protocol by high level languages & constructs.
 
 ## API
 
 
 ## API
 
-These interfaces allow you to interact with all libmaa functionality. The C++
+These interfaces allow you to interact with all libmraa functionality. The C++
 classes directly wrap the C API and provide a near 1:1 mapping of
 functionality.
 
 <center>
 | C API Modules          | C++ API Classes             |
 |:----------------------:|:---------------------------:|
 classes directly wrap the C API and provide a near 1:1 mapping of
 functionality.
 
 <center>
 | C API Modules          | C++ API Classes             |
 |:----------------------:|:---------------------------:|
-| @ref gpio.h "gpio"     | @ref maa::Gpio "Gpio class" |
-| @ref i2c.h "i2c"       | @ref maa::I2c "I2c class"   |
-| @ref aio.h "aio"       | @ref maa::Aio "Aio class"   |
-| @ref pwm.h "pwm"       | @ref maa::Pwm "Pwm class"   |
-| @ref spi.h "spi"       | @ref maa::Spi "Spi class"   |
+| @ref gpio.h "gpio"     | @ref mraa::Gpio "Gpio class" |
+| @ref i2c.h "i2c"       | @ref mraa::I2c "I2c class"   |
+| @ref aio.h "aio"       | @ref mraa::Aio "Aio class"   |
+| @ref pwm.h "pwm"       | @ref mraa::Pwm "Pwm class"   |
+| @ref spi.h "spi"       | @ref mraa::Spi "Spi class"   |
 | @ref common.h "common" | @ref common.h "common"      |
 </center>
 
 | @ref common.h "common" | @ref common.h "common"      |
 </center>
 
-### Hello Maa
-@snippet hellomaa.c Interesting
+### Hello Mraa
+@snippet hellomraa.c Interesting
 
 ## Supported platforms
 
 
 ## Supported platforms
 
@@ -61,20 +61,20 @@ they are listed here. Anything pre 0.2.x is ignored.
 
 **0.3.1**
   * Initial Intel Galileo Gen 2 support
 
 **0.3.1**
   * Initial Intel Galileo Gen 2 support
-  * maa_gpio_isr parameters added.
+  * mraa_gpio_isr parameters added.
   * Detection of different supported platforms added.
 
 **0.3.0**
   * Detection of different supported platforms added.
 
 **0.3.0**
-  * maa_i2c_read now returns length of read
+  * mraa_i2c_read now returns length of read
 
 **0.2.9**
 
 **0.2.9**
-  * Add global maa.h & maa.hpp headers
-  * usage of "gpio.h" is not legal you need to use "maa/gpio.h" unless adding
-    -L/usr/include/maa
+  * Add global mraa.h & mraa.hpp headers
+  * usage of "gpio.h" is not legal you need to use "mraa/gpio.h" unless adding
+    -L/usr/include/mraa
 
 **0.2.8**
 
 **0.2.8**
-  * Added maa_set_priority call
-  * Added mmap gpio call maa_gpio_use_mmaped
+  * Added mraa_set_priority call
+  * Added mmap gpio call mraa_gpio_use_mmaped
 
 **0.2.7**
   * C++ API now uses basic types and not unistd types as C
 
 **0.2.7**
   * C++ API now uses basic types and not unistd types as C
@@ -83,7 +83,7 @@ they are listed here. Anything pre 0.2.x is ignored.
 **0.2.6**
   * C++ examples added, using c++ headers/api.
   * moved to open instead of fopen in all modules
 **0.2.6**
   * C++ examples added, using c++ headers/api.
   * moved to open instead of fopen in all modules
-  * rename maa_check functions and made them internal to maa only.
+  * rename mraa_check functions and made them internal to mraa only.
   * removed "export" functions from api
   * Intel Galileo Gen 1 (rev d) fixes, incorrect definition of some items
   * SPI, implementation completed.
   * removed "export" functions from api
   * Intel Galileo Gen 1 (rev d) fixes, incorrect definition of some items
   * SPI, implementation completed.
@@ -94,23 +94,23 @@ they are listed here. Anything pre 0.2.x is ignored.
   * GPIO/PWM ownership guard prevents closing on existing pins, still can be forced.
 
 **0.2.5**
   * GPIO/PWM ownership guard prevents closing on existing pins, still can be forced.
 
 **0.2.5**
-  * C++/Python/Node Enums/const names now do not contain MAA_GPIO
+  * C++/Python/Node Enums/const names now do not contain MRAA_GPIO
   * Enum type declaration for C++ changed
   * Python/Node get_version() -> GetVersion()
   * i2c read calls don't use const char* and i2c write calls do
 
 **0.2.4**
   * Enum type declaration for C++ changed
   * Python/Node get_version() -> GetVersion()
   * i2c read calls don't use const char* and i2c write calls do
 
 **0.2.4**
-  * All maa_ contexts now are pointers to the actual struct which is not
+  * All mraa_ contexts now are pointers to the actual struct which is not
     delcared in the header. The only end user change is that instead of
     delcared in the header. The only end user change is that instead of
-    returning a type maa_gpio_context pointer maa_gpio_init() now returns a
-    maa_gpio_context (which is actually a pointer to struct _gpio internally).
+    returning a type mraa_gpio_context pointer mraa_gpio_init() now returns a
+    mraa_gpio_context (which is actually a pointer to struct _gpio internally).
   * C++ API is available, use the .hpp headers and add stdc++  to the linker
     flags.
   * Initial SPI implementation is provided
 
 **0.2.3**
   * C++ API is available, use the .hpp headers and add stdc++  to the linker
     flags.
   * Initial SPI implementation is provided
 
 **0.2.3**
-  * maa_aio_read_u16() -> maa_aio_read()
-  * maa_aio_read() now returns a uint16_t instead of an unsigned int
+  * mraa_aio_read_u16() -> mraa_aio_read()
+  * mraa_aio_read() now returns a uint16_t instead of an unsigned int
 
 **0.2.2**
   * First version with API considered 'stable'
 
 **0.2.2**
   * First version with API considered 'stable'
index 614870b..ee914a2 100644 (file)
@@ -1,5 +1,5 @@
 add_executable (i2c_HMC5883L i2c_HMC5883L.c)
 add_executable (i2c_HMC5883L i2c_HMC5883L.c)
-add_executable (hellomaa hellomaa.c)
+add_executable (hellomraa hellomraa.c)
 add_executable (cycle-pwm3 cycle-pwm3.c)
 add_executable (blink-io blink-io.c)
 add_executable (analogin_a0 analogin_a0.c)
 add_executable (cycle-pwm3 cycle-pwm3.c)
 add_executable (blink-io blink-io.c)
 add_executable (analogin_a0 analogin_a0.c)
@@ -11,17 +11,17 @@ add_executable (blink_onboard blink_onboard.c)
 
 include_directories(${PROJECT_SOURCE_DIR}/api)
 
 
 include_directories(${PROJECT_SOURCE_DIR}/api)
 
-target_link_libraries (hellomaa maa)
-target_link_libraries (i2c_HMC5883L maa m)
-target_link_libraries (cycle-pwm3 maa)
-target_link_libraries (blink-io maa)
-target_link_libraries (analogin_a0 maa)
-target_link_libraries (isr_pin6 maa)
-target_link_libraries (gpio_read6 maa)
-target_link_libraries (spi_mcp4261 maa)
-target_link_libraries (mmap-io2 maa)
-target_link_libraries (blink_onboard maa)
+target_link_libraries (hellomraa mraa)
+target_link_libraries (i2c_HMC5883L mraa m)
+target_link_libraries (cycle-pwm3 mraa)
+target_link_libraries (blink-io mraa)
+target_link_libraries (analogin_a0 mraa)
+target_link_libraries (isr_pin6 mraa)
+target_link_libraries (gpio_read6 mraa)
+target_link_libraries (spi_mcp4261 mraa)
+target_link_libraries (mmap-io2 mraa)
+target_link_libraries (blink_onboard mraa)
 
 add_subdirectory (c++)
 
 
 add_subdirectory (c++)
 
-install (DIRECTORY ${PROJECT_SOURCE_DIR}/examples/ DESTINATION share/maa/examples)
+install (DIRECTORY ${PROJECT_SOURCE_DIR}/examples/ DESTINATION share/mraa/examples)
index 6e1a138..ab39311 100644 (file)
 
 #include <unistd.h>
 //! [Interesting]
 
 #include <unistd.h>
 //! [Interesting]
-#include "maa/aio.h"
+#include "mraa/aio.h"
 
 int main ()
 {
 
 int main ()
 {
-    maa_aio_context adc_a0;
+    mraa_aio_context adc_a0;
     uint16_t adc_value = 0;
 
     uint16_t adc_value = 0;
 
-    adc_a0 = maa_aio_init(0);
+    adc_a0 = mraa_aio_init(0);
     if (adc_a0 == NULL) {
         return 1;
     }
 
     for(;;) {
     if (adc_a0 == NULL) {
         return 1;
     }
 
     for(;;) {
-        adc_value = maa_aio_read(adc_a0);
+        adc_value = mraa_aio_read(adc_a0);
         fprintf(stdout, "ADC A0 read %X - %d\n", adc_value, adc_value);
     }
 
         fprintf(stdout, "ADC A0 read %X - %d\n", adc_value, adc_value);
     }
 
-    maa_aio_close(adc_a0);
+    mraa_aio_close(adc_a0);
 
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 //! [Interesting]
 }
 //! [Interesting]
index ec74b7c..b91ec60 100644 (file)
@@ -28,7 +28,7 @@
 #include <signal.h>
 #include <stdlib.h>
 
 #include <signal.h>
 #include <stdlib.h>
 
-#include "maa.h"
+#include "mraa.h"
 
 #define DEFAULT_IOPIN 8
 
 
 #define DEFAULT_IOPIN 8
 
@@ -47,7 +47,7 @@ sig_handler(int signo)
 int
 main(int argc, char **argv)
 {
 int
 main(int argc, char **argv)
 {
-    maa_result_t r = MAA_SUCCESS;
+    mraa_result_t r = MRAA_SUCCESS;
     iopin = DEFAULT_IOPIN;
 
     if (argc < 2) {
     iopin = DEFAULT_IOPIN;
 
     if (argc < 2) {
@@ -56,12 +56,12 @@ main(int argc, char **argv)
         iopin = strtol(argv[1], NULL, 10);
     }
 
         iopin = strtol(argv[1], NULL, 10);
     }
 
-    maa_init();
-    fprintf(stdout, "MAA Version: %s\nStarting Blinking on IO%d\n",
-            maa_get_version(), iopin);
+    mraa_init();
+    fprintf(stdout, "MRAA Version: %s\nStarting Blinking on IO%d\n",
+            mraa_get_version(), iopin);
 
 
-    maa_gpio_context gpio;
-    gpio = maa_gpio_init(iopin);
+    mraa_gpio_context gpio;
+    gpio = mraa_gpio_init(iopin);
     if (gpio == NULL) {
         fprintf(stderr, "Are you sure that pin%d you requested is valid on your platform?", iopin);
        exit(1);
     if (gpio == NULL) {
         fprintf(stderr, "Are you sure that pin%d you requested is valid on your platform?", iopin);
        exit(1);
@@ -69,26 +69,26 @@ main(int argc, char **argv)
     printf("Initialised pin%d\n", iopin);
 
     // set direction to OUT
     printf("Initialised pin%d\n", iopin);
 
     // set direction to OUT
-    r = maa_gpio_dir(gpio, MAA_GPIO_OUT);
-    if (r != MAA_SUCCESS) {
-        maa_result_print(r);
+    r = mraa_gpio_dir(gpio, MRAA_GPIO_OUT);
+    if (r != MRAA_SUCCESS) {
+        mraa_result_print(r);
     }
 
     signal(SIGINT, sig_handler);
 
     while (running == 0) {
     }
 
     signal(SIGINT, sig_handler);
 
     while (running == 0) {
-        r = maa_gpio_write(gpio, 0);
-        if (r != MAA_SUCCESS) {
-            maa_result_print(r);
+        r = mraa_gpio_write(gpio, 0);
+        if (r != MRAA_SUCCESS) {
+            mraa_result_print(r);
         } else {
             printf("off\n");
         }
 
         sleep(1);
 
         } else {
             printf("off\n");
         }
 
         sleep(1);
 
-        r = maa_gpio_write(gpio, 1);
-        if (r != MAA_SUCCESS) {
-            maa_result_print(r);
+        r = mraa_gpio_write(gpio, 1);
+        if (r != MRAA_SUCCESS) {
+            mraa_result_print(r);
         } else {
             printf("on\n");
         }
         } else {
             printf("on\n");
         }
@@ -96,9 +96,9 @@ main(int argc, char **argv)
         sleep(1);
     }
 
         sleep(1);
     }
 
-    r = maa_gpio_close(gpio);
-    if (r != MAA_SUCCESS) {
-        maa_result_print(r);
+    r = mraa_gpio_close(gpio);
+    if (r != MRAA_SUCCESS) {
+        mraa_result_print(r);
     }
 
     return r;
     }
 
     return r;
index 44e5f9f..66b6287 100644 (file)
 
 #include "stdio.h"
 #include <string.h>
 
 #include "stdio.h"
 #include <string.h>
-#include "maa/gpio.h"
+#include "mraa/gpio.h"
 
 int
 main(int argc, char **argv)
 {
 
 int
 main(int argc, char **argv)
 {
-    maa_platform_t platform = maa_get_platform_type();
-    maa_gpio_context gpio;
+    mraa_platform_t platform = mraa_get_platform_type();
+    mraa_gpio_context gpio;
     char board_name[] = "Some weird devboard that isn't recognised...";
     int ledstate = 0;
 
     switch (platform) {
     char board_name[] = "Some weird devboard that isn't recognised...";
     int ledstate = 0;
 
     switch (platform) {
-        case MAA_INTEL_GALILEO_GEN1:
+        case MRAA_INTEL_GALILEO_GEN1:
             strcpy(board_name, "Intel Galileo Gen1");
             strcpy(board_name, "Intel Galileo Gen1");
-            gpio = maa_gpio_init_raw(3);
+            gpio = mraa_gpio_init_raw(3);
             break;
             break;
-        case MAA_INTEL_GALILEO_GEN2:
+        case MRAA_INTEL_GALILEO_GEN2:
             strcpy(board_name, "Intel Galileo Gen2");
         default:
             strcpy(board_name, "Intel Galileo Gen2");
         default:
-            gpio = maa_gpio_init(13);
+            gpio = mraa_gpio_init(13);
     }
 
     }
 
-    fprintf(stdout, "Welcome to libmaa\n Version: %s\n Running on %d",
-        maa_get_version(), board_name);
+    fprintf(stdout, "Welcome to libmraa\n Version: %s\n Running on %d",
+        mraa_get_version(), board_name);
 
 
-    maa_gpio_dir(gpio, MAA_GPIO_OUT);
+    mraa_gpio_dir(gpio, MRAA_GPIO_OUT);
     for (;;) {
         ledstate = !ledstate;
     for (;;) {
         ledstate = !ledstate;
-        maa_gpio_write(gpio, !ledstate);
+        mraa_gpio_write(gpio, !ledstate);
         sleep(1);
     }
 
         sleep(1);
     }
 
index 47c46ef..44a9dc1 100644 (file)
  */
 
 //! [Interesting]
  */
 
 //! [Interesting]
-#include "maa.hpp"
+#include "mraa.hpp"
 
 int main ()
 {
     uint16_t adc_value;
 
 int main ()
 {
     uint16_t adc_value;
-    maa::Aio* a0;
+    mraa::Aio* a0;
 
 
-    a0 = new maa::Aio(0);
+    a0 = new mraa::Aio(0);
     if (a0 == NULL) {
     if (a0 == NULL) {
-        return MAA_ERROR_UNSPECIFIED;
+        return MRAA_ERROR_UNSPECIFIED;
     }
 
     for(;;) {
     }
 
     for(;;) {
@@ -40,6 +40,6 @@ int main ()
         fprintf(stdout, "ADC A0 read %X - %d\n", adc_value, adc_value);
     }
 
         fprintf(stdout, "ADC A0 read %X - %d\n", adc_value, adc_value);
     }
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 //! [Interesting]
 }
 //! [Interesting]
index 70b7023..4db2a74 100644 (file)
@@ -29,7 +29,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
 #include <stdlib.h>
 #include <unistd.h>
 
-#include "maa.hpp"
+#include "mraa.hpp"
 #define DEFAULT_IOPIN 8
 
 static int iopin;
 #define DEFAULT_IOPIN 8
 
 static int iopin;
@@ -55,13 +55,13 @@ int main (int argc, char **argv)
     signal(SIGINT, sig_handler);
 
 //! [Interesting]
     signal(SIGINT, sig_handler);
 
 //! [Interesting]
-    maa::Gpio* gpio = new maa::Gpio(iopin);
+    mraa::Gpio* gpio = new mraa::Gpio(iopin);
     if (gpio == NULL) {
     if (gpio == NULL) {
-        return MAA_ERROR_UNSPECIFIED;
+        return MRAA_ERROR_UNSPECIFIED;
     }
     }
-    int response = gpio->dir(maa::DIR_OUT);
-    if (response != MAA_SUCCESS)
-        maa_result_print((maa_result_t) MAA_SUCCESS);
+    int response = gpio->dir(mraa::DIR_OUT);
+    if (response != MRAA_SUCCESS)
+        mraa_result_print((mraa_result_t) MRAA_SUCCESS);
 
     while (running == 0) {
         response = gpio->write(1);
 
     while (running == 0) {
         response = gpio->write(1);
index 95a337f..75fce2c 100644 (file)
@@ -6,8 +6,8 @@ add_executable (Spi-pot Spi-pot.cpp)
 
 include_directories(${PROJECT_SOURCE_DIR}/api)
 
 
 include_directories(${PROJECT_SOURCE_DIR}/api)
 
-target_link_libraries (AioA0 maa stdc++)
-target_link_libraries (blink-io-cpp maa stdc++)
-target_link_libraries (Pwm3-cycle maa stdc++)
-target_link_libraries (I2c-compass maa stdc++ m)
-target_link_libraries (Spi-pot maa stdc++)
+target_link_libraries (AioA0 mraa stdc++)
+target_link_libraries (blink-io-cpp mraa stdc++)
+target_link_libraries (Pwm3-cycle mraa stdc++)
+target_link_libraries (I2c-compass mraa stdc++ m)
+target_link_libraries (Spi-pot mraa stdc++)
index f980648..d6c0d8f 100644 (file)
@@ -26,7 +26,7 @@
 #include <unistd.h>
 #include <signal.h>
 
 #include <unistd.h>
 #include <signal.h>
 
-#include "maa.hpp"
+#include "mraa.hpp"
 #include "math.h"
 
 #define MAX_BUFFER_LENGTH 6
 #include "math.h"
 
 #define MAX_BUFFER_LENGTH 6
@@ -98,8 +98,8 @@ int main ()
     uint8_t rx_tx_buf[MAX_BUFFER_LENGTH];
 
 //! [Interesting]
     uint8_t rx_tx_buf[MAX_BUFFER_LENGTH];
 
 //! [Interesting]
-    maa::I2c* i2c;
-    i2c = new maa::I2c(0);
+    mraa::I2c* i2c;
+    i2c = new mraa::I2c(0);
 
     i2c->address(HMC5883L_I2C_ADDR);
     rx_tx_buf[0] = HMC5883L_CONF_REG_B;
 
     i2c->address(HMC5883L_I2C_ADDR);
     rx_tx_buf[0] = HMC5883L_CONF_REG_B;
@@ -138,5 +138,5 @@ int main ()
     }
     delete i2c;
 
     }
     delete i2c;
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 }
index 1972634..eb82505 100644 (file)
@@ -25,7 +25,7 @@
 #include <unistd.h>
 #include <signal.h>
 
 #include <unistd.h>
 #include <signal.h>
 
-#include "maa.hpp"
+#include "mraa.hpp"
 
 int running = 0;
 
 
 int running = 0;
 
@@ -42,11 +42,11 @@ int main ()
 {
     signal(SIGINT, sig_handler);
 //! [Interesting]
 {
     signal(SIGINT, sig_handler);
 //! [Interesting]
-    maa::Pwm* pwm;
+    mraa::Pwm* pwm;
 
 
-    pwm = new maa::Pwm(3);
+    pwm = new mraa::Pwm(3);
     if (pwm == NULL) {
     if (pwm == NULL) {
-        return MAA_ERROR_UNSPECIFIED;
+        return MRAA_ERROR_UNSPECIFIED;
     }
     fprintf(stdout, "Cycling PWM on IO3 (pwm3) \n");
 
     }
     fprintf(stdout, "Cycling PWM on IO3 (pwm3) \n");
 
@@ -62,5 +62,5 @@ int main ()
     delete pwm;
 //! [Interesting]
 
     delete pwm;
 //! [Interesting]
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 }
index 53e7855..0ff0088 100644 (file)
@@ -26,7 +26,7 @@
 #include <signal.h>
 #include <stdint.h>
 
 #include <signal.h>
 #include <stdint.h>
 
-#include "maa.hpp"
+#include "mraa.hpp"
 
 int running = 0;
 
 
 int running = 0;
 
@@ -44,9 +44,9 @@ int main ()
     signal(SIGINT, sig_handler);
 
 //! [Interesting]
     signal(SIGINT, sig_handler);
 
 //! [Interesting]
-    maa::Spi* spi;
+    mraa::Spi* spi;
 
 
-    spi = new maa::Spi(0);
+    spi = new mraa::Spi(0);
 
     uint8_t data[] = {0x00, 100};
     uint8_t *recv;
 
     uint8_t data[] = {0x00, 100};
     uint8_t *recv;
@@ -71,5 +71,5 @@ int main ()
     delete spi;
 //! [Interesting]
 
     delete spi;
 //! [Interesting]
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 }
index e21a6a6..7250bf2 100644 (file)
 
 #include <unistd.h>
 
 
 #include <unistd.h>
 
-#include "maa.h"
+#include "mraa.h"
 
 int
 main ()
 {
 
 int
 main ()
 {
-    maa_init();
+    mraa_init();
 //! [Interesting]
 //! [Interesting]
-    maa_pwm_context pwm;
-    pwm = maa_pwm_init(3);
+    mraa_pwm_context pwm;
+    pwm = mraa_pwm_init(3);
     if (pwm == NULL) {
         return 1;
     }
     if (pwm == NULL) {
         return 1;
     }
-    maa_pwm_period_us(pwm, 200);
-    maa_pwm_enable(pwm, 1);
+    mraa_pwm_period_us(pwm, 200);
+    mraa_pwm_enable(pwm, 1);
 
     float value = 0.0f;
 
     while (1) {
         value = value + 0.01f;
 
     float value = 0.0f;
 
     while (1) {
         value = value + 0.01f;
-        maa_pwm_write(pwm, value);
+        mraa_pwm_write(pwm, value);
         usleep(50000);
         if (value >= 1.0f) {
             value = 0.0f;
         }
         usleep(50000);
         if (value >= 1.0f) {
             value = 0.0f;
         }
-        float output = maa_pwm_read(pwm);
+        float output = mraa_pwm_read(pwm);
     }
 //! [Interesting]
     return 0;
     }
 //! [Interesting]
     return 0;
index c21aeab..190055c 100644 (file)
 #include "stdio.h"
 #include "unistd.h"
 
 #include "stdio.h"
 #include "unistd.h"
 
-#include "maa.h"
+#include "mraa.h"
 
 int
 main(int argc, char **argv)
 {
 
 int
 main(int argc, char **argv)
 {
-    maa_init();
-    fprintf(stdout, "MAA Version: %s\nStarting Read on IO6\n",
-            maa_get_version());
+    mraa_init();
+    fprintf(stdout, "MRAA Version: %s\nStarting Read on IO6\n",
+            mraa_get_version());
 
 //! [Interesting]
 
 //! [Interesting]
-    maa_gpio_context gpio;
+    mraa_gpio_context gpio;
 
 
-    gpio = maa_gpio_init(6);
+    gpio = mraa_gpio_init(6);
 
 
-    maa_gpio_dir(gpio, MAA_GPIO_IN);
+    mraa_gpio_dir(gpio, MRAA_GPIO_IN);
 
     for (;;) {
 
     for (;;) {
-        fprintf(stdout, "Gpio is %d\n", maa_gpio_read(gpio));
+        fprintf(stdout, "Gpio is %d\n", mraa_gpio_read(gpio));
         sleep(1);
     }
 
         sleep(1);
     }
 
-    maa_gpio_close(gpio);
+    mraa_gpio_close(gpio);
 //! [Interesting]
 
     return 0;
 //! [Interesting]
 
     return 0;
similarity index 93%
rename from examples/hellomaa.c
rename to examples/hellomraa.c
index b9ed70a..d6748d2 100644 (file)
 
 #include "stdio.h"
 //! [Interesting]
 
 #include "stdio.h"
 //! [Interesting]
-#include "maa.h"
+#include "mraa.h"
 
 int
 main(int argc, char **argv)
 {
 
 int
 main(int argc, char **argv)
 {
-    fprintf(stdout, "hello maa\n Version: %s\n", maa_get_version());
+    fprintf(stdout, "hello mraa\n Version: %s\n", mraa_get_version());
     return 0;
 }
 //! [Interesting]
     return 0;
 }
 //! [Interesting]
index c2f6531..35ea07e 100644 (file)
@@ -22,7 +22,7 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "maa.h"
+#include "mraa.h"
 #include "math.h"
 
 #define MAX_BUFFER_LENGTH 6
 #include "math.h"
 
 #define MAX_BUFFER_LENGTH 6
 int
 main(int argc, char **argv)
 {
 int
 main(int argc, char **argv)
 {
-    maa_init();
+    mraa_init();
     float direction = 0;
     int16_t x = 0, y = 0, z = 0;
     char rx_tx_buf[MAX_BUFFER_LENGTH];
 
 //! [Interesting]
     float direction = 0;
     int16_t x = 0, y = 0, z = 0;
     char rx_tx_buf[MAX_BUFFER_LENGTH];
 
 //! [Interesting]
-    maa_i2c_context i2c;
-    i2c = maa_i2c_init(0);
+    mraa_i2c_context i2c;
+    i2c = mraa_i2c_init(0);
 
 
-    maa_i2c_address(i2c, HMC5883L_I2C_ADDR);
+    mraa_i2c_address(i2c, HMC5883L_I2C_ADDR);
     rx_tx_buf[0] = HMC5883L_CONF_REG_B;
     rx_tx_buf[1] = GA_1_3_REG;
     rx_tx_buf[0] = HMC5883L_CONF_REG_B;
     rx_tx_buf[1] = GA_1_3_REG;
-    maa_i2c_write(i2c, rx_tx_buf, 2);
+    mraa_i2c_write(i2c, rx_tx_buf, 2);
 //! [Interesting]
 
 //! [Interesting]
 
-    maa_i2c_address(i2c, HMC5883L_I2C_ADDR);
+    mraa_i2c_address(i2c, HMC5883L_I2C_ADDR);
     rx_tx_buf[0] = HMC5883L_MODE_REG;
     rx_tx_buf[1] = HMC5883L_CONT_MODE;
     rx_tx_buf[0] = HMC5883L_MODE_REG;
     rx_tx_buf[1] = HMC5883L_CONT_MODE;
-    maa_i2c_write(i2c, rx_tx_buf, 2);
+    mraa_i2c_write(i2c, rx_tx_buf, 2);
 
     for(;;) {
 
     for(;;) {
-        maa_i2c_address(i2c, HMC5883L_I2C_ADDR);
-        maa_i2c_write_byte(i2c, HMC5883L_DATA_REG);
+        mraa_i2c_address(i2c, HMC5883L_I2C_ADDR);
+        mraa_i2c_write_byte(i2c, HMC5883L_DATA_REG);
 
 
-        maa_i2c_address(i2c, HMC5883L_I2C_ADDR);
-        maa_i2c_read(i2c, rx_tx_buf, DATA_REG_SIZE);
+        mraa_i2c_address(i2c, HMC5883L_I2C_ADDR);
+        mraa_i2c_read(i2c, rx_tx_buf, DATA_REG_SIZE);
 
         x = (rx_tx_buf[HMC5883L_X_MSB_REG] << 8 ) | rx_tx_buf[HMC5883L_X_LSB_REG] ;
         z = (rx_tx_buf[HMC5883L_Z_MSB_REG] << 8 ) | rx_tx_buf[HMC5883L_Z_LSB_REG] ;
 
         x = (rx_tx_buf[HMC5883L_X_MSB_REG] << 8 ) | rx_tx_buf[HMC5883L_X_LSB_REG] ;
         z = (rx_tx_buf[HMC5883L_Z_MSB_REG] << 8 ) | rx_tx_buf[HMC5883L_Z_LSB_REG] ;
index 65a987d..d51e312 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <unistd.h>
 
 
 #include <unistd.h>
 
-#include "maa.h"
+#include "mraa.h"
 
 static volatile int counter = 0;
 static volatile int oldcounter = 0;
 
 static volatile int counter = 0;
 static volatile int oldcounter = 0;
@@ -35,19 +35,19 @@ void interrupt (void * args) {
 
 int main ()
 {
 
 int main ()
 {
-    maa_init();
-    maa_gpio_context x;
+    mraa_init();
+    mraa_gpio_context x;
 
 
-    x = maa_gpio_init(6);
+    x = mraa_gpio_init(6);
     if (x == NULL) {
         return 1;
     }
 
     if (x == NULL) {
         return 1;
     }
 
-    maa_gpio_dir(x, MAA_GPIO_IN);
+    mraa_gpio_dir(x, MRAA_GPIO_IN);
 
 
-    gpio_edge_t edge = MAA_GPIO_EDGE_BOTH;
+    gpio_edge_t edge = MRAA_GPIO_EDGE_BOTH;
    
    
-    maa_gpio_isr(x, edge, &interrupt, NULL);
+    mraa_gpio_isr(x, edge, &interrupt, NULL);
 
     for(;;) {
         if(counter != oldcounter) {
 
     for(;;) {
         if(counter != oldcounter) {
@@ -58,7 +58,7 @@ int main ()
         sleep(1);
     }
 
         sleep(1);
     }
 
-    maa_gpio_close(x);
+    mraa_gpio_close(x);
 
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 }
index d343e08..c29cb1c 100644 (file)
@@ -22,8 +22,8 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-var m = require("maajs")
-console.log("maa version: " + m.getVersion());
+var m = require("mraajs")
+console.log("mraa version: " + m.getVersion());
 
 var x = new m.Gpio(8)
 x.dir(m.DIR_OUT)
 
 var x = new m.Gpio(8)
 x.dir(m.DIR_OUT)
index 3bd22b1..0db5515 100644 (file)
 #include "stdio.h"
 #include <unistd.h>
 
 #include "stdio.h"
 #include <unistd.h>
 
-#include "maa.h"
+#include "mraa.h"
 
 int
 main(int argc, char **argv)
 {
 //! [Interesting]
 
 int
 main(int argc, char **argv)
 {
 //! [Interesting]
-    fprintf(stdout, "hello maa\n Version: %s\n", maa_get_version());
-    maa_gpio_context gpio;
-    gpio = maa_gpio_init(2);
+    fprintf(stdout, "hello mraa\n Version: %s\n", mraa_get_version());
+    mraa_gpio_context gpio;
+    gpio = mraa_gpio_init(2);
 
 
-    maa_gpio_use_mmaped(gpio, 1);
+    mraa_gpio_use_mmaped(gpio, 1);
 
     for (;;) {
 
     for (;;) {
-        maa_gpio_write(gpio , 1);
+        mraa_gpio_write(gpio , 1);
         usleep(50000);
         usleep(50000);
-        maa_gpio_write(gpio, 0);
+        mraa_gpio_write(gpio, 0);
         usleep(50000);
     }
 //! [Interesting]
         usleep(50000);
     }
 //! [Interesting]
index 937f070..af47857 100644 (file)
@@ -22,8 +22,8 @@
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-import pymaa as maa
+import pymraa as mraa
 
 
-print (maa.getVersion())
-x = maa.Aio(0)
+print (mraa.getVersion())
+x = mraa.Aio(0)
 print (x.read())
 print (x.read())
index b7da552..896d2a8 100644 (file)
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-import pymaa as maa
+import pymraa as mraa
 import time
 
 import time
 
-x = maa.Gpio(8)
-x.dir(maa.DIR_OUT)
+x = mraa.Gpio(8)
+x.dir(mraa.DIR_OUT)
 
 while True:
     x.write(1)
 
 while True:
     x.write(1)
index 290d16f..53852f0 100644 (file)
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-import pymaa as maa
+import pymraa as mraa
 import time
 
 import time
 
-x = maa.PWM(0,3)
+x = mraa.PWM(0,3)
 x.enable(1);
 x.period_us(20)
 value= 0.0
 x.enable(1);
 x.period_us(20)
 value= 0.0
index cacee8a..6add4bf 100644 (file)
@@ -22,9 +22,9 @@
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-import pymaa
+import pymraa
 
 
-print (pymaa.getVersion())
-x = pymaa.Gpio(13)
-x.dir(pymaa.DIR_OUT)
+print (pymraa.getVersion())
+x = pymraa.Gpio(13)
+x.dir(pymraa.DIR_OUT)
 x.write(1)
 x.write(1)
index 01c5bf5..d86802a 100644 (file)
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
-import pymaa as maa
+import pymraa as mraa
 
 def test(args):
   print("wooo")
 
 
 def test(args):
   print("wooo")
 
-x = maa.Gpio(6)
-x.dir(maa.DIR_IN)
-x.isr(maa.EDGE_BOTH, test, test)
+x = mraa.Gpio(6)
+x.dir(mraa.DIR_IN)
+x.isr(mraa.EDGE_BOTH, test, test)
index 06eab4a..6a05931 100644 (file)
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 
-import pymaa as maa
+import pymraa as mraa
 
 # This example will change the LCD backlight on the Grove-LCD RGB backlight
 # to a nice shade of purple
 
 # This example will change the LCD backlight on the Grove-LCD RGB backlight
 # to a nice shade of purple
-x = maa.I2c(0)
+x = mraa.I2c(0)
 x.address(0x62)
 x.writeReg(0,0)
 x.writeReg(1,0)
 x.address(0x62)
 x.writeReg(0,0)
 x.writeReg(1,0)
index 165e679..4be72ba 100644 (file)
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "maa.h"
+#include "mraa.h"
 #include <unistd.h>
 #include <stdint.h>
 
 int
 main(int argc, char **argv)
 {
 #include <unistd.h>
 #include <stdint.h>
 
 int
 main(int argc, char **argv)
 {
-    maa_init();
+    mraa_init();
 //! [Interesting]
 //! [Interesting]
-    maa_spi_context spi;
-    spi = maa_spi_init(0);
+    mraa_spi_context spi;
+    spi = mraa_spi_init(0);
     unsigned int response = 0;
     printf("Hello, SPI initialised\n");
     uint8_t data[] = {0x00, 100};
     unsigned int response = 0;
     printf("Hello, SPI initialised\n");
     uint8_t data[] = {0x00, 100};
@@ -41,14 +41,14 @@ main(int argc, char **argv)
         int i;
         for (i = 90; i < 130; i++) {
             data[1] = i;
         int i;
         for (i = 90; i < 130; i++) {
             data[1] = i;
-            recv = maa_spi_write_buf(spi, data, 2);
+            recv = mraa_spi_write_buf(spi, data, 2);
             printf("Writing -%i",i);
             printf("RECIVED-%i-%i\n",recv[0],recv[1]);
             usleep(100000);
         }
         for (i = 130; i > 90; i--) {
             data[1] = i;
             printf("Writing -%i",i);
             printf("RECIVED-%i-%i\n",recv[0],recv[1]);
             usleep(100000);
         }
         for (i = 130; i > 90; i--) {
             data[1] = i;
-            recv = maa_spi_write_buf(spi, data, 2);
+            recv = mraa_spi_write_buf(spi, data, 2);
             printf("Writing -%i",i);
             printf("RECIVED-%i-%i\n",recv[0],recv[1]);
             usleep(100000);
             printf("Writing -%i",i);
             printf("RECIVED-%i-%i\n",recv[0],recv[1]);
             usleep(100000);
index cff0cea..95ec144 100644 (file)
@@ -24,9 +24,9 @@
 
 #pragma once
 
 
 #pragma once
 
-#include "maa.h"
+#include "mraa.h"
 
 
-#define MAA_INTEL_GALILEO_REV_D_PINCOUNT 25
+#define MRAA_INTEL_GALILEO_REV_D_PINCOUNT 25
 
 
-maa_board_t*
-maa_intel_galileo_rev_d();
+mraa_board_t*
+mraa_intel_galileo_rev_d();
index 03cee51..2550beb 100644 (file)
@@ -24,7 +24,7 @@
 
 #pragma once
 
 
 #pragma once
 
-#define MAA_INTEL_GALILEO_GEN_2_PINCOUNT 25
+#define MRAA_INTEL_GALILEO_GEN_2_PINCOUNT 25
 
 
-maa_board_t*
-maa_intel_galileo_gen2();
+mraa_board_t*
+mraa_intel_galileo_gen2();
similarity index 88%
rename from include/maa_internal.h
rename to include/mraa_internal.h
index 7daf779..e8a24fb 100644 (file)
@@ -32,7 +32,7 @@
  * @param pin the pin as read from the board surface. i.e IO3 would be 3/
  * @return the pin as found in the pinmap
  */
  * @param pin the pin as read from the board surface. i.e IO3 would be 3/
  * @return the pin as found in the pinmap
  */
-unsigned int maa_setup_gpio(int pin);
+unsigned int mraa_setup_gpio(int pin);
 
 /** Setup Analog interface
  *
 
 /** Setup Analog interface
  *
@@ -40,19 +40,19 @@ unsigned int maa_setup_gpio(int pin);
  * @param pin the pin as read from the board surface. i.e A3 would be 3/
  * @return the pin as found in the pinmap
  */
  * @param pin the pin as read from the board surface. i.e A3 would be 3/
  * @return the pin as found in the pinmap
  */
-unsigned int maa_setup_aio(int pin);
+unsigned int mraa_setup_aio(int pin);
 
 /** Setup i2c interface, sets up multiplexer on device.
  *
  * @return unsigned int if using /dev/i2c-2 returned would be 2
  */
 
 /** Setup i2c interface, sets up multiplexer on device.
  *
  * @return unsigned int if using /dev/i2c-2 returned would be 2
  */
-unsigned int maa_setup_i2c(int bus);
+unsigned int mraa_setup_i2c(int bus);
 
 /** Setup spi interface, sets up multiplexer on device.
  *
  * @return spi bus type
  */
 
 /** Setup spi interface, sets up multiplexer on device.
  *
  * @return spi bus type
  */
-maa_spi_bus_t* maa_setup_spi(int bus);
+mraa_spi_bus_t* mraa_setup_spi(int bus);
 
 /** Setup PWM
  *
 
 /** Setup PWM
  *
@@ -61,18 +61,18 @@ maa_spi_bus_t* maa_setup_spi(int bus);
  * @param pin the pin as read from the board surface.
  * @return the pwm pin_info_t of that IO pin
  */
  * @param pin the pin as read from the board surface.
  * @return the pwm pin_info_t of that IO pin
  */
-maa_pin_t* maa_setup_pwm(int pin);
+mraa_pin_t* mraa_setup_pwm(int pin);
 
 /** Setup gpio mux to go straight to SoC, galileo.
  *
  * @param pin physical pin to use
 
 /** Setup gpio mux to go straight to SoC, galileo.
  *
  * @param pin physical pin to use
- * @return maa_mmap_pin_t
+ * @return mraa_mmap_pin_t
  */
  */
-maa_mmap_pin_t* maa_setup_mmap_gpio(int pin);
+mraa_mmap_pin_t* mraa_setup_mmap_gpio(int pin);
 
 /** Swap Directional mode.
  *
  * @param pin physical pin to operate on
  * @return out direction to setup. 1 for output 0 for input
  */
 
 /** Swap Directional mode.
  *
  * @param pin physical pin to operate on
  * @return out direction to setup. 1 for output 0 for input
  */
-maa_result_t maa_swap_complex_gpio(int pin, int out);
+mraa_result_t mraa_swap_complex_gpio(int pin, int out);
index 4197f23..cb60330 100644 (file)
@@ -1,11 +1,11 @@
 include_directories(
   ${PROJECT_SOURCE_DIR}/api
 include_directories(
   ${PROJECT_SOURCE_DIR}/api
-  ${PROJECT_SOURCE_DIR}/api/maa
+  ${PROJECT_SOURCE_DIR}/api/mraa
   ${PROJECT_SOURCE_DIR}/include
 )
 
   ${PROJECT_SOURCE_DIR}/include
 )
 
-set (maa_LIB_SRCS
-  ${PROJECT_SOURCE_DIR}/src/maa.c
+set (mraa_LIB_SRCS
+  ${PROJECT_SOURCE_DIR}/src/mraa.c
   ${PROJECT_SOURCE_DIR}/src/gpio/gpio.c
   ${PROJECT_SOURCE_DIR}/src/i2c/i2c.c
   ${PROJECT_SOURCE_DIR}/src/i2c/smbus.c
   ${PROJECT_SOURCE_DIR}/src/gpio/gpio.c
   ${PROJECT_SOURCE_DIR}/src/i2c/i2c.c
   ${PROJECT_SOURCE_DIR}/src/i2c/smbus.c
@@ -18,30 +18,30 @@ set (maa_LIB_SRCS
   ${CMAKE_CURRENT_BINARY_DIR}/version.c
 )
 
   ${CMAKE_CURRENT_BINARY_DIR}/version.c
 )
 
-set (maa_LIB_GLOB_HEADERS
-  ${PROJECT_SOURCE_DIR}/api/maa.h
-  ${PROJECT_SOURCE_DIR}/api/maa.hpp
+set (mraa_LIB_GLOB_HEADERS
+  ${PROJECT_SOURCE_DIR}/api/mraa.h
+  ${PROJECT_SOURCE_DIR}/api/mraa.hpp
 )
 
 )
 
-add_library (maa SHARED ${maa_LIB_SRCS})
-target_link_libraries (maa ${CMAKE_THREAD_LIBS_INIT})
+add_library (mraa SHARED ${mraa_LIB_SRCS})
+target_link_libraries (mraa ${CMAKE_THREAD_LIBS_INIT})
 
 set_target_properties(
 
 set_target_properties(
-   maa
+   mraa
    PROPERTIES
    PROPERTIES
-   SOVERSION ${maa_VERSION_MAJOR}
-   VERSION ${maa_VERSION_STRING}
+   SOVERSION ${mraa_VERSION_MAJOR}
+   VERSION ${mraa_VERSION_STRING}
 )
 )
-install (FILES ${maa_LIB_GLOB_HEADERS} DESTINATION include/)
-install (DIRECTORY ${PROJECT_SOURCE_DIR}/api/maa/ DESTINATION include/maa)
+install (FILES ${mraa_LIB_GLOB_HEADERS} DESTINATION include/)
+install (DIRECTORY ${PROJECT_SOURCE_DIR}/api/mraa/ DESTINATION include/mraa)
 
 
-macro (maa_CREATE_INSTALL_PKGCONFIG generated_file install_location)
+macro (mraa_CREATE_INSTALL_PKGCONFIG generated_file install_location)
   configure_file (${generated_file}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} @ONLY)
   install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} DESTINATION ${install_location})
   configure_file (${generated_file}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} @ONLY)
   install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} DESTINATION ${install_location})
-endmacro (maa_CREATE_INSTALL_PKGCONFIG)
-maa_create_install_pkgconfig (maa.pc lib${LIB_SUFFIX}/pkgconfig)
+endmacro (mraa_CREATE_INSTALL_PKGCONFIG)
+mraa_create_install_pkgconfig (mraa.pc lib${LIB_SUFFIX}/pkgconfig)
 
 
-install (TARGETS maa DESTINATION lib)
+install (TARGETS mraa DESTINATION lib)
 
 if (DOXYGEN_FOUND)
   set (CMAKE_SWIG_FLAGS -DDOXYGEN=${DOXYGEN_FOUND})
 
 if (DOXYGEN_FOUND)
   set (CMAKE_SWIG_FLAGS -DDOXYGEN=${DOXYGEN_FOUND})
@@ -49,9 +49,9 @@ if (DOXYGEN_FOUND)
   foreach (_file ${DOCCLASSES})
     add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}_class_doc.i
       COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doxy2swig.py -n
   foreach (_file ${DOCCLASSES})
     add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}_class_doc.i
       COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doxy2swig.py -n
-        ${CMAKE_BINARY_DIR}/xml/classmaa_1_1_${_file}.xml
+        ${CMAKE_BINARY_DIR}/xml/classmraa_1_1_${_file}.xml
         ${CMAKE_CURRENT_BINARY_DIR}/${_file}_class_doc.i
         ${CMAKE_CURRENT_BINARY_DIR}/${_file}_class_doc.i
-      DEPENDS ${CMAKE_BINARY_DIR}/xml/classmaa_1_1_${_file}.xml
+      DEPENDS ${CMAKE_BINARY_DIR}/xml/classmraa_1_1_${_file}.xml
     )
     add_custom_target (${_file}class_doc_i DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_file}_class_doc.i)
     add_dependencies (${_file}class_doc_i doc)
     )
     add_custom_target (${_file}class_doc_i DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_file}_class_doc.i)
     add_dependencies (${_file}class_doc_i doc)
@@ -73,7 +73,7 @@ if (BUILDSWIG)
   find_package (SWIG)
   if (SWIG_FOUND)
     include (${SWIG_USE_FILE})
   find_package (SWIG)
   if (SWIG_FOUND)
     include (${SWIG_USE_FILE})
-    set_source_files_properties (maa.i PROPERTIES SWIG_FLAGS "-I${CMAKE_BINARY_DIR}/src")
+    set_source_files_properties (mraa.i PROPERTIES SWIG_FLAGS "-I${CMAKE_BINARY_DIR}/src")
 
     if (BUILDSWIGPYTHON)
       add_subdirectory (python)
 
     if (BUILDSWIGPYTHON)
       add_subdirectory (python)
index 56f3928..aacdae5 100644 (file)
 #include <errno.h>
 
 #include "aio.h"
 #include <errno.h>
 
 #include "aio.h"
-#include "maa_internal.h"
+#include "mraa_internal.h"
 
 struct _aio {
     unsigned int channel;
     int adc_in_fp;
 };
 
 
 struct _aio {
     unsigned int channel;
     int adc_in_fp;
 };
 
-static maa_result_t aio_get_valid_fp(maa_aio_context dev)
+static mraa_result_t aio_get_valid_fp(mraa_aio_context dev)
 {
     char file_path[64]= "";
 
 {
     char file_path[64]= "";
 
@@ -45,22 +45,22 @@ static maa_result_t aio_get_valid_fp(maa_aio_context dev)
     dev->adc_in_fp = open(file_path, O_RDONLY);
     if (dev->adc_in_fp == -1) {
        fprintf(stderr, "Failed to open Analog input raw file %s for "
     dev->adc_in_fp = open(file_path, O_RDONLY);
     if (dev->adc_in_fp == -1) {
        fprintf(stderr, "Failed to open Analog input raw file %s for "
-           "reading!\n", file_path); return( MAA_ERROR_INVALID_RESOURCE);
+           "reading!\n", file_path); return( MRAA_ERROR_INVALID_RESOURCE);
     }
 
     }
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 /** Initialise an Analog input, connected to the specified channel
  *
  * @param aio_channel Analog input channel to read
  *
 }
 
 /** Initialise an Analog input, connected to the specified channel
  *
  * @param aio_channel Analog input channel to read
  *
- * @returns pointer to maa_aio_context structure  after initialisation of
+ * @returns pointer to mraa_aio_context structure  after initialisation of
  * Analog input pin connected to the device successfully, else returns NULL.
  */
  * Analog input pin connected to the device successfully, else returns NULL.
  */
-maa_aio_context maa_aio_init(unsigned int aio_channel)
+mraa_aio_context mraa_aio_init(unsigned int aio_channel)
 {
 {
-    int checked_pin = maa_setup_aio(aio_channel);
+    int checked_pin = mraa_setup_aio(aio_channel);
     if (checked_pin < 0) {
         switch(checked_pin) {
             case -1:
     if (checked_pin < 0) {
         switch(checked_pin) {
             case -1:
@@ -79,7 +79,7 @@ maa_aio_context maa_aio_init(unsigned int aio_channel)
     }
 
     //Create ADC device connected to specified channel
     }
 
     //Create ADC device connected to specified channel
-    maa_aio_context dev = malloc(sizeof(struct _aio));
+    mraa_aio_context dev = malloc(sizeof(struct _aio));
     if (dev == NULL) {
         fprintf(stderr, "Insufficient memory for specified Analog input channel "
             "%d\n", aio_channel);
     if (dev == NULL) {
         fprintf(stderr, "Insufficient memory for specified Analog input channel "
             "%d\n", aio_channel);
@@ -88,7 +88,7 @@ maa_aio_context maa_aio_init(unsigned int aio_channel)
     dev->channel = checked_pin;
 
     //Open valid  analog input file and get the pointer.
     dev->channel = checked_pin;
 
     //Open valid  analog input file and get the pointer.
-    if (MAA_SUCCESS != aio_get_valid_fp(dev)) {
+    if (MRAA_SUCCESS != aio_get_valid_fp(dev)) {
         free(dev);
         return NULL;
     }
         free(dev);
         return NULL;
     }
@@ -99,14 +99,14 @@ maa_aio_context maa_aio_init(unsigned int aio_channel)
 /** Read the input voltage, represented as an unsigned short in the range [0x0,
  * 0xFFFF]
  *
 /** Read the input voltage, represented as an unsigned short in the range [0x0,
  * 0xFFFF]
  *
- * @param pointer to maa_aio_context structure  initialised by
- * maa_aio_init()
+ * @param pointer to mraa_aio_context structure  initialised by
+ * mraa_aio_init()
  *
  * @returns
  *   unsigned 16 bit int representing the current input voltage, normalised to
  *   a 16-bit value
  */
  *
  * @returns
  *   unsigned 16 bit int representing the current input voltage, normalised to
  *   a 16-bit value
  */
-uint16_t maa_aio_read(maa_aio_context dev)
+uint16_t mraa_aio_read(mraa_aio_context dev)
 {
     char buffer[16];
     unsigned int shifter_value = 0;
 {
     char buffer[16];
     unsigned int shifter_value = 0;
@@ -147,12 +147,12 @@ uint16_t maa_aio_read(maa_aio_context dev)
  *
  * @param dev - the analog input context
  *
  *
  * @param dev - the analog input context
  *
- * @return maa result type.
+ * @return mraa result type.
  */
  */
-maa_result_t maa_aio_close(maa_aio_context dev)
+mraa_result_t mraa_aio_close(mraa_aio_context dev)
 {
     if (NULL != dev)
         free(dev);
 
 {
     if (NULL != dev)
         free(dev);
 
-    return(MAA_SUCCESS);
+    return(MRAA_SUCCESS);
 }
 }
index a9ec4e8..a13d1a3 100644 (file)
@@ -23,7 +23,7 @@
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include "gpio.h"
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include "gpio.h"
-#include "maa_internal.h"
+#include "mraa_internal.h"
 
 #include <stdlib.h>
 #include <fcntl.h>
 
 #include <stdlib.h>
 #include <fcntl.h>
@@ -52,41 +52,41 @@ struct _gpio {
     void *isr_args; /**< args return when interupt service request triggered */
     pthread_t thread_id; /**< the isr handler thread id */
     int isr_value_fp; /**< the isr file pointer on the value */
     void *isr_args; /**< args return when interupt service request triggered */
     pthread_t thread_id; /**< the isr handler thread id */
     int isr_value_fp; /**< the isr file pointer on the value */
-    maa_boolean_t owner; /**< If this context originally exported the pin */
-    maa_boolean_t mmap;
+    mraa_boolean_t owner; /**< If this context originally exported the pin */
+    mraa_boolean_t mmap;
     void *reg;
     unsigned int reg_sz;
     unsigned int reg_bit_pos;
     /*@}*/
 };
 
     void *reg;
     unsigned int reg_sz;
     unsigned int reg_bit_pos;
     /*@}*/
 };
 
-static maa_result_t
-maa_gpio_get_valfp(maa_gpio_context dev)
+static mraa_result_t
+mraa_gpio_get_valfp(mraa_gpio_context dev)
 {
     char bu[MAX_SIZE];
     sprintf(bu, SYSFS_CLASS_GPIO "/gpio%d/value", dev->pin);
     dev->value_fp = open(bu, O_RDWR);
     if (dev->value_fp == -1) {
 {
     char bu[MAX_SIZE];
     sprintf(bu, SYSFS_CLASS_GPIO "/gpio%d/value", dev->pin);
     dev->value_fp = open(bu, O_RDWR);
     if (dev->value_fp == -1) {
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     }
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_gpio_context
-maa_gpio_init(int pin)
+mraa_gpio_context
+mraa_gpio_init(int pin)
 {
 {
-    int pinm = maa_setup_gpio(pin);
+    int pinm = mraa_setup_gpio(pin);
     if (pinm < 0)
         return NULL;
 
     if (pinm < 0)
         return NULL;
 
-    maa_gpio_context r = maa_gpio_init_raw(pinm);
+    mraa_gpio_context r = mraa_gpio_init_raw(pinm);
     r->phy_pin = pin;
     return r;
 }
 
     r->phy_pin = pin;
     return r;
 }
 
-maa_gpio_context
-maa_gpio_init_raw(int pin)
+mraa_gpio_context
+mraa_gpio_init_raw(int pin)
 {
     if (pin < 0)
         return NULL;
 {
     if (pin < 0)
         return NULL;
@@ -94,7 +94,7 @@ maa_gpio_init_raw(int pin)
     char bu[MAX_SIZE];
     int length;
 
     char bu[MAX_SIZE];
     int length;
 
-    maa_gpio_context dev = (maa_gpio_context) malloc(sizeof(struct _gpio));
+    mraa_gpio_context dev = (mraa_gpio_context) malloc(sizeof(struct _gpio));
     memset(dev, 0, sizeof(struct _gpio));
     dev->value_fp = -1;
     dev->isr_value_fp = -1;
     memset(dev, 0, sizeof(struct _gpio));
     dev->value_fp = -1;
     dev->isr_value_fp = -1;
@@ -125,19 +125,19 @@ maa_gpio_init_raw(int pin)
     return dev;
 }
 
     return dev;
 }
 
-static maa_result_t
-maa_gpio_write_register(maa_gpio_context dev,int value)
+static mraa_result_t
+mraa_gpio_write_register(mraa_gpio_context dev,int value)
 {
     if (value == 1) {
         *((unsigned *)dev->reg) |= (1<<dev->reg_bit_pos);
 {
     if (value == 1) {
         *((unsigned *)dev->reg) |= (1<<dev->reg_bit_pos);
-        return MAA_SUCCESS;
+        return MRAA_SUCCESS;
     }
     *((unsigned *)dev->reg) &= ~(1<<dev->reg_bit_pos);
     }
     *((unsigned *)dev->reg) &= ~(1<<dev->reg_bit_pos);
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-static maa_result_t
-maa_gpio_wait_interrupt(int fd)
+static mraa_result_t
+mraa_gpio_wait_interrupt(int fd)
 {
     unsigned char c;
     struct pollfd pfd;
 {
     unsigned char c;
     struct pollfd pfd;
@@ -150,7 +150,7 @@ maa_gpio_wait_interrupt(int fd)
     read (fd, &c, 1);
 
     if (fd <= 0) {
     read (fd, &c, 1);
 
     if (fd <= 0) {
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     // Wait for it forever or until pthread_cancel
     }
 
     // Wait for it forever or until pthread_cancel
@@ -160,14 +160,14 @@ maa_gpio_wait_interrupt(int fd)
     // do a final read to clear interupt
     read (fd, &c, 1);
 
     // do a final read to clear interupt
     read (fd, &c, 1);
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 static void*
 }
 
 static void*
-maa_gpio_interrupt_handler(void* arg)
+mraa_gpio_interrupt_handler(void* arg)
 {
 {
-    maa_gpio_context dev = (maa_gpio_context) arg;
-    maa_result_t ret;
+    mraa_gpio_context dev = (mraa_gpio_context) arg;
+    mraa_result_t ret;
 
     // open gpio value with open(3)
     char bu[MAX_SIZE];
 
     // open gpio value with open(3)
     char bu[MAX_SIZE];
@@ -175,8 +175,8 @@ maa_gpio_interrupt_handler(void* arg)
     dev->isr_value_fp = open(bu, O_RDONLY);
 
     for (;;) {
     dev->isr_value_fp = open(bu, O_RDONLY);
 
     for (;;) {
-        ret = maa_gpio_wait_interrupt(dev->isr_value_fp);
-        if (ret == MAA_SUCCESS) {
+        ret = mraa_gpio_wait_interrupt(dev->isr_value_fp);
+        if (ret == MRAA_SUCCESS) {
             pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
 #ifdef SWIGPYTHON
             // In order to call a python object (all python functions are objects) we
             pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
 #ifdef SWIGPYTHON
             // In order to call a python object (all python functions are objects) we
@@ -214,8 +214,8 @@ maa_gpio_interrupt_handler(void* arg)
     }
 }
 
     }
 }
 
-maa_result_t
-maa_gpio_edge_mode(maa_gpio_context dev, gpio_edge_t mode)
+mraa_result_t
+mraa_gpio_edge_mode(mraa_gpio_context dev, gpio_edge_t mode)
 {
     if (dev->value_fp != -1) {
          close(dev->value_fp);
 {
     if (dev->value_fp != -1) {
          close(dev->value_fp);
@@ -228,61 +228,61 @@ maa_gpio_edge_mode(maa_gpio_context dev, gpio_edge_t mode)
     int edge = open(filepath, O_RDWR);
     if (edge == -1) {
         fprintf(stderr, "Failed to open edge for writing!\n");
     int edge = open(filepath, O_RDWR);
     if (edge == -1) {
         fprintf(stderr, "Failed to open edge for writing!\n");
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     char bu[MAX_SIZE];
     int length;
     switch(mode) {
     }
 
     char bu[MAX_SIZE];
     int length;
     switch(mode) {
-        case MAA_GPIO_EDGE_NONE:
+        case MRAA_GPIO_EDGE_NONE:
             length = snprintf(bu, sizeof(bu), "none");
             break;
             length = snprintf(bu, sizeof(bu), "none");
             break;
-        case MAA_GPIO_EDGE_BOTH:
+        case MRAA_GPIO_EDGE_BOTH:
             length = snprintf(bu, sizeof(bu), "both");
             break;
             length = snprintf(bu, sizeof(bu), "both");
             break;
-        case MAA_GPIO_EDGE_RISING:
+        case MRAA_GPIO_EDGE_RISING:
             length = snprintf(bu, sizeof(bu), "rising");
             break;
             length = snprintf(bu, sizeof(bu), "rising");
             break;
-        case MAA_GPIO_EDGE_FALLING:
+        case MRAA_GPIO_EDGE_FALLING:
             length = snprintf(bu, sizeof(bu), "falling");
             break;
         default:
             close(edge);
             length = snprintf(bu, sizeof(bu), "falling");
             break;
         default:
             close(edge);
-            return MAA_ERROR_FEATURE_NOT_IMPLEMENTED;
+            return MRAA_ERROR_FEATURE_NOT_IMPLEMENTED;
     }
     if (write(edge, bu, length*sizeof(char)) == -1) {
         fprintf(stderr, "Failed to write to edge\n");
         close(edge);
     }
     if (write(edge, bu, length*sizeof(char)) == -1) {
         fprintf(stderr, "Failed to write to edge\n");
         close(edge);
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     close(edge);
     }
 
     close(edge);
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_gpio_isr(maa_gpio_context dev, gpio_edge_t mode, void (*fptr)(void *), void * args)
+mraa_result_t
+mraa_gpio_isr(mraa_gpio_context dev, gpio_edge_t mode, void (*fptr)(void *), void * args)
 {
 {
-    // we only allow one isr per maa_gpio_context
+    // we only allow one isr per mraa_gpio_context
     if (dev->thread_id != 0) {
     if (dev->thread_id != 0) {
-        return MAA_ERROR_NO_RESOURCES;
+        return MRAA_ERROR_NO_RESOURCES;
     }
 
     }
 
-    if (MAA_SUCCESS != maa_gpio_edge_mode(dev, mode)) {
-        return MAA_ERROR_UNSPECIFIED;
+    if (MRAA_SUCCESS != mraa_gpio_edge_mode(dev, mode)) {
+        return MRAA_ERROR_UNSPECIFIED;
     }
         
     dev->isr = fptr;
     dev->isr_args = args;
     }
         
     dev->isr = fptr;
     dev->isr_args = args;
-    pthread_create (&dev->thread_id, NULL, maa_gpio_interrupt_handler, (void *) dev);
+    pthread_create (&dev->thread_id, NULL, mraa_gpio_interrupt_handler, (void *) dev);
 
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_gpio_isr_exit(maa_gpio_context dev)
+mraa_result_t
+mraa_gpio_isr_exit(mraa_gpio_context dev)
 {
 {
-    maa_result_t ret = MAA_SUCCESS;
+    mraa_result_t ret = MRAA_SUCCESS;
 
     // wasting our time, there is no isr to exit from
     if (dev->thread_id == 0 && dev->isr_value_fp == -1) {
 
     // wasting our time, there is no isr to exit from
     if (dev->thread_id == 0 && dev->isr_value_fp == -1) {
@@ -290,17 +290,17 @@ maa_gpio_isr_exit(maa_gpio_context dev)
     }
 
     // stop isr being useful
     }
 
     // stop isr being useful
-    ret = maa_gpio_edge_mode(dev, MAA_GPIO_EDGE_NONE);
+    ret = mraa_gpio_edge_mode(dev, MRAA_GPIO_EDGE_NONE);
 
     if ((dev->thread_id != 0) &&
         (pthread_cancel(dev->thread_id) != 0)) {
 
     if ((dev->thread_id != 0) &&
         (pthread_cancel(dev->thread_id) != 0)) {
-        ret = MAA_ERROR_INVALID_HANDLE;
+        ret = MRAA_ERROR_INVALID_HANDLE;
     }
 
     // close the filehandle in case it's still open
     if (dev->isr_value_fp != -1) {
           if (close(dev->isr_value_fp) != 0) {
     }
 
     // close the filehandle in case it's still open
     if (dev->isr_value_fp != -1) {
           if (close(dev->isr_value_fp) != 0) {
-              ret = MAA_ERROR_INVALID_PARAMETER;
+              ret = MRAA_ERROR_INVALID_PARAMETER;
           }
     }
 
           }
     }
 
@@ -316,8 +316,8 @@ maa_gpio_isr_exit(maa_gpio_context dev)
     return ret;
 }
 
     return ret;
 }
 
-maa_result_t
-maa_gpio_mode(maa_gpio_context dev, gpio_mode_t mode)
+mraa_result_t
+mraa_gpio_mode(mraa_gpio_context dev, gpio_mode_t mode)
 {
     if (dev->value_fp != -1) {
          close(dev->value_fp);
 {
     if (dev->value_fp != -1) {
          close(dev->value_fp);
@@ -330,44 +330,44 @@ maa_gpio_mode(maa_gpio_context dev, gpio_mode_t mode)
     int drive = open(filepath, O_WRONLY);
     if (drive == -1) {
         fprintf(stderr, "Failed to open drive for writing!\n");
     int drive = open(filepath, O_WRONLY);
     if (drive == -1) {
         fprintf(stderr, "Failed to open drive for writing!\n");
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     char bu[MAX_SIZE];
     int length;
     switch(mode) {
     }
 
     char bu[MAX_SIZE];
     int length;
     switch(mode) {
-        case MAA_GPIO_STRONG:
+        case MRAA_GPIO_STRONG:
             length = snprintf(bu, sizeof(bu), "strong");
             break;
             length = snprintf(bu, sizeof(bu), "strong");
             break;
-        case MAA_GPIO_PULLUP:
+        case MRAA_GPIO_PULLUP:
             length = snprintf(bu, sizeof(bu), "pullup");
             break;
             length = snprintf(bu, sizeof(bu), "pullup");
             break;
-        case MAA_GPIO_PULLDOWN:
+        case MRAA_GPIO_PULLDOWN:
             length = snprintf(bu, sizeof(bu), "pulldown");
             break;
             length = snprintf(bu, sizeof(bu), "pulldown");
             break;
-        case MAA_GPIO_HIZ:
+        case MRAA_GPIO_HIZ:
             length = snprintf(bu, sizeof(bu), "hiz");
             break;
         default:
             close(drive);
             length = snprintf(bu, sizeof(bu), "hiz");
             break;
         default:
             close(drive);
-            return MAA_ERROR_FEATURE_NOT_IMPLEMENTED;
+            return MRAA_ERROR_FEATURE_NOT_IMPLEMENTED;
     }
     if (write(drive, bu, length*sizeof(char)) == -1) {
         fprintf(stderr, "Failed to write to drive mode!\n");
         close(drive);
     }
     if (write(drive, bu, length*sizeof(char)) == -1) {
         fprintf(stderr, "Failed to write to drive mode!\n");
         close(drive);
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
 
     }
 
     close(drive);
 
     }
 
     close(drive);
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_gpio_dir(maa_gpio_context dev, gpio_dir_t dir)
+mraa_result_t
+mraa_gpio_dir(mraa_gpio_context dev, gpio_dir_t dir)
 {
     if (dev == NULL) {
 {
     if (dev == NULL) {
-        return MAA_ERROR_INVALID_HANDLE;
+        return MRAA_ERROR_INVALID_HANDLE;
     }
     if (dev->value_fp != -1) {
          close(dev->value_fp);
     }
     if (dev->value_fp != -1) {
          close(dev->value_fp);
@@ -380,45 +380,45 @@ maa_gpio_dir(maa_gpio_context dev, gpio_dir_t dir)
 
     if (direction == -1) {
         fprintf(stderr, "Failed to open direction for writing!\n");
 
     if (direction == -1) {
         fprintf(stderr, "Failed to open direction for writing!\n");
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     char bu[MAX_SIZE];
     int length;
     int out_switch = 0;
     switch(dir) {
     }
 
     char bu[MAX_SIZE];
     int length;
     int out_switch = 0;
     switch(dir) {
-        case MAA_GPIO_OUT:
+        case MRAA_GPIO_OUT:
             length = snprintf(bu, sizeof(bu), "out");
             out_switch = 1;
             break;
             length = snprintf(bu, sizeof(bu), "out");
             out_switch = 1;
             break;
-        case MAA_GPIO_IN:
+        case MRAA_GPIO_IN:
             length = snprintf(bu, sizeof(bu), "in");
             break;
         default:
             close(direction);
             length = snprintf(bu, sizeof(bu), "in");
             break;
         default:
             close(direction);
-            return MAA_ERROR_FEATURE_NOT_IMPLEMENTED;
+            return MRAA_ERROR_FEATURE_NOT_IMPLEMENTED;
     }
 
     if (dev->phy_pin >= 0) {
     }
 
     if (dev->phy_pin >= 0) {
-        maa_result_t swap_res = maa_swap_complex_gpio(dev->phy_pin, out_switch);
-        if (swap_res != MAA_SUCCESS)
+        mraa_result_t swap_res = mraa_swap_complex_gpio(dev->phy_pin, out_switch);
+        if (swap_res != MRAA_SUCCESS)
             return swap_res;
     }
 
     if (write(direction, bu, length*sizeof(char)) == -1) {
         close(direction);
             return swap_res;
     }
 
     if (write(direction, bu, length*sizeof(char)) == -1) {
         close(direction);
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     close(direction);
     }
 
     close(direction);
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 int
 }
 
 int
-maa_gpio_read(maa_gpio_context dev)
+mraa_gpio_read(mraa_gpio_context dev)
 {
     if (dev->value_fp == -1) {
 {
     if (dev->value_fp == -1) {
-        if (maa_gpio_get_valfp(dev) != MAA_SUCCESS) {
+        if (mraa_gpio_get_valfp(dev) != MRAA_SUCCESS) {
              fprintf(stderr, "Failed to get value file pointer\n");
         }
     }
              fprintf(stderr, "Failed to get value file pointer\n");
         }
     }
@@ -436,35 +436,35 @@ maa_gpio_read(maa_gpio_context dev)
     return ret;
 }
 
     return ret;
 }
 
-maa_result_t
-maa_gpio_write(maa_gpio_context dev, int value)
+mraa_result_t
+mraa_gpio_write(mraa_gpio_context dev, int value)
 {
     if (dev->mmap == 1)
 {
     if (dev->mmap == 1)
-        return maa_gpio_write_register(dev,value);
+        return mraa_gpio_write_register(dev,value);
 
     if (dev->value_fp == -1) {
 
     if (dev->value_fp == -1) {
-        maa_gpio_get_valfp(dev);
+        mraa_gpio_get_valfp(dev);
     }
     if (lseek(dev->value_fp, 0, SEEK_SET) == -1) {
     }
     if (lseek(dev->value_fp, 0, SEEK_SET) == -1) {
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     char bu[MAX_SIZE];
     int length = snprintf(bu, sizeof(bu), "%d", value);
     if (write(dev->value_fp, bu, length*sizeof(char)) == -1) {
     }
 
     char bu[MAX_SIZE];
     int length = snprintf(bu, sizeof(bu), "%d", value);
     if (write(dev->value_fp, bu, length*sizeof(char)) == -1) {
-        return MAA_ERROR_INVALID_HANDLE;
+        return MRAA_ERROR_INVALID_HANDLE;
     }
 
     }
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-static maa_result_t
-maa_gpio_unexport_force(maa_gpio_context dev)
+static mraa_result_t
+mraa_gpio_unexport_force(mraa_gpio_context dev)
 {
     int unexport = open(SYSFS_CLASS_GPIO "/unexport", O_WRONLY);
     if (unexport == -1) {
         fprintf(stderr, "Failed to open unexport for writing!\n");
 {
     int unexport = open(SYSFS_CLASS_GPIO "/unexport", O_WRONLY);
     if (unexport == -1) {
         fprintf(stderr, "Failed to open unexport for writing!\n");
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     char bu[MAX_SIZE];
     }
 
     char bu[MAX_SIZE];
@@ -472,55 +472,55 @@ maa_gpio_unexport_force(maa_gpio_context dev)
     if (write(unexport, bu, length*sizeof(char)) == -1) {
         fprintf(stderr, "Failed to write to unexport\n");
         close(unexport);
     if (write(unexport, bu, length*sizeof(char)) == -1) {
         fprintf(stderr, "Failed to write to unexport\n");
         close(unexport);
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     close(unexport);
     }
 
     close(unexport);
-    maa_gpio_isr_exit(dev);
-    return MAA_SUCCESS;
+    mraa_gpio_isr_exit(dev);
+    return MRAA_SUCCESS;
 }
 }
-static maa_result_t
-maa_gpio_unexport(maa_gpio_context dev)
+static mraa_result_t
+mraa_gpio_unexport(mraa_gpio_context dev)
 {
     if(dev->owner) {
 {
     if(dev->owner) {
-        return maa_gpio_unexport_force(dev);
+        return mraa_gpio_unexport_force(dev);
     }
     }
-    return MAA_ERROR_INVALID_RESOURCE;
+    return MRAA_ERROR_INVALID_RESOURCE;
 }
 
 }
 
-maa_result_t
-maa_gpio_close(maa_gpio_context dev)
+mraa_result_t
+mraa_gpio_close(mraa_gpio_context dev)
 {
     if (dev->value_fp != -1) {
         close(dev->value_fp);
     }
 {
     if (dev->value_fp != -1) {
         close(dev->value_fp);
     }
-    maa_gpio_unexport(dev);
+    mraa_gpio_unexport(dev);
     free(dev);
     free(dev);
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_gpio_owner(maa_gpio_context dev, maa_boolean_t own)
+mraa_result_t
+mraa_gpio_owner(mraa_gpio_context dev, mraa_boolean_t own)
 {
     if (dev == NULL)
 {
     if (dev == NULL)
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     dev->owner = own;
     dev->owner = own;
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_gpio_use_mmaped(maa_gpio_context dev, maa_boolean_t mmap_en)
+mraa_result_t
+mraa_gpio_use_mmaped(mraa_gpio_context dev, mraa_boolean_t mmap_en)
 {
     if (dev ==  NULL) {
 {
     if (dev ==  NULL) {
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     }
 
-    if (maa_pin_mode_test(dev->phy_pin, MAA_PIN_FAST_GPIO) == 0)
-        return MAA_ERROR_NO_RESOURCES;
+    if (mraa_pin_mode_test(dev->phy_pin, MRAA_PIN_FAST_GPIO) == 0)
+        return MRAA_ERROR_NO_RESOURCES;
 
 
-    maa_mmap_pin_t *mmp = maa_setup_mmap_gpio(dev->phy_pin);
+    mraa_mmap_pin_t *mmp = mraa_setup_mmap_gpio(dev->phy_pin);
     if (mmp == NULL)
     if (mmp == NULL)
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
 
     if (mmap_en == 1) {
         if (dev->mmap == 0) {
 
     if (mmap_en == 1) {
         if (dev->mmap == 0) {
@@ -529,15 +529,15 @@ maa_gpio_use_mmaped(maa_gpio_context dev, maa_boolean_t mmap_en)
             fd = open(mmp->mem_dev, O_RDWR);
             if (fd < 1) {
                 fprintf(stderr, "Unable to open memory device\n");
             fd = open(mmp->mem_dev, O_RDWR);
             if (fd < 1) {
                 fprintf(stderr, "Unable to open memory device\n");
-                return MAA_ERROR_INVALID_RESOURCE;
+                return MRAA_ERROR_INVALID_RESOURCE;
             }
             dev->reg_sz = mmp->mem_sz;
             dev->reg = mmap(NULL, dev->reg_sz, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
             dev->reg_bit_pos = mmp->bit_pos;
             dev->mmap = 1;
             }
             dev->reg_sz = mmp->mem_sz;
             dev->reg = mmap(NULL, dev->reg_sz, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
             dev->reg_bit_pos = mmp->bit_pos;
             dev->mmap = 1;
-            return MAA_SUCCESS;
+            return MRAA_SUCCESS;
         }
         }
-        return MAA_ERROR_INVALID_PARAMETER;
+        return MRAA_ERROR_INVALID_PARAMETER;
     }
 
     if (mmap_en == 0) {
     }
 
     if (mmap_en == 0) {
@@ -545,8 +545,8 @@ maa_gpio_use_mmaped(maa_gpio_context dev, maa_boolean_t mmap_en)
             munmap(dev->reg, dev->reg_sz);
             dev->mmap = 0;
         }
             munmap(dev->reg, dev->reg_sz);
             dev->mmap = 0;
         }
-        return MAA_ERROR_INVALID_PARAMETER;
+        return MRAA_ERROR_INVALID_PARAMETER;
     }
 
     }
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 }
index 9d21e87..e58eb70 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "i2c.h"
 #include "smbus.h"
 
 #include "i2c.h"
 #include "smbus.h"
-#include "maa_internal.h"
+#include "mraa_internal.h"
 
 struct _i2c {
     /*@{*/
 
 struct _i2c {
     /*@{*/
@@ -34,10 +34,10 @@ struct _i2c {
     /*@}*/
 };
 
     /*@}*/
 };
 
-maa_i2c_context
-maa_i2c_init(int bus)
+mraa_i2c_context
+mraa_i2c_init(int bus)
 {
 {
-    int checked_pin = maa_setup_i2c(bus);
+    int checked_pin = mraa_setup_i2c(bus);
     if (checked_pin < 0) {
         switch(checked_pin) {
             case -1:
     if (checked_pin < 0) {
         switch(checked_pin) {
             case -1:
@@ -52,13 +52,13 @@ maa_i2c_init(int bus)
             default: return NULL;
         }
     }
             default: return NULL;
         }
     }
-    return maa_i2c_init_raw((unsigned int) checked_pin);
+    return mraa_i2c_init_raw((unsigned int) checked_pin);
 }
 
 }
 
-maa_i2c_context
-maa_i2c_init_raw(unsigned int bus)
+mraa_i2c_context
+mraa_i2c_init_raw(unsigned int bus)
 {
 {
-    maa_i2c_context dev = (maa_i2c_context) malloc(sizeof(struct _i2c));
+    mraa_i2c_context dev = (mraa_i2c_context) malloc(sizeof(struct _i2c));
     if (dev == NULL)
         return NULL;
 
     if (dev == NULL)
         return NULL;
 
@@ -70,18 +70,18 @@ maa_i2c_init_raw(unsigned int bus)
     return dev;
 }
 
     return dev;
 }
 
-maa_result_t
-maa_i2c_frequency(maa_i2c_context dev, int hz)
+mraa_result_t
+mraa_i2c_frequency(mraa_i2c_context dev, int hz)
 {
     dev->hz = hz;
 
 {
     dev->hz = hz;
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 int
 }
 
 int
-maa_i2c_read(maa_i2c_context dev, uint8_t* data, int length)
+mraa_i2c_read(mraa_i2c_context dev, uint8_t* data, int length)
 {
 {
-    // this is the read(3) syscall not maa_i2c_read()
+    // this is the read(3) syscall not mraa_i2c_read()
     if (read(dev->fh, data, length) == length) {
         return length;
     }
     if (read(dev->fh, data, length) == length) {
         return length;
     }
@@ -89,7 +89,7 @@ maa_i2c_read(maa_i2c_context dev, uint8_t* data, int length)
 }
 
 uint8_t
 }
 
 uint8_t
-maa_i2c_read_byte(maa_i2c_context dev)
+mraa_i2c_read_byte(mraa_i2c_context dev)
 {
     uint8_t byte = i2c_smbus_read_byte(dev->fh);
     if (byte < 0) {
 {
     uint8_t byte = i2c_smbus_read_byte(dev->fh);
     if (byte < 0) {
@@ -98,40 +98,40 @@ maa_i2c_read_byte(maa_i2c_context dev)
     return byte;
 }
 
     return byte;
 }
 
-maa_result_t
-maa_i2c_write(maa_i2c_context dev, const uint8_t* data, int length)
+mraa_result_t
+mraa_i2c_write(mraa_i2c_context dev, const uint8_t* data, int length)
 {
     if (i2c_smbus_write_i2c_block_data(dev->fh, data[0], length-1, (uint8_t*) data+1) < 0) {
         fprintf(stderr, "Failed to write to i2c\n");
 {
     if (i2c_smbus_write_i2c_block_data(dev->fh, data[0], length-1, (uint8_t*) data+1) < 0) {
         fprintf(stderr, "Failed to write to i2c\n");
-       return MAA_ERROR_INVALID_HANDLE;
+       return MRAA_ERROR_INVALID_HANDLE;
     }
     }
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_i2c_write_byte(maa_i2c_context dev, const uint8_t data)
+mraa_result_t
+mraa_i2c_write_byte(mraa_i2c_context dev, const uint8_t data)
 {
     if (i2c_smbus_write_byte(dev->fh, data) < 0) {
         fprintf(stderr, "Failed to write to i2c\n");
 {
     if (i2c_smbus_write_byte(dev->fh, data) < 0) {
         fprintf(stderr, "Failed to write to i2c\n");
-       return MAA_ERROR_INVALID_HANDLE;
+       return MRAA_ERROR_INVALID_HANDLE;
     }
     }
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_i2c_address(maa_i2c_context dev, int addr)
+mraa_result_t
+mraa_i2c_address(mraa_i2c_context dev, int addr)
 {
     dev->addr = addr;
     if (ioctl(dev->fh, I2C_SLAVE_FORCE, addr) < 0) {
         fprintf(stderr, "Failed to set slave address %d\n", addr);
 {
     dev->addr = addr;
     if (ioctl(dev->fh, I2C_SLAVE_FORCE, addr) < 0) {
         fprintf(stderr, "Failed to set slave address %d\n", addr);
-       return MAA_ERROR_INVALID_HANDLE;
+       return MRAA_ERROR_INVALID_HANDLE;
     }
     }
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_i2c_stop(maa_i2c_context dev)
+mraa_result_t
+mraa_i2c_stop(mraa_i2c_context dev)
 {
     free(dev);
 {
     free(dev);
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 }
index effff42..4614492 100644 (file)
 #include "common.h"
 #include "intel_galileo_rev_d.h"
 
 #include "common.h"
 #include "intel_galileo_rev_d.h"
 
-maa_board_t*
-maa_intel_galileo_rev_d()
+mraa_board_t*
+mraa_intel_galileo_rev_d()
 {
 {
-    maa_board_t* b = (maa_board_t*) malloc(sizeof(maa_board_t));
+    mraa_board_t* b = (mraa_board_t*) malloc(sizeof(mraa_board_t));
     if (b == NULL)
         return NULL;
 
     if (b == NULL)
         return NULL;
 
@@ -39,11 +39,11 @@ maa_intel_galileo_rev_d()
     b->gpio_count = 14;
     b->aio_count = 6;
 
     b->gpio_count = 14;
     b->aio_count = 6;
 
-    b->pins = (maa_pininfo_t*) malloc(sizeof(maa_pininfo_t)*MAA_INTEL_GALILEO_REV_D_PINCOUNT);
+    b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t)*MRAA_INTEL_GALILEO_REV_D_PINCOUNT);
 
     //GPIO IO0 - IO10
     strncpy(b->pins[0].name, "IO0", 8);
 
     //GPIO IO0 - IO10
     strncpy(b->pins[0].name, "IO0", 8);
-    b->pins[0].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,0};
+    b->pins[0].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,0};
     b->pins[0].gpio.pinmap = 50;
     b->pins[0].gpio.parent_id = 0;
     b->pins[0].gpio.mux_total = 1;
     b->pins[0].gpio.pinmap = 50;
     b->pins[0].gpio.parent_id = 0;
     b->pins[0].gpio.mux_total = 1;
@@ -51,14 +51,14 @@ maa_intel_galileo_rev_d()
     b->pins[0].gpio.mux[0].value = 1;
 
     strncpy(b->pins[1].name, "IO1", 8);
     b->pins[0].gpio.mux[0].value = 1;
 
     strncpy(b->pins[1].name, "IO1", 8);
-    b->pins[1].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,0};
+    b->pins[1].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,0};
     b->pins[1].gpio.pinmap = 51;
     b->pins[1].gpio.mux_total = 1;
     b->pins[1].gpio.mux[0].pin = 41;
     b->pins[1].gpio.mux[0].value = 1;
 
     strncpy(b->pins[2].name, "IO2", 8);
     b->pins[1].gpio.pinmap = 51;
     b->pins[1].gpio.mux_total = 1;
     b->pins[1].gpio.mux[0].pin = 41;
     b->pins[1].gpio.mux[0].value = 1;
 
     strncpy(b->pins[2].name, "IO2", 8);
-    b->pins[2].capabilites = (maa_pincapabilities_t) {1,1,0,1,0,0,0};
+    b->pins[2].capabilites = (mraa_pincapabilities_t) {1,1,0,1,0,0,0};
     b->pins[2].gpio.pinmap = 32;
     b->pins[2].gpio.mux_total = 1;
     b->pins[2].gpio.mux[0].pin = 31;
     b->pins[2].gpio.pinmap = 32;
     b->pins[2].gpio.mux_total = 1;
     b->pins[2].gpio.mux[0].pin = 31;
@@ -74,7 +74,7 @@ maa_intel_galileo_rev_d()
     b->pins[2].mmap.bit_pos = 6;
 
     strncpy(b->pins[3].name, "IO3", 8);
     b->pins[2].mmap.bit_pos = 6;
 
     strncpy(b->pins[3].name, "IO3", 8);
-    b->pins[3].capabilites = (maa_pincapabilities_t) {1,1,1,1,0,0,0};
+    b->pins[3].capabilites = (mraa_pincapabilities_t) {1,1,1,1,0,0,0};
     b->pins[3].gpio.pinmap = 18;
     b->pins[3].gpio.mux_total = 1;
     b->pins[3].gpio.mux[0].pin = 30;
     b->pins[3].gpio.pinmap = 18;
     b->pins[3].gpio.mux_total = 1;
     b->pins[3].gpio.mux[0].pin = 30;
@@ -96,12 +96,12 @@ maa_intel_galileo_rev_d()
 
 
     strncpy(b->pins[4].name, "IO4", 8);
 
 
     strncpy(b->pins[4].name, "IO4", 8);
-    b->pins[4].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,0};
+    b->pins[4].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,0};
     b->pins[4].gpio.pinmap = 28;
     b->pins[4].gpio.mux_total = 0;
 
     strncpy(b->pins[5].name, "IO5", 8);
     b->pins[4].gpio.pinmap = 28;
     b->pins[4].gpio.mux_total = 0;
 
     strncpy(b->pins[5].name, "IO5", 8);
-    b->pins[5].capabilites = (maa_pincapabilities_t) {1,1,1,0,0,0,0};
+    b->pins[5].capabilites = (mraa_pincapabilities_t) {1,1,1,0,0,0,0};
     b->pins[5].gpio.pinmap = 17;
     b->pins[5].gpio.mux_total = 0;
     b->pins[5].pwm.pinmap = 5;
     b->pins[5].gpio.pinmap = 17;
     b->pins[5].gpio.mux_total = 0;
     b->pins[5].pwm.pinmap = 5;
@@ -110,24 +110,24 @@ maa_intel_galileo_rev_d()
 
     strncpy(b->pins[6].name, "IO6", 8);
     b->pins[6].gpio.pinmap = 24;
 
     strncpy(b->pins[6].name, "IO6", 8);
     b->pins[6].gpio.pinmap = 24;
-    b->pins[6].capabilites = (maa_pincapabilities_t) {1,1,1,0,0,0,0};
+    b->pins[6].capabilites = (mraa_pincapabilities_t) {1,1,1,0,0,0,0};
     b->pins[6].gpio.mux_total = 0;
     b->pins[6].pwm.pinmap = 6;
     b->pins[6].pwm.parent_id = 0;
     b->pins[6].pwm.mux_total = 0;
 
     strncpy(b->pins[7].name, "IO7", 8);
     b->pins[6].gpio.mux_total = 0;
     b->pins[6].pwm.pinmap = 6;
     b->pins[6].pwm.parent_id = 0;
     b->pins[6].pwm.mux_total = 0;
 
     strncpy(b->pins[7].name, "IO7", 8);
-    b->pins[7].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,0};
+    b->pins[7].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,0};
     b->pins[7].gpio.pinmap = 27;
     b->pins[7].gpio.mux_total = 0;
 
     strncpy(b->pins[8].name, "IO8", 8);
     b->pins[7].gpio.pinmap = 27;
     b->pins[7].gpio.mux_total = 0;
 
     strncpy(b->pins[8].name, "IO8", 8);
-    b->pins[8].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,0};
+    b->pins[8].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,0};
     b->pins[8].gpio.pinmap = 26;
     b->pins[8].gpio.mux_total = 0;
 
     strncpy(b->pins[9].name, "IO9", 8);
     b->pins[8].gpio.pinmap = 26;
     b->pins[8].gpio.mux_total = 0;
 
     strncpy(b->pins[9].name, "IO9", 8);
-    b->pins[9].capabilites = (maa_pincapabilities_t) {1,1,1,0,0,0,0};
+    b->pins[9].capabilites = (mraa_pincapabilities_t) {1,1,1,0,0,0,0};
     b->pins[9].gpio.pinmap = 19;
     b->pins[9].gpio.mux_total = 0;
     b->pins[9].pwm.pinmap = 1;
     b->pins[9].gpio.pinmap = 19;
     b->pins[9].gpio.mux_total = 0;
     b->pins[9].pwm.pinmap = 1;
@@ -135,7 +135,7 @@ maa_intel_galileo_rev_d()
     b->pins[9].pwm.mux_total = 0;
 
     strncpy(b->pins[10].name, "IO10", 8);
     b->pins[9].pwm.mux_total = 0;
 
     strncpy(b->pins[10].name, "IO10", 8);
-    b->pins[10].capabilites = (maa_pincapabilities_t) {1,1,1,0,1,0,0};
+    b->pins[10].capabilites = (mraa_pincapabilities_t) {1,1,1,0,1,0,0};
     b->pins[10].gpio.pinmap = 16;
     b->pins[10].gpio.mux_total = 1;
     b->pins[10].gpio.mux[0].pin = 42;
     b->pins[10].gpio.pinmap = 16;
     b->pins[10].gpio.mux_total = 1;
     b->pins[10].gpio.mux[0].pin = 42;
@@ -151,7 +151,7 @@ maa_intel_galileo_rev_d()
     b->pins[10].spi.mux[0].value = 0;
 
     strncpy(b->pins[11].name, "IO11", 8);
     b->pins[10].spi.mux[0].value = 0;
 
     strncpy(b->pins[11].name, "IO11", 8);
-    b->pins[11].capabilites = (maa_pincapabilities_t) {1,1,1,0,1,0,0};
+    b->pins[11].capabilites = (mraa_pincapabilities_t) {1,1,1,0,1,0,0};
     b->pins[11].gpio.pinmap = 25;
     b->pins[11].gpio.mux_total = 1;
     b->pins[11].gpio.mux[0].pin = 43;
     b->pins[11].gpio.pinmap = 25;
     b->pins[11].gpio.mux_total = 1;
     b->pins[11].gpio.mux[0].pin = 43;
@@ -167,7 +167,7 @@ maa_intel_galileo_rev_d()
     b->pins[11].spi.mux[0].value = 0;
 
     strncpy(b->pins[12].name, "IO12", 8);
     b->pins[11].spi.mux[0].value = 0;
 
     strncpy(b->pins[12].name, "IO12", 8);
-    b->pins[12].capabilites = (maa_pincapabilities_t) {1,1,0,0,1,0,0};
+    b->pins[12].capabilites = (mraa_pincapabilities_t) {1,1,0,0,1,0,0};
     b->pins[12].gpio.pinmap = 38;
     b->pins[12].gpio.mux_total = 1;
     b->pins[12].gpio.mux[0].pin = 54;
     b->pins[12].gpio.pinmap = 38;
     b->pins[12].gpio.mux_total = 1;
     b->pins[12].gpio.mux[0].pin = 54;
@@ -178,7 +178,7 @@ maa_intel_galileo_rev_d()
     b->pins[12].spi.mux[0].value = 0;
 
     strncpy(b->pins[13].name, "IO13", 8);
     b->pins[12].spi.mux[0].value = 0;
 
     strncpy(b->pins[13].name, "IO13", 8);
-    b->pins[13].capabilites = (maa_pincapabilities_t) {1,1,0,0,1,0,0};
+    b->pins[13].capabilites = (mraa_pincapabilities_t) {1,1,0,0,1,0,0};
     b->pins[13].gpio.pinmap = 39;
     b->pins[13].gpio.mux_total = 1;
     b->pins[13].gpio.mux[0].pin = 55;
     b->pins[13].gpio.pinmap = 39;
     b->pins[13].gpio.mux_total = 1;
     b->pins[13].gpio.mux[0].pin = 55;
@@ -189,7 +189,7 @@ maa_intel_galileo_rev_d()
     b->pins[13].spi.mux[0].value = 0;
 
     strncpy(b->pins[14].name, "A0", 8);
     b->pins[13].spi.mux[0].value = 0;
 
     strncpy(b->pins[14].name, "A0", 8);
-    b->pins[14].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,1};
+    b->pins[14].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,1};
     b->pins[14].gpio.pinmap = 44;
     b->pins[14].gpio.mux_total = 1;
     b->pins[14].gpio.mux[0].pin = 37;
     b->pins[14].gpio.pinmap = 44;
     b->pins[14].gpio.mux_total = 1;
     b->pins[14].gpio.mux[0].pin = 37;
@@ -200,7 +200,7 @@ maa_intel_galileo_rev_d()
     b->pins[14].aio.mux[0].value = 0;
 
     strncpy(b->pins[15].name, "A1", 8);
     b->pins[14].aio.mux[0].value = 0;
 
     strncpy(b->pins[15].name, "A1", 8);
-    b->pins[15].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,1};
+    b->pins[15].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,1};
     b->pins[15].gpio.pinmap = 45;
     b->pins[15].gpio.mux_total = 1;
     b->pins[15].gpio.mux[0].pin = 36;
     b->pins[15].gpio.pinmap = 45;
     b->pins[15].gpio.mux_total = 1;
     b->pins[15].gpio.mux[0].pin = 36;
@@ -211,7 +211,7 @@ maa_intel_galileo_rev_d()
     b->pins[15].aio.mux[0].value = 0;
 
     strncpy(b->pins[16].name, "A2", 8);
     b->pins[15].aio.mux[0].value = 0;
 
     strncpy(b->pins[16].name, "A2", 8);
-    b->pins[16].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,1};
+    b->pins[16].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,1};
     b->pins[16].gpio.pinmap = 46;
     b->pins[16].gpio.mux_total = 1;
     b->pins[16].gpio.mux[0].pin = 23;
     b->pins[16].gpio.pinmap = 46;
     b->pins[16].gpio.mux_total = 1;
     b->pins[16].gpio.mux[0].pin = 23;
@@ -222,7 +222,7 @@ maa_intel_galileo_rev_d()
     b->pins[16].aio.mux[0].value = 0;
 
     strncpy(b->pins[17].name, "A3", 8);
     b->pins[16].aio.mux[0].value = 0;
 
     strncpy(b->pins[17].name, "A3", 8);
-    b->pins[17].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,1};
+    b->pins[17].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,1};
     b->pins[17].gpio.pinmap = 47;
     b->pins[17].gpio.mux_total = 1;
     b->pins[17].gpio.mux[0].pin = 22;
     b->pins[17].gpio.pinmap = 47;
     b->pins[17].gpio.mux_total = 1;
     b->pins[17].gpio.mux[0].pin = 22;
@@ -233,7 +233,7 @@ maa_intel_galileo_rev_d()
     b->pins[17].aio.mux[0].value = 0;
 
     strncpy(b->pins[18].name, "A4", 8);
     b->pins[17].aio.mux[0].value = 0;
 
     strncpy(b->pins[18].name, "A4", 8);
-    b->pins[18].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,1,1};
+    b->pins[18].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,1,1};
     b->pins[18].gpio.pinmap = 48;
     b->pins[18].gpio.mux_total = 2;
     b->pins[18].gpio.mux[0].pin = 29;
     b->pins[18].gpio.pinmap = 48;
     b->pins[18].gpio.mux_total = 2;
     b->pins[18].gpio.mux[0].pin = 29;
@@ -252,7 +252,7 @@ maa_intel_galileo_rev_d()
     b->pins[18].aio.mux[1].value = 0;
 
     strncpy(b->pins[19].name, "A5", 8);
     b->pins[18].aio.mux[1].value = 0;
 
     strncpy(b->pins[19].name, "A5", 8);
-    b->pins[19].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,1,1};
+    b->pins[19].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,1,1};
     b->pins[19].gpio.pinmap = 49;
     b->pins[19].gpio.mux_total = 2;
     b->pins[19].gpio.mux[0].pin = 29;
     b->pins[19].gpio.pinmap = 49;
     b->pins[19].gpio.mux_total = 2;
     b->pins[19].gpio.mux[0].pin = 29;
index 5a6c926..769376a 100644 (file)
 #include "common.h"
 #include "intel_galileo_rev_g.h"
 
 #include "common.h"
 #include "intel_galileo_rev_g.h"
 
-maa_board_t*
-maa_intel_galileo_gen2()
+mraa_board_t*
+mraa_intel_galileo_gen2()
 {
 {
-    maa_board_t* b = (maa_board_t*) malloc(sizeof(maa_board_t));
+    mraa_board_t* b = (mraa_board_t*) malloc(sizeof(mraa_board_t));
     if (b == NULL)
         return NULL;
 
     if (b == NULL)
         return NULL;
 
@@ -40,41 +40,41 @@ maa_intel_galileo_gen2()
     b->gpio_count = 14;
     b->aio_count = 6;
 
     b->gpio_count = 14;
     b->aio_count = 6;
 
-    b->pins = (maa_pininfo_t*) malloc(sizeof(maa_pininfo_t)*MAA_INTEL_GALILEO_GEN_2_PINCOUNT);
+    b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t)*MRAA_INTEL_GALILEO_GEN_2_PINCOUNT);
 
     strncpy(b->pins[0].name, "IO0", 8);
 
     strncpy(b->pins[0].name, "IO0", 8);
-    b->pins[0].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,0};
+    b->pins[0].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,0};
     b->pins[0].gpio.pinmap = 11;
     b->pins[0].gpio.parent_id = 0;
     b->pins[0].gpio.mux_total = 0;
     b->pins[0].gpio.pinmap = 11;
     b->pins[0].gpio.parent_id = 0;
     b->pins[0].gpio.mux_total = 0;
-    b->pins[0].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[0].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[0].gpio.output_enable = 32;
     b->pins[0].gpio.pullup_enable = 33;
 
     strncpy(b->pins[1].name, "IO1", 8);
     b->pins[0].gpio.output_enable = 32;
     b->pins[0].gpio.pullup_enable = 33;
 
     strncpy(b->pins[1].name, "IO1", 8);
-    b->pins[1].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,0};
+    b->pins[1].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,0};
     b->pins[1].gpio.pinmap = 12;
     b->pins[1].gpio.parent_id = 0;
     b->pins[1].gpio.mux_total = 1;
     b->pins[1].gpio.mux[0].pin = 45;
     b->pins[1].gpio.mux[0].value = 0;
     b->pins[1].gpio.pinmap = 12;
     b->pins[1].gpio.parent_id = 0;
     b->pins[1].gpio.mux_total = 1;
     b->pins[1].gpio.mux[0].pin = 45;
     b->pins[1].gpio.mux[0].value = 0;
-    b->pins[1].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[1].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[1].gpio.output_enable = 28;
     b->pins[1].gpio.pullup_enable = 29;
 
     strncpy(b->pins[2].name, "IO2", 8);
     b->pins[1].gpio.output_enable = 28;
     b->pins[1].gpio.pullup_enable = 29;
 
     strncpy(b->pins[2].name, "IO2", 8);
-    b->pins[2].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,0};
+    b->pins[2].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,0};
     b->pins[2].gpio.pinmap = 13;
     b->pins[2].gpio.parent_id = 0;
     b->pins[2].gpio.mux_total = 1;
     b->pins[2].gpio.mux[0].pin = 77;
     b->pins[2].gpio.mux[0].value = 0;
     b->pins[2].gpio.pinmap = 13;
     b->pins[2].gpio.parent_id = 0;
     b->pins[2].gpio.mux_total = 1;
     b->pins[2].gpio.mux[0].pin = 77;
     b->pins[2].gpio.mux[0].value = 0;
-    b->pins[2].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[2].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[2].gpio.output_enable = 34;
     b->pins[2].gpio.pullup_enable = 35;
 
     strncpy(b->pins[3].name, "IO3", 8);
     b->pins[2].gpio.output_enable = 34;
     b->pins[2].gpio.pullup_enable = 35;
 
     strncpy(b->pins[3].name, "IO3", 8);
-    b->pins[3].capabilites = (maa_pincapabilities_t) {1,1,1,0,0,0,0};
+    b->pins[3].capabilites = (mraa_pincapabilities_t) {1,1,1,0,0,0,0};
     b->pins[3].gpio.pinmap = 14;
     b->pins[3].gpio.parent_id = 0;
     b->pins[3].gpio.mux_total = 2;
     b->pins[3].gpio.pinmap = 14;
     b->pins[3].gpio.parent_id = 0;
     b->pins[3].gpio.mux_total = 2;
@@ -82,7 +82,7 @@ maa_intel_galileo_gen2()
     b->pins[3].gpio.mux[0].value = 0;
     b->pins[3].gpio.mux[1].pin = 64;
     b->pins[3].gpio.mux[1].value = 0;
     b->pins[3].gpio.mux[0].value = 0;
     b->pins[3].gpio.mux[1].pin = 64;
     b->pins[3].gpio.mux[1].value = 0;
-    b->pins[3].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[3].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[3].gpio.output_enable = 16;
     b->pins[3].gpio.pullup_enable = 17;
     b->pins[3].pwm.pinmap = 1;
     b->pins[3].gpio.output_enable = 16;
     b->pins[3].gpio.pullup_enable = 17;
     b->pins[3].pwm.pinmap = 1;
@@ -97,22 +97,22 @@ maa_intel_galileo_gen2()
    //ADD Othher Bits?
 
     strncpy(b->pins[4].name, "IO4", 8);
    //ADD Othher Bits?
 
     strncpy(b->pins[4].name, "IO4", 8);
-    b->pins[4].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,0};
+    b->pins[4].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,0};
     b->pins[4].gpio.pinmap = 6;
     b->pins[4].gpio.parent_id = 0;
     b->pins[4].gpio.mux_total = 0;
     b->pins[4].gpio.pinmap = 6;
     b->pins[4].gpio.parent_id = 0;
     b->pins[4].gpio.mux_total = 0;
-    b->pins[4].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[4].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[4].gpio.output_enable = 36;
     b->pins[4].gpio.pullup_enable = 37;
 
     strncpy(b->pins[5].name, "IO5", 8);
     b->pins[4].gpio.output_enable = 36;
     b->pins[4].gpio.pullup_enable = 37;
 
     strncpy(b->pins[5].name, "IO5", 8);
-    b->pins[5].capabilites = (maa_pincapabilities_t) {1,1,1,0,0,0,0};
+    b->pins[5].capabilites = (mraa_pincapabilities_t) {1,1,1,0,0,0,0};
     b->pins[5].gpio.pinmap = 0;
     b->pins[5].gpio.parent_id = 0;
     b->pins[5].gpio.mux_total = 1;
     b->pins[5].gpio.mux[0].pin = 66;
     b->pins[5].gpio.mux[0].value = 0;
     b->pins[5].gpio.pinmap = 0;
     b->pins[5].gpio.parent_id = 0;
     b->pins[5].gpio.mux_total = 1;
     b->pins[5].gpio.mux[0].pin = 66;
     b->pins[5].gpio.mux[0].value = 0;
-    b->pins[5].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[5].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[5].gpio.output_enable = 18;
     b->pins[5].gpio.pullup_enable = 19;
     b->pins[5].pwm.pinmap = 4;
     b->pins[5].gpio.output_enable = 18;
     b->pins[5].gpio.pullup_enable = 19;
     b->pins[5].pwm.pinmap = 4;
@@ -124,13 +124,13 @@ maa_intel_galileo_gen2()
     b->pins[5].pwm.mux[1].value = 0;
 
     strncpy(b->pins[6].name, "IO6", 8);
     b->pins[5].pwm.mux[1].value = 0;
 
     strncpy(b->pins[6].name, "IO6", 8);
-    b->pins[6].capabilites = (maa_pincapabilities_t) {1,1,1,0,0,0,0};
+    b->pins[6].capabilites = (mraa_pincapabilities_t) {1,1,1,0,0,0,0};
     b->pins[6].gpio.pinmap = 1;
     b->pins[6].gpio.parent_id = 0;
     b->pins[6].gpio.mux_total = 1;
     b->pins[6].gpio.mux[0].pin = 68;
     b->pins[6].gpio.mux[0].value = 0;
     b->pins[6].gpio.pinmap = 1;
     b->pins[6].gpio.parent_id = 0;
     b->pins[6].gpio.mux_total = 1;
     b->pins[6].gpio.mux[0].pin = 68;
     b->pins[6].gpio.mux[0].value = 0;
-    b->pins[6].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[6].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[6].gpio.output_enable = 20;
     b->pins[6].gpio.pullup_enable = 21;
     b->pins[6].pwm.pinmap = 5;
     b->pins[6].gpio.output_enable = 20;
     b->pins[6].gpio.pullup_enable = 21;
     b->pins[6].pwm.pinmap = 5;
@@ -142,29 +142,29 @@ maa_intel_galileo_gen2()
     b->pins[6].pwm.mux[1].value = 0;
 
     strncpy(b->pins[7].name, "IO7", 8);
     b->pins[6].pwm.mux[1].value = 0;
 
     strncpy(b->pins[7].name, "IO7", 8);
-    b->pins[7].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,0};
+    b->pins[7].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,0};
     b->pins[7].gpio.pinmap = 38;
     b->pins[7].gpio.parent_id = 0;
     b->pins[7].gpio.mux_total = 0;
     b->pins[7].gpio.pinmap = 38;
     b->pins[7].gpio.parent_id = 0;
     b->pins[7].gpio.mux_total = 0;
-    b->pins[7].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,0,0,1,1};
+    b->pins[7].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,0,0,1,1};
     b->pins[7].gpio.pullup_enable = 39;
 
     strncpy(b->pins[8].name, "IO8", 8);
     b->pins[7].gpio.pullup_enable = 39;
 
     strncpy(b->pins[8].name, "IO8", 8);
-    b->pins[8].capabilites = (maa_pincapabilities_t) {1,1,0,0,0,0,0};
+    b->pins[8].capabilites = (mraa_pincapabilities_t) {1,1,0,0,0,0,0};
     b->pins[8].gpio.pinmap = 40;
     b->pins[8].gpio.parent_id = 0;
     b->pins[8].gpio.mux_total = 0;
     b->pins[8].gpio.pinmap = 40;
     b->pins[8].gpio.parent_id = 0;
     b->pins[8].gpio.mux_total = 0;
-    b->pins[8].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,0,0,1,1};
+    b->pins[8].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,0,0,1,1};
     b->pins[8].gpio.pullup_enable = 41;
 
     strncpy(b->pins[9].name, "IO9", 8);
     b->pins[8].gpio.pullup_enable = 41;
 
     strncpy(b->pins[9].name, "IO9", 8);
-    b->pins[9].capabilites = (maa_pincapabilities_t) {1,1,1,0,0,0,0};
+    b->pins[9].capabilites = (mraa_pincapabilities_t) {1,1,1,0,0,0,0};
     b->pins[9].gpio.pinmap = 4;
     b->pins[9].gpio.parent_id = 0;
     b->pins[9].gpio.mux_total = 1;
     b->pins[9].gpio.mux[0].pin = 70;
     b->pins[9].gpio.mux[0].value = 0;
     b->pins[9].gpio.pinmap = 4;
     b->pins[9].gpio.parent_id = 0;
     b->pins[9].gpio.mux_total = 1;
     b->pins[9].gpio.mux[0].pin = 70;
     b->pins[9].gpio.mux[0].value = 0;
-    b->pins[9].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[9].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[9].gpio.output_enable = 22;
     b->pins[9].gpio.pullup_enable = 23;
     b->pins[9].pwm.pinmap = 7;
     b->pins[9].gpio.output_enable = 22;
     b->pins[9].gpio.pullup_enable = 23;
     b->pins[9].pwm.pinmap = 7;
@@ -176,13 +176,13 @@ maa_intel_galileo_gen2()
     b->pins[9].pwm.mux[1].value = 0;
 
     strncpy(b->pins[10].name, "IO10", 8);
     b->pins[9].pwm.mux[1].value = 0;
 
     strncpy(b->pins[10].name, "IO10", 8);
-    b->pins[10].capabilites = (maa_pincapabilities_t) {1,1,1,0,0,0,0};
+    b->pins[10].capabilites = (mraa_pincapabilities_t) {1,1,1,0,0,0,0};
     b->pins[10].gpio.pinmap = 10;
     b->pins[10].gpio.parent_id = 0;
     b->pins[10].gpio.mux_total = 1;
     b->pins[10].gpio.mux[0].pin = 74;
     b->pins[10].gpio.mux[0].value = 0;
     b->pins[10].gpio.pinmap = 10;
     b->pins[10].gpio.parent_id = 0;
     b->pins[10].gpio.mux_total = 1;
     b->pins[10].gpio.mux[0].pin = 74;
     b->pins[10].gpio.mux[0].value = 0;
-    b->pins[10].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[10].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[10].gpio.output_enable = 26;
     b->pins[10].gpio.pullup_enable = 27;
     b->pins[10].pwm.pinmap = 11;
     b->pins[10].gpio.output_enable = 26;
     b->pins[10].gpio.pullup_enable = 27;
     b->pins[10].pwm.pinmap = 11;
@@ -194,7 +194,7 @@ maa_intel_galileo_gen2()
     b->pins[10].pwm.mux[1].value = 0;
 
     strncpy(b->pins[11].name, "IO11", 8);
     b->pins[10].pwm.mux[1].value = 0;
 
     strncpy(b->pins[11].name, "IO11", 8);
-    b->pins[11].capabilites = (maa_pincapabilities_t) {1,1,1,0,1,0,0};
+    b->pins[11].capabilites = (mraa_pincapabilities_t) {1,1,1,0,1,0,0};
     b->pins[11].gpio.pinmap = 5;
     b->pins[11].gpio.parent_id = 0;
     b->pins[11].gpio.mux_total = 2;
     b->pins[11].gpio.pinmap = 5;
     b->pins[11].gpio.parent_id = 0;
     b->pins[11].gpio.mux_total = 2;
@@ -202,7 +202,7 @@ maa_intel_galileo_gen2()
     b->pins[11].gpio.mux[0].value = 0;
     b->pins[11].gpio.mux[1].pin = 44;
     b->pins[11].gpio.mux[1].value = 0;
     b->pins[11].gpio.mux[0].value = 0;
     b->pins[11].gpio.mux[1].pin = 44;
     b->pins[11].gpio.mux[1].value = 0;
-    b->pins[11].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[11].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[11].gpio.output_enable = 24;
     b->pins[11].gpio.pullup_enable = 25;
     b->pins[11].pwm.pinmap = 9;
     b->pins[11].gpio.output_enable = 24;
     b->pins[11].gpio.pullup_enable = 25;
     b->pins[11].pwm.pinmap = 9;
@@ -224,11 +224,11 @@ maa_intel_galileo_gen2()
     b->pins[11].pwm.mux[2].value = 0;
 
     strncpy(b->pins[12].name, "IO12", 8);
     b->pins[11].pwm.mux[2].value = 0;
 
     strncpy(b->pins[12].name, "IO12", 8);
-    b->pins[12].capabilites = (maa_pincapabilities_t) {1,1,0,0,1,0,0};
+    b->pins[12].capabilites = (mraa_pincapabilities_t) {1,1,0,0,1,0,0};
     b->pins[12].gpio.pinmap = 15;
     b->pins[12].gpio.parent_id = 0;
     b->pins[12].gpio.mux_total = 0;
     b->pins[12].gpio.pinmap = 15;
     b->pins[12].gpio.parent_id = 0;
     b->pins[12].gpio.mux_total = 0;
-    b->pins[12].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[12].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[12].gpio.output_enable = 42;
     b->pins[12].gpio.pullup_enable = 43;
     b->pins[12].spi.pinmap = 1;
     b->pins[12].gpio.output_enable = 42;
     b->pins[12].gpio.pullup_enable = 43;
     b->pins[12].spi.pinmap = 1;
@@ -238,13 +238,13 @@ maa_intel_galileo_gen2()
     // THIS NEEDS TESTING UNSURE IF MOSI WILL BE EXPOSED.
 
     strncpy(b->pins[13].name, "IO13", 8);
     // THIS NEEDS TESTING UNSURE IF MOSI WILL BE EXPOSED.
 
     strncpy(b->pins[13].name, "IO13", 8);
-    b->pins[13].capabilites = (maa_pincapabilities_t) {1,1,0,0,1,0,0};
+    b->pins[13].capabilites = (mraa_pincapabilities_t) {1,1,0,0,1,0,0};
     b->pins[13].gpio.pinmap = 7;
     b->pins[13].gpio.parent_id = 0;
     b->pins[13].gpio.mux_total = 1;
     b->pins[13].gpio.mux[0].pin = 46;
     b->pins[13].gpio.mux[0].value = 0;
     b->pins[13].gpio.pinmap = 7;
     b->pins[13].gpio.parent_id = 0;
     b->pins[13].gpio.mux_total = 1;
     b->pins[13].gpio.mux[0].pin = 46;
     b->pins[13].gpio.mux[0].value = 0;
-    b->pins[13].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,1,0,1,1};
+    b->pins[13].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,1,0,1,1};
     b->pins[13].gpio.output_enable = 30;
     b->pins[13].gpio.pullup_enable = 31;
     b->pins[13].spi.pinmap = 1;
     b->pins[13].gpio.output_enable = 30;
     b->pins[13].gpio.pullup_enable = 31;
     b->pins[13].spi.pinmap = 1;
@@ -256,36 +256,36 @@ maa_intel_galileo_gen2()
 
     //ANALOG
     strncpy(b->pins[14].name, "A0", 8);
 
     //ANALOG
     strncpy(b->pins[14].name, "A0", 8);
-    b->pins[14].capabilites = (maa_pincapabilities_t) {1,0,0,0,0,0,1};
-    b->pins[14].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,0,0,1,1};
+    b->pins[14].capabilites = (mraa_pincapabilities_t) {1,0,0,0,0,0,1};
+    b->pins[14].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,0,0,1,1};
     b->pins[14].gpio.pullup_enable = 49;
     b->pins[14].aio.pinmap = 0;
     b->pins[14].aio.mux_total = 0;
 
     strncpy(b->pins[15].name, "A1", 8);
     b->pins[14].gpio.pullup_enable = 49;
     b->pins[14].aio.pinmap = 0;
     b->pins[14].aio.mux_total = 0;
 
     strncpy(b->pins[15].name, "A1", 8);
-    b->pins[15].capabilites = (maa_pincapabilities_t) {1,0,0,0,0,0,1};
-    b->pins[15].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,0,0,1,1};
+    b->pins[15].capabilites = (mraa_pincapabilities_t) {1,0,0,0,0,0,1};
+    b->pins[15].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,0,0,1,1};
     b->pins[15].gpio.pullup_enable = 51;
     b->pins[15].aio.pinmap = 1;
     b->pins[15].aio.mux_total = 0;
 
     strncpy(b->pins[16].name, "A2", 8);
     b->pins[15].gpio.pullup_enable = 51;
     b->pins[15].aio.pinmap = 1;
     b->pins[15].aio.mux_total = 0;
 
     strncpy(b->pins[16].name, "A2", 8);
-    b->pins[16].capabilites = (maa_pincapabilities_t) {1,0,0,0,0,0,1};
-    b->pins[16].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,0,0,1,1};
+    b->pins[16].capabilites = (mraa_pincapabilities_t) {1,0,0,0,0,0,1};
+    b->pins[16].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,0,0,1,1};
     b->pins[16].gpio.pullup_enable = 53;
     b->pins[16].aio.pinmap = 2;
     b->pins[16].aio.mux_total = 0;
 
     strncpy(b->pins[17].name, "A3", 8);
     b->pins[16].gpio.pullup_enable = 53;
     b->pins[16].aio.pinmap = 2;
     b->pins[16].aio.mux_total = 0;
 
     strncpy(b->pins[17].name, "A3", 8);
-    b->pins[17].capabilites = (maa_pincapabilities_t) {1,0,0,0,0,0,1};
-    b->pins[17].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,0,0,1,1};
+    b->pins[17].capabilites = (mraa_pincapabilities_t) {1,0,0,0,0,0,1};
+    b->pins[17].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,0,0,1,1};
     b->pins[17].gpio.pullup_enable = 55;
     b->pins[17].aio.pinmap = 3;
     b->pins[17].aio.mux_total = 0;
 
     strncpy(b->pins[18].name, "A4", 8);
     b->pins[17].gpio.pullup_enable = 55;
     b->pins[17].aio.pinmap = 3;
     b->pins[17].aio.mux_total = 0;
 
     strncpy(b->pins[18].name, "A4", 8);
-    b->pins[18].capabilites = (maa_pincapabilities_t) {1,0,0,0,0,1,1};
-    b->pins[18].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,0,0,1,1};
+    b->pins[18].capabilites = (mraa_pincapabilities_t) {1,0,0,0,0,1,1};
+    b->pins[18].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,0,0,1,1};
     b->pins[18].gpio.pullup_enable = 57;
     b->pins[18].i2c.pinmap = 1;
     b->pins[18].i2c.mux_total = 1;
     b->pins[18].gpio.pullup_enable = 57;
     b->pins[18].i2c.pinmap = 1;
     b->pins[18].i2c.mux_total = 1;
@@ -299,8 +299,8 @@ maa_intel_galileo_gen2()
     b->pins[18].aio.mux[1].value = 0;
 
     strncpy(b->pins[19].name, "A5", 8);
     b->pins[18].aio.mux[1].value = 0;
 
     strncpy(b->pins[19].name, "A5", 8);
-    b->pins[19].capabilites = (maa_pincapabilities_t) {1,0,0,0,0,1,1};
-    b->pins[19].gpio.complex_cap  = (maa_pin_cap_complex_t) {1,0,0,1,1};
+    b->pins[19].capabilites = (mraa_pincapabilities_t) {1,0,0,0,0,1,1};
+    b->pins[19].gpio.complex_cap  = (mraa_pin_cap_complex_t) {1,0,0,1,1};
     b->pins[19].gpio.pullup_enable = 59;
     b->pins[19].i2c.pinmap = 1;
     b->pins[19].i2c.mux_total = 1;
     b->pins[19].gpio.pullup_enable = 59;
     b->pins[19].i2c.pinmap = 1;
     b->pins[19].i2c.mux_total = 1;
index d6d6bc2..253e13f 100644 (file)
@@ -14,23 +14,23 @@ include_directories (
 
 set (CMAKE_CXX_FLAGS -DBUILDING_NODE_EXTENSION)
 # SWIG treats SWIG_FLAGS as a list and not a string so semicolon seperation is required
 
 set (CMAKE_CXX_FLAGS -DBUILDING_NODE_EXTENSION)
 # SWIG treats SWIG_FLAGS as a list and not a string so semicolon seperation is required
-set_source_files_properties (maajs.i PROPERTIES SWIG_FLAGS "-node;-I${CMAKE_BINARY_DIR}/src")
-set_source_files_properties (maajs.i PROPERTIES CPLUSPLUS ON)
+set_source_files_properties (mraajs.i PROPERTIES SWIG_FLAGS "-node;-I${CMAKE_BINARY_DIR}/src")
+set_source_files_properties (mraajs.i PROPERTIES CPLUSPLUS ON)
 
 
-swig_add_module (maajs javascript maajs.i ${maa_LIB_SRCS})
-swig_link_libraries (maajs ${NODE_LIBRARIES})
+swig_add_module (mraajs javascript mraajs.i ${mraa_LIB_SRCS})
+swig_link_libraries (mraajs ${NODE_LIBRARIES})
 
 if (DOXYGEN_FOUND)
   foreach (_file ${DOCFILES})
 
 if (DOXYGEN_FOUND)
   foreach (_file ${DOCFILES})
-    add_dependencies (${SWIG_MODULE_maajs_REAL_NAME} ${_file}doc_i)
+    add_dependencies (${SWIG_MODULE_mraajs_REAL_NAME} ${_file}doc_i)
   endforeach ()
 endif ()
 
   endforeach ()
 endif ()
 
-set_target_properties (maajs PROPERTIES
+set_target_properties (mraajs PROPERTIES
   PREFIX ""
   SUFFIX ".node"
 )
 
 install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/package.json
   PREFIX ""
   SUFFIX ".node"
 )
 
 install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/package.json
-         ${CMAKE_CURRENT_BINARY_DIR}/maajs.node
-         DESTINATION lib/node_modules/maajs)
+         ${CMAKE_CURRENT_BINARY_DIR}/mraajs.node
+         DESTINATION lib/node_modules/mraajs)
diff --git a/src/javascript/maajs.i b/src/javascript/maajs.i
deleted file mode 100644 (file)
index 1cc2e90..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-%module (docstring="Javascript interface to libmaa") maajs
-
-%feature("autodoc", "3");
-
-%include ../maa.i
diff --git a/src/javascript/mraajs.i b/src/javascript/mraajs.i
new file mode 100644 (file)
index 0000000..59ff5fe
--- /dev/null
@@ -0,0 +1,5 @@
+%module (docstring="Javascript interface to libmraa") mraajs
+
+%feature("autodoc", "3");
+
+%include ../mraa.i
index 7227cbc..9938da7 100644 (file)
@@ -1,6 +1,6 @@
 {
 {
-  "name" : "maajs",
-  "main" : "./maajs.node",
+  "name" : "mraajs",
+  "main" : "./mraajs.node",
   "engines": {
     "node": ">= 1.0.x"
   },
   "engines": {
     "node": ">= 1.0.x"
   },
similarity index 58%
rename from src/maa.c
rename to src/mraa.c
index 330f3b4..204bbc6 100644 (file)
--- a/src/maa.c
 #include <sched.h>
 #include <string.h>
 
 #include <sched.h>
 #include <string.h>
 
-#include "maa_internal.h"
+#include "mraa_internal.h"
 #include "intel_galileo_rev_d.h"
 #include "intel_galileo_rev_g.h"
 #include "gpio.h"
 #include "version.h"
 
 #include "intel_galileo_rev_d.h"
 #include "intel_galileo_rev_g.h"
 #include "gpio.h"
 #include "version.h"
 
-//static maa_pininfo_t* pindata;
-static maa_board_t* plat = NULL;
-static maa_platform_t platform_type = MAA_UNKNOWN_PLATFORM;
+//static mraa_pininfo_t* pindata;
+static mraa_board_t* plat = NULL;
+static mraa_platform_t platform_type = MRAA_UNKNOWN_PLATFORM;
 
 const char *
 
 const char *
-maa_get_version()
+mraa_get_version()
 {
     return gVERSION;
 }
 
 #ifdef SWIG
 {
     return gVERSION;
 }
 
 #ifdef SWIG
-maa_result_t
-maa_init()
+mraa_result_t
+mraa_init()
 #else
 #else
-maa_result_t __attribute__((constructor))
-maa_init()
+mraa_result_t __attribute__((constructor))
+mraa_init()
 #endif
 {
     /** Once more board definitions have been added,
      *  A method for detecting them will need to be devised.
      */
     if (plat != NULL) {
 #endif
 {
     /** Once more board definitions have been added,
      *  A method for detecting them will need to be devised.
      */
     if (plat != NULL) {
-        return MAA_ERROR_PLATFORM_ALREADY_INITIALISED;
+        return MRAA_ERROR_PLATFORM_ALREADY_INITIALISED;
     }
 #ifdef SWIGPYTHON
     // Initialise python threads, this allows use to grab the GIL when we are
     }
 #ifdef SWIGPYTHON
     // Initialise python threads, this allows use to grab the GIL when we are
@@ -72,9 +72,9 @@ maa_init()
     if (fh != NULL) {
         if (getline(&line, &len, fh) != -1) {
             if (strncmp(line, "GalileoGen2", 10) == 0) {
     if (fh != NULL) {
         if (getline(&line, &len, fh) != -1) {
             if (strncmp(line, "GalileoGen2", 10) == 0) {
-                platform_type = MAA_INTEL_GALILEO_GEN2;
+                platform_type = MRAA_INTEL_GALILEO_GEN2;
             } else {
             } else {
-                platform_type = MAA_INTEL_GALILEO_GEN1;
+                platform_type = MRAA_INTEL_GALILEO_GEN1;
             }
         }
     }
             }
         }
     }
@@ -82,22 +82,22 @@ maa_init()
     fclose(fh);
 
     switch(platform_type) {
     fclose(fh);
 
     switch(platform_type) {
-        case MAA_INTEL_GALILEO_GEN2:
-            plat = maa_intel_galileo_gen2();
+        case MRAA_INTEL_GALILEO_GEN2:
+            plat = mraa_intel_galileo_gen2();
             break;
             break;
-        case MAA_INTEL_GALILEO_GEN1:
-            plat = maa_intel_galileo_rev_d();
+        case MRAA_INTEL_GALILEO_GEN1:
+            plat = mraa_intel_galileo_rev_d();
             break;
         default:
             break;
         default:
-            plat = maa_intel_galileo_rev_d();
-            fprintf(stderr, "Platform not found, initialising MAA_INTEL_GALILEO_GEN1\n");
+            plat = mraa_intel_galileo_rev_d();
+            fprintf(stderr, "Platform not found, initialising MRAA_INTEL_GALILEO_GEN1\n");
     }
 
     }
 
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 int
 }
 
 int
-maa_set_priority(const unsigned int priority)
+mraa_set_priority(const unsigned int priority)
 {
     struct sched_param sched_s;
 
 {
     struct sched_param sched_s;
 
@@ -112,24 +112,24 @@ maa_set_priority(const unsigned int priority)
     return sched_setscheduler(0, SCHED_RR, &sched_s);
 }
 
     return sched_setscheduler(0, SCHED_RR, &sched_s);
 }
 
-static maa_result_t
-maa_setup_mux_mapped(maa_pin_t meta)
+static mraa_result_t
+mraa_setup_mux_mapped(mraa_pin_t meta)
 {
     int mi;
     for (mi = 0; mi < meta.mux_total; mi++) {
 {
     int mi;
     for (mi = 0; mi < meta.mux_total; mi++) {
-        maa_gpio_context mux_i;
-        mux_i = maa_gpio_init_raw(meta.mux[mi].pin);
+        mraa_gpio_context mux_i;
+        mux_i = mraa_gpio_init_raw(meta.mux[mi].pin);
         if (mux_i == NULL)
         if (mux_i == NULL)
-            return MAA_ERROR_INVALID_HANDLE;
-        maa_gpio_dir(mux_i, MAA_GPIO_OUT);
-        if (maa_gpio_write(mux_i, meta.mux[mi].value) != MAA_SUCCESS)
-            return MAA_ERROR_INVALID_RESOURCE;
+            return MRAA_ERROR_INVALID_HANDLE;
+        mraa_gpio_dir(mux_i, MRAA_GPIO_OUT);
+        if (mraa_gpio_write(mux_i, meta.mux[mi].value) != MRAA_SUCCESS)
+            return MRAA_ERROR_INVALID_RESOURCE;
     }
     }
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 unsigned int
 }
 
 unsigned int
-maa_setup_gpio(int pin)
+mraa_setup_gpio(int pin)
 {
     if (plat == NULL)
         return -1;
 {
     if (plat == NULL)
         return -1;
@@ -141,13 +141,13 @@ maa_setup_gpio(int pin)
       return -1;
 
     if (plat->pins[pin].gpio.mux_total > 0)
       return -1;
 
     if (plat->pins[pin].gpio.mux_total > 0)
-       if (maa_setup_mux_mapped(plat->pins[pin].gpio) != MAA_SUCCESS)
+       if (mraa_setup_mux_mapped(plat->pins[pin].gpio) != MRAA_SUCCESS)
             return -1;
     return plat->pins[pin].gpio.pinmap;
 }
 
 unsigned int
             return -1;
     return plat->pins[pin].gpio.pinmap;
 }
 
 unsigned int
-maa_setup_aio(int aio)
+mraa_setup_aio(int aio)
 {
     if (plat == NULL)
         return -3;
 {
     if (plat == NULL)
         return -3;
@@ -161,13 +161,13 @@ maa_setup_aio(int aio)
       return -1;
 
     if (plat->pins[pin].aio.mux_total > 0)
       return -1;
 
     if (plat->pins[pin].aio.mux_total > 0)
-       if (maa_setup_mux_mapped(plat->pins[pin].aio) != MAA_SUCCESS)
+       if (mraa_setup_mux_mapped(plat->pins[pin].aio) != MRAA_SUCCESS)
             return -1;
     return plat->pins[pin].aio.pinmap;
 }
 
 unsigned int
             return -1;
     return plat->pins[pin].aio.pinmap;
 }
 
 unsigned int
-maa_setup_i2c(int bus)
+mraa_setup_i2c(int bus)
 {
     if (plat == NULL)
         return -3;
 {
     if (plat == NULL)
         return -3;
@@ -183,19 +183,19 @@ maa_setup_i2c(int bus)
 
     int pos = plat->i2c_bus[bus].sda;
     if (plat->pins[pos].i2c.mux_total > 0)
 
     int pos = plat->i2c_bus[bus].sda;
     if (plat->pins[pos].i2c.mux_total > 0)
-        if (maa_setup_mux_mapped(plat->pins[pos].i2c) != MAA_SUCCESS)
+        if (mraa_setup_mux_mapped(plat->pins[pos].i2c) != MRAA_SUCCESS)
              return -2;
 
     pos = plat->i2c_bus[bus].scl;
     if (plat->pins[pos].i2c.mux_total > 0)
              return -2;
 
     pos = plat->i2c_bus[bus].scl;
     if (plat->pins[pos].i2c.mux_total > 0)
-        if (maa_setup_mux_mapped(plat->pins[pos].i2c) != MAA_SUCCESS)
+        if (mraa_setup_mux_mapped(plat->pins[pos].i2c) != MRAA_SUCCESS)
              return -2;
 
     return plat->i2c_bus[bus].bus_id;
 }
 
              return -2;
 
     return plat->i2c_bus[bus].bus_id;
 }
 
-maa_spi_bus_t*
-maa_setup_spi(int bus)
+mraa_spi_bus_t*
+mraa_setup_spi(int bus)
 {
     if (plat == NULL)
         return NULL;
 {
     if (plat == NULL)
         return NULL;
@@ -211,25 +211,25 @@ maa_setup_spi(int bus)
 
     int pos = plat->spi_bus[bus].sclk;
     if (plat->pins[pos].spi.mux_total > 0)
 
     int pos = plat->spi_bus[bus].sclk;
     if (plat->pins[pos].spi.mux_total > 0)
-        if (maa_setup_mux_mapped(plat->pins[pos].spi) != MAA_SUCCESS)
+        if (mraa_setup_mux_mapped(plat->pins[pos].spi) != MRAA_SUCCESS)
              return NULL;
 
     pos = plat->spi_bus[bus].mosi;
     if (plat->pins[pos].spi.mux_total > 0)
              return NULL;
 
     pos = plat->spi_bus[bus].mosi;
     if (plat->pins[pos].spi.mux_total > 0)
-        if (maa_setup_mux_mapped(plat->pins[pos].spi) != MAA_SUCCESS)
+        if (mraa_setup_mux_mapped(plat->pins[pos].spi) != MRAA_SUCCESS)
              return NULL;
 
     pos = plat->spi_bus[bus].miso;
     if (plat->pins[pos].spi.mux_total > 0)
              return NULL;
 
     pos = plat->spi_bus[bus].miso;
     if (plat->pins[pos].spi.mux_total > 0)
-        if (maa_setup_mux_mapped(plat->pins[pos].spi) != MAA_SUCCESS)
+        if (mraa_setup_mux_mapped(plat->pins[pos].spi) != MRAA_SUCCESS)
              return NULL;
 
              return NULL;
 
-    maa_spi_bus_t *spi = &(plat->spi_bus[bus]);
+    mraa_spi_bus_t *spi = &(plat->spi_bus[bus]);
     return spi;
 }
 
     return spi;
 }
 
-maa_pin_t*
-maa_setup_pwm(int pin)
+mraa_pin_t*
+mraa_setup_pwm(int pin)
 {
     if (plat == NULL)
         return NULL;
 {
     if (plat == NULL)
         return NULL;
@@ -238,85 +238,85 @@ maa_setup_pwm(int pin)
         return NULL;
 
     if (plat->pins[pin].capabilites.gpio == 1) {
         return NULL;
 
     if (plat->pins[pin].capabilites.gpio == 1) {
-        maa_gpio_context mux_i;
-        mux_i = maa_gpio_init_raw(plat->pins[pin].gpio.pinmap);
+        mraa_gpio_context mux_i;
+        mux_i = mraa_gpio_init_raw(plat->pins[pin].gpio.pinmap);
         if (mux_i == NULL)
             return NULL;
         if (mux_i == NULL)
             return NULL;
-        if (maa_gpio_dir(mux_i, MAA_GPIO_OUT) != MAA_SUCCESS)
+        if (mraa_gpio_dir(mux_i, MRAA_GPIO_OUT) != MRAA_SUCCESS)
             return NULL;
         // Current REV D quirk. //TODO GEN 2
             return NULL;
         // Current REV D quirk. //TODO GEN 2
-        if (maa_gpio_write(mux_i, 1) != MAA_SUCCESS)
+        if (mraa_gpio_write(mux_i, 1) != MRAA_SUCCESS)
             return NULL;
             return NULL;
-        if (maa_gpio_close(mux_i) != MAA_SUCCESS)
+        if (mraa_gpio_close(mux_i) != MRAA_SUCCESS)
             return NULL;
     }
 
     if (plat->pins[pin].pwm.mux_total > 0)
             return NULL;
     }
 
     if (plat->pins[pin].pwm.mux_total > 0)
-       if (maa_setup_mux_mapped(plat->pins[pin].pwm) != MAA_SUCCESS)
+       if (mraa_setup_mux_mapped(plat->pins[pin].pwm) != MRAA_SUCCESS)
             return NULL;
 
             return NULL;
 
-    maa_pin_t *ret;
-    ret = (maa_pin_t*) malloc(sizeof(maa_pin_t));
+    mraa_pin_t *ret;
+    ret = (mraa_pin_t*) malloc(sizeof(mraa_pin_t));
     ret->pinmap = plat->pins[pin].pwm.pinmap;
     ret->parent_id = plat->pins[pin].pwm.parent_id;
     return ret;
 }
 
 void
     ret->pinmap = plat->pins[pin].pwm.pinmap;
     ret->parent_id = plat->pins[pin].pwm.parent_id;
     return ret;
 }
 
 void
-maa_result_print(maa_result_t result)
+mraa_result_print(mraa_result_t result)
 {
     switch (result) {
 {
     switch (result) {
-        case MAA_SUCCESS: fprintf(stderr, "MAA: SUCCESS\n");
+        case MRAA_SUCCESS: fprintf(stderr, "MRAA: SUCCESS\n");
                           break;
                           break;
-        case MAA_ERROR_FEATURE_NOT_IMPLEMENTED:
-                          fprintf(stderr, "MAA: Feature not implemented.\n");
+        case MRAA_ERROR_FEATURE_NOT_IMPLEMENTED:
+                          fprintf(stderr, "MRAA: Feature not implemented.\n");
                           break;
                           break;
-        case MAA_ERROR_FEATURE_NOT_SUPPORTED:
-                          fprintf(stderr, "MAA: Feature not supported by Hardware.\n");
+        case MRAA_ERROR_FEATURE_NOT_SUPPORTED:
+                          fprintf(stderr, "MRAA: Feature not supported by Hardware.\n");
                           break;
                           break;
-        case MAA_ERROR_INVALID_VERBOSITY_LEVEL:
-                          fprintf(stderr, "MAA: Invalid verbosity level.\n");
+        case MRAA_ERROR_INVALID_VERBOSITY_LEVEL:
+                          fprintf(stderr, "MRAA: Invalid verbosity level.\n");
                           break;
                           break;
-        case MAA_ERROR_INVALID_PARAMETER:
-                          fprintf(stderr, "MAA: Invalid parameter.\n");
+        case MRAA_ERROR_INVALID_PARAMETER:
+                          fprintf(stderr, "MRAA: Invalid parameter.\n");
                           break;
                           break;
-        case MAA_ERROR_INVALID_HANDLE:
-                          fprintf(stderr, "MAA: Invalid Handle.\n");
+        case MRAA_ERROR_INVALID_HANDLE:
+                          fprintf(stderr, "MRAA: Invalid Handle.\n");
                           break;
                           break;
-        case MAA_ERROR_NO_RESOURCES:
-                          fprintf(stderr, "MAA: No resources.\n");
+        case MRAA_ERROR_NO_RESOURCES:
+                          fprintf(stderr, "MRAA: No resources.\n");
                           break;
                           break;
-        case MAA_ERROR_INVALID_RESOURCE:
-                          fprintf(stderr, "MAA: Invalid resource.\n");
+        case MRAA_ERROR_INVALID_RESOURCE:
+                          fprintf(stderr, "MRAA: Invalid resource.\n");
                           break;
                           break;
-        case MAA_ERROR_INVALID_QUEUE_TYPE:
-                          fprintf(stderr, "MAA: Invalid Queue Type.\n");
+        case MRAA_ERROR_INVALID_QUEUE_TYPE:
+                          fprintf(stderr, "MRAA: Invalid Queue Type.\n");
                           break;
                           break;
-        case MAA_ERROR_NO_DATA_AVAILABLE:
-                          fprintf(stderr, "MAA: No Data available.\n");
+        case MRAA_ERROR_NO_DATA_AVAILABLE:
+                          fprintf(stderr, "MRAA: No Data available.\n");
                           break;
                           break;
-        case MAA_ERROR_INVALID_PLATFORM:
-                          fprintf(stderr, "MAA: Platform not recognised.\n");
+        case MRAA_ERROR_INVALID_PLATFORM:
+                          fprintf(stderr, "MRAA: Platform not recognised.\n");
                           break;
                           break;
-        case MAA_ERROR_PLATFORM_NOT_INITIALISED:
-                          fprintf(stderr, "MAA: Platform not initialised.\n");
+        case MRAA_ERROR_PLATFORM_NOT_INITIALISED:
+                          fprintf(stderr, "MRAA: Platform not initialised.\n");
                           break;
                           break;
-        case MAA_ERROR_PLATFORM_ALREADY_INITIALISED:
-                          fprintf(stderr, "MAA: Platform already initialised.\n");
+        case MRAA_ERROR_PLATFORM_ALREADY_INITIALISED:
+                          fprintf(stderr, "MRAA: Platform already initialised.\n");
                           break;
                           break;
-        case MAA_ERROR_UNSPECIFIED:
-                          fprintf(stderr, "MAA: Unspecified Error.\n");
+        case MRAA_ERROR_UNSPECIFIED:
+                          fprintf(stderr, "MRAA: Unspecified Error.\n");
                           break;
                           break;
-        default:     fprintf(stderr, "MAA: Unrecognised error.\n");
+        default:     fprintf(stderr, "MRAA: Unrecognised error.\n");
                           break;
     }
 }
 
                           break;
     }
 }
 
-maa_boolean_t
-maa_pin_mode_test(int pin, maa_pinmodes_t mode)
+mraa_boolean_t
+mraa_pin_mode_test(int pin, mraa_pinmodes_t mode)
 {
     if (plat == NULL) {
 {
     if (plat == NULL) {
-        maa_init();
+        mraa_init();
         if (plat == NULL)
             return 0;
     }
         if (plat == NULL)
             return 0;
     }
@@ -324,31 +324,31 @@ maa_pin_mode_test(int pin, maa_pinmodes_t mode)
         return 0;
 
     switch(mode) {
         return 0;
 
     switch(mode) {
-        case MAA_PIN_VALID:
+        case MRAA_PIN_VALID:
             if (plat->pins[pin].capabilites.valid == 1)
                 return 1;
             break;
             if (plat->pins[pin].capabilites.valid == 1)
                 return 1;
             break;
-        case MAA_PIN_GPIO:
+        case MRAA_PIN_GPIO:
             if (plat->pins[pin].capabilites.gpio ==1)
                 return 1;
             break;
             if (plat->pins[pin].capabilites.gpio ==1)
                 return 1;
             break;
-        case MAA_PIN_PWM:
+        case MRAA_PIN_PWM:
             if (plat->pins[pin].capabilites.pwm ==1)
                 return 1;
             break;
             if (plat->pins[pin].capabilites.pwm ==1)
                 return 1;
             break;
-        case MAA_PIN_FAST_GPIO:
+        case MRAA_PIN_FAST_GPIO:
             if (plat->pins[pin].capabilites.fast_gpio ==1)
                 return 1;
             break;
             if (plat->pins[pin].capabilites.fast_gpio ==1)
                 return 1;
             break;
-        case MAA_PIN_SPI:
+        case MRAA_PIN_SPI:
             if (plat->pins[pin].capabilites.spi ==1)
                 return 1;
             break;
             if (plat->pins[pin].capabilites.spi ==1)
                 return 1;
             break;
-        case MAA_PIN_I2C:
+        case MRAA_PIN_I2C:
             if (plat->pins[pin].capabilites.i2c ==1)
                 return 1;
             break;
             if (plat->pins[pin].capabilites.i2c ==1)
                 return 1;
             break;
-        case MAA_PIN_AIO:
+        case MRAA_PIN_AIO:
             if (pin < plat->aio_count)
                 pin = pin + plat->gpio_count;
             if (plat->pins[pin].capabilites.aio ==1)
             if (pin < plat->aio_count)
                 pin = pin + plat->gpio_count;
             if (plat->pins[pin].capabilites.aio ==1)
@@ -359,8 +359,8 @@ maa_pin_mode_test(int pin, maa_pinmodes_t mode)
     return 0;
 }
 
     return 0;
 }
 
-maa_mmap_pin_t*
-maa_setup_mmap_gpio(int pin)
+mraa_mmap_pin_t*
+mraa_setup_mmap_gpio(int pin)
 {
     if (plat == NULL)
         return NULL;
 {
     if (plat == NULL)
         return NULL;
@@ -369,30 +369,30 @@ maa_setup_mmap_gpio(int pin)
         return NULL;
 
     if (plat->pins[pin].mmap.gpio.mux_total > 0)
         return NULL;
 
     if (plat->pins[pin].mmap.gpio.mux_total > 0)
-       if (maa_setup_mux_mapped(plat->pins[pin].mmap.gpio) != MAA_SUCCESS)
+       if (mraa_setup_mux_mapped(plat->pins[pin].mmap.gpio) != MRAA_SUCCESS)
             return NULL;
 
             return NULL;
 
-    if (maa_setup_mux_mapped(plat->pins[pin].mmap.gpio) != MAA_SUCCESS)
+    if (mraa_setup_mux_mapped(plat->pins[pin].mmap.gpio) != MRAA_SUCCESS)
             return NULL;
             return NULL;
-    maa_mmap_pin_t *ret = &(plat->pins[pin].mmap);
+    mraa_mmap_pin_t *ret = &(plat->pins[pin].mmap);
     return ret;
 }
 
     return ret;
 }
 
-maa_result_t
-maa_swap_complex_gpio(int pin, int out)
+mraa_result_t
+mraa_swap_complex_gpio(int pin, int out)
 {
     if (plat == NULL)
 {
     if (plat == NULL)
-        return MAA_ERROR_INVALID_PLATFORM;
+        return MRAA_ERROR_INVALID_PLATFORM;
 
     switch (platform_type) {
 
     switch (platform_type) {
-        case MAA_INTEL_GALILEO_GEN2:
+        case MRAA_INTEL_GALILEO_GEN2:
             if (plat->pins[pin].gpio.complex_cap.complex_pin != 1)
             if (plat->pins[pin].gpio.complex_cap.complex_pin != 1)
-                return MAA_SUCCESS;
+                return MRAA_SUCCESS;
             if (plat->pins[pin].gpio.complex_cap.output_en == 1) {
             if (plat->pins[pin].gpio.complex_cap.output_en == 1) {
-                maa_gpio_context output_e;
-                output_e = maa_gpio_init_raw(plat->pins[pin].gpio.output_enable);
-                if (maa_gpio_dir(output_e, MAA_GPIO_OUT) != MAA_SUCCESS)
-                    return MAA_ERROR_INVALID_RESOURCE;
+                mraa_gpio_context output_e;
+                output_e = mraa_gpio_init_raw(plat->pins[pin].gpio.output_enable);
+                if (mraa_gpio_dir(output_e, MRAA_GPIO_OUT) != MRAA_SUCCESS)
+                    return MRAA_ERROR_INVALID_RESOURCE;
                 int output_val;
                 if (plat->pins[pin].gpio.complex_cap.output_en_high == 1)
                     output_val = out;
                 int output_val;
                 if (plat->pins[pin].gpio.complex_cap.output_en_high == 1)
                     output_val = out;
@@ -401,21 +401,21 @@ maa_swap_complex_gpio(int pin, int out)
                         output_val = 0;
                     else
                         output_val = 1;
                         output_val = 0;
                     else
                         output_val = 1;
-                if (maa_gpio_write(output_e, output_val) != MAA_SUCCESS)
-                    return MAA_ERROR_INVALID_RESOURCE;
+                if (mraa_gpio_write(output_e, output_val) != MRAA_SUCCESS)
+                    return MRAA_ERROR_INVALID_RESOURCE;
             }
             //if (plat->pins[pin].gpio.complex_cap.pullup_en == 1) {
             }
             //if (plat->pins[pin].gpio.complex_cap.pullup_en == 1) {
-            //    maa_gpio_context pullup_e;
-            //    pullup_e = maa_gpio_init_raw(plat->pins[pin].gpio.pullup_enable);
-            //    if (maa_gpio_mode(pullup_e, MAA_GPIO_HIZ) != MAA_SUCCESS)
-            //        return MAA_ERROR_INVALID_RESOURCE;
+            //    mraa_gpio_context pullup_e;
+            //    pullup_e = mraa_gpio_init_raw(plat->pins[pin].gpio.pullup_enable);
+            //    if (mraa_gpio_mode(pullup_e, MRAA_GPIO_HIZ) != MRAA_SUCCESS)
+            //        return MRAA_ERROR_INVALID_RESOURCE;
             //}
             break;
             //}
             break;
-        default: return MAA_SUCCESS;
+        default: return MRAA_SUCCESS;
     }
 }
 
     }
 }
 
-maa_platform_t maa_get_platform_type()
+mraa_platform_t mraa_get_platform_type()
 {
     return platform_type;
 }
 {
     return platform_type;
 }
similarity index 69%
rename from src/maa.i
rename to src/mraa.i
index 3ab5126..5b56d66 100644 (file)
--- a/src/maa.i
 %}
 
 %init %{
 %}
 
 %init %{
-    //Adding maa_init() to the module initialisation process
-    maa_init();
+    //Adding mraa_init() to the module initialisation process
+    mraa_init();
 %}
 
 %}
 
-%rename(getVersion) maa_get_version;
+%rename(getVersion) mraa_get_version;
 
 
-%rename(setPriority) maa_set_priority;
+%rename(setPriority) mraa_set_priority;
 
 
-%rename(printError) maa_result_print(maa_result_t error);
+%rename(printError) mraa_result_print(mraa_result_t error);
 
 
-%rename(getPlatform) maa_get_platform_type;
+%rename(getPlatform) mraa_get_platform_type;
 
 %typemap(in) uint8_t = char;
 
 
 %typemap(in) uint8_t = char;
 
similarity index 75%
rename from src/maa.pc.cmake
rename to src/mraa.pc.cmake
index 82e8fb6..fb5c0b1 100644 (file)
@@ -3,9 +3,9 @@ exec_prefix=${prefix}
 libdir=${exec_prefix}/lib@LIB_SUFFIX@
 includedir=${prefix}/include
 
 libdir=${exec_prefix}/lib@LIB_SUFFIX@
 includedir=${prefix}/include
 
-Name: maa
+Name: mraa
 Description: Low Level Skeleton Library for Communication
 Description: Low Level Skeleton Library for Communication
-Version: @maa_VERSION_STRING@
+Version: @mraa_VERSION_STRING@
 
 
-Libs: -L${libdir} -lmaa
+Libs: -L${libdir} -lmraa
 Cflags: -I${includedir}
 Cflags: -I${includedir}
index 6b9067f..b590b8b 100644 (file)
@@ -27,7 +27,7 @@
 #include <unistd.h>
 
 #include "pwm.h"
 #include <unistd.h>
 
 #include "pwm.h"
-#include "maa_internal.h"
+#include "mraa_internal.h"
 
 #define MAX_SIZE 64
 #define SYSFS_PWM "/sys/class/pwm"
 
 #define MAX_SIZE 64
 #define SYSFS_PWM "/sys/class/pwm"
@@ -40,12 +40,12 @@ struct _pwm {
     int pin; /**< the pin number, as known to the os. */
     int chipid; /**< the chip id, which the pwm resides */
     int duty_fp; /**< File pointer to duty file */
     int pin; /**< the pin number, as known to the os. */
     int chipid; /**< the chip id, which the pwm resides */
     int duty_fp; /**< File pointer to duty file */
-    maa_boolean_t owner; /**< Owner of pwm context*/
+    mraa_boolean_t owner; /**< Owner of pwm context*/
     /*@}*/
 };
 
 static int
     /*@}*/
 };
 
 static int
-maa_pwm_setup_duty_fp(maa_pwm_context dev)
+mraa_pwm_setup_duty_fp(mraa_pwm_context dev)
 {
     char bu[MAX_SIZE];
     snprintf(bu,MAX_SIZE, "/sys/class/pwm/pwmchip%d/pwm%d/duty_cycle", dev->chipid, dev->pin);
 {
     char bu[MAX_SIZE];
     snprintf(bu,MAX_SIZE, "/sys/class/pwm/pwmchip%d/pwm%d/duty_cycle", dev->chipid, dev->pin);
@@ -57,8 +57,8 @@ maa_pwm_setup_duty_fp(maa_pwm_context dev)
     return 0;
 }
 
     return 0;
 }
 
-static maa_result_t
-maa_pwm_write_period(maa_pwm_context dev, int period)
+static mraa_result_t
+mraa_pwm_write_period(mraa_pwm_context dev, int period)
 {
     char bu[MAX_SIZE];
     snprintf(bu,MAX_SIZE ,"/sys/class/pwm/pwmchip%d/pwm%d/period", dev->chipid, dev->pin);
 {
     char bu[MAX_SIZE];
     snprintf(bu,MAX_SIZE ,"/sys/class/pwm/pwmchip%d/pwm%d/period", dev->chipid, dev->pin);
@@ -66,34 +66,34 @@ maa_pwm_write_period(maa_pwm_context dev, int period)
     int period_f = open(bu, O_RDWR);
     if (period_f == -1) {
         fprintf(stderr, "Failed to open period for writing!\n");
     int period_f = open(bu, O_RDWR);
     if (period_f == -1) {
         fprintf(stderr, "Failed to open period for writing!\n");
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
     char out[MAX_SIZE];
     int length = snprintf(out, MAX_SIZE, "%d", period);
     if (write(period_f, out, length*sizeof(char)) == -1) {
         close(period_f);
     }
     char out[MAX_SIZE];
     int length = snprintf(out, MAX_SIZE, "%d", period);
     if (write(period_f, out, length*sizeof(char)) == -1) {
         close(period_f);
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     close(period_f);
     }
 
     close(period_f);
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-static maa_result_t
-maa_pwm_write_duty(maa_pwm_context dev, int duty)
+static mraa_result_t
+mraa_pwm_write_duty(mraa_pwm_context dev, int duty)
 {
     if (dev->duty_fp == -1) {
 {
     if (dev->duty_fp == -1) {
-        maa_pwm_setup_duty_fp(dev);
+        mraa_pwm_setup_duty_fp(dev);
     }
     char bu[64];
     int length = sprintf(bu, "%d", duty);
     if (write(dev->duty_fp, bu, length * sizeof(char)) == -1)
     }
     char bu[64];
     int length = sprintf(bu, "%d", duty);
     if (write(dev->duty_fp, bu, length * sizeof(char)) == -1)
-        return MAA_ERROR_INVALID_RESOURCE;
-    return MAA_SUCCESS;
+        return MRAA_ERROR_INVALID_RESOURCE;
+    return MRAA_SUCCESS;
 }
 
 static int
 }
 
 static int
-maa_pwm_get_period(maa_pwm_context dev)
+mraa_pwm_get_period(mraa_pwm_context dev)
 {
     char bu[MAX_SIZE];
     char output[MAX_SIZE];
 {
     char bu[MAX_SIZE];
     char output[MAX_SIZE];
@@ -115,10 +115,10 @@ maa_pwm_get_period(maa_pwm_context dev)
 }
 
 static int
 }
 
 static int
-maa_pwm_get_duty(maa_pwm_context dev)
+mraa_pwm_get_duty(mraa_pwm_context dev)
 {
     if (dev->duty_fp == -1) {
 {
     if (dev->duty_fp == -1) {
-        maa_pwm_setup_duty_fp(dev);
+        mraa_pwm_setup_duty_fp(dev);
     } else {
         lseek(dev->duty_fp, 0, SEEK_SET);
     }
     } else {
         lseek(dev->duty_fp, 0, SEEK_SET);
     }
@@ -131,21 +131,21 @@ maa_pwm_get_duty(maa_pwm_context dev)
     return ret;
 }
 
     return ret;
 }
 
-maa_pwm_context
-maa_pwm_init(int pin) {
-    maa_pin_t* pinm = maa_setup_pwm(pin);
+mraa_pwm_context
+mraa_pwm_init(int pin) {
+    mraa_pin_t* pinm = mraa_setup_pwm(pin);
     if (pinm == NULL)
         return NULL;
     int chip = pinm->parent_id;
     int pinn = pinm->pinmap;
     free(pinm);
     if (pinm == NULL)
         return NULL;
     int chip = pinm->parent_id;
     int pinn = pinm->pinmap;
     free(pinm);
-    return maa_pwm_init_raw(chip,pinn);
+    return mraa_pwm_init_raw(chip,pinn);
 }
 
 }
 
-maa_pwm_context
-maa_pwm_init_raw(int chipin, int pin)
+mraa_pwm_context
+mraa_pwm_init_raw(int chipin, int pin)
 {
 {
-    maa_pwm_context dev = (maa_pwm_context) malloc(sizeof(struct _pwm));
+    mraa_pwm_context dev = (mraa_pwm_context) malloc(sizeof(struct _pwm));
     if (dev == NULL)
         return NULL;
     dev->duty_fp = -1;
     if (dev == NULL)
         return NULL;
     dev->duty_fp = -1;
@@ -178,61 +178,61 @@ maa_pwm_init_raw(int chipin, int pin)
         dev->owner = 1;
         close(export_f);
     }
         dev->owner = 1;
         close(export_f);
     }
-    maa_pwm_setup_duty_fp(dev);
+    mraa_pwm_setup_duty_fp(dev);
     return dev;
 }
 
     return dev;
 }
 
-maa_result_t
-maa_pwm_write(maa_pwm_context dev, float percentage)
+mraa_result_t
+mraa_pwm_write(mraa_pwm_context dev, float percentage)
 {
 {
-    return maa_pwm_write_duty(dev, percentage * maa_pwm_get_period(dev));
+    return mraa_pwm_write_duty(dev, percentage * mraa_pwm_get_period(dev));
 }
 
 float
 }
 
 float
-maa_pwm_read(maa_pwm_context dev)
+mraa_pwm_read(mraa_pwm_context dev)
 {
 {
-    float output = maa_pwm_get_duty(dev) / (float) maa_pwm_get_period(dev);
+    float output = mraa_pwm_get_duty(dev) / (float) mraa_pwm_get_period(dev);
     return output;
 }
 
     return output;
 }
 
-maa_result_t
-maa_pwm_period(maa_pwm_context dev, float seconds)
+mraa_result_t
+mraa_pwm_period(mraa_pwm_context dev, float seconds)
 {
 {
-    return maa_pwm_period_ms(dev, seconds*1000);
+    return mraa_pwm_period_ms(dev, seconds*1000);
 }
 
 }
 
-maa_result_t
-maa_pwm_period_ms(maa_pwm_context dev, int ms)
+mraa_result_t
+mraa_pwm_period_ms(mraa_pwm_context dev, int ms)
 {
 {
-    return maa_pwm_period_us(dev, ms*1000);
+    return mraa_pwm_period_us(dev, ms*1000);
 }
 
 }
 
-maa_result_t
-maa_pwm_period_us(maa_pwm_context dev, int us)
+mraa_result_t
+mraa_pwm_period_us(mraa_pwm_context dev, int us)
 {
 {
-    return maa_pwm_write_period(dev, us*1000);
+    return mraa_pwm_write_period(dev, us*1000);
 }
 
 }
 
-maa_result_t
-maa_pwm_pulsewidth(maa_pwm_context dev, float seconds)
+mraa_result_t
+mraa_pwm_pulsewidth(mraa_pwm_context dev, float seconds)
 {
 {
-    return maa_pwm_pulsewidth_ms(dev, seconds*1000);
+    return mraa_pwm_pulsewidth_ms(dev, seconds*1000);
 }
 
 }
 
-maa_result_t
-maa_pwm_pulsewidth_ms(maa_pwm_context dev, int ms)
+mraa_result_t
+mraa_pwm_pulsewidth_ms(mraa_pwm_context dev, int ms)
 {
 {
-    return maa_pwm_pulsewidth_us(dev, ms*1000);
+    return mraa_pwm_pulsewidth_us(dev, ms*1000);
 }
 
 }
 
-maa_result_t
-maa_pwm_pulsewidth_us(maa_pwm_context dev, int us)
+mraa_result_t
+mraa_pwm_pulsewidth_us(mraa_pwm_context dev, int us)
 {
 {
-    return maa_pwm_write_duty(dev, us*1000);
+    return mraa_pwm_write_duty(dev, us*1000);
 }
 
 }
 
-maa_result_t
-maa_pwm_enable(maa_pwm_context dev, int enable)
+mraa_result_t
+mraa_pwm_enable(mraa_pwm_context dev, int enable)
 {
     int status;
     if (enable != 0) {
 {
     int status;
     if (enable != 0) {
@@ -247,21 +247,21 @@ maa_pwm_enable(maa_pwm_context dev, int enable)
 
     if (enable_f == -1) {
         fprintf(stderr, "Failed to open enable for writing!\n");
 
     if (enable_f == -1) {
         fprintf(stderr, "Failed to open enable for writing!\n");
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
     char out[2];
     int size = snprintf(out, sizeof(out), "%d", enable);
     if (write(enable_f, out, size * sizeof(char)) == -1) {
         fprintf(stderr, "Failed to write to enable!\n");
         close(enable_f);
     }
     char out[2];
     int size = snprintf(out, sizeof(out), "%d", enable);
     if (write(enable_f, out, size * sizeof(char)) == -1) {
         fprintf(stderr, "Failed to write to enable!\n");
         close(enable_f);
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
     close(enable_f);
     }
     close(enable_f);
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_pwm_unexport_force(maa_pwm_context dev)
+mraa_result_t
+mraa_pwm_unexport_force(mraa_pwm_context dev)
 {
     char filepath[MAX_SIZE];
     snprintf(filepath, MAX_SIZE, "/sys/class/pwm/pwmchip%d/unexport", dev->chipid);
 {
     char filepath[MAX_SIZE];
     snprintf(filepath, MAX_SIZE, "/sys/class/pwm/pwmchip%d/unexport", dev->chipid);
@@ -269,7 +269,7 @@ maa_pwm_unexport_force(maa_pwm_context dev)
     int unexport_f = open(filepath, O_WRONLY);
     if (unexport_f == -1) {
         fprintf(stderr, "Failed to open unexport for writing!\n");
     int unexport_f = open(filepath, O_WRONLY);
     if (unexport_f == -1) {
         fprintf(stderr, "Failed to open unexport for writing!\n");
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     char out[MAX_SIZE];
     }
 
     char out[MAX_SIZE];
@@ -277,36 +277,36 @@ maa_pwm_unexport_force(maa_pwm_context dev)
     if (write(unexport_f, out, size*sizeof(char)) == -1) {
         fprintf(stderr, "Failed to write to unexport!\n");
         close(unexport_f);
     if (write(unexport_f, out, size*sizeof(char)) == -1) {
         fprintf(stderr, "Failed to write to unexport!\n");
         close(unexport_f);
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
 
     close(unexport_f);
     }
 
     close(unexport_f);
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_pwm_unexport(maa_pwm_context dev)
+mraa_result_t
+mraa_pwm_unexport(mraa_pwm_context dev)
 {
 {
-    maa_pwm_enable(dev, 0);
+    mraa_pwm_enable(dev, 0);
     if (dev->owner) {
     if (dev->owner) {
-        return maa_pwm_unexport_force(dev);
+        return mraa_pwm_unexport_force(dev);
     }
     }
-    return MAA_ERROR_INVALID_RESOURCE;
+    return MRAA_ERROR_INVALID_RESOURCE;
 }
 
 }
 
-maa_result_t
-maa_pwm_close(maa_pwm_context dev)
+mraa_result_t
+mraa_pwm_close(mraa_pwm_context dev)
 {
 {
-    maa_pwm_unexport(dev);
+    mraa_pwm_unexport(dev);
     free(dev);
     free(dev);
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_pwm_owner(maa_pwm_context dev, maa_boolean_t owner_new)
+mraa_result_t
+mraa_pwm_owner(mraa_pwm_context dev, mraa_boolean_t owner_new)
 {
     if (dev == NULL)
 {
     if (dev == NULL)
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     dev->owner = owner_new;
     dev->owner = owner_new;
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 }
index 78483c9..98b1dd1 100644 (file)
@@ -6,21 +6,21 @@ include_directories(
   ${PYTHON_INCLUDE_DIRS}
 )
 
   ${PYTHON_INCLUDE_DIRS}
 )
 
-set_source_files_properties (pymaa.i PROPERTIES CPLUSPLUS ON)
-set_source_files_properties (pymaa.i PROPERTIES SWIG_FLAGS "-I${CMAKE_BINARY_DIR}/src")
-swig_add_module (pymaa python pymaa.i ${maa_LIB_SRCS})
-swig_link_libraries (pymaa ${PYTHON_LIBRARIES})
+set_source_files_properties (pymraa.i PROPERTIES CPLUSPLUS ON)
+set_source_files_properties (pymraa.i PROPERTIES SWIG_FLAGS "-I${CMAKE_BINARY_DIR}/src")
+swig_add_module (pymraa python pymraa.i ${mraa_LIB_SRCS})
+swig_link_libraries (pymraa ${PYTHON_LIBRARIES})
 
 set (CMAKE_C_FLAGS -DSWIGPYTHON=${SWIG_FOUND})
 
 if (DOXYGEN_FOUND)
   foreach (_file ${DOCCLASSES})
 
 set (CMAKE_C_FLAGS -DSWIGPYTHON=${SWIG_FOUND})
 
 if (DOXYGEN_FOUND)
   foreach (_file ${DOCCLASSES})
-    add_dependencies (${SWIG_MODULE_pymaa_REAL_NAME} ${_file}class_doc_i)
+    add_dependencies (${SWIG_MODULE_pymraa_REAL_NAME} ${_file}class_doc_i)
   endforeach ()
   endforeach ()
-  add_dependencies (${SWIG_MODULE_pymaa_REAL_NAME} commondoc_i)
+  add_dependencies (${SWIG_MODULE_pymraa_REAL_NAME} commondoc_i)
 
   add_custom_target (pydoc
 
   add_custom_target (pydoc
-    pydoc -w ${CMAKE_CURRENT_BINARY_DIR}/pymaa.py ${CMAKE_CURRENT_BINARY_DIR}/
+    pydoc -w ${CMAKE_CURRENT_BINARY_DIR}/pymraa.py ${CMAKE_CURRENT_BINARY_DIR}/
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     COMMENT "Generating API documentation with pydoc" VERBATIM
   )
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     COMMENT "Generating API documentation with pydoc" VERBATIM
   )
@@ -31,8 +31,8 @@ string (REPLACE "." ";" PYTHON_VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
 list (GET PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)
 list (GET PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
 
 list (GET PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)
 list (GET PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
 
-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/_pymaa.so
-         ${CMAKE_CURRENT_BINARY_DIR}/pymaa.py
+install (FILES ${CMAKE_CURRENT_BINARY_DIR}/_pymraa.so
+         ${CMAKE_CURRENT_BINARY_DIR}/pymraa.py
          DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/)
 
 add_subdirectory (docs)
          DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/)
 
 add_subdirectory (docs)
index d1659d3..a833fbb 100644 (file)
@@ -36,6 +36,6 @@ if (DOXYGEN_FOUND)
       COMMENT "Building HTML documentation with Sphinx"
     )
 
       COMMENT "Building HTML documentation with Sphinx"
     )
 
-    add_dependencies (sphinx ${SWIG_MODULE_pymaa_REAL_NAME})
+    add_dependencies (sphinx ${SWIG_MODULE_pymraa_REAL_NAME})
   endif ()
 endif ()
   endif ()
 endif ()
index b3038fa..b95c88a 100644 (file)
@@ -47,7 +47,7 @@ source_suffix = '.rst'
 master_doc = 'index'
 
 # General information about the project.
 master_doc = 'index'
 
 # General information about the project.
-project = 'pymaa'
+project = 'pymraa'
 copyright = '2014, Intel Corporation'
 
 # The version info for the project you're documenting, acts as replacement for
 copyright = '2014, Intel Corporation'
 
 # The version info for the project you're documenting, acts as replacement for
@@ -55,7 +55,7 @@ copyright = '2014, Intel Corporation'
 # built documents.
 #
 # The short X.Y version.
 # built documents.
 #
 # The short X.Y version.
-version = '@maa_VERSION_STRING@'
+version = '@mraa_VERSION_STRING@'
 # The full version, including alpha/beta/rc tags.
 release = '@VERSION@'
 
 # The full version, including alpha/beta/rc tags.
 release = '@VERSION@'
 
@@ -180,7 +180,7 @@ html_static_path = ['_static']
 #html_file_suffix = None
 
 # Output file base name for HTML help builder.
 #html_file_suffix = None
 
 # Output file base name for HTML help builder.
-htmlhelp_basename = 'pymaadoc'
+htmlhelp_basename = 'pymraadoc'
 
 
 # -- Options for LaTeX output ---------------------------------------------
 
 
 # -- Options for LaTeX output ---------------------------------------------
index ab25c1d..da74d0e 100644 (file)
@@ -1,16 +1,16 @@
 #######
 Example
 #######
 #######
 Example
 #######
-Here are some examples of how to use pymaa, common convention is to import pymaa as maa to keep it short but feel free to import it globally!
+Here are some examples of how to use pymraa, common convention is to import pymraa as mraa to keep it short but feel free to import it globally!
 
 Hello GPIO
 ==========
 
 
 Hello GPIO
 ==========
 
-Here is the simplest Gpio program in pymaa.
+Here is the simplest Gpio program in pymraa.
 
 .. literalinclude:: ../../../examples/python/hello_gpio.py
 
 .. literalinclude:: ../../../examples/python/hello_gpio.py
-  :prepend: import pymaa
-  :start-after: import pymaa
+  :prepend: import pymraa
+  :start-after: import pymraa
 
 GPIO Interupt (isr)
 ===================
 
 GPIO Interupt (isr)
 ===================
@@ -20,6 +20,6 @@ The GPIO module allows you to set an interupt on a GPIO. This interupt is contro
 **Note:** Galileo Gen1 only supports EDGE_BOTH
 
 .. literalinclude:: ../../../examples/python/hello_isr.py
 **Note:** Galileo Gen1 only supports EDGE_BOTH
 
 .. literalinclude:: ../../../examples/python/hello_isr.py
-  :prepend: import pymaa as maa
-  :start-after: import pymaa as maa
+  :prepend: import pymraa as mraa
+  :start-after: import pymraa as mraa
 
 
index 7e0f2ea..9caf879 100644 (file)
@@ -3,7 +3,7 @@
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
-Welcome to Pymaa's documentation!
+Welcome to Pymraa's documentation!
 =============================
 
 Contents:
 =============================
 
 Contents:
@@ -11,7 +11,7 @@ Contents:
 .. toctree::
    :maxdepth: 2
 
 .. toctree::
    :maxdepth: 2
 
-   pymaa
+   pymraa
    example
 
 
    example
 
 
similarity index 65%
rename from src/python/docs/pymaa.rst
rename to src/python/docs/pymraa.rst
index 6f919b6..1b6c011 100644 (file)
@@ -1,7 +1,7 @@
-pymaa module
+pymraa module
 ============
 
 ============
 
-.. automodule:: pymaa
+.. automodule:: pymraa
     :members:
     :undoc-members:
     :show-inheritance:
     :members:
     :undoc-members:
     :show-inheritance:
diff --git a/src/python/pymaa.i b/src/python/pymaa.i
deleted file mode 100644 (file)
index 0c66b30..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-%module(docstring="Python interface to libmaa") pymaa
-
-%feature("autodoc", "3");
-
-%include ../maa.i
-
diff --git a/src/python/pymraa.i b/src/python/pymraa.i
new file mode 100644 (file)
index 0000000..98bbc24
--- /dev/null
@@ -0,0 +1,6 @@
+%module(docstring="Python interface to libmraa") pymraa
+
+%feature("autodoc", "3");
+
+%include ../mraa.i
+
index 44ea4e7..a32ad1c 100644 (file)
@@ -31,7 +31,7 @@
 #include <unistd.h>
 
 #include "spi.h"
 #include <unistd.h>
 
 #include "spi.h"
-#include "maa_internal.h"
+#include "mraa_internal.h"
 
 #define MAX_SIZE 64
 #define SPI_MAX_LENGTH 4096
 
 #define MAX_SIZE 64
 #define SPI_MAX_LENGTH 4096
@@ -44,20 +44,20 @@ struct _spi {
     int devfd; /**< File descriptor to SPI Device */
     int mode; /**< Spi mode see spidev.h */
     int clock; /**< clock to run transactions at */
     int devfd; /**< File descriptor to SPI Device */
     int mode; /**< Spi mode see spidev.h */
     int clock; /**< clock to run transactions at */
-    maa_boolean_t lsb; /**< least significant bit mode */
+    mraa_boolean_t lsb; /**< least significant bit mode */
     unsigned int bpw; /**< Bits per word */
     /*@}*/
 };
 
     unsigned int bpw; /**< Bits per word */
     /*@}*/
 };
 
-maa_spi_context
-maa_spi_init(int bus)
+mraa_spi_context
+mraa_spi_init(int bus)
 {
 {
-    maa_spi_bus_t *spi = maa_setup_spi(bus);
+    mraa_spi_bus_t *spi = mraa_setup_spi(bus);
     if(bus < 0) {
         fprintf(stderr, "Failed. SPI platform Error\n");
         return NULL;
     }
     if(bus < 0) {
         fprintf(stderr, "Failed. SPI platform Error\n");
         return NULL;
     }
-    maa_spi_context dev = (maa_spi_context) malloc(sizeof(struct _spi));
+    mraa_spi_context dev = (mraa_spi_context) malloc(sizeof(struct _spi));
     memset(dev, 0, sizeof(struct _spi));
 
     char path[MAX_SIZE];
     memset(dev, 0, sizeof(struct _spi));
 
     char path[MAX_SIZE];
@@ -77,22 +77,22 @@ maa_spi_init(int bus)
     return dev;
 }
 
     return dev;
 }
 
-maa_result_t
-maa_spi_mode(maa_spi_context dev, unsigned short mode)
+mraa_result_t
+mraa_spi_mode(mraa_spi_context dev, unsigned short mode)
 {
     dev->mode = mode;
 {
     dev->mode = mode;
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_spi_frequency(maa_spi_context dev, int hz)
+mraa_result_t
+mraa_spi_frequency(mraa_spi_context dev, int hz)
 {
     dev->clock = hz;
 {
     dev->clock = hz;
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_spi_lsbmode(maa_spi_context dev, maa_boolean_t lsb)
+mraa_result_t
+mraa_spi_lsbmode(mraa_spi_context dev, mraa_boolean_t lsb)
 {
     uint8_t lsb_mode = 0;
     if (lsb == 1) {
 {
     uint8_t lsb_mode = 0;
     if (lsb == 1) {
@@ -100,21 +100,21 @@ maa_spi_lsbmode(maa_spi_context dev, maa_boolean_t lsb)
     }
     if (ioctl (dev->devfd, SPI_IOC_WR_LSB_FIRST, &lsb_mode) < 0) {
         fprintf(stderr, "Failed to set bit order\n");
     }
     if (ioctl (dev->devfd, SPI_IOC_WR_LSB_FIRST, &lsb_mode) < 0) {
         fprintf(stderr, "Failed to set bit order\n");
-        return MAA_ERROR_INVALID_RESOURCE;
+        return MRAA_ERROR_INVALID_RESOURCE;
     }
     dev->lsb = lsb;
     }
     dev->lsb = lsb;
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 }
 
-maa_result_t
-maa_spi_bit_per_word(maa_spi_context dev, unsigned int bits)
+mraa_result_t
+mraa_spi_bit_per_word(mraa_spi_context dev, unsigned int bits)
 {
     dev->bpw = bits;
 {
     dev->bpw = bits;
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 
 uint8_t
 }
 
 uint8_t
-maa_spi_write(maa_spi_context dev, uint8_t data)
+mraa_spi_write(mraa_spi_context dev, uint8_t data)
 {
     struct spi_ioc_transfer msg;
     memset(&msg, 0, sizeof(msg));
 {
     struct spi_ioc_transfer msg;
     memset(&msg, 0, sizeof(msg));
@@ -136,7 +136,7 @@ maa_spi_write(maa_spi_context dev, uint8_t data)
 }
 
 uint8_t*
 }
 
 uint8_t*
-maa_spi_write_buf(maa_spi_context dev, uint8_t* data, int length)
+mraa_spi_write_buf(mraa_spi_context dev, uint8_t* data, int length)
 {
     struct spi_ioc_transfer msg;
     memset(&msg, 0, sizeof(msg));
 {
     struct spi_ioc_transfer msg;
     memset(&msg, 0, sizeof(msg));
@@ -156,9 +156,9 @@ maa_spi_write_buf(maa_spi_context dev, uint8_t* data, int length)
     return recv;
 }
 
     return recv;
 }
 
-maa_result_t
-maa_spi_stop(maa_spi_context dev)
+mraa_result_t
+mraa_spi_stop(mraa_spi_context dev)
 {
     close(dev->devfd);
 {
     close(dev->devfd);
-    return MAA_SUCCESS;
+    return MRAA_SUCCESS;
 }
 }
index ebe9ba3..8b079db 100644 (file)
@@ -8,8 +8,8 @@ include_directories(
   ${PROJECT_SOURCE_DIR}/include
 )
 
   ${PROJECT_SOURCE_DIR}/include
 )
 
-add_executable(${PROJECT_TEST_NAME} "maa_test.cxx")
+add_executable(${PROJECT_TEST_NAME} "mraa_test.cxx")
 
 
-target_link_libraries(${PROJECT_TEST_NAME} ${PROJECT_NAME_STR} ${GTEST_BOTH_LIBRARIES} maa pthread)
+target_link_libraries(${PROJECT_TEST_NAME} ${PROJECT_NAME_STR} ${GTEST_BOTH_LIBRARIES} mraa pthread)
 
 add_test(Basic ${PROJECT_TEST_NAME})
 
 add_test(Basic ${PROJECT_TEST_NAME})
similarity index 60%
rename from tests/maa_test.cxx
rename to tests/mraa_test.cxx
index f610389..ab25202 100644 (file)
@@ -1,12 +1,12 @@
-#include <maa.h>
+#include <mraa.h>
 #include "gtest/gtest.h"
 #include "version.h"
 
 /* Careful, this test will only attempt to check the returned version is valid,
  * it doesn't try to check the version is a release one.
  */
 #include "gtest/gtest.h"
 #include "version.h"
 
 /* Careful, this test will only attempt to check the returned version is valid,
  * it doesn't try to check the version is a release one.
  */
-TEST (basic, maa_get_version) {
+TEST (basic, mraa_get_version) {
     char bar[64];
     char bar[64];
-    strcpy(bar, maa_get_version());
-    ASSERT_STREQ(maa_get_version(), gVERSION);
+    strcpy(bar, mraa_get_version());
+    ASSERT_STREQ(mraa_get_version(), gVERSION);
 }
 }