same
Fork of BNO055_fusion by
Diff: BNO055.h
- Revision:
- 5:6a08a4c5b1e1
- Parent:
- 4:9e6fead1e93e
--- a/BNO055.h Thu Apr 16 10:47:40 2015 +0000 +++ b/BNO055.h Mon Jan 16 16:51:39 2017 +0000 @@ -62,6 +62,9 @@ #define I_AM_BNO055_MAG 0x32 // MAG ID #define I_AM_BNO055_GYR 0x0f // GYR ID + + + ////////////// DATA TYPE DEFINITION /////////////////////// typedef struct { uint8_t chip_id; @@ -102,6 +105,21 @@ int8_t gyr_chip; } BNO055_TEMPERATURE_TypeDef; +typedef struct { + uint8_t Gscale; + uint8_t Gbw; + uint8_t GPwrMode; + + uint8_t Ascale; + uint8_t Abw; + uint8_t APwrMode; + + uint8_t MOpMode; + uint8_t MPwrMode; + uint8_t Modr; + +} BNO055_CONFIG_TypeDef; + enum {MT_P0 = 0, MT_P1, MT_P2, MT_P3, MT_P4, MT_P5, MT_P6, MT_P7}; /** Interface for Bosch Sensortec Intelligent 9-axis absolute orientation sensor @@ -258,7 +276,16 @@ * @return register data */ uint8_t write_reg1(uint8_t addr, uint8_t data); - + + /** Calculate acceleration in Earth frame + * @param Linear acceleration structure + */ + void get_abs_accel(BNO055_LIN_ACC_TypeDef *la); + + void get_quaternion_float(float *Q); + + void configure_accelerometer_range(uint8_t range); + protected: void initialize(void); void check_id(void); @@ -283,6 +310,8 @@ uint8_t gyr_id; uint8_t bootldr_rev_id; uint16_t sw_rev_id; + + }; @@ -465,6 +494,9 @@ #define GYRO_ANY_MOTION_THRES 0x1e #define GYRO_ANY_MOTION_SET 0x1f + + + //--------------------------------------------------------- //----- Calibration example ------------------------------- //---------------------------------------------------------