Library for NXP's MMA8653

Revision:
1:e8b14e0a4584
Parent:
0:c101a5ec5ef2
diff -r c101a5ec5ef2 -r e8b14e0a4584 MMA8653.h
--- a/MMA8653.h	Thu Aug 30 04:52:39 2018 +0000
+++ b/MMA8653.h	Fri Aug 31 08:21:23 2018 +0000
@@ -59,13 +59,25 @@
         PM4G,
         PM8G
     };
-    
+
+    // Data rate selection in register 0x02A[5-3]
+    enum DR {
+        DR800HZ = 0,
+        DR400HZ,
+        DR200HZ,
+        DR100HZ,
+        DR50HZ,
+        DR12_5HZ,
+        DR6_25HZ,
+        DR1_56HZ
+    };
+
     // Fast-read mode in register 0x02A[1]
     enum F_READ {
         Normal = 0,
         FastRead
     };
-    
+
     /**
     * Create a MMA8653 object
     *
@@ -73,8 +85,8 @@
     * @param dr dynamic range setting
     * @param fr fast read setting
     */
-    MMA8653(I2C &i2c, FS fs = PM2G, F_READ fr = Normal);
-    
+    MMA8653(I2C &i2c, FS fs = PM2G, DR dr= DR800HZ, F_READ fr = Normal);
+
     /**
      * Read 3-axis acceleration in floating point values (unit: G)
      *
@@ -88,7 +100,7 @@
      * @param *val array where acceleration data will be stored
      */
     void ReadXYZ_s16(short *val);
-    
+
     /**
      * Read 3-axis acceleration in signed 8-bit values (fast read should be on)
      *