Fixed library from MBED update 145.

Dependents:   Bicycl_Computer_NUCLEO-F411RE

Fork of BNO055_fusion by Kenji Arai

Files at this revision

API Documentation at this revision

Comitter:
kenjiArai
Date:
Wed Apr 08 11:27:57 2015 +0000
Parent:
1:cb7e19c0a702
Child:
3:0ad6f85b178f
Commit message:
Added read_calib_status() function

Changed in this revision

BNO055.cpp Show annotated file Show diff for this revision Revisions of this file
BNO055.h Show annotated file Show diff for this revision Revisions of this file
--- a/BNO055.cpp	Tue Apr 07 12:03:58 2015 +0000
+++ b/BNO055.cpp	Wed Apr 08 11:27:57 2015 +0000
@@ -7,7 +7,7 @@
  *  http://www.page.sannet.ne.jp/kenjia/index.html
  *  http://mbed.org/users/kenjiArai/
  *      Created: March     30th, 2015
- *      Revised: April      7th, 2015
+ *      Revised: April      8th, 2015
  *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
@@ -306,7 +306,7 @@
 }
 
 /////////////// Check chip ready or not  //////////////////
-uint8_t BNO055::chip_ready()
+uint8_t BNO055::chip_ready(void)
 {
     if (ready_flg == 0x0f) {
         return 1;
@@ -314,6 +314,16 @@
     return 0;
 }
 
+/////////////// Read Calibration status  //////////////////
+uint8_t BNO055::read_calib_status(void)
+{
+    select_page(0);
+    dt[0] = BNO055_CALIB_STAT;
+    _i2c.write(chip_addr, dt, 1, true);
+    _i2c.read(chip_addr, dt, 1, false);
+    return dt[0];
+}
+
 /////////////// Change Fusion mode  ///////////////////////
 void BNO055::change_fusion_mode(uint8_t mode)
 {
--- a/BNO055.h	Tue Apr 07 12:03:58 2015 +0000
+++ b/BNO055.h	Wed Apr 08 11:27:57 2015 +0000
@@ -7,7 +7,7 @@
  *  http://www.page.sannet.ne.jp/kenjia/index.html
  *  http://mbed.org/users/kenjiArai/
  *      Created: March     30th, 2015
- *      Revised: April      7th, 2015
+ *      Revised: April      8th, 2015
  *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
@@ -215,6 +215,12 @@
       */
     uint8_t chip_ready(void);
 
+    /** Read calibration status
+      * @param none
+      * @return SYS(7:6),GYR(5:4),ACC(3:2),MAG(1:0) 3 = Calibrated, 0= not yet
+      */
+    uint8_t read_calib_status(void);
+
     /** Reset
       * @param none
       * @return 0 = sucess, 1 = Not avirable chip