edits to standard MMA8451Q lib

Dependents:   KL05_accel-test

Fork of MMA8451Q by Emilio Monti

Files at this revision

API Documentation at this revision

Comitter:
angusg
Date:
Thu Nov 19 02:10:35 2015 +0000
Parent:
4:c4d879a39775
Child:
6:aca483d0fa8d
Commit message:
make read reg public

Changed in this revision

MMA8451Q.cpp Show annotated file Show diff for this revision Revisions of this file
MMA8451Q.h Show annotated file Show diff for this revision Revisions of this file
--- a/MMA8451Q.cpp	Fri Oct 12 11:35:07 2012 +0000
+++ b/MMA8451Q.cpp	Thu Nov 19 02:10:35 2015 +0000
@@ -18,7 +18,7 @@
 
 #include "MMA8451Q.h"
 
-#define REG_WHO_AM_I      0x0D
+#define REG_WHO_AM_I      0x0D //13
 #define REG_CTRL_REG_1    0x2A
 #define REG_OUT_X_MSB     0x01
 #define REG_OUT_Y_MSB     0x03
--- a/MMA8451Q.h	Fri Oct 12 11:35:07 2012 +0000
+++ b/MMA8451Q.h	Thu Nov 19 02:10:35 2015 +0000
@@ -97,12 +97,13 @@
    * @param res array where acceleration data will be stored
    */
   void getAccAllAxis(float * res);
+  
+  void readRegs(int addr, uint8_t * data, int len);
+  void writeRegs(uint8_t * data, int len);
 
 private:
   I2C m_i2c;
-  int m_addr;
-  void readRegs(int addr, uint8_t * data, int len);
-  void writeRegs(uint8_t * data, int len);
+  int m_addr;  
   int16_t getAccAxis(uint8_t addr);
 
 };