Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Rocket MAX32630FTHR_JOYSTICK MAX32630FTHR_IMU_Hello_World Pike_the_Flipper_Main_Branch ... more
Fork of BMI160 by
Diff: bmi160.h
- Revision:
- 9:ca6b5fecdd63
- Parent:
- 8:a89b529b1d96
- Child:
- 10:9e219f2f1fb3
diff -r a89b529b1d96 -r ca6b5fecdd63 bmi160.h --- a/bmi160.h Tue Dec 20 00:10:04 2016 +0000 +++ b/bmi160.h Tue Dec 20 01:08:33 2016 +0000 @@ -279,6 +279,18 @@ SENS_16G, ///<Accelerometer range +-16G }; + ///Structure for holding accelerometer configuration + struct AccConfig + { + AccRange range; + AccUnderSampling us; + AccBandWidthParam bwp; + AccOutPutDataRate odr; + }; + + ///Accelerometer default configuration + static const AccConfig DEFAULT_ACC_CONFIG; + ///BMI160 Power Modes enum PowerModes { @@ -419,36 +431,26 @@ ///On Entry: ///@param[in] axis - Sensor axis ///@param[in] data - AxisData structure + ///@param[in] accConfig - Accelerometer configuration structure /// ///On Exit: ///@param[out] data - Structure holds raw and scaled axis data /// ///@returns 0 on success, non 0 on failure - int32_t getAccAxis(SensorAxis axis, AxisData &data); + int32_t getAccAxis(SensorAxis axis, AxisData &data, AccConfig accConfig); ///@brief Get accelerometer xyz axis as float.\n /// ///On Entry: ///@param[in] data - SensorData structure + ///@param[in] accConfig - Accelerometer configuration structure /// ///On Exit: ///@param[out] data - Structure holds raw and scaled data for all three axis /// ///@returns 0 on success, non 0 on failure - int32_t getAccXYZ(SensorData &data); - - -protected: - - struct AccConfig - { - AccRange range; - AccUnderSampling us; - AccBandWidthParam bwp; - AccOutPutDataRate odr; - }; - + int32_t getAccXYZ(SensorData &data, AccConfig accConfig); };