Skip to content

Commit

Permalink
Merge branch 'davgibbs-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Aug 14, 2022
2 parents 946205f + fbe39c8 commit 911d2b1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
9 changes: 9 additions & 0 deletions Adafruit_BNO055.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ void Adafruit_BNO055::setMode(adafruit_bno055_opmode_t mode) {
delay(30);
}

/*!
* @brief Gets the current operating mode of the chip
* @return operating_mode in integer which can be mapped in Section 3.3
* for example: a return of 12 (0X0C) => NDOF
*/
adafruit_bno055_opmode_t Adafruit_BNO055::getMode() {
return (adafruit_bno055_opmode_t)read8(BNO055_OPR_MODE_ADDR);
}

/*!
* @brief Changes the chip's axis remap
* @param remapcode
Expand Down
35 changes: 18 additions & 17 deletions Adafruit_BNO055.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ typedef struct {
int16_t mag_radius; /**< magnetometer radius */
} adafruit_bno055_offsets_t;

/** Operation mode settings **/
typedef enum {
OPERATION_MODE_CONFIG = 0X00,
OPERATION_MODE_ACCONLY = 0X01,
OPERATION_MODE_MAGONLY = 0X02,
OPERATION_MODE_GYRONLY = 0X03,
OPERATION_MODE_ACCMAG = 0X04,
OPERATION_MODE_ACCGYRO = 0X05,
OPERATION_MODE_MAGGYRO = 0X06,
OPERATION_MODE_AMG = 0X07,
OPERATION_MODE_IMUPLUS = 0X08,
OPERATION_MODE_COMPASS = 0X09,
OPERATION_MODE_M4G = 0X0A,
OPERATION_MODE_NDOF_FMC_OFF = 0X0B,
OPERATION_MODE_NDOF = 0X0C
} adafruit_bno055_opmode_t;

/*!
* @brief Class that stores state and functions for interacting with
* BNO055 Sensor
Expand Down Expand Up @@ -219,23 +236,6 @@ class Adafruit_BNO055 : public Adafruit_Sensor {
POWER_MODE_SUSPEND = 0X02
} adafruit_bno055_powermode_t;

/** Operation mode settings **/
typedef enum {
OPERATION_MODE_CONFIG = 0X00,
OPERATION_MODE_ACCONLY = 0X01,
OPERATION_MODE_MAGONLY = 0X02,
OPERATION_MODE_GYRONLY = 0X03,
OPERATION_MODE_ACCMAG = 0X04,
OPERATION_MODE_ACCGYRO = 0X05,
OPERATION_MODE_MAGGYRO = 0X06,
OPERATION_MODE_AMG = 0X07,
OPERATION_MODE_IMUPLUS = 0X08,
OPERATION_MODE_COMPASS = 0X09,
OPERATION_MODE_M4G = 0X0A,
OPERATION_MODE_NDOF_FMC_OFF = 0X0B,
OPERATION_MODE_NDOF = 0X0C
} adafruit_bno055_opmode_t;

/** Remap settings **/
typedef enum {
REMAP_CONFIG_P0 = 0x21,
Expand Down Expand Up @@ -284,6 +284,7 @@ class Adafruit_BNO055 : public Adafruit_Sensor {

bool begin(adafruit_bno055_opmode_t mode = OPERATION_MODE_NDOF);
void setMode(adafruit_bno055_opmode_t mode);
adafruit_bno055_opmode_t getMode();
void setAxisRemap(adafruit_bno055_axis_remap_config_t remapcode);
void setAxisSign(adafruit_bno055_axis_remap_sign_t remapsign);
void getRevInfo(adafruit_bno055_rev_info_t *);
Expand Down

0 comments on commit 911d2b1

Please sign in to comment.