A library of the 9-Axis Sensor BNO055 from Bosch Sensortec.

Requires the I2C-Master library - Link

Revision:
1:6c64ebf1f2b5
Parent:
0:a2a71c38065e
Child:
2:d7baee646b4e
--- a/bno055.cpp	Thu Jul 11 09:34:29 2019 +0000
+++ b/bno055.cpp	Thu Jul 11 10:57:31 2019 +0000
@@ -20,8 +20,19 @@
  */
 
 #ifdef DEBUGGING_ENABLED
-BNO055::BNO055(uint8_t slave_address, DoWi& dowi, DigitalOut& ResetPin, bool external_clk, Serial& DEBUG_SERIAL) :
-    m_i2c_master(dowi),
+/**
+ * @brief Construct a new BNO055::BNO055 object
+ * 
+ * This is the Debugging-version of the BNO055 class. The constructor requires an additional Serial-Object.
+ * 
+ * @param slave_address The slave-address (determined by the Address-Pin on the chip)
+ * @param i2c_master    I2C-Master object
+ * @param ResetPin      Reference of the Output-Pin, which is connected to the Reset-Pin of the Sensor
+ * @param external_clk  Boolean to determine if the Sensor uses an external 32kHz oscillator
+ * @param DEBUG_SERIAL  Reference of the Serial-object used to debug the different functions.
+ */
+BNO055::BNO055(uint8_t slave_address, I2C_Master& i2c_master, DigitalOut& ResetPin, bool external_clk, Serial& DEBUG_SERIAL) :
+    m_i2c_master(i2c_master),
     m_ResetPin(ResetPin),
     m_DEBUG_SERIAL(DEBUG_SERIAL),
     m_bno055_address(slave_address << 1)
@@ -47,6 +58,14 @@
     setOrientation(REMAP_OPTION_P1);
 }
 #else
+/**
+ * @brief Construct a new BNO055::BNO055 object
+ * 
+ * @param slave_address The slave-address (determined by the Address-Pin on the chip)
+ * @param i2c_master    I2C-Master object
+ * @param ResetPin      Reference of the Output-Pin, which is connected to the Reset-Pin of the Sensor
+ * @param external_clk  Boolean to determine if the Sensor uses an external 32kHz oscillator
+ */
 BNO055::BNO055(uint8_t slave_address, I2C_Master& i2c_master, DigitalOut& ResetPin, bool external_clk) :
     m_i2c_master(i2c_master),
     m_ResetPin(ResetPin),
@@ -74,6 +93,26 @@
 }
 #endif
 
+/**
+ * @brief Defines the format of the measurment units
+ * 
+ * Following is a table, which displays all the possible formats for each measurement units. The column <i>Code<\i>
+ * contain the values, which are used in the programm.
+ * 
+ * | Type         | Formats                                                | Code                           |
+ * | :----------- | :----------------------------------------------------- | :----------------------------- |
+ * | Orientation  | Windows, Android - this changes the ranges of the axis.| WINDOWS, ANDROID               |
+ * | Temperature  | Celsius, Fahrenheit                                    | CELSIUS, FAHRENHEIT            |
+ * | Euler        | Degree, Radians                                        | DEGREE, RADIANS                |
+ * | Gyroscope    | degree per seconds, radian per seconds                 | DEGREE_PER_SEC, RADIAN_PER_SEC |
+ * | Acceleration | acceleration (m/s2), milli g-force                     | ACCELERATION, MILLI_G_FORCE    |
+ * 
+ * @param new_orientation_format  
+ * @param new_temperature_format  
+ * @param new_euler_format        
+ * @param new_gyroscope_format    
+ * @param new_acceleration_format 
+ */
 void    BNO055::setUnitFormat(bno055_orientation_t  new_orientation_format,
                               bno055_temperature_t  new_temperature_format,
                               bno055_euler_t        new_euler_format,