Some improvements on mrcrsch's BNO055_fusion library
Fork of BNO055_fusion by
Revision 7:7df0c13f0ef9, committed 2017-04-22
- Comitter:
- gume
- Date:
- Sat Apr 22 19:24:31 2017 +0000
- Parent:
- 6:eae1a743876b
- Commit message:
- Add power mode change; Extend mode change with non fusion modes
Changed in this revision
BNO055.cpp | Show annotated file Show diff for this revision Revisions of this file |
BNO055.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/BNO055.cpp Sat Apr 22 10:22:28 2017 +0000 +++ b/BNO055.cpp Sat Apr 22 19:24:31 2017 +0000 @@ -331,6 +331,12 @@ return dt[0]; } +/////////////// Change Power mode /////////////////////// +void BNO055::change_power_mode(uint8_t mode) +{ + write_reg0(BNO055_PWR_MODE, mode); +} + /////////////// Change Fusion mode /////////////////////// void BNO055::change_fusion_mode(uint8_t mode) {
--- a/BNO055.h Sat Apr 22 10:22:28 2017 +0000 +++ b/BNO055.h Sat Apr 22 19:24:31 2017 +0000 @@ -36,14 +36,23 @@ #define BNO055_G_CHIP_ADDR (0x28 << 1) // COM3 = GND #define BNO055_V_CHIP_ADDR (0x29 << 1) // COM3 = Vdd +// Operating modes +#define CONFIGMODE 0x00 +// Non Fusion mode +#define MODE_ACCONLY 0x01 // Fusion mode -#define CONFIGMODE 0x00 #define MODE_IMU 0x08 #define MODE_COMPASS 0x09 #define MODE_M4G 0x0a #define MODE_NDOF_FMC_OFF 0x0b #define MODE_NDOF 0x0c +// Power modes +#define MODE_PWR_NORMAL 0x00 +#define MODE_PWR_LOWPOWER 0x01 +#define MODE_PWR_SUSPEND 0x02 + + // UNIT #define UNIT_ACC_MSS 0x00 // acc m/s2 #define UNIT_ACC_MG 0x01 // acc mg @@ -207,6 +216,12 @@ */ void get_chip_temperature(BNO055_TEMPERATURE_TypeDef *tmp); + /** Change power mode + * @param power mode + * @return none + */ + void change_power_mode(uint8_t mode); + /** Change fusion mode * @param fusion mode * @return none