Republished Library, to be refined for use with the SparkFun 9DOF in HARP project.

Dependents:   vmConfort_v6

Fork of ADXL345 by Tyler Weaver

Revision:
4:8046894b947e
Parent:
3:7b83694c7292
Child:
5:122a504fcfa3
--- a/ADXL345.h	Thu Sep 13 11:43:11 2012 +0000
+++ b/ADXL345.h	Mon Sep 17 10:39:19 2012 +0000
@@ -121,6 +121,12 @@
 
 public:
 
+    static const char RANGE_BITS = 0x3;
+    static const char RANGE_2G = 0x0;
+    static const char RANGE_4G = 0x1;
+    static const char RANGE_8G = 0x2;
+    static const char RANGE_16G = 0x3;
+
     /**
      * Constructor.
      *
@@ -184,8 +190,16 @@
      * @param settings The control byte to write to the DATA_FORMAT register.
      */
     int setDataFormatControl(char settings);
+
+    /**
+     * Set the data format settings with only specified bits.
+     *
+     * @param settings The control byte to write to the DATA_FORMAT register.
+     * @param mask The mask bits that 
+     */
+    int setDataFormatControl(char settings, char mask, char *prev = NULL);
   
-       /**
+    /**
      * Set the data rate.
      *
      * @param rate The rate code (see #defines or datasheet).
@@ -535,9 +549,7 @@
         - address of the register to write to.
         - the value of the data to store
      */
-  
-   
-   int SingleByteWrite(char address, char data);
+    int SingleByteWrite(char address, char data);
 
     /**
      * Read several consecutive bytes on the device and store them in a given location.