I modified the Bosch library to implement reading and writing the calibration state. For those that are interested the modifications are.
Near the end of NAxisMotion.h add:
/****************************** ADDED CLASS FUNCTIONS **************************************/
/*******************************************************************************************
*Description: This function is used to read the magnetic offsets the BNO055
*Input Parameters: struct bno055_mag_offset_t *mag_offset;
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::read_mag_offset(struct bno055_mag_offset_t *mag_offset);
/*******************************************************************************************
*Description: This function is used to read the gyro offsets the BNO055
*Input Parameters: struct bno055_gyro_offset_t *gyro_offset; A place to store Offset Values
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::read_gyro_offset(struct bno055_gyro_offset_t *gyro_offset);
/*******************************************************************************************
*Description: This function is used to read the gyro offsets the BNO055
*Input Parameters: struct bno055_accel_offset_t *accel_offset; A place for Offset and Radius Values
A place to store Offset Values
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::read_accel_offset(struct bno055_accel_offset_t *accel_offset);
/*******************************************************************************************
*Description: This function is used to write the magnetic offsets the BNO055
*Input Parameters: struct bno055_mag_offset_t *mag_offset;
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::write_mag_offset(struct bno055_mag_offset_t *mag_offset);
/*******************************************************************************************
*Description: This function is used to write the gyro offsets the BNO055
*Input Parameters: struct bno055_gyro_offset_t *gyro_offset; A place to store Offset Values
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::write_gyro_offset(struct bno055_gyro_offset_t *gyro_offset);
/*******************************************************************************************
*Description: This function is used to write the gyro offsets the BNO055
*Input Parameters: struct bno055_accel_offset_t *accel_offset; A place for Offset and Radius Values
A place to store Offset Values
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::write_accel_offset(struct bno055_accel_offset_t *accel_offset);
};
To the end of NAxisMotion.cpp I added:
/*********************************** ADDED CLASS FUNCTIONS *********************************/
/*******************************************************************************************
*Description: This function is used to read the magnetic offsets the BNO055
*Input Parameters: struct bno055_mag_offset_t *mag_offset;
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::read_mag_offset(struct bno055_mag_offset_t *mag_offset)
{
return(bno055_read_mag_offset(mag_offset));
}
/*******************************************************************************************
*Description: This function is used to read the gyro offsets the BNO055
*Input Parameters: struct bno055_gyro_offset_t *gyro_offset; A place to store Offset Values
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::read_gyro_offset(struct bno055_gyro_offset_t *gyro_offset)
{
return(bno055_read_gyro_offset(gyro_offset));
}
/*******************************************************************************************
*Description: This function is used to read the gyro offsets the BNO055
*Input Parameters: struct bno055_accel_offset_t *accel_offset; A place for Offset and Radius Values
A place to store Offset Values
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::read_accel_offset(struct bno055_accel_offset_t *accel_offset)
{
return(bno055_read_accel_offset(accel_offset));
}
/*******************************************************************************************
*Description: This function is used to write the magnetic offsets the BNO055
*Input Parameters: struct bno055_mag_offset_t *mag_offset;
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::write_mag_offset(struct bno055_mag_offset_t *mag_offset)
{
return(bno055_write_mag_offset(mag_offset));
}
/*******************************************************************************************
*Description: This function is used to write the gyro offsets the BNO055
*Input Parameters: struct bno055_gyro_offset_t *gyro_offset; A place to store Offset Values
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::write_gyro_offset(struct bno055_gyro_offset_t *gyro_offset)
{
return(bno055_write_gyro_offset(gyro_offset));
}
/*******************************************************************************************
*Description: This function is used to write the gyro offsets the BNO055
*Input Parameters: struct bno055_accel_offset_t *accel_offset; A place for Offset and Radius Values
A place to store Offset Values
*Return Parameter: @retval 0 -> Success
* @retval 1 -> Error
*******************************************************************************************/
int8_t NAxisMotion::write_accel_offset(struct bno055_accel_offset_t *accel_offset)
{
return(bno055_write_accel_offset(accel_offset));
}