upm  0.8.0
Sensor/Actuator repository for libmraa (v1.1.1)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Types | Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
BNO055 Class Reference

API for the BNO055 Absolute Orientation 9DOF Fusion Hub. More...

Detailed Description

The BNO055 is a System in Package (SiP), integrating a triaxial 14-bit accelerometer, a triaxial 16-bit gyroscope with a range of ±2000 degrees per second, a triaxial geomagnetic sensor and a 32-bit cortex M0+ microcontroller running Bosch Sensortec sensor fusion software, in a single package.

This sensor handles the hard problem of combining various sensor information into a reliable measurement of sensor orientation (refered to as 'sensor fusion'). The onboard MCU runs this software and can provide fusion output in the form of Euler Angles, Quaternions, Linear Acceleration, and Gravity Vectors in 3 axes.

The focus on this driver has been on supporting the fusion components. Less support is available for use of this device as a generic accelerometer, gyroscope and magnetometer, however enough infrastructure is available to add any missing functionality.

This device requires calibration in order to operate accurately. Methods are provided to retrieve calibration data (once calibrated) to be stored somewhere else, like in a file. A method is provided to load this data as well. Calibration data is lost on a power cycle. See one of the examples for a description of how to calibrate the device, but in essence:

There is a calibration status register available (getCalibrationStatus()) that returns the calibration status of the accelerometer (ACC), magnetometer (MAG), gyroscope (GYR), and overall system (SYS). Each of these values range from 0 (uncalibrated) to 3 (fully calibrated). Calibration involves certain motions to get all 4 values at 3. The motions are as follows (though see the datasheet for more information):

GYR: Simply let the sensor sit flat for a few seconds.

ACC: Move the sensor in various positions. Start flat, then rotate slowly by 45 degrees, hold for a few seconds, then continue rotating another 45 degrees and hold, etc. 6 or more movements of this type may be required. You can move through any axis you desire, but make sure that the device is lying at least once perpendicular to the x, y, and z axis.

MAG: Move slowly in a figure 8 pattern in the air, until the calibration values reaches 3.

SYS: This will usually reach 3 when the other items have also reached 3. If not, continue slowly moving the device though various axes until it does.

// Instantiate an BNO055 using default parameters (bus 0, addr
// 0x28). The default running mode is NDOF absolute orientation
// mode.
upm::BNO055 *sensor = new upm::BNO055();
// First we need to calibrate....
cout << "First we need to calibrate. 4 numbers will be output every"
<< endl;
cout << "second for each sensor. 0 means uncalibrated, and 3 means"
<< endl;
cout << "fully calibrated."
<< endl;
cout << "See the UPM documentation on this sensor for instructions on"
<< endl;
cout << "what actions are required to calibrate."
<< endl;
cout << endl;
// do the calibration...
while (shouldRun && !sensor->isFullyCalibrated())
{
int mag, acc, gyr, sys;
sensor->getCalibrationStatus(&mag, &acc, &gyr, &sys);
cout << "Magnetometer: " << mag
<< " Accelerometer: " << acc
<< " Gyroscope: " << gyr
<< " System: " << sys
<< endl;
sleep(1);
}
cout << endl;
cout << "Calibration complete." << endl;
cout << endl;
// now output various fusion data every 250 milliseconds
while (shouldRun)
{
float w, x, y, z;
sensor->update();
sensor->getEulerAngles(&x, &y, &z);
cout << "Euler: Heading: " << x
<< " Roll: " << y
<< " Pitch: " << z
<< " degrees"
<< endl;
sensor->getQuaternions(&w, &x, &y, &z);
cout << "Quaternion: W: " << w
<< " X: " << x
<< " Y: " << y
<< " Z: " << z
<< endl;
sensor->getLinearAcceleration(&x, &y, &z);
cout << "Linear Acceleration: X: " << x
<< " Y: " << y
<< " Z: " << z
<< " m/s^2"
<< endl;
sensor->getGravityVectors(&x, &y, &z);
cout << "Gravity Vector: X: " << x
<< " Y: " << y
<< " Z: " << z
<< " m/s^2"
<< endl;
cout << endl;
usleep(250000);
}

Public Types

enum  REGS_T : uint8_t {
  REG_PAGE_ID = 0x07, REG_CHIP_ID = 0x00, REG_ACC_ID = 0x01, REG_MAG_ID = 0x02,
  REG_GYR_ID = 0x03, REG_SW_REV_ID_LSB = 0x04, REG_SW_REV_ID_MSB = 0x05, REG_BL_REV_ID = 0x06,
  REG_ACC_DATA_X_LSB = 0x08, REG_ACC_DATA_X_MSB = 0x09, REG_ACC_DATA_Y_LSB = 0x0a, REG_ACC_DATA_Y_MSB = 0x0b,
  REG_ACC_DATA_Z_LSB = 0x0c, REG_ACC_DATA_Z_MSB = 0x0d, REG_MAG_DATA_X_LSB = 0x0e, REG_MAG_DATA_X_MSB = 0x0f,
  REG_MAG_DATA_Y_LSB = 0x10, REG_MAG_DATA_Y_MSB = 0x11, REG_MAG_DATA_Z_LSB = 0x12, REG_MAG_DATA_Z_MSB = 0x13,
  REG_GYR_DATA_X_LSB = 0x14, REG_GYR_DATA_X_MSB = 0x15, REG_GYR_DATA_Y_LSB = 0x16, REG_GYR_DATA_Y_MSB = 0x17,
  REG_GYR_DATA_Z_LSB = 0x18, REG_GYR_DATA_Z_MSB = 0x19, REG_EUL_HEADING_LSB = 0x1a, REG_EUL_HEADING_MSB = 0x1b,
  REG_EUL_ROLL_LSB = 0x1c, REG_EUL_ROLL_MSB = 0x1d, REG_EUL_PITCH_LSB = 0x1e, REG_EUL_PITCH_MSB = 0x1f,
  REG_QUA_DATA_W_LSB = 0x20, REG_QUA_DATA_W_MSB = 0x21, REG_QUA_DATA_X_LSB = 0x22, REG_QUA_DATA_X_MSB = 0x23,
  REG_QUA_DATA_Y_LSB = 0x24, REG_QUA_DATA_Y_MSB = 0x25, REG_QUA_DATA_Z_LSB = 0x26, REG_QUA_DATA_Z_MSB = 0x27,
  REG_LIA_DATA_X_LSB = 0x28, REG_LIA_DATA_X_MSB = 0x29, REG_LIA_DATA_Y_LSB = 0x2a, REG_LIA_DATA_Y_MSB = 0x2b,
  REG_LIA_DATA_Z_LSB = 0x2c, REG_LIA_DATA_Z_MSB = 0x2d, REG_GRV_DATA_X_LSB = 0x2e, REG_GRV_DATA_X_MSB = 0x2f,
  REG_GRV_DATA_Y_LSB = 0x30, REG_GRV_DATA_Y_MSB = 0x31, REG_GRV_DATA_Z_LSB = 0x32, REG_GRV_DATA_Z_MSB = 0x33,
  REG_TEMPERATURE = 0x34, REG_CALIB_STAT = 0x35, REG_ST_RESULT = 0x36, REG_INT_STA = 0x37,
  REG_SYS_CLK_STATUS = 0x38, REG_SYS_STATUS = 0x39, REG_SYS_ERROR = 0x3a, REG_UNIT_SEL = 0x3b,
  REG_OPER_MODE = 0x3d, REG_POWER_MODE = 0x3e, REG_SYS_TRIGGER = 0x3f, REG_TEMP_SOURCE = 0x40,
  REG_AXIS_MAP_CONFIG = 0x41, REG_AXIS_MAP_SIGN = 0x42, REG_ACC_OFFSET_X_LSB = 0x55, REG_ACC_OFFSET_X_MSB = 0x56,
  REG_ACC_OFFSET_Y_LSB = 0x57, REG_ACC_OFFSET_Y_MSB = 0x58, REG_ACC_OFFSET_Z_LSB = 0x59, REG_ACC_OFFSET_Z_MSB = 0x5a,
  REG_MAG_OFFSET_X_LSB = 0x5b, REG_MAG_OFFSET_X_MSB = 0x5c, REG_MAG_OFFSET_Y_LSB = 0x5d, REG_MAG_OFFSET_Y_MSB = 0x5e,
  REG_MAG_OFFSET_Z_LSB = 0x5f, REG_MAG_OFFSET_Z_MSB = 0x60, REG_GYR_OFFSET_X_LSB = 0x61, REG_GYR_OFFSET_X_MSB = 0x62,
  REG_GYR_OFFSET_Y_LSB = 0x63, REG_GYR_OFFSET_Y_MSB = 0x64, REG_GYR_OFFSET_Z_LSB = 0x65, REG_GYR_OFFSET_Z_MSB = 0x66,
  REG_ACC_RADIUS_LSB = 0x67, REG_ACC_RADIUS_MSB = 0x68, REG_MAG_RADIUS_LSB = 0x69, REG_MAG_RADIUS_MSB = 0x6a,
  REG_ACC_CONFIG = 0x08, REG_MAG_CONFIG = 0x09, REG_GYR_CONFIG0 = 0x0a, REG_GYR_CONFIG1 = 0x0b,
  REG_ACC_SLEEP_CONFIG = 0x0c, REG_GYR_SLEEP_CONFIG = 0x0d, REG_INT_MSK = 0x0f, REG_INT_EN = 0x10,
  REG_ACC_AM_THRES = 0x11, REG_ACC_INT_SETTINGS = 0x12, REG_ACC_HG_DURATION = 0x13, REG_ACC_HG_THRES = 0x14,
  REG_ACC_NM_THRES = 0x15, REG_ACC_NM_SET = 0x16, REG_GYR_INT_SETTING = 0x17, REG_GYR_HR_X_SET = 0x18,
  REG_GYR_DUR_X = 0x19, REG_GYR_HR_Y_SET = 0x1a, REG_GYR_DUR_Y = 0x1b, REG_GYR_HR_Z_SET = 0x1c,
  REG_GYR_DUR_Z = 0x1d, REG_GYR_AM_THRES = 0x1e, REG_GYR_AM_SET = 0x1f, REG_BNO_UNIQUE_ID = 0x50
}
 
enum  CALIB_STAT_BITS_T {
  CALIB_STAT_MAG0 = 0x01, CALIB_STAT_MAG1 = 0x02, _CALIB_STAT_MAG_MASK = 3, _CALIB_STAT_MAG_SHIFT = 0,
  CALIB_STAT_ACC0 = 0x04, CALIB_STAT_ACC1 = 0x08, _CALIB_STAT_ACC_MASK = 3, _CALIB_STAT_ACC_SHIFT = 2,
  CALIB_STAT_GYR0 = 0x10, CALIB_STAT_GYR1 = 0x20, _CALIB_STAT_GYR_MASK = 3, _CALIB_STAT_GYR_SHIFT = 4,
  CALIB_STAT_SYS0 = 0x40, CALIB_STAT_SYS1 = 0x80, _CALIB_STAT_SYS_MASK = 3, _CALIB_STAT_SYS_SHIFT = 6
}
 
enum  ST_RESULT_BITS_T { ST_RESULT_ACC = 0x01, ST_RESULT_MAG = 0x02, ST_RESULT_GYR = 0x04, ST_RESULT_MCU = 0x08 }
 
enum  INT_STA_BITS_T {
  INT_STA_GYRO_AM = 0x04, INT_STA_GYR_HIGH_RATE = 0x08, INT_STA_ACC_HIGH_G = 0x20, INT_STA_ACC_AM = 0x40,
  INT_STA_ACC_NM = 0x80
}
 
enum  SYS_CLK_STATUS_BITS_T { SYS_CLK_STATUS_ST_MAIN_CLK = 0x01 }
 
enum  SYS_STATUS_T {
  SYS_STATUS_IDLE = 0, SYS_STATUS_SYS_ERR = 1, SYS_STATUS_INIT_PERIPHERALS = 2, SYS_STATUS_SYSTEM_INIT = 3,
  SYS_STATUS_EXECUTING_SELFTEST = 4, SYS_STATUS_FUSION_RUNNING = 5, SYS_STATUS_NO_FUSION_RUNNING = 6
}
 
enum  SYS_ERR_T {
  SYS_ERR_NOERROR = 0, SYS_ERR_PERIPH_INIT_ERROR = 1, SYS_ERR_SYS_INIT_ERROR = 2, SYS_ERR_SELFTEST_FAIL_ERROR = 3,
  SYS_ERR_REG_VAL_OUTOFRANGE_ERROR = 4, SYS_ERR_REG_ADDR_OUTOFRANGE_ERROR = 5, SYS_ERR_REG_WRITE_ERROR = 6, SYS_ERR_LP_MODE_NOT_AVAIL_ERROR = 7,
  SYS_ERR_ACC_PWR_MODE_NOT_AVAIL_ERROR = 8, SYS_ERR_FUSION_CONFIG_ERROR = 9, SYS_ERR_SENSOR_CONFIG_ERROR = 10
}
 
enum  UNIT_SEL_BITS_T {
  UNIT_SEL_ACC_UNIT = 0x01, UNIT_SEL_GYR_UNIT = 0x02, UNIT_SEL_EUL_UNIT = 0x04, UNIT_SEL_TEMP_UNIT = 0x10,
  UNIT_SEL_ORI_ANDROID_WINDOWS = 0x80
}
 
enum  OPR_MODE_BITS_T {
  OPR_MODE_OPERATION_MODE0 = 0x01, OPR_MODE_OPERATION_MODE1 = 0x02, OPR_MODE_OPERATION_MODE2 = 0x04, OPR_MODE_OPERATION_MODE3 = 0x08,
  _OPR_MODE_OPERATION_MODE_MASK = 15, _OPR_MODE_OPERATION_MODE_SHIFT = 0
}
 
enum  OPERATION_MODES_T {
  OPERATION_MODE_CONFIGMODE = 0, OPERATION_MODE_ACCONLY = 1, OPERATION_MODE_MAGONLY = 2, OPERATION_MODE_GYROONLY = 3,
  OPERATION_MODE_ACCMAG = 4, OPERATION_MODE_ACCGYRO = 5, OPERATION_MODE_MAGGYRO = 6, OPERATION_MODE_AMG = 7,
  OPERATION_MODE_IMU = 8, OPERATION_MODE_COMPASS = 9, OPERATION_MODE_M4G = 10, OPERATION_MODE_NDOF_FMC_OFF = 11,
  OPERATION_MODE_NDOF = 12
}
 
enum  PWR_MODE_BITS_T { PWR_MODE_POWER_MODE0 = 0x01, PWR_MODE_POWER_MODE1 = 0x02, _PWR_MODE_POWER_MODE_MASK = 3, _PWR_MODE_POWER_MODE_SHIFT = 0 }
 
enum  POWER_MODES_T { POWER_MODE_NORMAL = 0, POWER_MODE_LOW = 1, POWER_MODE_SUSPEND = 2 }
 
enum  SYS_TRIGGER_BITS_T { SYS_TRIGGER_SELF_TEST = 0x01, SYS_TRIGGER_RST_SYS = 0x20, SYS_TRIGGER_RST_INT = 0x40, SYS_TRIGGER_CLK_SEL = 0x80 }
 
enum  TEMP_SOURCE_BITS_T { TEMP_SOURCE_TEMP_SOURCE0 = 0x01, TEMP_SOURCE_TEMP_SOURCE1 = 0x02, _TEMP_SOURCE_TEMP_SOURCE_MASK = 3, _TEMP_SOURCE_TEMP_SOURCE_SHIFT = 0 }
 
enum  TEMP_SOURCES_T { TEMP_SOURCE_ACC = 0, TEMP_SOURCE_GYR = 1 }
 
enum  AXIS_MAP_CONFIG_BITS_T {
  AXIS_MAP_CONFIG_REMAPPED_X_VAL0 = 0x01, AXIS_MAP_CONFIG_REMAPPED_X_VAL1 = 0x02, _AXIS_MAP_CONFIG_REMAPPED_X_VAL_MASK = 3, _AXIS_MAP_CONFIG_REMAPPED_X_VAL_SHIFT = 0,
  AXIS_MAP_CONFIG_REMAPPED_Y_VAL0 = 0x04, AXIS_MAP_CONFIG_REMAPPED_Y_VAL1 = 0x08, _AXIS_MAP_CONFIG_REMAPPED_Y_VAL_MASK = 3, _AXIS_MAP_CONFIG_REMAPPED_Y_VAL_SHIFT = 2,
  AXIS_MAP_CONFIG_REMAPPED_Z_VAL0 = 0x10, AXIS_MAP_CONFIG_REMAPPED_Z_VAL1 = 0x20, _AXIS_MAP_CONFIG_REMAPPED_Z_VAL_MASK = 3, _AXIS_MAP_CONFIG_REMAPPED_Z_VAL_SHIFT = 4
}
 
enum  REMAPPED_AXIS_T { REMAPPED_AXIS_X = 0, REMAPPED_AXIS_Y = 1, REMAPPED_AXIS_Z = 2 }
 
enum  AXIS_MAP_SIGN_BITS_T { AXIS_MAP_SIGN_REMAPPED_Z_SIGN = 0x01, AXIS_MAP_SIGN_REMAPPED_Y_SIGN = 0x02, AXIS_MAP_SIGN_REMAPPED_X_SIGN = 0x04 }
 
enum  ACC_CONFIG_BITS_T {
  ACC_CONFIG_ACC_RANGE0 = 0x01, ACC_CONFIG_ACC_RANGE1 = 0x02, _ACC_CONFIG_ACC_RANGE_MASK = 3, _ACC_CONFIG_ACC_RANGE_SHIFT = 0,
  ACC_CONFIG_ACC_BW0 = 0x04, ACC_CONFIG_ACC_BW1 = 0x08, ACC_CONFIG_ACC_BW2 = 0x10, _ACC_CONFIG_ACC_BW_MASK = 7,
  _ACC_CONFIG_ACC_BW_SHIFT = 2, ACC_CONFIG_ACC_PWR_MODE0 = 0x20, ACC_CONFIG_ACC_PWR_MODE1 = 0x40, ACC_CONFIG_ACC_PWR_MODE2 = 0x80,
  _ACC_CONFIG_ACC_PWR_MODE_MASK = 7, _ACC_CONFIG_ACC_PWR_MODE_SHIFT = 5
}
 
enum  ACC_RANGE_T { ACC_RANGE_2G = 0, ACC_RANGE_4G = 1, ACC_RANGE_8G = 2, ACC_RANGE_16G = 3 }
 
enum  ACC_BW_T {
  ACC_BW_7_81 = 0, ACC_BW_15_53 = 1, ACC_BW_31_25 = 2, ACC_BW_62_5 = 3,
  ACC_BW_125 = 4, ACC_BW_250 = 5, ACC_BW_500 = 6, ACC_BW_1000 = 7
}
 
enum  ACC_PWR_MODE_T {
  ACC_PWR_MODE_NORMAL = 0, ACC_PWR_MODE_SUSPEND = 1, ACC_PWR_MODE_LOWPOWER1 = 2, ACC_PWR_MODE_STANDBY = 3,
  ACC_PWR_MODE_LOWPOWER2 = 4, ACC_PWR_MODE_DEEPSUSPEND = 5
}
 
enum  MAG_CONFIG_BITS_T {
  MAG_CONFIG_MAG_ODR0 = 0x01, MAG_CONFIG_MAG_ODR1 = 0x02, MAG_CONFIG_MAG_ODR2 = 0x04, _MAG_CONFIG_MAG_ODR_MASK = 7,
  _MAG_CONFIG_MAG_ODR_SHIFT = 0, MAG_CONFIG_MAG_OPR_MODE0 = 0x08, MAG_CONFIG_MAG_OPR_MODE1 = 0x10, _MAG_CONFIG_MAG_OPR_MODE_MASK = 3,
  _MAG_CONFIG_MAG_OPR_MODE_SHIFT = 3, MAG_CONFIG_MAG_POWER_MODE0 = 0x20, MAG_CONFIG_MAG_POWER_MODE1 = 0x40, _MAG_CONFIG_MAG_POWER_MODE_MASK = 3,
  _MAG_CONFIG_MAG_POWER_MODE_SHIFT = 5
}
 
enum  MAG_ODR_T {
  MAG_ODR_2 = 0, MAG_ODR_6 = 1, MAG_ODR_8 = 2, MAG_ODR_10 = 3,
  MAG_ODR_15 = 4, MAG_ODR_20 = 5, MAG_ODR_25 = 6, MAG_ODR_30 = 7
}
 
enum  MAG_OPR_T { MAG_OPR_LOW = 0, MAG_OPR_REGULAR = 1, MAG_OPR_ENHANCED_REGULAR = 2, MAG_OPR_HIGH_ACCURACY = 3 }
 
enum  MAG_POWER_T { MAG_POWER_NORMAL = 0, MAG_POWER_SLEEP = 1, MAG_POWER_SUSPEND = 2, MAG_POWER_FORCE_MODE = 3 }
 
enum  GYR_CONFIG0_BITS_T {
  GYR_CONFIG0_GYR_RANGE0 = 0x01, GYR_CONFIG0_GYR_RANGE1 = 0x02, GYR_CONFIG0_GYR_RANGE2 = 0x04, _GYR_CONFIG0_GYR_RANGE_MASK = 7,
  _GYR_CONFIG0_GYR_RANGE_SHIFT = 0, GYR_CONFIG0_GYR_BW0 = 0x08, GYR_CONFIG0_GYR_BW1 = 0x10, GYR_CONFIG0_GYR_BW2 = 0x20,
  _GYR_CONFIG0_GYR_BW_MASK = 7, _GYR_CONFIG0_GYR_BW_SHIFT = 3
}
 
enum  GYR_RANGE_T {
  GYR_RANGE_2000 = 0, GYR_RANGE_1000 = 1, GYR_RANGE_500 = 2, GYR_RANGE_250 = 3,
  GYR_RANGE_125 = 4
}
 
enum  GYR_BW_T {
  GYR_BW_523 = 0, GYR_BW_230 = 1, GYR_BW_116 = 2, GYR_BW_47 = 3,
  GYR_BW_23 = 4, GYR_BW_12 = 5, GYR_BW_64 = 6, GYR_BW_32 = 7
}
 
enum  GYR_CONFIG1_BITS_T {
  GYR_CONFIG1_GYR_POWER_MODE0 = 0x01, GYR_CONFIG1_GYR_POWER_MODE1 = 0x02, GYR_CONFIG1_GYR_POWER_MODE2 = 0x04, _GYR_CONFIG1_GYR_POWER_MODE_MASK = 7,
  _GYR_CONFIG1_GYR_POWER_MODE_SHIFT = 0
}
 
enum  GYR_POWER_MODE_T {
  GYR_POWER_MODE_NORMAL = 0, GYR_POWER_MODE_FAST_POWERUP = 1, GYR_POWER_MODE_DEEP_SUSPEND = 2, GYR_POWER_MODE_SUSPEND = 3,
  GYR_POWER_MODE_ADVANCED_POWERSAVE = 4
}
 
enum  ACC_SLEEP_CONFIG_BITS_T {
  ACC_SLEEP_CONFIG_SLP_MODE = 0x01, ACC_SLEEP_CONFIG_ACC_SLP_DUR0 = 0x02, ACC_SLEEP_CONFIG_ACC_SLP_DUR1 = 0x04, ACC_SLEEP_CONFIG_ACC_SLP_DUR2 = 0x08,
  ACC_SLEEP_CONFIG_ACC_SLP_DUR3 = 0x10, _ACC_SLEEP_CONFIG_ACC_SLP_DUR_MASK = 15, _ACC_SLEEP_CONFIG_ACC_SLP_DUR_SHIFT = 1
}
 
enum  ACC_SLP_DUR_T {
  ACC_SLP_DUR_0_5 = 0, ACC_SLP_DUR_1 = 6, ACC_SLP_DUR_2 = 7, ACC_SLP_DUR_4 = 8,
  ACC_SLP_DUR_6 = 9, ACC_SLP_DUR_10 = 10, ACC_SLP_DUR_25 = 11, ACC_SLP_DUR_50 = 12,
  ACC_SLP_DUR_100 = 13, ACC_SLP_DUR_500 = 14
}
 
enum  GYR_SLEEP_CONFIG_BITS_T {
  GYR_SLEEP_CONFIG_GYR_SLEEP_DUR0 = 0x01, GYR_SLEEP_CONFIG_GYR_SLEEP_DUR1 = 0x02, GYR_SLEEP_CONFIG_GYR_SLEEP_DUR2 = 0x04, _GYR_SLEEP_CONFIG_GYR_SLEEP_DUR_MASK = 7,
  _GYR_SLEEP_CONFIG_GYR_SLEEP_DUR_SHIFT = 0, GYR_SLEEP_CONFIG_GYR_AUTO_SLP_DUR0 = 0x08, GYR_SLEEP_CONFIG_GYR_AUTO_SLP_DUR1 = 0x10, GYR_SLEEP_CONFIG_GYR_AUTO_SLP_DUR2 = 0x20,
  _GYR_SLEEP_CONFIG_GYR_AUTO_SLP_DUR_MASK = 7, _GYR_SLEEP_CONFIG_GYR_AUTO_SLP_DUR_SHIFT = 3
}
 
enum  GYR_SLEEP_DUR_T {
  GYR_SLEEP_DUR_2 = 0, GYR_SLEEP_DUR_4 = 1, GYR_SLEEP_DUR_5 = 2, GYR_SLEEP_DUR_8 = 3,
  GYR_SLEEP_DUR_10 = 4, GYR_SLEEP_DUR_15 = 5, GYR_SLEEP_DUR_18 = 6, GYR_SLEEP_DUR_20 = 7
}
 
enum  GYR_AUTO_SLP_DUR_T {
  GYR_AUTO_SLP_DUR_4 = 1, GYR_AUTO_SLP_DUR_5 = 2, GYR_AUTO_SLP_DUR_8 = 3, GYR_AUTO_SLP_DUR_10 = 4,
  GYR_AUTO_SLP_DUR_15 = 5, GYR_AUTO_SLP_DUR_20 = 6, GYR_AUTO_SLP_DUR_40 = 7
}
 
enum  INT_BITS_T {
  INT_GYRO_AM = 0x04, INT_GYRO_HIGH_RATE = 0x08, INT_ACC_HIGH_G = 0x20, INT_ACC_AM = 0x40,
  INT_ACC_NM = 0x80
}
 
enum  ACC_INT_SETTINGS_BITS_T {
  ACC_INT_SETTINGS_AM_DUR0 = 0x01, ACC_INT_SETTINGS_AM_DUR1 = 0x02, _ACC_INT_SETTINGS_AM_DUR_MASK = 3, _ACC_INT_SETTINGS_AM_DUR_SHIFT = 0,
  ACC_INT_SETTINGS_AM_NM_X_AXIS = 0x04, ACC_INT_SETTINGS_AM_NM_Y_AXIS = 0x08, ACC_INT_SETTINGS_AM_NM_Z_AXIS = 0x10, ACC_INT_SETTINGS_HG_X_AXIS = 0x20,
  ACC_INT_SETTINGS_HG_Y_AXIS = 0x40, ACC_INT_SETTINGS_HG_Z_AXIS = 0x80
}
 
enum  ACC_NM_SET_BITS_T {
  ACC_NM_SET_SM_NM = 0x01, ACC_NM_SET_SM_NM_DUR0 = 0x02, ACC_NM_SET_SM_NM_DUR1 = 0x04, ACC_NM_SET_SM_NM_DUR2 = 0x08,
  ACC_NM_SET_SM_NM_DUR3 = 0x10, ACC_NM_SET_SM_NM_DUR4 = 0x20, ACC_NM_SET_SM_NM_DUR5 = 0x40, _ACC_NM_SET_SM_NM_DUR_MASK = 63,
  _ACC_NM_SET_SM_NM_DUR_SHIFT = 1
}
 
enum  GYR_INT_SETTING_BITS_T {
  GYR_INT_SETTING_AM_X_AXIS = 0x01, GYR_INT_SETTING_AM_Y_AXIS = 0x02, GYR_INT_SETTING_AM_Z_AXIS = 0x04, GYR_INT_SETTING_HR_X_AXIS = 0x08,
  GYR_INT_SETTING_HR_Y_AXIS = 0x10, GYR_INT_SETTING_HR_Z_AXIS = 0x20, GYR_INT_SETTING_AM_FILT = 0x40, GYR_INT_SETTING_HR_FILT = 0x80
}
 
enum  GYR_HR_XYZ_SET_BITS_T {
  GYR_HR_XYZ_SET_HR_THRESH0 = 0x01, GYR_HR_XYZ_SET_HR_THRESH1 = 0x02, GYR_HR_XYZ_SET_HR_THRESH2 = 0x04, GYR_HR_XYZ_SET_HR_THRESH3 = 0x08,
  GYR_HR_XYZ_SET_HR_THRESH4 = 0x10, _GYR_HR_XYZ_SET_HR_THRESH_MASK = 31, _GYR_HR_XYZ_SET_HR_THRESH_SHIFT = 0, GYR_HR_XYZ_SET_HR_THRESH_HYST0 = 0x20,
  GYR_HR_XYZ_SET_HR_THRESH_HYST1 = 0x40, _GYR_HR_XYZ_SET_HR_THRESH_HYST_MASK = 3, _GYR_HR_XYZ_SET_HR_THRESH_HYST_SHIFT = 5
}
 
enum  GYR_AM_SET_BITS_T {
  GYR_AM_SET_SLOPE_SAMPLES0 = 0x01, GYR_AM_SET_SLOPE_SAMPLES1 = 0x02, _GYR_AM_SET_SLOPE_SAMPLES_MASK = 3, _GYR_AM_SET_SLOPE_SAMPLES_SHIFT = 0,
  GYR_AM_SET_AWAKE_DUR0 = 0x04, GYR_AM_SET_AWAKE_DUR1 = 0x08, _GYR_AM_SET_AWAKE_DUR_MASK = 3, _GYR_AM_SET_AWAKE_DUR_SHIFT = 2
}
 
enum  SLOPE_SAMPLES_T { SLOPE_SAMPLES_8 = 0, SLOPE_SAMPLES_16 = 1, SLOPE_SAMPLES_32 = 2, SLOPE_SAMPLES_64 = 3 }
 

Public Member Functions

 BNO055 (int bus=BNO055_I2C_BUS, uint8_t addr=BNO055_DEFAULT_ADDR)
 
 ~BNO055 ()
 
void update ()
 
uint8_t getChipID ()
 
uint8_t getACCID ()
 
uint8_t getMAGID ()
 
uint8_t getGYRID ()
 
uint16_t getSWRevID ()
 
uint8_t getBootLoaderID ()
 
void setClockExternal (bool extClock)
 
void setTemperatureSource (TEMP_SOURCES_T src)
 
void setTemperatureUnits (bool celsius)
 
void setOperationMode (OPERATION_MODES_T mode)
 
void resetSystem ()
 
void getCalibrationStatus (int *mag, int *acc, int *gyr, int *sys)
 
int * getCalibrationStatus ()
 
bool isFullyCalibrated ()
 
std::string readCalibrationData ()
 
void writeCalibrationData (std::string calibData)
 
float getTemperature (bool fahrenheit=false)
 
void getEulerAngles (float *heading, float *roll, float *pitch)
 
float * getEulerAngles ()
 
void getQuaternions (float *w, float *x, float *y, float *z)
 
float * getQuaternions ()
 
void getLinearAcceleration (float *x, float *y, float *z)
 
float * getLinearAcceleration ()
 
void getGravityVectors (float *x, float *y, float *z)
 
float * getGravityVectors ()
 
void getAccelerometer (float *x, float *y, float *z)
 
float * getAccelerometer ()
 
void getMagnetometer (float *x, float *y, float *z)
 
float * getMagnetometer ()
 
void getGyroscope (float *x, float *y, float *z)
 
float * getGyroscope ()
 
void setAccelerationConfig (ACC_RANGE_T range, ACC_BW_T bw, ACC_PWR_MODE_T pwr)
 
void setMagnetometerConfig (MAG_ODR_T odr, MAG_OPR_T opr, MAG_POWER_T pwr)
 
void setGyroscopeConfig (GYR_RANGE_T range, GYR_BW_T bw, GYR_POWER_MODE_T pwr)
 
void setAccelerometerUnits (bool mg=false)
 
void setGyroscopeUnits (bool radians=false)
 
void setEulerUnits (bool radians=false)
 
void resetInterruptStatus ()
 
uint8_t getInterruptStatus ()
 
uint8_t getInterruptEnable ()
 
void setInterruptEnable (uint8_t enables)
 
uint8_t getInterruptMask ()
 
void setInterruptMask (uint8_t mask)
 
SYS_STATUS_T getSystemStatus ()
 
SYS_ERR_T getSystemError ()
 
void installISR (int gpio, mraa::Edge level, void(*isr)(void *), void *arg)
 
void uninstallISR ()
 

Data Fields

const uint8_t BNO055_CHIPID = 0xa0
 
const int calibrationDataNumBytes = 22
 

Protected Member Functions

void clearData ()
 
bool updateFusionData ()
 
bool updateNonFusionData ()
 
void setPage (uint8_t page, bool force=false)
 
uint8_t readReg (uint8_t reg)
 
void readRegs (uint8_t reg, uint8_t *buffer, int len)
 
bool writeReg (uint8_t reg, uint8_t val)
 
bool writeRegs (uint8_t reg, uint8_t *buffer, int len)
 

Protected Attributes

mraa::I2c m_i2c
 
mraa::Gpio * m_gpioIntr
 
uint8_t m_addr
 
float m_temperature
 
float m_magX
 
float m_magY
 
float m_magZ
 
float m_accX
 
float m_accY
 
float m_accZ
 
float m_accUnitScale
 
float m_gyrX
 
float m_gyrY
 
float m_gyrZ
 
float m_gyrUnitScale
 
float m_eulHeading
 
float m_eulRoll
 
float m_eulPitch
 
float m_eulUnitScale
 
float m_quaW
 
float m_quaX
 
float m_quaY
 
float m_quaZ
 
float m_liaX
 
float m_liaY
 
float m_liaZ
 
float m_grvX
 
float m_grvY
 
float m_grvZ
 

Member Enumeration Documentation

enum REGS_T : uint8_t

BNO055 registers

REG_CALIB_STAT bits

REG_ST_RESULT bits

REG_INT_STA bits

REG_SYS_CLK_STATUS bits

REG_SYS_STATUS values

enum SYS_ERR_T

REG_SYS_ERR values

REG_UNIT_SEL bits

REG_OPR_MODE bits

OPR_MODE_OPERATION values

REG_PWR_MODE bits

POWER_MODE values

REG_SYS_TRIGGER bits

REG_TEMP_SOURCE bits

TEMP_SOURCE values

REG_AXIS_MAP_CONFIG bits

REMAPPED_AXIS values, applied to X, Y, and Z axes (REG_AXIS_MAP_CONFIG)

REG_AXIS_MAP_SIGN bits

REG_ACC_CONFIG bits

ACC_CONFIG_ACC_RANGE values

enum ACC_BW_T

ACC_CONFIG_ACC_BW values

ACC_PWR_MODE values

REG_MAG_CONFIG bits

enum MAG_ODR_T

MAG_ODR values

enum MAG_OPR_T

MAG_OPR values

MAG_POWER values

REG_GYR_CONFIG0 bits

GYR_RANGE values

enum GYR_BW_T

GYR_BW values

REG_GYR_CONFIG1 bits

GYR_POWER_MODE values

REG_ACC_SLEEP_CONFIG bits

ACC_SLP_DUR values

REG_GYR_SLEEP_CONFIG bits

GYR_SLEEP_DUR values

GYR_AUTO_SLP_DUR values

enum INT_BITS_T

REG_INT_MSK and REG_INT_EN bits

REG_ACC_INT_SETTINGS bits

REG_ACC_NM_SET bits

REG_GYR_INT_SETTING bits

REG_GYR_HR_X_SET, REG_GYR_HR_Y_SET, and REG_GYR_HR_Z_SET bits

REG_GYR_AM_SET bits

GYR_AM_SET_SLOPE_SAMPLES values

Constructor & Destructor Documentation

BNO055 ( int  bus = BNO055_I2C_BUS,
uint8_t  addr = BNO055_DEFAULT_ADDR 
)

BNO055 constructor.

By default, the constructor sets the acceleration units to m/s^2, gyro and Euler units to degrees, and temperature to celsius. It then enters the NDOF fusion mode.

In addition, the internal clock is used so that compatibility with other implementations is assured. If you are using a device with an external clock, call setClockExternal(true) to enable it.

Parameters
busI2C bus to use.
addressThe address for this device.

Here is the call graph for this function:

~BNO055 ( )

BNO055 Destructor.

Here is the call graph for this function:

Member Function Documentation

void update ( void  )

Update the internal stored values from sensor data.

Here is the call graph for this function:

uint8_t getChipID ( )

Return the chip ID.

Returns
The chip ID (BNO055_CHIPID).

Here is the call graph for this function:

uint8_t getACCID ( )

Return the accelerometer chip ID.

Returns
The chip ID.

Here is the call graph for this function:

uint8_t getMAGID ( )

Return the magnetometer chip ID.

Returns
The chip ID.

Here is the call graph for this function:

uint8_t getGYRID ( )

Return the gyroscope chip ID.

Returns
The chip ID.

Here is the call graph for this function:

uint16_t getSWRevID ( )

Return the fusion firmware revison.

Returns
The firmware revison.

Here is the call graph for this function:

uint8_t getBootLoaderID ( )

Return the bootloader ID.

Returns
The bootloader ID.

Here is the call graph for this function:

void setClockExternal ( bool  extClock)

Enable or disables the use of the external clock. The Adafriut device does contain an external clock which might be more stable. By default, the internal clock is used.

Parameters
extClocktrue to use external clock, false otherwise.

Here is the call graph for this function:

Here is the caller graph for this function:

void setTemperatureSource ( TEMP_SOURCES_T  src)

Select the temperature source. This can be the accelerometer or the gyroscope. By default, the accelerometer temperature is used as the source.

Parameters
srcOne of the TEMP_SOURCES_T values.

Here is the call graph for this function:

Here is the caller graph for this function:

void setTemperatureUnits ( bool  celsius)

Select the temperature units. This can be the Fahrenheit or Celsius.

Parameters
celsiustrue for Celius, false for Fahrenheit.

Here is the call graph for this function:

Here is the caller graph for this function:

void setOperationMode ( OPERATION_MODES_T  mode)

Set the operating mode for the device. This places the device into a config mode, one of 7 non-fusion modes, or one of 5 fusion modes. All stored sensor data is cleared when switching modes. The device must be in config mode for most configuration operations. See the datasheet for details.

Parameters
modeOne of the OPERATION_MODES_T values.

Here is the call graph for this function:

Here is the caller graph for this function:

void resetSystem ( )

Reboot the sensor. This is equivalent to a power on reset. All calibration data will be lost, and the device must be recalibrated.

Here is the call graph for this function:

void getCalibrationStatus ( int *  mag,
int *  acc,
int *  gyr,
int *  sys 
)

Read the calibration status registers and return them. The values range from 0 (uncalibrated) to 3 (fully calibrated).

Parameters
magThe calibration status of the magnetometer.
accThe calibration status of the accelerometer.
magThe calibration status of the gyroscope.
magThe calibration status of the overall system.

Here is the call graph for this function:

int * getCalibrationStatus ( )

Read the calibration status registers and return them as an integer array. The values range from 0 (uncalibrated) to 3 (fully calibrated).

Returns
An integer array containing the values in the order: mag, acc, gyr, and sys.

Here is the caller graph for this function:

bool isFullyCalibrated ( )

Read the calibration status registers and return true or false, indicating whether all of the calibration parameters are fully calibrated.

Returns
true if all 4 calibration parameters are fully calibrated, else false.

Here is the call graph for this function:

Here is the caller graph for this function:

string readCalibrationData ( )

Read the calibration data and return it as a string. This data can then be saved for later reuse by writeCalibrationData() to restore calibration data after a reset.

Returns
string representing calibration data.

Here is the call graph for this function:

void writeCalibrationData ( std::string  calibData)

Write previously saved calibration data to the calibration registers.

Parameters
stringrepresenting calibration data, as returned by readCalibrationData().

Here is the call graph for this function:

float getTemperature ( bool  fahrenheit = false)

Return the current measured temperature. Note, this is not ambient temperature - this is the temperature of the selected source on the chip. update() must have been called prior to calling this method.

Parameters
fahrenheittrue to return data in Fahrenheit, false for Celicus. Celsius is the default.
Returns
The temperature in degrees Celsius or Fahrenheit.
void getEulerAngles ( float *  heading,
float *  roll,
float *  pitch 
)

Return current orientation fusion data in the form of Euler Angles. By default, the returned values are in degrees. update() must have been called prior to calling this method.

Parameters
headingPointer to a floating point value that will have the current heading angle placed into it.
rollPointer to a floating point value that will have the current roll angle placed into it.
pitchPointer to a floating point value that will have the current pitch angle placed into it.
float * getEulerAngles ( )

Return current orientation fusion data in the form of Euler Angles as a floating point array. By default, the returned values are in degrees. update() must have been called prior to calling this method.

Returns
A floating point array containing heading, roll, and pitch, in that order.
void getQuaternions ( float *  w,
float *  x,
float *  y,
float *  z 
)

Return current orientation fusion data in the form of Quaternions. update() must have been called prior to calling this method.

Parameters
wPointer to a floating point value that will have the current w component placed into it.
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.
float * getQuaternions ( )

Return current orientation fusion data in the form of Quaternions, as a floating point array. update() must have been called prior to calling this method.

Returns
A floating point array containing w, x, y, and z in that order.
void getLinearAcceleration ( float *  x,
float *  y,
float *  z 
)

Return current orientation fusion data in the form of Linear Acceleration. By default the returned values are in meters per-second squared (m/s^2). update() must have been called prior to calling this method.

Parameters
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.
float * getLinearAcceleration ( )

Return current orientation fusion data in the form of Linear Acceleration, as a floating point array. update() must have been called prior to calling this method.

Returns
A floating point array containing x, y, and z in that order.
void getGravityVectors ( float *  x,
float *  y,
float *  z 
)

Return current orientation fusion data in the form of a Gravity Vector per-axis. By default the returned values are in meters per-second squared (m/s^2). update() must have been called prior to calling this method.

Parameters
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.
float * getGravityVectors ( )

Return current orientation fusion data in the form of a Gravity Vector per-axis as a floating point array. update() must have been called prior to calling this method.

Returns
A floating point array containing x, y, and z in that order.
void getAccelerometer ( float *  x,
float *  y,
float *  z 
)

Return uncompensated accelerometer data (non-fusion). In fusion modes, this data will be of little value. By default the returned values are in meters per-second squared (m/s^2). update() must have been called prior to calling this method.

Parameters
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.
float * getAccelerometer ( )

Return current uncompensated accelerometer (non-fusion) data in the form of a floating point array. By default the returned values are in meters per-second squared (m/s^2). update() must have been called prior to calling this method.

Returns
A floating point array containing x, y, and z in that order.
void getMagnetometer ( float *  x,
float *  y,
float *  z 
)

Return uncompensated magnetometer data (non-fusion). In fusion modes, this data will be of little value. The returned values are in micro-teslas (uT). update() must have been called prior to calling this method.

Parameters
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.
float * getMagnetometer ( )

Return current uncompensated magnetometer (non-fusion) data in the form of a floating point array. The returned values are in micro-teslas (uT). update() must have been called prior to calling this method.

Returns
A floating point array containing x, y, and z in that order.
void getGyroscope ( float *  x,
float *  y,
float *  z 
)

Return uncompensated gyroscope data (non-fusion). In fusion modes, this data will be of little value. By default the returned values are in meters per-second squared (m/s^2). update() must have been called prior to calling this method.

Parameters
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.
float * getGyroscope ( )

Return current uncompensated gyroscope (non-fusion) data in the form of a floating point array. By default the returned values are in meters per-second squared (m/s^2). update() must have been called prior to calling this method.

Returns
A floating point array containing x, y, and z in that order.
void setAccelerationConfig ( ACC_RANGE_T  range,
ACC_BW_T  bw,
ACC_PWR_MODE_T  pwr 
)

Set the bandwidth, range, and power modes of the accelerometer. In fusion modes, these values will be ignored.

Parameters
rangeOne of the ACC_RANGE_T values.
bwOne of the ACC_BW_T values.
pwrOne of the ACC_PWR_MODE_T values.

Here is the call graph for this function:

void setMagnetometerConfig ( MAG_ODR_T  odr,
MAG_OPR_T  opr,
MAG_POWER_T  pwr 
)

Set the output data rate, operating mode and power mode of the magnetometer. In fusion modes, these values will be ignored.

Parameters
odrOne of the MAG_ODR_T values.
oprOne of the MAG_OPR_T values.
pwrOne of the MAG_POWER_T values.

Here is the call graph for this function:

void setGyroscopeConfig ( GYR_RANGE_T  range,
GYR_BW_T  bw,
GYR_POWER_MODE_T  pwr 
)

Set the range, bandwidth and power modes of the gyroscope. In fusion modes, these values will be ignored.

Parameters
rangeOne of the GYR_RANGE_T values.
bwOne of the GYR_BW_T values.
pwrOne of the GYR_POWER_MODE_T values.

Here is the call graph for this function:

void setAccelerometerUnits ( bool  mg = false)

Set the unit of measurement for the accelerometer related sensor values. The choices are mg (milligrams) or meters per-second squared (m/s^2). The default is m/s^2.

Parameters
mgtrue for mg, false for m/s^2.

Here is the call graph for this function:

Here is the caller graph for this function:

void setGyroscopeUnits ( bool  radians = false)

Set the unit of measurement for the gyroscope related sensor values. The choices are degrees and radians. The default is degrees.

Parameters
radianstrue for radians, false for degrees.

Here is the call graph for this function:

Here is the caller graph for this function:

void setEulerUnits ( bool  radians = false)

Set the unit of measurement for the Euler Angle related sensor values. The choices are degrees and radians. The default is degrees.

Parameters
radianstrue for radians, false for degrees.

Here is the call graph for this function:

Here is the caller graph for this function:

void resetInterruptStatus ( )

Reset all interrupt status bits and interrupt output.

Here is the call graph for this function:

uint8_t getInterruptStatus ( )

Return the interrupt status register. This is a bitmask of the INT_STA_BITS_T bits.

Returns
a bitmask of INT_STA_BITS_T bits.

Here is the call graph for this function:

uint8_t getInterruptEnable ( )

Return the interrupt enables register. This is a bitmask of the INT_STA_BITS_T bits.

Returns
a bitmask of INT_STA_BITS_T bits currently set in the enable register.

Here is the call graph for this function:

void setInterruptEnable ( uint8_t  enables)

Set the interrupt enable register. This is composed of a bitmask of the INT_STA_BITS_T bits.

Parameters
enablesa bitmask of INT_STA_BITS_T bits to enable

Here is the call graph for this function:

uint8_t getInterruptMask ( )

Return the interrupt mask register. This is a bitmask of the INT_STA_BITS_T bits. The interrupt mask is used to mask off enabled interrupts from generating a hardware interrupt. The interrupt status register can still be used to detect masked interrupts if they are enabled.

Returns
a bitmask of INT_STA_BITS_T bits currently set in the interrupt mask register.

Here is the call graph for this function:

void setInterruptMask ( uint8_t  mask)

Set the interrupt mask register. This is a bitmask of the INT_STA_BITS_T bits. The interrupt mask is used to mask off enabled interrupts from generating a hardware interrupt. The interrupt status register can still be used to detect masked interrupts if they are enabled.

Parameters
abitmask of INT_STA_BITS_T bits to set in the interrupt mask register.

Here is the call graph for this function:

BNO055::SYS_STATUS_T getSystemStatus ( )

Return the value of the system status register. This method can be used to determine the overall status of the device.

Returns
One of the SYS_STATUS_T values.

Here is the call graph for this function:

BNO055::SYS_ERR_T getSystemError ( )

Return the value of the system error register. This mathod can be used to determine a variety of system related error conditions.

Returns
One of the SYS_ERR_T values.

Here is the call graph for this function:

void installISR ( int  gpio,
mraa::Edge  level,
void(*)(void *)  isr,
void *  arg 
)

install an interrupt handler.

Parameters
gpiogpio pin to use as interrupt pin
levelthe interrupt trigger level (one of mraa::Edge values). Make sure that you have configured the interrupt pin properly for whatever level you choose.
isrthe interrupt handler, accepting a void * argument
argthe argument to pass the the interrupt handler

Here is the call graph for this function:

void uninstallISR ( )

uninstall a previously installed interrupt handler

Here is the caller graph for this function:

uint8_t readReg ( uint8_t  reg)
protected

Read a register.

Parameters
regThe register to read
Returns
The value of the register

Here is the caller graph for this function:

void readRegs ( uint8_t  reg,
uint8_t *  buffer,
int  len 
)
protected

Read contiguous registers into a buffer.

Parameters
bufferThe buffer to store the results
lenThe number of registers to read

Here is the caller graph for this function:

bool writeReg ( uint8_t  reg,
uint8_t  val 
)
protected

Write to a register

Parameters
regThe register to write to
valThe value to write
Returns
true if successful, false otherwise

Here is the caller graph for this function:

bool writeRegs ( uint8_t  reg,
uint8_t *  buffer,
int  len 
)
protected

Write data to contiguous registers

Parameters
regThe starting register to write to
bufferThe buffer containing the data to write
lenThe number of bytes to write
Returns
true if successful, false otherwise

Here is the caller graph for this function:


The documentation for this class was generated from the following files: