BMI160 Initial

Dependents:   MAX32630HSP3_IMU_HelloWorld MAX32630HSP3_IMU_HelloWorld MAX32630HSP3_Pitch_Charles Maxim_Squeeks

Files at this revision

API Documentation at this revision

Comitter:
j3
Date:
Tue Dec 20 01:27:13 2016 +0000
Parent:
9:ca6b5fecdd63
Child:
11:24602ff07e9f
Commit message:
Added get sensor time fx

Changed in this revision

bmi160.cpp Show annotated file Show diff for this revision Revisions of this file
bmi160.h Show annotated file Show diff for this revision Revisions of this file
--- a/bmi160.cpp	Tue Dec 20 01:08:33 2016 +0000
+++ b/bmi160.cpp	Tue Dec 20 01:27:13 2016 +0000
@@ -192,3 +192,19 @@
     
     return rtnVal;
 }
+
+
+//***************************************************************************** 
+int32_t BMI160::getSensorTime(float *data)
+{
+    uint8_t localData[3];
+    int32_t rtnVal = readBlock(SENSORTIME_0, SENSORTIME_2, localData);
+    
+    if(rtnVal == RTN_NO_ERROR)
+    {
+        *data = (((localData[2] << 16) | (localData[1] << 8) | localData[0]) * 39e-6);
+    }
+    
+    return rtnVal;
+}
+
--- a/bmi160.h	Tue Dec 20 01:08:33 2016 +0000
+++ b/bmi160.h	Tue Dec 20 01:27:13 2016 +0000
@@ -451,6 +451,20 @@
     ///
     ///@returns 0 on success, non 0 on failure
     int32_t getAccXYZ(SensorData &data, AccConfig accConfig);  
+    
+    
+    ///@brief Get sensor time.\n
+    ///
+    ///On Entry:
+    ///@param[in] data - pointer to float for holding data 
+    ///
+    ///On Exit:
+    ///@param[out] data - time in seconds, as float
+    ///
+    ///@returns returns 0 on success, non 0 on failure
+    int32_t getSensorTime(float *data);
+
+
 };