First Commit as a new library
Dependents: Host_Software_MAX32664GWEB_HR_wrist Host_Software_MAX32664GWEC_SpO2_HR Host_Software_MAX32664GWEB_HR_EXTENDED Host_Software_MAX32664GWEC_SpO2_HR-_EXTE ... more
Revision 10:9e219f2f1fb3, committed 2016-12-20
- 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);
+
+
};