Skip to content

Commit

Permalink
move typedef out of object so its accessable
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Aug 14, 2022
1 parent 8bc20da commit fbe39c8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
3 changes: 1 addition & 2 deletions Adafruit_BNO055.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ void Adafruit_BNO055::setMode(adafruit_bno055_opmode_t mode) {
* for example: a return of 12 (0X0C) => NDOF
*/
adafruit_bno055_opmode_t Adafruit_BNO055::getMode() {
adafruit_bno055_opmode_t operating_mode = read8(BNO055_OPR_MODE_ADDR);
return operating_mode;
return (adafruit_bno055_opmode_t)read8(BNO055_OPR_MODE_ADDR);
}

/*!
Expand Down
34 changes: 17 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

0 comments on commit fbe39c8

Please sign in to comment.