Showing preview only (1,005K chars total). Download the full file or copy to clipboard to get everything.
Repository: BoschSensortec/BNO055_driver
Branch: master
Commit: 6c5d87b771b1
Files: 5
Total size: 980.3 KB
Directory structure:
gitextract_2eq01wo3/
├── LICENSE
├── README.md
├── bno055.c
├── bno055.h
└── bno055_support.c
================================================
FILE CONTENTS
================================================
================================================
FILE: LICENSE
================================================
Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved.
BSD-3-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: README.md
================================================
## Table of Contents
- [Introduction](#intro)
- [Version](#ver)
- [Integration details](#integration)
- [Driver files information](#fileinfo)
- [Supported sensor interface](#interface)
- [Copyright](#copy)
### Introduction<a name=intro></a>
- This package contains the Bosch Sensortec MEMS BNO055 sensor driver (sensor API)
- The sensor driver package includes bno055.h, bno055.c and bno055_support.c files
### Version<a name=ver></a>
- Version of bno055 sensor driver is:
* bno055.c - V2.0.3
* bno055.h - V2.0.3
* bno055_support.c - V1.0.4
### Integration details<a name=integration></a>
- Integrate bno055.h and bno055.c file in to your project.
- The bno055_support.c file contains only examples for API use cases, so it is not required to integrate into project.
### Driver files information<a name=fileinfo></a>
- bno055.h
* This header file has the register address definition, constant definitions, data type definition and supported sensor driver calls declarations.
- bno055.c
* This file contains the implementation for the sensor driver APIs.
- bno055_support.c
* This file shall be used as an user guidance, here you can find samples of
* Initialize the sensor with I2C communication
- Add your code to the I2C bus read and bus write functions.
- Return value can be chosen by yourself
- API just passes that value to your application code
- Add your code to the delay function
- Change I2C address accordingly in bno055.h
* Power mode configuration of the sensor
* Get and set functions usage
* Reading the sensor read out data
### Supported sensor interface<a name=interface></a>
- This BNO055 sensor driver supports I2C and SPI interfaces
### Copyright<a name=copy></a>
- Copyright (C) 2015 - 2016 Bosch Sensortec GmbH
================================================
FILE: bno055.c
================================================
/**
* Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved.
*
* BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @file bno055.c
* @date 10/01/2020
* @version 2.0.6
*
*/
/*********************************************************/
/* INCLUDES */
/*******************************************************/
#include "bno055.h"
#ifdef __KERNEL__
#include <linux/types.h>
#include <linux/kernel.h>
#else
#include <stdint.h>
#include <stddef.h>
#endif
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *) 0)
#endif
#endif
/*! file <BNO055 >
* brief <Sensor driver for BNO055> */
/* STRUCTURE DEFINITIONS */
static struct bno055_t *p_bno055;
/* LOCAL FUNCTIONS */
/*!
* @brief
* This API is used for initialize
* bus read, bus write function pointers,device
* address,accel revision id, gyro revision id
* mag revision id, software revision id, boot loader
* revision id and page id
*
* @param bno055 - structure pointer
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
* @note While changing the parameter of the bno055_t
* consider the following point:
* Changing the reference value of the parameter
* will changes the local copy or local reference
* make sure your changes will not
* affect the reference value of the parameter
* (Better case don't change the reference value of the parameter)
*/
BNO055_RETURN_FUNCTION_TYPE bno055_init(struct bno055_t *bno055)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8 = BNO055_INIT_VALUE;
u8 bno055_page_zero_u8 = BNO055_PAGE_ZERO;
/* Array holding the Software revision id
*/
u8 a_SW_ID_u8[BNO055_REV_ID_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
/* stuct parameters are assign to bno055*/
p_bno055 = bno055;
/* Write the default page as zero*/
com_rslt = p_bno055->BNO055_BUS_WRITE_FUNC(p_bno055->dev_addr,
BNO055_PAGE_ID_REG,
&bno055_page_zero_u8,
BNO055_GEN_READ_WRITE_LENGTH);
/* Read the chip id of the sensor from page
* zero 0x00 register*/
com_rslt += p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_CHIP_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
p_bno055->chip_id = data_u8;
/* Read the accel revision id from page
* zero 0x01 register*/
com_rslt += p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_ACCEL_REV_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
p_bno055->accel_rev_id = data_u8;
/* Read the mag revision id from page
* zero 0x02 register*/
com_rslt += p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_MAG_REV_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
p_bno055->mag_rev_id = data_u8;
/* Read the gyro revision id from page
* zero 0x02 register*/
com_rslt += p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_GYRO_REV_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
p_bno055->gyro_rev_id = data_u8;
/* Read the boot loader revision from page
* zero 0x06 register*/
com_rslt += p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_BL_REV_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
p_bno055->bl_rev_id = data_u8;
/* Read the software revision id from page
* zero 0x04 and 0x05 register( 2 bytes of data)*/
com_rslt += p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_SW_REV_ID_LSB_REG,
a_SW_ID_u8,
BNO055_LSB_MSB_READ_LENGTH);
a_SW_ID_u8[BNO055_SW_ID_LSB] = BNO055_GET_BITSLICE(a_SW_ID_u8[BNO055_SW_ID_LSB], BNO055_SW_REV_ID_LSB);
p_bno055->sw_rev_id =
(u16)((((u32)((u8)a_SW_ID_u8[BNO055_SW_ID_MSB])) << BNO055_SHIFT_EIGHT_BITS) | (a_SW_ID_u8[BNO055_SW_ID_LSB]));
/* Read the page id from the register 0x07*/
com_rslt += p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_PAGE_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
p_bno055->page_id = data_u8;
return com_rslt;
}
/*!
* @brief
* This API gives data to the given register and
* the data is written in the corresponding register address
*
* @param addr_u8 : Address of the register
* @param data_u8 : Data to be written to the register
* @param len_u8 : Length of the Data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_write_register(u8 addr_u8, u8 *data_u8, u8 len_u8)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/* Write the values of respective given register */
com_rslt = p_bno055->BNO055_BUS_WRITE_FUNC(p_bno055->dev_addr, addr_u8, data_u8, len_u8);
}
return com_rslt;
}
/*!
* @brief This API reads the data from
* the given register address
*
* @param addr_u8 : Address of the register
* @param data_u8 : address of the variable,
* read value will be kept
* @param len_u8 : Length of the data
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_register(u8 addr_u8, u8 *data_u8, u8 len_u8)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/* Read the value from given register*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr, addr_u8, data_u8, len_u8);
}
return com_rslt;
}
/*!
* @brief This API reads chip id
* from register 0x00 it is a byte of data
*
*
* @param chip_id_u8 : The chip id value 0xA0
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_chip_id(u8 *chip_id_u8)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8 = BNO055_INIT_VALUE;
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the chip id*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_CHIP_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
*chip_id_u8 = data_u8;
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads software revision id
* from register 0x04 and 0x05 it is a two byte of data
*
* @param sw_id_u8 : The SW revision id
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_sw_rev_id(u16 *sw_id_u8)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* array having the software revision id
* data_u8[0] - LSB
* data_u8[1] - MSB*/
u8 data_u8[BNO055_REV_ID_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty*/
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the two byte value of software
* revision id*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_SW_REV_ID_LSB_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SW_ID_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SW_ID_LSB], BNO055_SW_REV_ID_LSB);
*sw_id_u8 =
(u16)((((u32)((u8)data_u8[BNO055_SW_ID_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SW_ID_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads page id
* from register 0x07 it is a byte of data
*
*
* @param page_id_u8 : The value of page id
*
* BNO055_PAGE_ZERO -> 0x00
* BNO055_PAGE_ONE -> 0x01
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_page_id(u8 *page_id_u8)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8 = BNO055_INIT_VALUE;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/* Read the page id form 0x07*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_PAGE_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
if (com_rslt == BNO055_SUCCESS)
{
data_u8 = BNO055_GET_BITSLICE(data_u8, BNO055_PAGE_ID);
*page_id_u8 = data_u8;
p_bno055->page_id = data_u8;
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API used to write
* the page id register 0x07
*
* @param page_id_u8 : The value of page id
*
* BNO055_PAGE_ZERO -> 0x00
* BNO055_PAGE_ONE -> 0x01
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_write_page_id(u8 page_id_u8)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8r = BNO055_INIT_VALUE;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/* Read the current page*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_PAGE_ID_REG,
&data_u8r,
BNO055_GEN_READ_WRITE_LENGTH);
/* Check condition for communication BNO055_SUCCESS*/
if (com_rslt == BNO055_SUCCESS)
{
data_u8r = BNO055_SET_BITSLICE(data_u8r, BNO055_PAGE_ID, page_id_u8);
/* Write the page id*/
com_rslt += p_bno055->BNO055_BUS_WRITE_FUNC(p_bno055->dev_addr,
BNO055_PAGE_ID_REG,
&data_u8r,
BNO055_GEN_READ_WRITE_LENGTH);
if (com_rslt == BNO055_SUCCESS)
{
p_bno055->page_id = page_id_u8;
}
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads accel revision id
* from register 0x01 it is a byte of value
*
* @param accel_rev_id_u8 : The accel revision id 0xFB
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_accel_rev_id(u8 *accel_rev_id_u8)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8 = BNO055_INIT_VALUE;
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the accel revision id */
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_ACCEL_REV_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
*accel_rev_id_u8 = data_u8;
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads mag revision id
* from register 0x02 it is a byte of value
*
* @param mag_rev_id_u8 : The mag revision id 0x32
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_mag_rev_id(u8 *mag_rev_id_u8)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8 = BNO055_INIT_VALUE;
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the mag revision id */
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_MAG_REV_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
*mag_rev_id_u8 = data_u8;
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads gyro revision id
* from register 0x03 it is a byte of value
*
* @param gyro_rev_id_u8 : The gyro revision id 0xF0
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_gyro_rev_id(u8 *gyro_rev_id_u8)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8 = BNO055_INIT_VALUE;
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the gyro revision id */
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_GYRO_REV_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
*gyro_rev_id_u8 = data_u8;
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API used to read boot loader revision id
* from register 0x06 it is a byte of value
*
* @param bl_rev_id_u8 : The boot loader revision id
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_bl_rev_id(u8 *bl_rev_id_u8)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8 = BNO055_INIT_VALUE;
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the boot loader revision id */
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_BL_REV_ID_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
*bl_rev_id_u8 = data_u8;
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads acceleration data X values
* from register 0x08 and 0x09 it is a two byte data
*
*
*
*
* @param accel_x_s16 : The X raw data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_accel_x(s16 *accel_x_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the accel x value
* data_u8[BNO055_SENSOR_DATA_LSB] - x-LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - x-MSB
*/
u8 data_u8[BNO055_ACCEL_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the accel x axis two byte value*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_ACCEL_DATA_X_LSB_VALUEX_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_ACCEL_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_ACCEL_DATA_X_MSB_VALUEX);
*accel_x_s16 =
(s16)((((s32)(s8)(data_u8[BNO055_SENSOR_DATA_MSB])) << (BNO055_SHIFT_EIGHT_BITS)) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads acceleration data Y values
* from register 0x0A and 0x0B it is a two byte data
*
*
*
*
* @param accel_y_s16 : The Y raw data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_accel_y(s16 *accel_y_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the accel y value
* data_u8[BNO055_SENSOR_DATA_LSB] - y-LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - y-MSB
*/
u8 data_u8[BNO055_ACCEL_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the accel y axis two byte value*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_ACCEL_DATA_Y_LSB_VALUEY_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_ACCEL_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_ACCEL_DATA_Y_MSB_VALUEY);
*accel_y_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads acceleration data z values
* from register 0x0C and 0x0D it is a two byte data
*
*
*
*
* @param accel_z_s16 : The z raw data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_accel_z(s16 *accel_z_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the accel z value
* data_u8[BNO055_SENSOR_DATA_LSB] - z-LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - z-MSB
*/
u8 data_u8[BNO055_ACCEL_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the accel z axis two byte value*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_ACCEL_DATA_Z_LSB_VALUEZ_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_ACCEL_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_ACCEL_DATA_Z_MSB_VALUEZ);
*accel_z_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads acceleration data xyz values
* from register 0x08 to 0x0D it is a six byte data
*
*
* @param accel : The value of accel xyz data
*
* Parameter | result
* --------- | -----------------
* x | The accel x data
* y | The accel y data
* z | The accel z data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_accel_xyz(struct bno055_accel_t *accel)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the accel xyz value
* data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB] - x->LSB
* data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB] - x->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB] - z->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB] - z->MSB
*/
u8 data_u8[BNO055_ACCEL_XYZ_DATA_SIZE] = {
BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE
};
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_ACCEL_DATA_X_LSB_VALUEX_REG,
data_u8,
BNO055_ACCEL_XYZ_DATA_SIZE);
/* Data X*/
data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB],
BNO055_ACCEL_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB],
BNO055_ACCEL_DATA_X_MSB_VALUEX);
accel->x =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB]));
/* Data Y*/
data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB],
BNO055_ACCEL_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB],
BNO055_ACCEL_DATA_Y_MSB_VALUEY);
accel->y =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB]));
/* Data Z*/
data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB],
BNO055_ACCEL_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB],
BNO055_ACCEL_DATA_Z_MSB_VALUEZ);
accel->z =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads mag data x values
* from register 0x0E and 0x0F it is a two byte data
*
*
*
*
* @param mag_x_s16 : The x raw data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_mag_x(s16 *mag_x_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the mag x value
* data_u8[BNO055_SENSOR_DATA_LSB] - x->LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - x->MSB
*/
u8 data_u8[BNO055_MAG_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/*Read the mag x two bytes of data */
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_MAG_DATA_X_LSB_VALUEX_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_MAG_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_MAG_DATA_X_MSB_VALUEX);
*mag_x_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads mag data y values
* from register 0x10 and 0x11 it is a two byte data
*
*
*
*
* @param mag_y_s16 : The y raw data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_mag_y(s16 *mag_y_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the mag y value
* data_u8[BNO055_SENSOR_DATA_LSB] - y->LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - y->MSB
*/
u8 data_u8[BNO055_MAG_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/*Read the mag y two bytes of data */
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_MAG_DATA_Y_LSB_VALUEY_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_MAG_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_MAG_DATA_Y_MSB_VALUEY);
*mag_y_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads mag data z values
* from register 0x12 and 0x13 it is a two byte data
*
*
*
*
* @param mag_z_s16 : The z raw data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_mag_z(s16 *mag_z_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the mag z value
* data_u8[BNO055_SENSOR_DATA_LSB] - z->LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - z->MSB
*/
u8 data_u8[BNO055_MAG_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_MAG_DATA_Z_LSB_VALUEZ_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
/*Read the mag z two bytes of data */
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_MAG_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_MAG_DATA_Z_MSB_VALUEZ);
*mag_z_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads mag data xyz values
* from register 0x0E to 0x13 it is a six byte data
*
*
* @param mag : The mag xyz values
*
* Parameter | result
* --------- | -----------------
* x | The mag x data
* y | The mag y data
* z | The mag z data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_mag_xyz(struct bno055_mag_t *mag)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the mag xyz value
* data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB] - x->LSB
* data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB] - x->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB] - z->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB] - z->MSB
*/
u8 data_u8[BNO055_MAG_XYZ_DATA_SIZE] = {
BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE
};
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/*Read the six byte value of mag xyz*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_MAG_DATA_X_LSB_VALUEX_REG,
data_u8,
BNO055_MAG_XYZ_DATA_SIZE);
/* Data X*/
data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB],
BNO055_MAG_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB],
BNO055_MAG_DATA_X_MSB_VALUEX);
mag->x =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB]));
/* Data Y*/
data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB],
BNO055_MAG_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB],
BNO055_MAG_DATA_Y_MSB_VALUEY);
mag->y =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB]));
/* Data Z*/
data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB],
BNO055_MAG_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB],
BNO055_MAG_DATA_Z_MSB_VALUEZ);
mag->z =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads gyro data x values
* from register 0x14 and 0x15 it is a two byte data
*
*
*
*
* @param gyro_x_s16 : The x raw data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_gyro_x(s16 *gyro_x_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8[BNO055_GYRO_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the gyro 16 bit x value*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_GYRO_DATA_X_LSB_VALUEX_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_GYRO_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_GYRO_DATA_X_MSB_VALUEX);
*gyro_x_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads gyro data y values
* from register 0x16 and 0x17 it is a two byte data
*
*
*
*
* @param gyro_y_s16 : The y raw data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_gyro_y(s16 *gyro_y_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8[BNO055_GYRO_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the value of gyro y */
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_GYRO_DATA_Y_LSB_VALUEY_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_GYRO_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_GYRO_DATA_Y_MSB_VALUEY);
*gyro_y_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads gyro data z values
* from register 0x18 and 0x19 it is a two byte data
*
* @param gyro_z_s16 : The z raw data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_gyro_z(s16 *gyro_z_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8[BNO055_GYRO_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the gyro z 16 bit value*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_GYRO_DATA_Z_LSB_VALUEZ_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_GYRO_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_GYRO_DATA_Z_MSB_VALUEZ);
*gyro_z_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads gyro data xyz values
* from register 0x14 to 0x19 it is a six byte data
*
*
* @param gyro : The value of gyro xyz data's
*
* Parameter | result
* --------- | -----------------
* x | The gyro x data
* y | The gyro y data
* z | The gyro z data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_gyro_xyz(struct bno055_gyro_t *gyro)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the gyro xyz value
* data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB] - x->LSB
* data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB] - x->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB] - z->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB] - z->MSB
*/
u8 data_u8[BNO055_GYRO_XYZ_DATA_SIZE] = {
BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE
};
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the six bytes data of gyro xyz*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_GYRO_DATA_X_LSB_VALUEX_REG,
data_u8,
BNO055_GYRO_XYZ_DATA_SIZE);
/* Data x*/
data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB],
BNO055_GYRO_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB],
BNO055_GYRO_DATA_X_MSB_VALUEX);
gyro->x =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB]));
/* Data y*/
data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB],
BNO055_GYRO_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB],
BNO055_GYRO_DATA_Y_MSB_VALUEY);
gyro->y =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB]));
/* Data z*/
data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB],
BNO055_GYRO_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB],
BNO055_GYRO_DATA_Z_MSB_VALUEZ);
gyro->z =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads gyro data z values
* from register 0x1A and 0x1B it is a two byte data
*
* @param euler_h_s16 : The raw h data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_euler_h(s16 *euler_h_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the Euler h value
* data_u8[BNO055_SENSOR_DATA_EULER_LSB] - h->LSB
* data_u8[BNO055_SENSOR_DATA_EULER_MSB] - h->MSB
*/
u8 data_u8[BNO055_EULER_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the eulre heading data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_EULER_H_LSB_VALUEH_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_EULER_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_EULER_LSB],
BNO055_EULER_H_LSB_VALUEH);
data_u8[BNO055_SENSOR_DATA_EULER_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_EULER_MSB],
BNO055_EULER_H_MSB_VALUEH);
*euler_h_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_EULER_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_EULER_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads Euler data r values
* from register 0x1C and 0x1D it is a two byte data
*
* @param euler_r_s16 : The raw r data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_euler_r(s16 *euler_r_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the Euler r value
* data_u8[BNO055_SENSOR_DATA_EULER_LSB] - r->LSB
* data_u8[BNO055_SENSOR_DATA_EULER_MSB] - r->MSB
*/
u8 data_u8[BNO055_EULER_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the Euler roll data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_EULER_R_LSB_VALUER_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_EULER_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_EULER_LSB],
BNO055_EULER_R_LSB_VALUER);
data_u8[BNO055_SENSOR_DATA_EULER_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_EULER_MSB],
BNO055_EULER_R_MSB_VALUER);
*euler_r_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_EULER_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_EULER_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads Euler data p values
* from register 0x1E and 0x1F it is a two byte data
*
* @param euler_p_s16 : The raw p data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_euler_p(s16 *euler_p_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the Euler p value
* data_u8[BNO055_SENSOR_DATA_EULER_LSB] - p->LSB
* data_u8[BNO055_SENSOR_DATA_EULER_MSB] - p->MSB
*/
u8 data_u8[BNO055_EULER_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the Euler p data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_EULER_P_LSB_VALUEP_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_EULER_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_EULER_LSB],
BNO055_EULER_P_LSB_VALUEP);
data_u8[BNO055_SENSOR_DATA_EULER_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_EULER_MSB],
BNO055_EULER_P_MSB_VALUEP);
*euler_p_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_EULER_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_EULER_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads Euler data hrp values
* from register 0x1A to 0x1F it is a six byte data
*
*
* @param euler : The Euler hrp data's
*
* Parameter | result
* --------- | -----------------
* h | The Euler h data
* r | The Euler r data
* p | The Euler p data
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_euler_hrp(struct bno055_euler_t *euler)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the Euler hrp value
* data_u8[BNO055_SENSOR_DATA_EULER_HRP_H_LSB] - h->LSB
* data_u8[BNO055_SENSOR_DATA_EULER_HRP_H_MSB] - h->MSB
* data_u8[BNO055_SENSOR_DATA_EULER_HRP_R_LSB] - r->MSB
* data_u8[BNO055_SENSOR_DATA_EULER_HRP_R_MSB] - r->MSB
* data_u8[BNO055_SENSOR_DATA_EULER_HRP_P_LSB] - p->MSB
* data_u8[BNO055_SENSOR_DATA_EULER_HRP_P_MSB] - p->MSB
*/
u8 data_u8[BNO055_EULER_HRP_DATA_SIZE] = {
BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE
};
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the six byte of Euler hrp data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_EULER_H_LSB_VALUEH_REG,
data_u8,
BNO055_EULER_HRP_DATA_SIZE);
/* Data h*/
data_u8[BNO055_SENSOR_DATA_EULER_HRP_H_LSB] = BNO055_GET_BITSLICE(
data_u8[BNO055_SENSOR_DATA_EULER_HRP_H_LSB],
BNO055_EULER_H_LSB_VALUEH);
data_u8[BNO055_SENSOR_DATA_EULER_HRP_H_MSB] = BNO055_GET_BITSLICE(
data_u8[BNO055_SENSOR_DATA_EULER_HRP_H_MSB],
BNO055_EULER_H_MSB_VALUEH);
euler->h =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_EULER_HRP_H_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_EULER_HRP_H_LSB]));
/* Data r*/
data_u8[BNO055_SENSOR_DATA_EULER_HRP_R_LSB] = BNO055_GET_BITSLICE(
data_u8[BNO055_SENSOR_DATA_EULER_HRP_R_LSB],
BNO055_EULER_R_LSB_VALUER);
data_u8[BNO055_SENSOR_DATA_EULER_HRP_R_MSB] = BNO055_GET_BITSLICE(
data_u8[BNO055_SENSOR_DATA_EULER_HRP_R_MSB],
BNO055_EULER_R_MSB_VALUER);
euler->r =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_EULER_HRP_R_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_EULER_HRP_R_LSB]));
/* Data p*/
data_u8[BNO055_SENSOR_DATA_EULER_HRP_P_LSB] = BNO055_GET_BITSLICE(
data_u8[BNO055_SENSOR_DATA_EULER_HRP_P_LSB],
BNO055_EULER_P_LSB_VALUEP);
data_u8[BNO055_SENSOR_DATA_EULER_HRP_P_MSB] = BNO055_GET_BITSLICE(
data_u8[BNO055_SENSOR_DATA_EULER_HRP_P_MSB],
BNO055_EULER_P_MSB_VALUEP);
euler->p =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_EULER_HRP_P_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_EULER_HRP_P_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads quaternion data w values
* from register 0x20 and 0x21 it is a two byte data
*
* @param quaternion_w_s16 : The raw w data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_quaternion_w(s16 *quaternion_w_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the Quaternion w value
* data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB] - w->LSB
* data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB] - w->MSB
*/
u8 data_u8[BNO055_QUATERNION_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the two byte value
* of quaternion w data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_QUATERNION_DATA_W_LSB_VALUEW_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB],
BNO055_QUATERNION_DATA_W_LSB_VALUEW);
data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB],
BNO055_QUATERNION_DATA_W_MSB_VALUEW);
*quaternion_w_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads quaternion data x values
* from register 0x22 and 0x23 it is a two byte data
*
* @param quaternion_x_s16 : The raw x data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_quaternion_x(s16 *quaternion_x_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the quaternion x value
* data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB] - x->LSB
* data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB] - x->MSB
*/
u8 data_u8[BNO055_QUATERNION_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the two byte value
* of quaternion x data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_QUATERNION_DATA_X_LSB_VALUEX_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB],
BNO055_QUATERNION_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB],
BNO055_QUATERNION_DATA_X_MSB_VALUEX);
*quaternion_x_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads quaternion data y values
* from register 0x24 and 0x25 it is a two byte data
*
* @param quaternion_y_s16 : The raw y data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_quaternion_y(s16 *quaternion_y_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the quaternion y value
* data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB] - y->LSB
* data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB] - y->MSB
*/
u8 data_u8[BNO055_QUATERNION_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the two byte value
* of quaternion y data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_QUATERNION_DATA_Y_LSB_VALUEY_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB],
BNO055_QUATERNION_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB],
BNO055_QUATERNION_DATA_Y_MSB_VALUEY);
*quaternion_y_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads quaternion data z values
* from register 0x26 and 0x27 it is a two byte data
*
* @param quaternion_z_s16 : The raw z data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_quaternion_z(s16 *quaternion_z_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the quaternion z value
* data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB] - z->LSB
* data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB] - z->MSB
*/
u8 data_u8[BNO055_QUATERNION_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the two byte value
* of quaternion z data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_QUATERNION_DATA_Z_LSB_VALUEZ_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB],
BNO055_QUATERNION_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB],
BNO055_QUATERNION_DATA_Z_MSB_VALUEZ);
*quaternion_z_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_QUATERNION_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_QUATERNION_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads Quaternion data wxyz values
* from register 0x20 to 0x27 it is a six byte data
*
*
* @param quaternion : The value of quaternion wxyz data's
*
* Parameter | result
* --------- | -----------------
* w | The quaternion w data
* x | The quaternion x data
* y | The quaternion y data
* z | The quaternion z data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_quaternion_wxyz(struct bno055_quaternion_t *quaternion)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the quaternion wxyz value
* data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_W_LSB] - w->LSB
* data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_W_MSB] - w->MSB
* data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_X_LSB] - x->LSB
* data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_X_MSB] - x->MSB
* data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Y_LSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Y_MSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Z_LSB] - z->MSB
* data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Z_MSB] - z->MSB
*/
u8 data_u8[BNO055_QUATERNION_WXYZ_DATA_SIZE] = {
BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE,
BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE
};
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the eight byte value
* of quaternion wxyz data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_QUATERNION_DATA_W_LSB_VALUEW_REG,
data_u8,
BNO055_QUATERNION_WXYZ_DATA_SIZE);
/* Data W*/
data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_W_LSB] =
BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_W_LSB],
BNO055_QUATERNION_DATA_W_LSB_VALUEW);
data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_W_MSB] =
BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_W_MSB],
BNO055_QUATERNION_DATA_W_MSB_VALUEW);
quaternion->w =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_W_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_W_LSB]));
/* Data X*/
data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_X_LSB] =
BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_X_LSB],
BNO055_QUATERNION_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_X_MSB] =
BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_X_MSB],
BNO055_QUATERNION_DATA_X_MSB_VALUEX);
quaternion->x =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_X_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_X_LSB]));
/* Data Y*/
data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Y_LSB] =
BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Y_LSB],
BNO055_QUATERNION_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Y_MSB] =
BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Y_MSB],
BNO055_QUATERNION_DATA_Y_MSB_VALUEY);
quaternion->y =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Y_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Y_LSB]));
/* Data Z*/
data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Z_LSB] =
BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Z_LSB],
BNO055_QUATERNION_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Z_MSB] =
BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Z_MSB],
BNO055_QUATERNION_DATA_Z_MSB_VALUEZ);
quaternion->z =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Z_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_QUATERNION_WXYZ_Z_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads Linear accel data x values
* from register 0x29 and 0x2A it is a two byte data
*
* @param linear_accel_x_s16 : The raw x data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_linear_accel_x(s16 *linear_accel_x_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the linear accel x value
* data_u8[BNO055_SENSOR_DATA_LSB] - x->LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - x->MSB
*/
u8 data_u8[BNO055_ACCEL_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the two byte value
* of linear accel x data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_LINEAR_ACCEL_DATA_X_LSB_VALUEX_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_LINEAR_ACCEL_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_LINEAR_ACCEL_DATA_X_MSB_VALUEX);
*linear_accel_x_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads Linear accel data x values
* from register 0x2B and 0x2C it is a two byte data
*
* @param linear_accel_y_s16 : The raw y data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_linear_accel_y(s16 *linear_accel_y_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the linear accel y value
* data_u8[BNO055_SENSOR_DATA_LSB] - y->LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - y->MSB
*/
u8 data_u8[BNO055_ACCEL_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the two byte value
* of linear accel y data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_LINEAR_ACCEL_DATA_Y_LSB_VALUEY_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_LINEAR_ACCEL_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_LINEAR_ACCEL_DATA_Y_MSB_VALUEY);
*linear_accel_y_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads Linear accel data x values
* from register 0x2C and 0x2D it is a two byte data
*
* @param linear_accel_z_s16 : The raw z data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_linear_accel_z(s16 *linear_accel_z_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the linear accel z value
* data_u8[BNO055_SENSOR_DATA_LSB] - z->LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - z->MSB
*/
u8 data_u8[BNO055_ACCEL_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the two byte value
* of linear accel z data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_LINEAR_ACCEL_DATA_Z_LSB_VALUEZ_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_LINEAR_ACCEL_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_LINEAR_ACCEL_DATA_Z_MSB_VALUEZ);
*linear_accel_z_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads Linear accel data xyz values
* from register 0x28 to 0x2D it is a six byte data
*
*
* @param linear_accel : The value of linear accel xyz data's
*
* Parameter | result
* --------- | -----------------
* x | The linear accel x data
* y | The linear accel y data
* z | The linear accel z data
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_linear_accel_xyz(struct bno055_linear_accel_t *linear_accel)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the linear accel xyz value
* data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB] - x->LSB
* data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB] - x->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB] - z->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB] - z->MSB
*/
u8 data_u8[BNO055_ACCEL_XYZ_DATA_SIZE] = {
BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE
};
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the six byte value
* of linear accel xyz data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_LINEAR_ACCEL_DATA_X_LSB_VALUEX_REG,
data_u8,
BNO055_ACCEL_XYZ_DATA_SIZE);
/* Data x*/
data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB],
BNO055_LINEAR_ACCEL_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB],
BNO055_LINEAR_ACCEL_DATA_X_MSB_VALUEX);
linear_accel->x =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB]));
/* Data y*/
data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB],
BNO055_LINEAR_ACCEL_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB],
BNO055_LINEAR_ACCEL_DATA_Y_MSB_VALUEY);
linear_accel->y =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB]));
/* Data z*/
data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB],
BNO055_LINEAR_ACCEL_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB],
BNO055_LINEAR_ACCEL_DATA_Z_MSB_VALUEZ);
linear_accel->z =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads gravity data x values
* from register 0x2E and 0x2F it is a two byte data
*
* @param gravity_x_s16 : The raw x data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_gravity_x(s16 *gravity_x_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the gravity x value
* data_u8[BNO055_SENSOR_DATA_LSB] - x->LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - x->MSB
*/
u8 data_u8[BNO055_GRAVITY_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the two byte value
* of gravity x data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_GRAVITY_DATA_X_LSB_VALUEX_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_GRAVITY_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_GRAVITY_DATA_X_MSB_VALUEX);
*gravity_x_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads gravity data y values
* from register 0x30 and 0x31 it is a two byte data
*
* @param gravity_y_s16 : The raw y data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_gravity_y(s16 *gravity_y_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the gravity y value
* data_u8[BNO055_SENSOR_DATA_LSB] - y->LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - y->MSB
*/
u8 data_u8[BNO055_GRAVITY_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the two byte value
* of gravity y data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_GRAVITY_DATA_Y_LSB_VALUEY_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_GRAVITY_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_GRAVITY_DATA_Y_MSB_VALUEY);
*gravity_y_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads gravity data z values
* from register 0x32 and 0x33 it is a two byte data
*
* @param gravity_z_s16 : The raw z data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_gravity_z(s16 *gravity_z_s16)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the gravity z value
* data_u8[BNO055_SENSOR_DATA_LSB] - z->LSB
* data_u8[BNO055_SENSOR_DATA_MSB] - z->MSB
*/
u8 data_u8[BNO055_GRAVITY_DATA_SIZE] = { BNO055_INIT_VALUE, BNO055_INIT_VALUE };
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the two byte value
* of gravity z data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_GRAVITY_DATA_Z_LSB_VALUEZ_REG,
data_u8,
BNO055_LSB_MSB_READ_LENGTH);
data_u8[BNO055_SENSOR_DATA_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_LSB],
BNO055_GRAVITY_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_MSB],
BNO055_GRAVITY_DATA_Z_MSB_VALUEZ);
*gravity_z_s16 =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads gravity data xyz values
* from register 0x2E to 0x33 it is a six byte data
*
*
* @param gravity : The value of gravity xyz data's
*
* Parameter | result
* --------- | -----------------
* x | The gravity x data
* y | The gravity y data
* z | The gravity z data
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_gravity_xyz(struct bno055_gravity_t *gravity)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
/* Array holding the gravity xyz value
* data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB] - x->LSB
* data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB] - x->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB] - y->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB] - z->MSB
* data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB] - z->MSB
*/
u8 data_u8[BNO055_GRAVITY_XYZ_DATA_SIZE] = {
BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE
};
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the six byte value
* of gravity xyz data*/
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_GRAVITY_DATA_X_LSB_VALUEX_REG,
data_u8,
BNO055_GRAVITY_XYZ_DATA_SIZE);
/* Data x*/
data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB],
BNO055_GRAVITY_DATA_X_LSB_VALUEX);
data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB],
BNO055_GRAVITY_DATA_X_MSB_VALUEX);
gravity->x =
(s16)(((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_X_MSB]) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_X_LSB]));
/* Data y*/
data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB],
BNO055_GRAVITY_DATA_Y_LSB_VALUEY);
data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB],
BNO055_GRAVITY_DATA_Y_MSB_VALUEY);
gravity->y =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_Y_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_Y_LSB]));
/* Data z*/
data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB],
BNO055_GRAVITY_DATA_Z_LSB_VALUEZ);
data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB] = BNO055_GET_BITSLICE(data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB],
BNO055_GRAVITY_DATA_Z_MSB_VALUEZ);
gravity->z =
(s16)((((s32)((s8)data_u8[BNO055_SENSOR_DATA_XYZ_Z_MSB])) << BNO055_SHIFT_EIGHT_BITS) |
(data_u8[BNO055_SENSOR_DATA_XYZ_Z_LSB]));
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
/*!
* @brief This API reads temperature values
* from register 0x33 it is a byte data
*
* @param temp_s8 : The raw temperature data
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_read_temp_data(s8 *temp_s8)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
u8 data_u8 = BNO055_INIT_VALUE;
s8 stat_s8 = BNO055_ERROR;
/* Check the struct p_bno055 is empty */
if (p_bno055 == NULL)
{
return BNO055_E_NULL_PTR;
}
else
{
/*condition check for page, chip id is
* available in the page zero*/
if (p_bno055->page_id != BNO055_PAGE_ZERO)
{
/* Write the page zero*/
stat_s8 = bno055_write_page_id(BNO055_PAGE_ZERO);
}
if ((stat_s8 == BNO055_SUCCESS) || (p_bno055->page_id == BNO055_PAGE_ZERO))
{
/* Read the raw temperature data */
com_rslt = p_bno055->BNO055_BUS_READ_FUNC(p_bno055->dev_addr,
BNO055_TEMP_REG,
&data_u8,
BNO055_GEN_READ_WRITE_LENGTH);
*temp_s8 = data_u8;
}
else
{
com_rslt = BNO055_ERROR;
}
}
return com_rslt;
}
#ifdef BNO055_FLOAT_ENABLE
/*!
* @brief This API is used to convert the accel x raw data
* to meterpersecseq output as float
*
* @param accel_x_f : The accel x meterpersecseq data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_x_msq(float *accel_x_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_x_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as m/s2 if the unit is in mg*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MSQ)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MSQ);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw x data*/
com_rslt += bno055_read_accel_x(®_accel_x_s16);
p_bno055->delay_msec(BNO055_GEN_READ_WRITE_LENGTH);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw accel x to m/s2*/
data_f = (float)(reg_accel_x_s16 / BNO055_ACCEL_DIV_MSQ);
*accel_x_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel x raw data
* to millig output as float
*
* @param accel_x_f : The accel x millig data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_x_mg(float *accel_x_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_x_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as mg if the unit is in m/s2*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MG)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw x data*/
com_rslt += bno055_read_accel_x(®_accel_x_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw accel x to m/s2*/
data_f = (float)(reg_accel_x_s16 / BNO055_ACCEL_DIV_MG);
*accel_x_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel x raw data
* to meterpersecseq output as float
*
* @param accel_y_f : The accel y meterpersecseq data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_y_msq(float *accel_y_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_y_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as m/s2 if the unit is in mg*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MSQ)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MSQ);
}
if (com_rslt == BNO055_SUCCESS)
{
com_rslt += bno055_read_accel_y(®_accel_y_s16);
p_bno055->delay_msec(BNO055_GEN_READ_WRITE_LENGTH);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw accel y to m/s2*/
data_f = (float)(reg_accel_y_s16 / BNO055_ACCEL_DIV_MSQ);
*accel_y_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel y raw data
* to millig output as float
*
* @param accel_y_f : The accel y millig data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_y_mg(float *accel_y_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_y_s16 = BNO055_INIT_VALUE;
float data = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as mg if the unit is in m/s2*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MG)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw z data*/
com_rslt += bno055_read_accel_y(®_accel_y_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw accel z to mg*/
data = (float)(reg_accel_y_s16 / BNO055_ACCEL_DIV_MG);
*accel_y_f = data;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel z raw data
* to meterpersecseq output as float
*
* @param accel_z_f : The accel z meterpersecseq data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_z_msq(float *accel_z_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_z_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as m/s2 if the unit is in mg*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MSQ)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MSQ);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw z data*/
com_rslt += bno055_read_accel_z(®_accel_z_s16);
p_bno055->delay_msec(BNO055_GEN_READ_WRITE_LENGTH);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw accel z to m/s2*/
data_f = (float)(reg_accel_z_s16 / BNO055_ACCEL_DIV_MSQ);
*accel_z_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel z raw data
* to millig output as float
*
* @param accel_z_f : The accel z millig data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_z_mg(float *accel_z_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_z_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as mg if the unit is in m/s2 */
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MG)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw z data*/
com_rslt += bno055_read_accel_z(®_accel_z_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw accel x to mg*/
data_f = (float)(reg_accel_z_s16 / BNO055_ACCEL_DIV_MG);
*accel_z_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel xyz raw data
* to meterpersecseq output as float
*
* @param accel_xyz : The meterpersecseq data of accel xyz
*
* Parameter | result
* --------- | -----------------
* x | meterpersecseq data of accel
* y | meterpersecseq data of accel
* z | meterpersecseq data of accel
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_xyz_msq(struct bno055_accel_float_t *accel_xyz)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_accel_t reg_accel_xyz = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as m/s2 if the unit is in mg*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MSQ)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MSQ);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw xyz data*/
com_rslt += bno055_read_accel_xyz(®_accel_xyz);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the accel raw xyz to meterpersecseq*/
accel_xyz->x = (float)(reg_accel_xyz.x / BNO055_ACCEL_DIV_MSQ);
accel_xyz->y = (float)(reg_accel_xyz.y / BNO055_ACCEL_DIV_MSQ);
accel_xyz->z = (float)(reg_accel_xyz.z / BNO055_ACCEL_DIV_MSQ);
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel xyz raw data
* to millig output as float
*
* @param accel_xyz : The millig data of accel xyz
*
* Parameter | result
* --------- | -----------------
* x | millig data of accel
* y | millig data of accel
* z | millig data of accel
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_xyz_mg(struct bno055_accel_float_t *accel_xyz)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_accel_t reg_accel_xyz = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as mg if the unit is in m/s2*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MG)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw y data*/
com_rslt += bno055_read_accel_xyz(®_accel_xyz);
if (com_rslt == BNO055_SUCCESS)
{
/*Convert the accel raw xyz to millig */
accel_xyz->x = (float)(reg_accel_xyz.x / BNO055_ACCEL_DIV_MG);
accel_xyz->y = (float)(reg_accel_xyz.y / BNO055_ACCEL_DIV_MG);
accel_xyz->z = (float)(reg_accel_xyz.z / BNO055_ACCEL_DIV_MG);
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the mag x raw data
* to microTesla output as float
*
* @param mag_x_f : The mag x microTesla data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_mag_x_uT(float *mag_x_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_mag_x_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
/* Read raw mag x data */
com_rslt = bno055_read_mag_x(®_mag_x_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw mag x to microTesla*/
data_f = (float)(reg_mag_x_s16 / BNO055_MAG_DIV_UT);
*mag_x_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the mag y raw data
* to microTesla output as float
*
* @param mag_y_f : The mag y microTesla data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_mag_y_uT(float *mag_y_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_mag_y_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
/* Read raw mag y data */
com_rslt = bno055_read_mag_y(®_mag_y_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw mag y to microTesla*/
data_f = (float)(reg_mag_y_s16 / BNO055_MAG_DIV_UT);
*mag_y_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the mag z raw data
* to microTesla output as float
*
* @param mag_z_f : The mag z microTesla data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_mag_z_uT(float *mag_z_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_mag_z_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
/* Read raw mag z data */
com_rslt = bno055_read_mag_z(®_mag_z_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw mag z to microTesla*/
data_f = (float)(reg_mag_z_s16 / BNO055_MAG_DIV_UT);
*mag_z_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the mag yz raw data
* to microTesla output as float
*
* @param mag_xyz_data : The microTesla data of mag xyz
*
* Parameter | result
* --------- | -----------------
* x | microTesla data of mag
* y | microTesla data of mag
* z | microTesla data of mag
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_mag_xyz_uT(struct bno055_mag_float_t *mag_xyz_data)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_mag_t mag_xyz = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
/* Read raw mag x data */
com_rslt = bno055_read_mag_xyz(&mag_xyz);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert mag raw xyz to microTesla*/
mag_xyz_data->x = (float)(mag_xyz.x / BNO055_MAG_DIV_UT);
mag_xyz_data->y = (float)(mag_xyz.y / BNO055_MAG_DIV_UT);
mag_xyz_data->z = (float)(mag_xyz.z / BNO055_MAG_DIV_UT);
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro x raw data
* to dps output as float
*
* @param gyro_x_f : The gyro x dps float data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_x_dps(float *gyro_x_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_x_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as dps if the unit is in rps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_DPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_DPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw x data */
com_rslt += bno055_read_gyro_x(®_gyro_x_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw gyro x to dps*/
data_f = (float)(reg_gyro_x_s16 / BNO055_GYRO_DIV_DPS);
*gyro_x_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro x raw data
* to rps output as float
*
* @param gyro_x_f : The gyro x dps float data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_x_rps(float *gyro_x_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_x_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as rps if the unit is in dps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_RPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_RPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw x data */
com_rslt += bno055_read_gyro_x(®_gyro_x_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw gyro x to rps*/
data_f = (float)(reg_gyro_x_s16 / BNO055_GYRO_DIV_RPS);
*gyro_x_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro y raw data
* to dps output as float
*
* @param gyro_y_f : The gyro y dps float data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_y_dps(float *gyro_y_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_y_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as dps if the unit is in rps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_DPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_DPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw y data */
com_rslt += bno055_read_gyro_y(®_gyro_y_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw gyro x to dps*/
data_f = (float)(reg_gyro_y_s16 / BNO055_GYRO_DIV_DPS);
*gyro_y_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro y raw data
* to rps output as float
*
* @param gyro_y_f : The gyro y dps float data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_y_rps(float *gyro_y_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_y_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as rps if the unit is in dps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_RPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_RPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw y data */
com_rslt += bno055_read_gyro_y(®_gyro_y_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw gyro x to rps*/
data_f = (float)(reg_gyro_y_s16 / BNO055_GYRO_DIV_RPS);
*gyro_y_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro z raw data
* to dps output as float
*
* @param gyro_z_f : The gyro z dps float data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_z_dps(float *gyro_z_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_z_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as dps if the unit is in rps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_DPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_DPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw z data */
com_rslt += bno055_read_gyro_z(®_gyro_z_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw gyro x to dps*/
data_f = (float)(reg_gyro_z_s16 / BNO055_GYRO_DIV_DPS);
*gyro_z_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro z raw data
* to rps output as float
*
* @param gyro_z_f : The gyro z rps float data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_z_rps(float *gyro_z_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_z_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as rps if the unit is in dps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_RPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_RPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw x data */
com_rslt += bno055_read_gyro_z(®_gyro_z_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw gyro x to rps*/
data_f = (float)(reg_gyro_z_s16 / BNO055_GYRO_DIV_RPS);
*gyro_z_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro xyz raw data
* to dps output as float
*
* @param gyro_xyz_data : The dps data of gyro xyz
*
* Parameter | result
* --------- | -----------------
* x | dps data of gyro
* y | dps data of gyro
* z | dps data of gyro
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_xyz_dps(struct bno055_gyro_float_t *gyro_xyz_data)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_gyro_t gyro_xyz = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as dps if the unit is in rps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_DPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_DPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw xyz data */
com_rslt += bno055_read_gyro_xyz(&gyro_xyz);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert gyro raw xyz to dps*/
gyro_xyz_data->x = (float)(gyro_xyz.x / BNO055_GYRO_DIV_DPS);
gyro_xyz_data->y = (float)(gyro_xyz.y / BNO055_GYRO_DIV_DPS);
gyro_xyz_data->z = (float)(gyro_xyz.z / BNO055_GYRO_DIV_DPS);
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro xyz raw data
* to rps output as float
*
* @param gyro_xyz_data : The rps data of gyro xyz
*
* Parameter | result
* --------- | -----------------
* x | rps data of gyro
* y | rps data of gyro
* z | rps data of gyro
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_xyz_rps(struct bno055_gyro_float_t *gyro_xyz_data)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_gyro_t gyro_xyz = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as rps if the unit is in dps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_RPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_RPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw xyz data */
com_rslt += bno055_read_gyro_xyz(&gyro_xyz);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert gyro raw xyz to rps*/
gyro_xyz_data->x = (float)(gyro_xyz.x / BNO055_GYRO_DIV_RPS);
gyro_xyz_data->y = (float)(gyro_xyz.y / BNO055_GYRO_DIV_RPS);
gyro_xyz_data->z = (float)(gyro_xyz.z / BNO055_GYRO_DIV_RPS);
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler h raw data
* to degree output as float
*
* @param euler_h_f : The float value of Euler h degree
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_h_deg(float *euler_h_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_h_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as degree if the unit is in radians */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_DEG)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_DEG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw h data*/
com_rslt += bno055_read_euler_h(®_euler_h_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler h data to degree*/
data_f = (float)(reg_euler_h_s16 / BNO055_EULER_DIV_DEG);
*euler_h_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler h raw data
* to radians output as float
*
* @param euler_h_f : The float value of Euler h radians
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_h_rad(float *euler_h_f)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_h_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_RAD)
{
/* Read the current Euler unit and set the
* unit as radians if the unit is in degree */
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_RAD);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw h data*/
com_rslt += bno055_read_euler_h(®_euler_h_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler h data to degree*/
data_f = (float)(reg_euler_h_s16 / BNO055_EULER_DIV_RAD);
*euler_h_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler r raw data
* to degree output as float
*
* @param euler_r_f : The float value of Euler r degree
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_r_deg(float *euler_r_f)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_r = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as degree if the unit is in radians */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_DEG)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_DEG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw r data*/
com_rslt += bno055_read_euler_r(®_euler_r);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler r data to degree*/
data_f = (float)(reg_euler_r / BNO055_EULER_DIV_DEG);
*euler_r_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler r raw data
* to radians output as float
*
* @param euler_r_f : The float value of Euler r radians
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_r_rad(float *euler_r_f)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_r_f = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as radians if the unit is in degree */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_RAD)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_RAD);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw r data*/
com_rslt += bno055_read_euler_r(®_euler_r_f);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler r data to radians*/
data_f = (float)(reg_euler_r_f / BNO055_EULER_DIV_RAD);
*euler_r_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler p raw data
* to degree output as float
*
* @param euler_p_f : The float value of Euler p degree
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_p_deg(float *euler_p_f)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_p_f = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as degree if the unit is in radians */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_DEG)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_DEG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw p data*/
com_rslt += bno055_read_euler_p(®_euler_p_f);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler p data to degree*/
data_f = (float)(reg_euler_p_f / BNO055_EULER_DIV_DEG);
*euler_p_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler p raw data
* to radians output as float
*
* @param euler_p_f : The float value of Euler p radians
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_p_rad(float *euler_p_f)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_p_f = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as radians if the unit is in degree */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_RAD)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_RAD);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw r data*/
com_rslt += bno055_read_euler_p(®_euler_p_f);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler r data to radians*/
data_f = (float)(reg_euler_p_f / BNO055_EULER_DIV_RAD);
*euler_p_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler hrp raw data
* to degree output as float
*
* @param euler_hpr : The degree data of Euler hrp
*
* Parameter | result
* --------- | -----------------
* h | degree data of Euler
* r | degree data of Euler
* p | degree data of Euler
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_hpr_deg(struct bno055_euler_float_t *euler_hpr)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_euler_t reg_euler = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as degree if the unit is in radians */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_DEG)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_DEG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw hrp data*/
com_rslt += bno055_read_euler_hrp(®_euler);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler hrp to degree*/
euler_hpr->h = (float)(reg_euler.h / BNO055_EULER_DIV_DEG);
euler_hpr->p = (float)(reg_euler.p / BNO055_EULER_DIV_DEG);
euler_hpr->r = (float)(reg_euler.r / BNO055_EULER_DIV_DEG);
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler xyz raw data
* to radians output as float
*
* @param euler_hpr : The radians data of Euler hrp
*
* Parameter | result
* --------- | -----------------
* h | radians data of Euler
* r | radians data of Euler
* p | radians data of Euler
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_hpr_rad(struct bno055_euler_float_t *euler_hpr)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_euler_t reg_euler = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as radians if the unit is in degree */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_RAD)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_RAD);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw hrp data*/
com_rslt += bno055_read_euler_hrp(®_euler);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw hrp to radians */
euler_hpr->h = (float)(reg_euler.h / BNO055_EULER_DIV_RAD);
euler_hpr->p = (float)(reg_euler.p / BNO055_EULER_DIV_RAD);
euler_hpr->r = (float)(reg_euler.r / BNO055_EULER_DIV_RAD);
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the linear
* accel x raw data to meterpersecseq output as float
*
* @param linear_accel_x_f : The float value of linear accel x meterpersecseq
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_linear_accel_x_msq(float *linear_accel_x_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_linear_accel_x_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
/* Read the raw x of linear accel */
com_rslt = bno055_read_linear_accel_x(®_linear_accel_x_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw linear accel x to m/s2*/
data_f = (float)(reg_linear_accel_x_s16 / BNO055_LINEAR_ACCEL_DIV_MSQ);
*linear_accel_x_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the linear
* accel y raw data to meterpersecseq output as float
*
* @param linear_accel_y_f : The float value of linear accel y meterpersecseq
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_linear_accel_y_msq(float *linear_accel_y_f)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_linear_accel_y = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
/* Read the raw y of linear accel */
com_rslt = bno055_read_linear_accel_y(®_linear_accel_y);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw linear accel x to m/s2*/
data_f = (float)(reg_linear_accel_y / BNO055_LINEAR_ACCEL_DIV_MSQ);
*linear_accel_y_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the linear
* accel z raw data to meterpersecseq output as float
*
* @param linear_accel_z_f : The float value of linear accel z meterpersecseq
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_linear_accel_z_msq(float *linear_accel_z_f)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_linear_accel_z = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
/* Read the raw x of linear accel */
com_rslt = bno055_read_linear_accel_z(®_linear_accel_z);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw linear accel z to m/s2*/
data_f = (float)(reg_linear_accel_z / BNO055_LINEAR_ACCEL_DIV_MSQ);
*linear_accel_z_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the linear accel xyz raw data
* to meterpersecseq output as float
*
* @param linear_accel_xyz : The meterpersecseq data of linear accel xyz
*
* Parameter | result
* --------- | -----------------
* x | meterpersecseq data of linear accel
* y | meterpersecseq data of linear accel
* z | meterpersecseq data of linear accel
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_linear_accel_xyz_msq(
struct bno055_linear_accel_float_t *linear_accel_xyz)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_linear_accel_t reg_linear_accel = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
/* Read the raw x of linear accel */
com_rslt = bno055_read_linear_accel_xyz(®_linear_accel);
if (com_rslt == BNO055_SUCCESS)
{
linear_accel_xyz->x = (float)(reg_linear_accel.x / BNO055_LINEAR_ACCEL_DIV_MSQ);
linear_accel_xyz->y = (float)(reg_linear_accel.y / BNO055_LINEAR_ACCEL_DIV_MSQ);
linear_accel_xyz->z = (float)(reg_linear_accel.z / BNO055_LINEAR_ACCEL_DIV_MSQ);
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gravity
* x raw data to meterpersecseq output as float
*
* @param gravity_x_f : The float value of gravity x meterpersecseq
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_gravity_float_x_msq(float *gravity_x_f)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gravity_x_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
/* Read raw gravity of x*/
com_rslt = bno055_read_gravity_x(®_gravity_x_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw gravity x to m/s2*/
data_f = (float)(reg_gravity_x_s16 / BNO055_GRAVITY_DIV_MSQ);
*gravity_x_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gravity
* y raw data to meterpersecseq output as float
*
* @param gravity_y_f : The float value of gravity y meterpersecseq
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_gravity_float_y_msq(float *gravity_y_f)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gravity_y_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
/* Read raw gravity of y*/
com_rslt = bno055_read_gravity_y(®_gravity_y_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw gravity y to m/s2*/
data_f = (float)(reg_gravity_y_s16 / BNO055_GRAVITY_DIV_MSQ);
*gravity_y_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gravity
* z raw data to meterpersecseq output as float
*
* @param gravity_z_f : The float value of gravity z meterpersecseq
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_gravity_float_z_msq(float *gravity_z_f)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gravity_z_s16 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
/* Read raw gravity of z */
com_rslt = bno055_read_gravity_z(®_gravity_z_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw gravity z to m/s2*/
data_f = (float)(reg_gravity_z_s16 / BNO055_GRAVITY_DIV_MSQ);
*gravity_z_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gravity xyz raw data
* to meterpersecseq output as float
*
* @param gravity_xyz : The meterpersecseq data of gravity xyz
*
* Parameter | result
* --------- | -----------------
* x | meterpersecseq data of gravity
* y | meterpersecseq data of gravity
* z | meterpersecseq data of gravity
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gravity_xyz_msq(struct bno055_gravity_float_t *gravity_xyz)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_gravity_t reg_gravity_xyz = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
/* Read raw gravity of xyz */
com_rslt = bno055_read_gravity_xyz(®_gravity_xyz);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw gravity xyz to meterpersecseq */
gravity_xyz->x = (float)(reg_gravity_xyz.x / BNO055_GRAVITY_DIV_MSQ);
gravity_xyz->y = (float)(reg_gravity_xyz.y / BNO055_GRAVITY_DIV_MSQ);
gravity_xyz->z = (float)(reg_gravity_xyz.z / BNO055_GRAVITY_DIV_MSQ);
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the temperature
* data to Fahrenheit output as float
*
* @param temp_f : The float value of temperature Fahrenheit
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_temp_fahrenheit(float *temp_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s8 reg_temp_s8 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 temp_unit_u8 = BNO055_INIT_VALUE;
/* Read the current temperature unit and set the
* unit as Fahrenheit if the unit is in Celsius */
com_rslt = bno055_get_temp_unit(&temp_unit_u8);
if (temp_unit_u8 != BNO055_TEMP_UNIT_FAHRENHEIT)
{
com_rslt += bno055_set_temp_unit(BNO055_TEMP_UNIT_FAHRENHEIT);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the raw temperature data */
com_rslt += bno055_read_temp_data(®_temp_s8);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw temperature data to Fahrenheit*/
data_f = (float)(reg_temp_s8 / BNO055_TEMP_DIV_FAHRENHEIT);
*temp_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the temperature
* data to Celsius output as float
*
* @param temp_f : The float value of temperature Celsius
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_temp_celsius(float *temp_f)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s8 reg_temp_s8 = BNO055_INIT_VALUE;
float data_f = BNO055_INIT_VALUE;
u8 temp_unit_u8 = BNO055_INIT_VALUE;
/* Read the current temperature unit and set the
* unit as Fahrenheit if the unit is in Celsius */
com_rslt = bno055_get_temp_unit(&temp_unit_u8);
if (temp_unit_u8 != BNO055_TEMP_UNIT_CELSIUS)
{
com_rslt += bno055_set_temp_unit(BNO055_TEMP_UNIT_CELSIUS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the raw temperature data */
com_rslt += bno055_read_temp_data(®_temp_s8);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw temperature data to Fahrenheit*/
data_f = (float)(reg_temp_s8 / BNO055_TEMP_DIV_CELSIUS);
*temp_f = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
#endif
#ifdef BNO055_DOUBLE_ENABLE
/*!
* @brief This API is used to convert the accel x raw data
* to meterpersecseq output as double
*
* @param accel_x_d : The accel x meterpersecseq data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_x_msq(double *accel_x_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_x_s16 = BNO055_INIT_VALUE;
double data_f = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as m/s2 if the unit is in mg*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MSQ)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MSQ);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw y data*/
com_rslt += bno055_read_accel_x(®_accel_x_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw x to m/s2 */
data_f = (double)(reg_accel_x_s16 / BNO055_ACCEL_DIV_MSQ);
*accel_x_d = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel x raw data
* to millig output as double
*
* @param accel_x_d : The accel x millig data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_x_mg(double *accel_x_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_x_s16 = BNO055_INIT_VALUE;
double data_f = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as mg if the unit is in m/s2*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MG)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw y data*/
com_rslt += bno055_read_accel_x(®_accel_x_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw x to mg */
data_f = (double)(reg_accel_x_s16 / BNO055_ACCEL_DIV_MG);
*accel_x_d = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel y raw data
* to meterpersecseq output as double
*
* @param accel_y_d : The accel y meterpersecseq data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_y_msq(double *accel_y_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_y_s16 = BNO055_INIT_VALUE;
double data_f = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as m/s2 if the unit is in mg*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MSQ)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MSQ);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw y data*/
com_rslt += bno055_read_accel_y(®_accel_y_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw x to m/s2 */
data_f = (double)(reg_accel_y_s16 / BNO055_ACCEL_DIV_MSQ);
*accel_y_d = data_f;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel y raw data
* to millig output as double
*
* @param accel_y_d : The accel y millig data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_y_mg(double *accel_y_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_y_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as mg if the unit is in m/s2*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MG)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw y data*/
com_rslt += bno055_read_accel_y(®_accel_y_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw y to mg */
data_d = (double)(reg_accel_y_s16 / BNO055_ACCEL_DIV_MG);
*accel_y_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel z raw data
* to meterpersecseq output as double
*
* @param accel_z_d : The accel z meterpersecseq data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_z_msq(double *accel_z_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_z_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as m/s2 if the unit is in mg*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MSQ)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MSQ);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw z data*/
com_rslt += bno055_read_accel_z(®_accel_z_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw z to m/s2 */
data_d = (double)(reg_accel_z_s16 / BNO055_ACCEL_DIV_MSQ);
*accel_z_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel z raw data
* to millig output as double
*
* @param accel_z_d : The accel z millig data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_z_mg(double *accel_z_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_accel_z_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as mg if the unit is in m/s2*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MG)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw z data*/
com_rslt += bno055_read_accel_z(®_accel_z_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw z to mg */
data_d = (double)(reg_accel_z_s16 / BNO055_ACCEL_DIV_MG);
*accel_z_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel xyz raw data
* to meterpersecseq output as double
*
* @param accel_xyz : The meterpersecseq data of accel xyz
*
* Parameter | result
* --------- | -----------------
* x | meterpersecseq data of accel
* y | meterpersecseq data of accel
* z | meterpersecseq data of accel
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_xyz_msq(struct bno055_accel_double_t *accel_xyz)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_accel_t reg_accel_xyz = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as m/s2 if the unit is in mg*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MSQ)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MSQ);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw xyz data*/
com_rslt += bno055_read_accel_xyz(®_accel_xyz);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw xyz to m/s2*/
accel_xyz->x = (double)(reg_accel_xyz.x / BNO055_ACCEL_DIV_MSQ);
accel_xyz->y = (double)(reg_accel_xyz.y / BNO055_ACCEL_DIV_MSQ);
accel_xyz->z = (double)(reg_accel_xyz.z / BNO055_ACCEL_DIV_MSQ);
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the accel xyz raw data
* to millig output as double
*
* @param accel_xyz : The millig data of accel xyz
*
* Parameter | result
* --------- | -----------------
* x | millig data of accel
* y | millig data of accel
* z | millig data of accel
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_xyz_mg(struct bno055_accel_double_t *accel_xyz)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_accel_t reg_accel_xyz = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
u8 accel_unit_u8 = BNO055_INIT_VALUE;
/* Read the current accel unit and set the
* unit as m/s2 if the unit is in mg*/
com_rslt = bno055_get_accel_unit(&accel_unit_u8);
if (accel_unit_u8 != BNO055_ACCEL_UNIT_MG)
{
com_rslt += bno055_set_accel_unit(BNO055_ACCEL_UNIT_MG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read the accel raw xyz data*/
com_rslt += bno055_read_accel_xyz(®_accel_xyz);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw xyz to mg*/
accel_xyz->x = (double)(reg_accel_xyz.x / BNO055_ACCEL_DIV_MG);
accel_xyz->y = (double)(reg_accel_xyz.y / BNO055_ACCEL_DIV_MG);
accel_xyz->z = (double)(reg_accel_xyz.z / BNO055_ACCEL_DIV_MG);
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the mag x raw data
* to microTesla output as double
*
* @param mag_x_d : The mag x microTesla data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_mag_x_uT(double *mag_x_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_mag_x_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
/* Read raw mag x data */
com_rslt = bno055_read_mag_x(®_mag_x_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw mag x to microTesla */
data_d = (double)(reg_mag_x_s16 / BNO055_MAG_DIV_UT);
*mag_x_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the mag y raw data
* to microTesla output as double
*
* @param mag_y_d : The mag y microTesla data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_mag_y_uT(double *mag_y_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_mag_y_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
/* Read raw mag y data */
com_rslt = bno055_read_mag_y(®_mag_y_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw mag y to microTesla */
data_d = (double)(reg_mag_y_s16 / BNO055_MAG_DIV_UT);
*mag_y_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the mag z raw data
* to microTesla output as double
*
* @param mag_z_d : The mag z microTesla data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_mag_z_uT(double *mag_z_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_mag_z_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
/* Read raw mag x */
com_rslt = bno055_read_mag_z(®_mag_z_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw mag x to microTesla */
data_d = (double)(reg_mag_z_s16 / BNO055_MAG_DIV_UT);
*mag_z_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the mag yz raw data
* to microTesla output as double
*
* @param mag_xyz : The microTesla data of mag xyz
*
* Parameter | result
* --------- | -----------------
* x | microTesla data of mag
* y | microTesla data of mag
* z | microTesla data of mag
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_mag_xyz_uT(struct bno055_mag_double_t *mag_xyz)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_mag_t reg_mag_xyz = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
/* Read raw mag xyz data */
com_rslt = bno055_read_mag_xyz(®_mag_xyz);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw mag xyz to microTesla*/
mag_xyz->x = (double)(reg_mag_xyz.x / BNO055_MAG_DIV_UT);
mag_xyz->y = (double)(reg_mag_xyz.y / BNO055_MAG_DIV_UT);
mag_xyz->z = (double)(reg_mag_xyz.z / BNO055_MAG_DIV_UT);
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro x raw data
* to dps output as double
*
* @param gyro_x_d : The gyro x dps double data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_x_dps(double *gyro_x_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_x_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as dps if the unit is in rps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_DPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_DPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw x data */
com_rslt += bno055_read_gyro_x(®_gyro_x_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw gyro x to dps */
data_d = (double)(reg_gyro_x_s16 / BNO055_GYRO_DIV_DPS);
*gyro_x_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro x raw data
* to rps output as double
*
* @param gyro_x_d : The gyro x dps double data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_x_rps(double *gyro_x_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_x_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as rps if the unit is in dps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_RPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_RPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw x data */
com_rslt += bno055_read_gyro_x(®_gyro_x_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw gyro x to rps */
data_d = (double)(reg_gyro_x_s16 / BNO055_GYRO_DIV_RPS);
*gyro_x_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro y raw data
* to dps output as double
*
* @param gyro_y_d : The gyro y dps double data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_y_dps(double *gyro_y_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_y_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as dps if the unit is in rps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_DPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_DPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw y data */
com_rslt += bno055_read_gyro_y(®_gyro_y_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw gyro y to dps */
data_d = (double)(reg_gyro_y_s16 / BNO055_GYRO_DIV_DPS);
*gyro_y_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro y raw data
* to rps output as double
*
* @param gyro_y_d : The gyro y dps double data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_y_rps(double *gyro_y_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_y_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as rps if the unit is in dps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_RPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_RPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw y data */
com_rslt += bno055_read_gyro_y(®_gyro_y_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw gyro y to rps */
data_d = (double)(reg_gyro_y_s16 / BNO055_GYRO_DIV_RPS);
*gyro_y_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro z raw data
* to dps output as double
*
* @param gyro_z_d : The gyro z dps double data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_z_dps(double *gyro_z_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_z_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as dps if the unit is in rps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_DPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_DPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw z data */
com_rslt += bno055_read_gyro_z(®_gyro_z_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw gyro z to dps */
data_d = (double)(reg_gyro_z_s16 / BNO055_GYRO_DIV_DPS);
*gyro_z_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro z raw data
* to rps output as double
*
* @param gyro_z_d : The gyro z rps double data
*
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_z_rps(double *gyro_z_d)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_gyro_z_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as rps if the unit is in dps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_RPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_RPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw x data */
com_rslt += bno055_read_gyro_z(®_gyro_z_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw gyro x to rps */
data_d = (double)(reg_gyro_z_s16 / BNO055_GYRO_DIV_RPS);
*gyro_z_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro xyz raw data
* to dps output as double
*
* @param gyro_xyz : The dps data of gyro xyz
*
* Parameter | result
* --------- | -----------------
* x | dps data of gyro
* y | dps data of gyro
* z | dps data of gyro
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_xyz_dps(struct bno055_gyro_double_t *gyro_xyz)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_gyro_t reg_gyro_xyz = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as dps if the unit is in rps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_DPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_DPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw xyz data */
com_rslt += bno055_read_gyro_xyz(®_gyro_xyz);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert gyro raw xyz to dps*/
gyro_xyz->x = (double)(reg_gyro_xyz.x / BNO055_GYRO_DIV_DPS);
gyro_xyz->y = (double)(reg_gyro_xyz.y / BNO055_GYRO_DIV_DPS);
gyro_xyz->z = (double)(reg_gyro_xyz.z / BNO055_GYRO_DIV_DPS);
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the gyro xyz raw data
* to rps output as double
*
* @param gyro_xyz : The rps data of gyro xyz
*
* Parameter | result
* --------- | -----------------
* x | rps data of gyro
* y | rps data of gyro
* z | rps data of gyro
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_xyz_rps(struct bno055_gyro_double_t *gyro_xyz)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_gyro_t reg_gyro_xyz = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
u8 gyro_unit_u8 = BNO055_INIT_VALUE;
/* Read the current gyro unit and set the
* unit as rps if the unit is in dps */
com_rslt = bno055_get_gyro_unit(&gyro_unit_u8);
if (gyro_unit_u8 != BNO055_GYRO_UNIT_RPS)
{
com_rslt += bno055_set_gyro_unit(BNO055_GYRO_UNIT_RPS);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read gyro raw x data */
com_rslt += bno055_read_gyro_xyz(®_gyro_xyz);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert the raw gyro xyz to rps*/
gyro_xyz->x = (double)(reg_gyro_xyz.x / BNO055_GYRO_DIV_RPS);
gyro_xyz->y = (double)(reg_gyro_xyz.y / BNO055_GYRO_DIV_RPS);
gyro_xyz->z = (double)(reg_gyro_xyz.z / BNO055_GYRO_DIV_RPS);
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler h raw data
* to degree output as double
*
* @param euler_h_d : The double value of Euler h degree
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_h_deg(double *euler_h_d)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_h_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as degree if the unit is in radians */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_DEG)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_DEG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw h data*/
com_rslt += bno055_read_euler_h(®_euler_h_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler h to degree */
data_d = (double)(reg_euler_h_s16 / BNO055_EULER_DIV_DEG);
*euler_h_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler h raw data
* to radians output as double
*
* @param euler_h_d : The double value of Euler h radians
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_h_rad(double *euler_h_d)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_h_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as radians if the unit is in degree */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_RAD)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_RAD);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw h data*/
com_rslt += bno055_read_euler_h(®_euler_h_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler h to radians */
data_d = (double)(reg_euler_h_s16 / BNO055_EULER_DIV_RAD);
*euler_h_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler r raw data
* to degree output as double
*
* @param euler_r_d : The double value of Euler r degree
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_r_deg(double *euler_r_d)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_r_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as degree if the unit is in radians */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_DEG)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_DEG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw r data*/
com_rslt += bno055_read_euler_r(®_euler_r_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler r to degree */
data_d = (double)(reg_euler_r_s16 / BNO055_EULER_DIV_DEG);
*euler_r_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler r raw data
* to radians output as double
*
* @param euler_r_d : The double value of Euler r radians
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_r_rad(double *euler_r_d)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_r_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as radians if the unit is in degree */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_RAD)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_RAD);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw r data*/
com_rslt += bno055_read_euler_r(®_euler_r_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler r to radians */
data_d = (double)(reg_euler_r_s16 / BNO055_EULER_DIV_RAD);
*euler_r_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler p raw data
* to degree output as double
*
* @param euler_p_d : The double value of Euler p degree
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_p_deg(double *euler_p_d)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_p_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as degree if the unit is in radians */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_DEG)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_DEG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw p data*/
com_rslt += bno055_read_euler_p(®_euler_p_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler p to degree*/
data_d = (double)(reg_euler_p_s16 / BNO055_EULER_DIV_DEG);
*euler_p_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler p raw data
* to radians output as double
*
* @param euler_p_d : The double value of Euler p radians
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_p_rad(double *euler_p_d)
{
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
s16 reg_euler_p_s16 = BNO055_INIT_VALUE;
double data_d = BNO055_INIT_VALUE;
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as radians if the unit is in degree */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_RAD)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_RAD);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw p data*/
com_rslt += bno055_read_euler_p(®_euler_p_s16);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw p to radians*/
data_d = (double)(reg_euler_p_s16 / BNO055_EULER_DIV_RAD);
*euler_p_d = data_d;
}
else
{
com_rslt = BNO055_ERROR;
}
}
else
{
com_rslt = BNO055_ERROR;
}
return com_rslt;
}
/*!
* @brief This API is used to convert the Euler hpr raw data
* to degree output as double
*
* @param euler_hpr : The degree data of Euler hpr
*
* Parameter | result
* --------- | -----------------
* h | degree data of Euler
* r | degree data of Euler
* p | degree data of Euler
*
*
* @return results of bus communication function
* @retval 0 -> BNO055_SUCCESS
* @retval 1 -> BNO055_ERROR
*
*/
BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_hpr_deg(struct bno055_euler_double_t *euler_hpr)
{
/* Variable used to return value of
* communication routine*/
BNO055_RETURN_FUNCTION_TYPE com_rslt = BNO055_ERROR;
struct bno055_euler_t reg_euler = { BNO055_INIT_VALUE, BNO055_INIT_VALUE, BNO055_INIT_VALUE };
u8 euler_unit_u8 = BNO055_INIT_VALUE;
/* Read the current Euler unit and set the
* unit as degree if the unit is in radians */
com_rslt = bno055_get_euler_unit(&euler_unit_u8);
if (euler_unit_u8 != BNO055_EULER_UNIT_DEG)
{
com_rslt += bno055_set_euler_unit(BNO055_EULER_UNIT_DEG);
}
if (com_rslt == BNO055_SUCCESS)
{
/* Read Euler raw h data*/
com_rslt += bno055_read_euler_hrp(®_euler);
if (com_rslt == BNO055_SUCCESS)
{
/* Convert raw Euler hrp to degree*/
gitextract_2eq01wo3/ ├── LICENSE ├── README.md ├── bno055.c ├── bno055.h └── bno055_support.c
SYMBOL INDEX (416 symbols across 3 files) FILE: bno055.c type bno055_t (line 64) | struct bno055_t function BNO055_RETURN_FUNCTION_TYPE (line 91) | BNO055_RETURN_FUNCTION_TYPE bno055_init(struct bno055_t *bno055) function BNO055_RETURN_FUNCTION_TYPE (line 187) | BNO055_RETURN_FUNCTION_TYPE bno055_write_register(u8 addr_u8, u8 *data_u... function BNO055_RETURN_FUNCTION_TYPE (line 222) | BNO055_RETURN_FUNCTION_TYPE bno055_read_register(u8 addr_u8, u8 *data_u8... function BNO055_RETURN_FUNCTION_TYPE (line 253) | BNO055_RETURN_FUNCTION_TYPE bno055_read_chip_id(u8 *chip_id_u8) function BNO055_RETURN_FUNCTION_TYPE (line 305) | BNO055_RETURN_FUNCTION_TYPE bno055_read_sw_rev_id(u16 *sw_id_u8) function BNO055_RETURN_FUNCTION_TYPE (line 369) | BNO055_RETURN_FUNCTION_TYPE bno055_read_page_id(u8 *page_id_u8) function BNO055_RETURN_FUNCTION_TYPE (line 418) | BNO055_RETURN_FUNCTION_TYPE bno055_write_page_id(u8 page_id_u8) function BNO055_RETURN_FUNCTION_TYPE (line 474) | BNO055_RETURN_FUNCTION_TYPE bno055_read_accel_rev_id(u8 *accel_rev_id_u8) function BNO055_RETURN_FUNCTION_TYPE (line 526) | BNO055_RETURN_FUNCTION_TYPE bno055_read_mag_rev_id(u8 *mag_rev_id_u8) function BNO055_RETURN_FUNCTION_TYPE (line 580) | BNO055_RETURN_FUNCTION_TYPE bno055_read_gyro_rev_id(u8 *gyro_rev_id_u8) function BNO055_RETURN_FUNCTION_TYPE (line 633) | BNO055_RETURN_FUNCTION_TYPE bno055_read_bl_rev_id(u8 *bl_rev_id_u8) function BNO055_RETURN_FUNCTION_TYPE (line 690) | BNO055_RETURN_FUNCTION_TYPE bno055_read_accel_x(s16 *accel_x_s16) function BNO055_RETURN_FUNCTION_TYPE (line 756) | BNO055_RETURN_FUNCTION_TYPE bno055_read_accel_y(s16 *accel_y_s16) function BNO055_RETURN_FUNCTION_TYPE (line 824) | BNO055_RETURN_FUNCTION_TYPE bno055_read_accel_z(s16 *accel_z_s16) function BNO055_RETURN_FUNCTION_TYPE (line 895) | BNO055_RETURN_FUNCTION_TYPE bno055_read_accel_xyz(struct bno055_accel_t ... function BNO055_RETURN_FUNCTION_TYPE (line 989) | BNO055_RETURN_FUNCTION_TYPE bno055_read_mag_x(s16 *mag_x_s16) function BNO055_RETURN_FUNCTION_TYPE (line 1057) | BNO055_RETURN_FUNCTION_TYPE bno055_read_mag_y(s16 *mag_y_s16) function BNO055_RETURN_FUNCTION_TYPE (line 1126) | BNO055_RETURN_FUNCTION_TYPE bno055_read_mag_z(s16 *mag_z_s16) function BNO055_RETURN_FUNCTION_TYPE (line 1198) | BNO055_RETURN_FUNCTION_TYPE bno055_read_mag_xyz(struct bno055_mag_t *mag) function BNO055_RETURN_FUNCTION_TYPE (line 1292) | BNO055_RETURN_FUNCTION_TYPE bno055_read_gyro_x(s16 *gyro_x_s16) function BNO055_RETURN_FUNCTION_TYPE (line 1355) | BNO055_RETURN_FUNCTION_TYPE bno055_read_gyro_y(s16 *gyro_y_s16) function BNO055_RETURN_FUNCTION_TYPE (line 1413) | BNO055_RETURN_FUNCTION_TYPE bno055_read_gyro_z(s16 *gyro_z_s16) function BNO055_RETURN_FUNCTION_TYPE (line 1479) | BNO055_RETURN_FUNCTION_TYPE bno055_read_gyro_xyz(struct bno055_gyro_t *g... function BNO055_RETURN_FUNCTION_TYPE (line 1567) | BNO055_RETURN_FUNCTION_TYPE bno055_read_euler_h(s16 *euler_h_s16) function BNO055_RETURN_FUNCTION_TYPE (line 1629) | BNO055_RETURN_FUNCTION_TYPE bno055_read_euler_r(s16 *euler_r_s16) function BNO055_RETURN_FUNCTION_TYPE (line 1692) | BNO055_RETURN_FUNCTION_TYPE bno055_read_euler_p(s16 *euler_p_s16) function BNO055_RETURN_FUNCTION_TYPE (line 1762) | BNO055_RETURN_FUNCTION_TYPE bno055_read_euler_hrp(struct bno055_euler_t ... function BNO055_RETURN_FUNCTION_TYPE (line 1857) | BNO055_RETURN_FUNCTION_TYPE bno055_read_quaternion_w(s16 *quaternion_w_s16) function BNO055_RETURN_FUNCTION_TYPE (line 1921) | BNO055_RETURN_FUNCTION_TYPE bno055_read_quaternion_x(s16 *quaternion_x_s16) function BNO055_RETURN_FUNCTION_TYPE (line 1985) | BNO055_RETURN_FUNCTION_TYPE bno055_read_quaternion_y(s16 *quaternion_y_s16) function BNO055_RETURN_FUNCTION_TYPE (line 2049) | BNO055_RETURN_FUNCTION_TYPE bno055_read_quaternion_z(s16 *quaternion_z_s16) function BNO055_RETURN_FUNCTION_TYPE (line 2122) | BNO055_RETURN_FUNCTION_TYPE bno055_read_quaternion_wxyz(struct bno055_qu... function BNO055_RETURN_FUNCTION_TYPE (line 2232) | BNO055_RETURN_FUNCTION_TYPE bno055_read_linear_accel_x(s16 *linear_accel... function BNO055_RETURN_FUNCTION_TYPE (line 2296) | BNO055_RETURN_FUNCTION_TYPE bno055_read_linear_accel_y(s16 *linear_accel... function BNO055_RETURN_FUNCTION_TYPE (line 2360) | BNO055_RETURN_FUNCTION_TYPE bno055_read_linear_accel_z(s16 *linear_accel... function BNO055_RETURN_FUNCTION_TYPE (line 2430) | BNO055_RETURN_FUNCTION_TYPE bno055_read_linear_accel_xyz(struct bno055_l... function BNO055_RETURN_FUNCTION_TYPE (line 2520) | BNO055_RETURN_FUNCTION_TYPE bno055_read_gravity_x(s16 *gravity_x_s16) function BNO055_RETURN_FUNCTION_TYPE (line 2584) | BNO055_RETURN_FUNCTION_TYPE bno055_read_gravity_y(s16 *gravity_y_s16) function BNO055_RETURN_FUNCTION_TYPE (line 2648) | BNO055_RETURN_FUNCTION_TYPE bno055_read_gravity_z(s16 *gravity_z_s16) function BNO055_RETURN_FUNCTION_TYPE (line 2719) | BNO055_RETURN_FUNCTION_TYPE bno055_read_gravity_xyz(struct bno055_gravit... function BNO055_RETURN_FUNCTION_TYPE (line 2809) | BNO055_RETURN_FUNCTION_TYPE bno055_read_temp_data(s8 *temp_s8) function BNO055_RETURN_FUNCTION_TYPE (line 2864) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_x_msq(float *acce... function BNO055_RETURN_FUNCTION_TYPE (line 2919) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_x_mg(float *accel... function BNO055_RETURN_FUNCTION_TYPE (line 2972) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_y_msq(float *acce... function BNO055_RETURN_FUNCTION_TYPE (line 3024) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_y_mg(float *accel... function BNO055_RETURN_FUNCTION_TYPE (line 3077) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_z_msq(float *acce... function BNO055_RETURN_FUNCTION_TYPE (line 3131) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_z_mg(float *accel... function BNO055_RETURN_FUNCTION_TYPE (line 3188) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_xyz_msq(struct bn... function BNO055_RETURN_FUNCTION_TYPE (line 3246) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_accel_xyz_mg(struct bno... function BNO055_RETURN_FUNCTION_TYPE (line 3299) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_mag_x_uT(float *mag_x_f) function BNO055_RETURN_FUNCTION_TYPE (line 3336) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_mag_y_uT(float *mag_y_f) function BNO055_RETURN_FUNCTION_TYPE (line 3373) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_mag_z_uT(float *mag_z_f) function BNO055_RETURN_FUNCTION_TYPE (line 3415) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_mag_xyz_uT(struct bno05... function BNO055_RETURN_FUNCTION_TYPE (line 3451) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_x_dps(float *gyro_... function BNO055_RETURN_FUNCTION_TYPE (line 3503) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_x_rps(float *gyro_... function BNO055_RETURN_FUNCTION_TYPE (line 3555) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_y_dps(float *gyro_... function BNO055_RETURN_FUNCTION_TYPE (line 3608) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_y_rps(float *gyro_... function BNO055_RETURN_FUNCTION_TYPE (line 3660) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_z_dps(float *gyro_... function BNO055_RETURN_FUNCTION_TYPE (line 3712) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_z_rps(float *gyro_... function BNO055_RETURN_FUNCTION_TYPE (line 3770) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_xyz_dps(struct bno... function BNO055_RETURN_FUNCTION_TYPE (line 3828) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gyro_xyz_rps(struct bno... function BNO055_RETURN_FUNCTION_TYPE (line 3879) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_h_deg(float *eule... function BNO055_RETURN_FUNCTION_TYPE (line 3930) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_h_rad(float *eule... function BNO055_RETURN_FUNCTION_TYPE (line 3978) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_r_deg(float *eule... function BNO055_RETURN_FUNCTION_TYPE (line 4026) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_r_rad(float *eule... function BNO055_RETURN_FUNCTION_TYPE (line 4074) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_p_deg(float *eule... function BNO055_RETURN_FUNCTION_TYPE (line 4123) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_p_rad(float *eule... function BNO055_RETURN_FUNCTION_TYPE (line 4178) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_hpr_deg(struct bn... function BNO055_RETURN_FUNCTION_TYPE (line 4235) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_euler_hpr_rad(struct bn... function BNO055_RETURN_FUNCTION_TYPE (line 4284) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_linear_accel_x_msq(floa... function BNO055_RETURN_FUNCTION_TYPE (line 4318) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_linear_accel_y_msq(floa... function BNO055_RETURN_FUNCTION_TYPE (line 4351) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_linear_accel_z_msq(floa... function BNO055_RETURN_FUNCTION_TYPE (line 4392) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_linear_accel_xyz_msq( function BNO055_RETURN_FUNCTION_TYPE (line 4428) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_gravity_float_x_msq(float *gr... function BNO055_RETURN_FUNCTION_TYPE (line 4462) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_gravity_float_y_msq(float *gr... function BNO055_RETURN_FUNCTION_TYPE (line 4495) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_gravity_float_z_msq(float *gr... function BNO055_RETURN_FUNCTION_TYPE (line 4536) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_gravity_xyz_msq(struct ... function BNO055_RETURN_FUNCTION_TYPE (line 4572) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_temp_fahrenheit(float *... function BNO055_RETURN_FUNCTION_TYPE (line 4624) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_float_temp_celsius(float *tem... function BNO055_RETURN_FUNCTION_TYPE (line 4679) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_x_msq(double *ac... function BNO055_RETURN_FUNCTION_TYPE (line 4733) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_x_mg(double *acc... function BNO055_RETURN_FUNCTION_TYPE (line 4787) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_y_msq(double *ac... function BNO055_RETURN_FUNCTION_TYPE (line 4840) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_y_mg(double *acc... function BNO055_RETURN_FUNCTION_TYPE (line 4891) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_z_msq(double *ac... function BNO055_RETURN_FUNCTION_TYPE (line 4943) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_z_mg(double *acc... function BNO055_RETURN_FUNCTION_TYPE (line 5001) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_xyz_msq(struct b... function BNO055_RETURN_FUNCTION_TYPE (line 5058) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_accel_xyz_mg(struct bn... function BNO055_RETURN_FUNCTION_TYPE (line 5112) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_mag_x_uT(double *mag_x_d) function BNO055_RETURN_FUNCTION_TYPE (line 5150) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_mag_y_uT(double *mag_y_d) function BNO055_RETURN_FUNCTION_TYPE (line 5188) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_mag_z_uT(double *mag_z_d) function BNO055_RETURN_FUNCTION_TYPE (line 5230) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_mag_xyz_uT(struct bno0... function BNO055_RETURN_FUNCTION_TYPE (line 5268) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_x_dps(double *gyr... function BNO055_RETURN_FUNCTION_TYPE (line 5321) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_x_rps(double *gyr... function BNO055_RETURN_FUNCTION_TYPE (line 5374) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_y_dps(double *gyr... function BNO055_RETURN_FUNCTION_TYPE (line 5427) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_y_rps(double *gyr... function BNO055_RETURN_FUNCTION_TYPE (line 5480) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_z_dps(double *gyr... function BNO055_RETURN_FUNCTION_TYPE (line 5533) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_z_rps(double *gyr... function BNO055_RETURN_FUNCTION_TYPE (line 5590) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_xyz_dps(struct bn... function BNO055_RETURN_FUNCTION_TYPE (line 5647) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gyro_xyz_rps(struct bn... function BNO055_RETURN_FUNCTION_TYPE (line 5698) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_h_deg(double *eu... function BNO055_RETURN_FUNCTION_TYPE (line 5747) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_h_rad(double *eu... function BNO055_RETURN_FUNCTION_TYPE (line 5796) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_r_deg(double *eu... function BNO055_RETURN_FUNCTION_TYPE (line 5845) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_r_rad(double *eu... function BNO055_RETURN_FUNCTION_TYPE (line 5894) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_p_deg(double *eu... function BNO055_RETURN_FUNCTION_TYPE (line 5943) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_p_rad(double *eu... function BNO055_RETURN_FUNCTION_TYPE (line 5998) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_hpr_deg(struct b... function BNO055_RETURN_FUNCTION_TYPE (line 6055) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_euler_hpr_rad(struct b... function BNO055_RETURN_FUNCTION_TYPE (line 6107) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_linear_accel_x_msq(dou... function BNO055_RETURN_FUNCTION_TYPE (line 6142) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_linear_accel_y_msq(dou... function BNO055_RETURN_FUNCTION_TYPE (line 6177) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_linear_accel_z_msq(dou... function BNO055_RETURN_FUNCTION_TYPE (line 6217) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_linear_accel_xyz_msq( function BNO055_RETURN_FUNCTION_TYPE (line 6254) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_gravity_double_x_msq(double *... function BNO055_RETURN_FUNCTION_TYPE (line 6288) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_gravity_double_y_msq(double *... function BNO055_RETURN_FUNCTION_TYPE (line 6322) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_gravity_double_z_msq(double *... function BNO055_RETURN_FUNCTION_TYPE (line 6362) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_gravity_xyz_msq(struct... function BNO055_RETURN_FUNCTION_TYPE (line 6398) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_temp_fahrenheit(double... function BNO055_RETURN_FUNCTION_TYPE (line 6447) | BNO055_RETURN_FUNCTION_TYPE bno055_convert_double_temp_celsius(double *t... function BNO055_RETURN_FUNCTION_TYPE (line 6497) | BNO055_RETURN_FUNCTION_TYPE bno055_get_mag_calib_stat(u8 *mag_calib_u8) function BNO055_RETURN_FUNCTION_TYPE (line 6549) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_calib_stat(u8 *accel_calib_u8) function BNO055_RETURN_FUNCTION_TYPE (line 6601) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_calib_stat(u8 *gyro_calib_u8) function BNO055_RETURN_FUNCTION_TYPE (line 6653) | BNO055_RETURN_FUNCTION_TYPE bno055_get_sys_calib_stat(u8 *sys_calib_u8) function BNO055_RETURN_FUNCTION_TYPE (line 6709) | BNO055_RETURN_FUNCTION_TYPE bno055_get_selftest_accel(u8 *selftest_accel... function BNO055_RETURN_FUNCTION_TYPE (line 6765) | BNO055_RETURN_FUNCTION_TYPE bno055_get_selftest_mag(u8 *selftest_mag_u8) function BNO055_RETURN_FUNCTION_TYPE (line 6821) | BNO055_RETURN_FUNCTION_TYPE bno055_get_selftest_gyro(u8 *selftest_gyro_u8) function BNO055_RETURN_FUNCTION_TYPE (line 6877) | BNO055_RETURN_FUNCTION_TYPE bno055_get_selftest_mcu(u8 *selftest_mcu_u8) function BNO055_RETURN_FUNCTION_TYPE (line 6940) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_stat_gyro_any_motion(u8 *gyr... function BNO055_RETURN_FUNCTION_TYPE (line 7002) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_stat_gyro_highrate(u8 *gyro_... function BNO055_RETURN_FUNCTION_TYPE (line 7065) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_stat_accel_high_g(u8 *accel_... function BNO055_RETURN_FUNCTION_TYPE (line 7127) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_stat_accel_any_motion(u8 *ac... function BNO055_RETURN_FUNCTION_TYPE (line 7190) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_stat_accel_no_motion(u8 *acc... function BNO055_RETURN_FUNCTION_TYPE (line 7244) | BNO055_RETURN_FUNCTION_TYPE bno055_get_stat_main_clk(u8 *stat_main_clk_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7296) | BNO055_RETURN_FUNCTION_TYPE bno055_get_sys_stat_code(u8 *sys_stat_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7349) | BNO055_RETURN_FUNCTION_TYPE bno055_get_sys_error_code(u8 *sys_error_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7405) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_unit(u8 *accel_unit_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7462) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_unit(u8 accel_unit_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7539) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_unit(u8 *gyro_unit_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7596) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_unit(u8 gyro_unit_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7673) | BNO055_RETURN_FUNCTION_TYPE bno055_get_euler_unit(u8 *euler_unit_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7730) | BNO055_RETURN_FUNCTION_TYPE bno055_set_euler_unit(u8 euler_unit_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7807) | BNO055_RETURN_FUNCTION_TYPE bno055_get_tilt_unit(u8 *tilt_unit_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7867) | BNO055_RETURN_FUNCTION_TYPE bno055_set_tilt_unit(u8 tilt_unit_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7942) | BNO055_RETURN_FUNCTION_TYPE bno055_get_temp_unit(u8 *temp_unit_u8) function BNO055_RETURN_FUNCTION_TYPE (line 7999) | BNO055_RETURN_FUNCTION_TYPE bno055_set_temp_unit(u8 temp_unit_u8) function BNO055_RETURN_FUNCTION_TYPE (line 8075) | BNO055_RETURN_FUNCTION_TYPE bno055_get_data_output_format(u8 *data_outpu... function BNO055_RETURN_FUNCTION_TYPE (line 8132) | BNO055_RETURN_FUNCTION_TYPE bno055_set_data_output_format(u8 data_output... function BNO055_RETURN_FUNCTION_TYPE (line 8230) | BNO055_RETURN_FUNCTION_TYPE bno055_get_operation_mode(u8 *operation_mode... function BNO055_RETURN_FUNCTION_TYPE (line 8310) | BNO055_RETURN_FUNCTION_TYPE bno055_set_operation_mode(u8 operation_mode_u8) function BNO055_RETURN_FUNCTION_TYPE (line 8430) | BNO055_RETURN_FUNCTION_TYPE bno055_get_power_mode(u8 *power_mode_u8) function BNO055_RETURN_FUNCTION_TYPE (line 8497) | BNO055_RETURN_FUNCTION_TYPE bno055_set_power_mode(u8 power_mode_u8) function BNO055_RETURN_FUNCTION_TYPE (line 8574) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_rst(u8 *intr_rst_u8) function BNO055_RETURN_FUNCTION_TYPE (line 8631) | BNO055_RETURN_FUNCTION_TYPE bno055_set_intr_rst(u8 intr_rst_u8) function BNO055_RETURN_FUNCTION_TYPE (line 8692) | BNO055_RETURN_FUNCTION_TYPE bno055_get_clk_src(u8 *clk_src_u8) function BNO055_RETURN_FUNCTION_TYPE (line 8748) | BNO055_RETURN_FUNCTION_TYPE bno055_set_clk_src(u8 clk_src_u8) function BNO055_RETURN_FUNCTION_TYPE (line 8810) | BNO055_RETURN_FUNCTION_TYPE bno055_get_sys_rst(u8 *sys_rst_u8) function BNO055_RETURN_FUNCTION_TYPE (line 8867) | BNO055_RETURN_FUNCTION_TYPE bno055_set_sys_rst(u8 sys_rst_u8) function BNO055_RETURN_FUNCTION_TYPE (line 8929) | BNO055_RETURN_FUNCTION_TYPE bno055_get_selftest(u8 *selftest_u8) function BNO055_RETURN_FUNCTION_TYPE (line 8988) | BNO055_RETURN_FUNCTION_TYPE bno055_set_selftest(u8 selftest_u8) function BNO055_RETURN_FUNCTION_TYPE (line 9065) | BNO055_RETURN_FUNCTION_TYPE bno055_get_temp_source(u8 *temp_source_u8) function BNO055_RETURN_FUNCTION_TYPE (line 9122) | BNO055_RETURN_FUNCTION_TYPE bno055_set_temp_source(u8 temp_source_u8) function BNO055_RETURN_FUNCTION_TYPE (line 9215) | BNO055_RETURN_FUNCTION_TYPE bno055_get_axis_remap_value(u8 *remap_axis_u8) function BNO055_RETURN_FUNCTION_TYPE (line 9288) | BNO055_RETURN_FUNCTION_TYPE bno055_set_axis_remap_value(u8 remap_axis_u8) function BNO055_RETURN_FUNCTION_TYPE (line 9391) | BNO055_RETURN_FUNCTION_TYPE bno055_get_remap_x_sign(u8 *remap_x_sign_u8) function BNO055_RETURN_FUNCTION_TYPE (line 9447) | BNO055_RETURN_FUNCTION_TYPE bno055_set_remap_x_sign(u8 remap_x_sign_u8) function BNO055_RETURN_FUNCTION_TYPE (line 9523) | BNO055_RETURN_FUNCTION_TYPE bno055_get_remap_y_sign(u8 *remap_y_sign_u8) function BNO055_RETURN_FUNCTION_TYPE (line 9579) | BNO055_RETURN_FUNCTION_TYPE bno055_set_remap_y_sign(u8 remap_y_sign_u8) function BNO055_RETURN_FUNCTION_TYPE (line 9655) | BNO055_RETURN_FUNCTION_TYPE bno055_get_remap_z_sign(u8 *remap_z_sign_u8) function BNO055_RETURN_FUNCTION_TYPE (line 9711) | BNO055_RETURN_FUNCTION_TYPE bno055_set_remap_z_sign(u8 remap_z_sign_u8) function BNO055_RETURN_FUNCTION_TYPE (line 9796) | BNO055_RETURN_FUNCTION_TYPE bno055_read_sic_matrix(struct bno055_sic_mat... function BNO055_RETURN_FUNCTION_TYPE (line 9974) | BNO055_RETURN_FUNCTION_TYPE bno055_write_sic_matrix(struct bno055_sic_ma... function BNO055_RETURN_FUNCTION_TYPE (line 10313) | BNO055_RETURN_FUNCTION_TYPE bno055_read_accel_offset(struct bno055_accel... function BNO055_RETURN_FUNCTION_TYPE (line 10453) | BNO055_RETURN_FUNCTION_TYPE bno055_write_accel_offset(struct bno055_acce... function BNO055_RETURN_FUNCTION_TYPE (line 10632) | BNO055_RETURN_FUNCTION_TYPE bno055_read_mag_offset(struct bno055_mag_off... function BNO055_RETURN_FUNCTION_TYPE (line 10762) | BNO055_RETURN_FUNCTION_TYPE bno055_write_mag_offset(struct bno055_mag_of... function BNO055_RETURN_FUNCTION_TYPE (line 10952) | BNO055_RETURN_FUNCTION_TYPE bno055_read_gyro_offset(struct bno055_gyro_o... function BNO055_RETURN_FUNCTION_TYPE (line 11066) | BNO055_RETURN_FUNCTION_TYPE bno055_write_gyro_offset(struct bno055_gyro_... function BNO055_RETURN_FUNCTION_TYPE (line 11219) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_range(u8 *accel_range_u8) function BNO055_RETURN_FUNCTION_TYPE (line 11278) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_range(u8 accel_range_u8) function BNO055_RETURN_FUNCTION_TYPE (line 11378) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_bw(u8 *accel_bw_u8) function BNO055_RETURN_FUNCTION_TYPE (line 11441) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_bw(u8 accel_bw_u8) function BNO055_RETURN_FUNCTION_TYPE (line 11538) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_power_mode(u8 *accel_power_... function BNO055_RETURN_FUNCTION_TYPE (line 11598) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_power_mode(u8 accel_power_m... function BNO055_RETURN_FUNCTION_TYPE (line 11698) | BNO055_RETURN_FUNCTION_TYPE bno055_get_mag_data_output_rate(u8 *mag_data... function BNO055_RETURN_FUNCTION_TYPE (line 11761) | BNO055_RETURN_FUNCTION_TYPE bno055_set_mag_data_output_rate(u8 mag_data_... function BNO055_RETURN_FUNCTION_TYPE (line 11860) | BNO055_RETURN_FUNCTION_TYPE bno055_get_mag_operation_mode(u8 *mag_operat... function BNO055_RETURN_FUNCTION_TYPE (line 11919) | BNO055_RETURN_FUNCTION_TYPE bno055_set_mag_operation_mode(u8 mag_operati... function BNO055_RETURN_FUNCTION_TYPE (line 12016) | BNO055_RETURN_FUNCTION_TYPE bno055_get_mag_power_mode(u8 *mag_power_mode... function BNO055_RETURN_FUNCTION_TYPE (line 12075) | BNO055_RETURN_FUNCTION_TYPE bno055_set_mag_power_mode(u8 mag_power_mode_u8) function BNO055_RETURN_FUNCTION_TYPE (line 12172) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_range(u8 *gyro_range_u8) function BNO055_RETURN_FUNCTION_TYPE (line 12232) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_range(u8 gyro_range_u8) function BNO055_RETURN_FUNCTION_TYPE (line 12332) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_bw(u8 *gyro_bw_u8) function BNO055_RETURN_FUNCTION_TYPE (line 12394) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_bw(u8 gyro_bw_u8) function BNO055_RETURN_FUNCTION_TYPE (line 12535) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_power_mode(u8 *gyro_power_mo... function BNO055_RETURN_FUNCTION_TYPE (line 12595) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_power_mode(u8 gyro_power_mod... function BNO055_RETURN_FUNCTION_TYPE (line 12719) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_sleep_tmr_mode(u8 *sleep_tm... function BNO055_RETURN_FUNCTION_TYPE (line 12776) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_sleep_tmr_mode(u8 sleep_tmr... function BNO055_RETURN_FUNCTION_TYPE (line 12880) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_sleep_durn(u8 *sleep_durn_u8) function BNO055_RETURN_FUNCTION_TYPE (line 12946) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_sleep_durn(u8 sleep_durn_u8) function BNO055_RETURN_FUNCTION_TYPE (line 13036) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_sleep_durn(u8 *sleep_durn_u8) function BNO055_RETURN_FUNCTION_TYPE (line 13088) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_sleep_durn(u8 sleep_durn_u8) function BNO055_RETURN_FUNCTION_TYPE (line 13178) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_auto_sleep_durn(u8 *auto_sle... function BNO055_RETURN_FUNCTION_TYPE (line 13231) | BNO055_RETURN_FUNCTION_TYPE bno055_gyro_set_auto_sleep_durn(u8 auto_slee... function BNO055_RETURN_FUNCTION_TYPE (line 13414) | BNO055_RETURN_FUNCTION_TYPE bno055_get_mag_sleep_mode(u8 *sleep_mode_u8) function BNO055_RETURN_FUNCTION_TYPE (line 13466) | BNO055_RETURN_FUNCTION_TYPE bno055_set_mag_sleep_mode(u8 sleep_mode_u8) function BNO055_RETURN_FUNCTION_TYPE (line 13549) | BNO055_RETURN_FUNCTION_TYPE bno055_get_mag_sleep_durn(u8 *sleep_durn_u8) function BNO055_RETURN_FUNCTION_TYPE (line 13601) | BNO055_RETURN_FUNCTION_TYPE bno055_set_mag_sleep_durn(u8 sleep_durn_u8) function BNO055_RETURN_FUNCTION_TYPE (line 13708) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_mask_gyro_any_motion(u8 *gyr... function BNO055_RETURN_FUNCTION_TYPE (line 13784) | BNO055_RETURN_FUNCTION_TYPE bno055_set_intr_mask_gyro_any_motion(u8 gyro... function BNO055_RETURN_FUNCTION_TYPE (line 13880) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_mask_gyro_highrate(u8 *gyro_... function BNO055_RETURN_FUNCTION_TYPE (line 13971) | BNO055_RETURN_FUNCTION_TYPE bno055_set_intr_mask_gyro_highrate(u8 gyro_h... function BNO055_RETURN_FUNCTION_TYPE (line 14048) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_mask_accel_high_g(u8 *accel_... function BNO055_RETURN_FUNCTION_TYPE (line 14119) | BNO055_RETURN_FUNCTION_TYPE bno055_set_intr_mask_accel_high_g(u8 accel_h... function BNO055_RETURN_FUNCTION_TYPE (line 14196) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_mask_accel_any_motion(u8 *ac... function BNO055_RETURN_FUNCTION_TYPE (line 14266) | BNO055_RETURN_FUNCTION_TYPE bno055_set_intr_mask_accel_any_motion(u8 acc... function BNO055_RETURN_FUNCTION_TYPE (line 14340) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_mask_accel_no_motion(u8 *acc... function BNO055_RETURN_FUNCTION_TYPE (line 14414) | BNO055_RETURN_FUNCTION_TYPE bno055_set_intr_mask_accel_no_motion(u8 acce... function BNO055_RETURN_FUNCTION_TYPE (line 14496) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_gyro_any_motion(u8 *gyro_any... function BNO055_RETURN_FUNCTION_TYPE (line 14571) | BNO055_RETURN_FUNCTION_TYPE bno055_set_intr_gyro_any_motion(u8 gyro_any_... function BNO055_RETURN_FUNCTION_TYPE (line 14667) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_gyro_highrate(u8 *gyro_highr... function BNO055_RETURN_FUNCTION_TYPE (line 14758) | BNO055_RETURN_FUNCTION_TYPE bno055_set_intr_gyro_highrate(u8 gyro_highra... function BNO055_RETURN_FUNCTION_TYPE (line 14834) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_accel_high_g(u8 *accel_high_... function BNO055_RETURN_FUNCTION_TYPE (line 14905) | BNO055_RETURN_FUNCTION_TYPE bno055_set_intr_accel_high_g(u8 accel_high_g... function BNO055_RETURN_FUNCTION_TYPE (line 14980) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_accel_any_motion(u8 *accel_a... function BNO055_RETURN_FUNCTION_TYPE (line 15050) | BNO055_RETURN_FUNCTION_TYPE bno055_set_intr_accel_any_motion(u8 accel_an... function BNO055_RETURN_FUNCTION_TYPE (line 15129) | BNO055_RETURN_FUNCTION_TYPE bno055_get_intr_accel_no_motion(u8 *accel_no... function BNO055_RETURN_FUNCTION_TYPE (line 15203) | BNO055_RETURN_FUNCTION_TYPE bno055_set_intr_accel_no_motion(u8 accel_nom... function BNO055_RETURN_FUNCTION_TYPE (line 15275) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_any_motion_thres(u8 *accel_... function BNO055_RETURN_FUNCTION_TYPE (line 15340) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_any_motion_thres(u8 accel_a... function BNO055_RETURN_FUNCTION_TYPE (line 15429) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_any_motion_durn(u8 *accel_a... function BNO055_RETURN_FUNCTION_TYPE (line 15486) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_any_motion_durn(u8 accel_an... function BNO055_RETURN_FUNCTION_TYPE (line 15581) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_any_motion_no_motion_axis_e... function BNO055_RETURN_FUNCTION_TYPE (line 15670) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_any_motion_no_motion_axis_e... function BNO055_RETURN_FUNCTION_TYPE (line 15806) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_high_g_axis_enable(u8 chann... function BNO055_RETURN_FUNCTION_TYPE (line 15895) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_high_g_axis_enable(u8 chann... function BNO055_RETURN_FUNCTION_TYPE (line 16025) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_high_g_durn(u8 *accel_high_... function BNO055_RETURN_FUNCTION_TYPE (line 16081) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_high_g_durn(u8 accel_high_g... function BNO055_RETURN_FUNCTION_TYPE (line 16173) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_high_g_thres(u8 *accel_high... function BNO055_RETURN_FUNCTION_TYPE (line 16234) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_high_g_thres(u8 accel_high_... function BNO055_RETURN_FUNCTION_TYPE (line 16326) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_slow_no_motion_thres(u8 *ac... function BNO055_RETURN_FUNCTION_TYPE (line 16387) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_slow_no_motion_thres(u8 acc... function BNO055_RETURN_FUNCTION_TYPE (line 16475) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_slow_no_motion_enable(u8 *a... function BNO055_RETURN_FUNCTION_TYPE (line 16530) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_slow_no_motion_enable(u8 ac... function BNO055_RETURN_FUNCTION_TYPE (line 16615) | BNO055_RETURN_FUNCTION_TYPE bno055_get_accel_slow_no_motion_durn(u8 *acc... function BNO055_RETURN_FUNCTION_TYPE (line 16667) | BNO055_RETURN_FUNCTION_TYPE bno055_set_accel_slow_no_motion_durn(u8 acce... function BNO055_RETURN_FUNCTION_TYPE (line 16763) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_any_motion_axis_enable(u8 ch... function BNO055_RETURN_FUNCTION_TYPE (line 16852) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_any_motion_axis_enable(u8 ch... function BNO055_RETURN_FUNCTION_TYPE (line 16989) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_highrate_axis_enable(u8 chan... function BNO055_RETURN_FUNCTION_TYPE (line 17078) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_highrate_axis_enable(u8 chan... function BNO055_RETURN_FUNCTION_TYPE (line 17207) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_any_motion_filter(u8 *gyro_a... function BNO055_RETURN_FUNCTION_TYPE (line 17262) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_any_motion_filter(u8 gyro_an... function BNO055_RETURN_FUNCTION_TYPE (line 17350) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_highrate_filter(u8 *gyro_hig... function BNO055_RETURN_FUNCTION_TYPE (line 17405) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_highrate_filter(u8 gyro_high... function BNO055_RETURN_FUNCTION_TYPE (line 17497) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_highrate_x_thres(u8 *gyro_hi... function BNO055_RETURN_FUNCTION_TYPE (line 17558) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_highrate_x_thres(u8 gyro_hig... function BNO055_RETURN_FUNCTION_TYPE (line 17653) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_highrate_x_hyst(u8 *gyro_hig... function BNO055_RETURN_FUNCTION_TYPE (line 17716) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_highrate_x_hyst(u8 gyro_high... function BNO055_RETURN_FUNCTION_TYPE (line 17802) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_highrate_x_durn(u8 *gyro_hig... function BNO055_RETURN_FUNCTION_TYPE (line 17856) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_highrate_x_durn(u8 gyro_high... function BNO055_RETURN_FUNCTION_TYPE (line 17948) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_highrate_y_thres(u8 *gyro_hi... function BNO055_RETURN_FUNCTION_TYPE (line 18009) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_highrate_y_thres(u8 gyro_hig... function BNO055_RETURN_FUNCTION_TYPE (line 18103) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_highrate_y_hyst(u8 *gyro_hig... function BNO055_RETURN_FUNCTION_TYPE (line 18165) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_highrate_y_hyst(u8 gyro_high... function BNO055_RETURN_FUNCTION_TYPE (line 18250) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_highrate_y_durn(u8 *gyro_hig... function BNO055_RETURN_FUNCTION_TYPE (line 18304) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_highrate_y_durn(u8 gyro_high... function BNO055_RETURN_FUNCTION_TYPE (line 18396) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_highrate_z_thres(u8 *gyro_hi... function BNO055_RETURN_FUNCTION_TYPE (line 18457) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_highrate_z_thres(u8 gyro_hig... function BNO055_RETURN_FUNCTION_TYPE (line 18551) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_highrate_z_hyst(u8 *gyro_hig... function BNO055_RETURN_FUNCTION_TYPE (line 18613) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_highrate_z_hyst(u8 gyro_high... function BNO055_RETURN_FUNCTION_TYPE (line 18698) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_highrate_z_durn(u8 *gyro_hig... function BNO055_RETURN_FUNCTION_TYPE (line 18752) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_highrate_z_durn(u8 gyro_high... function BNO055_RETURN_FUNCTION_TYPE (line 18843) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_any_motion_thres(u8 *gyro_an... function BNO055_RETURN_FUNCTION_TYPE (line 18903) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_any_motion_thres(u8 gyro_any... function BNO055_RETURN_FUNCTION_TYPE (line 18993) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_any_motion_slope_samples(u8 ... function BNO055_RETURN_FUNCTION_TYPE (line 19051) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_any_motion_slope_samples(u8 ... function BNO055_RETURN_FUNCTION_TYPE (line 19135) | BNO055_RETURN_FUNCTION_TYPE bno055_get_gyro_any_motion_awake_durn(u8 *gy... function BNO055_RETURN_FUNCTION_TYPE (line 19186) | BNO055_RETURN_FUNCTION_TYPE bno055_set_gyro_any_motion_awake_durn(u8 gyr... FILE: bno055.h type s8 (line 66) | typedef int8_t s8; type s16 (line 67) | typedef int16_t s16; type s32 (line 68) | typedef int32_t s32; type s64 (line 69) | typedef int64_t s64; type u_int8_t (line 70) | typedef u_int8_t u8; type u_int16_t (line 71) | typedef u_int16_t u16; type u_int32_t (line 72) | typedef u_int32_t u32; type u_int64_t (line 73) | typedef u_int64_t u64; type u8 (line 93) | typedef uint8_t u8; type u16 (line 94) | typedef uint16_t u16; type u32 (line 95) | typedef uint32_t u32; type u64 (line 96) | typedef uint64_t u64; type s8 (line 98) | typedef int8_t s8; type s16 (line 99) | typedef int16_t s16; type s32 (line 100) | typedef int32_t s32; type s64 (line 101) | typedef int64_t s64; type u8 (line 117) | typedef uint8_t u8; type u16 (line 118) | typedef uint16_t u16; type u32 (line 119) | typedef uint32_t u32; type u64 (line 120) | typedef uint64_t u64; type s8 (line 122) | typedef int8_t s8; type s16 (line 123) | typedef int16_t s16; type s32 (line 124) | typedef int32_t s32; type s64 (line 125) | typedef int64_t s64; type s8 (line 148) | typedef signed char s8; type s16 (line 149) | typedef signed short int s16; type s32 (line 150) | typedef signed long int s32; type s64 (line 153) | typedef long int s64; type u64 (line 154) | typedef unsigned long int u64; type s64 (line 156) | typedef long long int s64; type u64 (line 157) | typedef unsigned long long int u64; type u8 (line 166) | typedef unsigned char u8; type u16 (line 167) | typedef unsigned short int u16; type u32 (line 168) | typedef unsigned long int u32; type s8 (line 175) | typedef signed char s8; type s16 (line 176) | typedef signed short int s16; type s32 (line 177) | typedef signed int s32; type s64 (line 178) | typedef signed long long int s64; type u8 (line 180) | typedef unsigned char u8; type u16 (line 181) | typedef unsigned short int u16; type u32 (line 182) | typedef unsigned int u32; type u64 (line 183) | typedef unsigned long long int u64; type s8 (line 190) | typedef signed char s8; type s16 (line 191) | typedef signed short int s16; type s32 (line 192) | typedef signed int s32; type s64 (line 193) | typedef signed long int s64; type u8 (line 195) | typedef unsigned char u8; type u16 (line 196) | typedef unsigned short int u16; type u32 (line 197) | typedef unsigned int u32; type u64 (line 198) | typedef unsigned long int u64; type s8 (line 224) | typedef signed char s8; type s16 (line 225) | typedef signed short int s16; type s32 (line 226) | typedef signed long int s32; type s64 (line 229) | typedef long int s64; type u64 (line 230) | typedef unsigned long int u64; type s64 (line 232) | typedef long long int s64; type u64 (line 233) | typedef unsigned long long int u64; type u8 (line 242) | typedef unsigned char u8; type u16 (line 243) | typedef unsigned short int u16; type u32 (line 244) | typedef unsigned long int u32; type s8 (line 251) | typedef signed char s8; type s16 (line 252) | typedef signed short int s16; type s32 (line 253) | typedef signed int s32; type s64 (line 254) | typedef signed long long int s64; type u8 (line 256) | typedef unsigned char u8; type u16 (line 257) | typedef unsigned short int u16; type u32 (line 258) | typedef unsigned int u32; type u64 (line 259) | typedef unsigned long long int u64; type s8 (line 266) | typedef signed char s8; type s16 (line 267) | typedef signed short int s16; type s32 (line 268) | typedef signed int s32; type s64 (line 269) | typedef signed long int s64; type u8 (line 271) | typedef unsigned char u8; type u16 (line 272) | typedef unsigned short int u16; type u32 (line 273) | typedef unsigned int u32; type u64 (line 274) | typedef unsigned long int u64; type bno055_t (line 511) | struct bno055_t type bno055_accel_t (line 529) | struct bno055_accel_t type bno055_mag_t (line 539) | struct bno055_mag_t type bno055_gyro_t (line 549) | struct bno055_gyro_t type bno055_euler_t (line 559) | struct bno055_euler_t type bno055_quaternion_t (line 569) | struct bno055_quaternion_t type bno055_linear_accel_t (line 580) | struct bno055_linear_accel_t type bno055_gravity_t (line 590) | struct bno055_gravity_t type bno055_accel_double_t (line 601) | struct bno055_accel_double_t type bno055_mag_double_t (line 611) | struct bno055_mag_double_t type bno055_gyro_double_t (line 621) | struct bno055_gyro_double_t type bno055_euler_double_t (line 631) | struct bno055_euler_double_t type bno055_linear_accel_double_t (line 641) | struct bno055_linear_accel_double_t type bno055_gravity_double_t (line 651) | struct bno055_gravity_double_t type bno055_accel_float_t (line 663) | struct bno055_accel_float_t type bno055_mag_float_t (line 673) | struct bno055_mag_float_t type bno055_gyro_float_t (line 683) | struct bno055_gyro_float_t type bno055_euler_float_t (line 693) | struct bno055_euler_float_t type bno055_linear_accel_float_t (line 703) | struct bno055_linear_accel_float_t type bno055_gravity_float_t (line 713) | struct bno055_gravity_float_t type bno055_accel_offset_t (line 724) | struct bno055_accel_offset_t type bno055_gyro_offset_t (line 735) | struct bno055_gyro_offset_t type bno055_mag_offset_t (line 745) | struct bno055_mag_offset_t type bno055_sic_matrix_t (line 756) | struct bno055_sic_matrix_t type bno055_t (line 2235) | struct bno055_t type bno055_accel_t (line 2473) | struct bno055_accel_t type bno055_mag_t (line 2558) | struct bno055_mag_t type bno055_gyro_t (line 2636) | struct bno055_gyro_t type bno055_euler_t (line 2701) | struct bno055_euler_t type bno055_quaternion_t (line 2784) | struct bno055_quaternion_t type bno055_linear_accel_t (line 2850) | struct bno055_linear_accel_t type bno055_gravity_t (line 2917) | struct bno055_gravity_t type bno055_accel_float_t (line 3055) | struct bno055_accel_float_t type bno055_accel_float_t (line 3076) | struct bno055_accel_float_t type bno055_mag_float_t (line 3146) | struct bno055_mag_float_t type bno055_gyro_float_t (line 3261) | struct bno055_gyro_float_t type bno055_gyro_float_t (line 3282) | struct bno055_gyro_float_t type bno055_euler_float_t (line 3387) | struct bno055_euler_float_t type bno055_euler_float_t (line 3407) | struct bno055_euler_float_t type bno055_linear_accel_float_t (line 3470) | struct bno055_linear_accel_float_t type bno055_gravity_float_t (line 3536) | struct bno055_gravity_float_t type bno055_accel_double_t (line 3692) | struct bno055_accel_double_t type bno055_accel_double_t (line 3712) | struct bno055_accel_double_t type bno055_mag_double_t (line 3786) | struct bno055_mag_double_t type bno055_gyro_double_t (line 3906) | struct bno055_gyro_double_t type bno055_gyro_double_t (line 3926) | struct bno055_gyro_double_t type bno055_euler_double_t (line 4034) | struct bno055_euler_double_t type bno055_euler_double_t (line 4054) | struct bno055_euler_double_t type bno055_linear_accel_double_t (line 4124) | struct bno055_linear_accel_double_t type bno055_gravity_double_t (line 4190) | struct bno055_gravity_double_t type bno055_sic_matrix_t (line 5364) | struct bno055_sic_matrix_t type bno055_sic_matrix_t (line 5391) | struct bno055_sic_matrix_t type bno055_accel_offset_t (line 5428) | struct bno055_accel_offset_t type bno055_accel_offset_t (line 5461) | struct bno055_accel_offset_t type bno055_mag_offset_t (line 5487) | struct bno055_mag_offset_t type bno055_mag_offset_t (line 5509) | struct bno055_mag_offset_t type bno055_gyro_offset_t (line 5546) | struct bno055_gyro_offset_t type bno055_gyro_offset_t (line 5579) | struct bno055_gyro_offset_t FILE: bno055_support.c type bno055_t (line 103) | struct bno055_t function s32 (line 109) | s32 bno055_data_readout_template(void) function s8 (line 536) | s8 I2C_routine(void) function s8 (line 568) | s8 BNO055_I2C_bus_write(u8 dev_addr, u8 reg_addr, u8 *reg_data, u8 cnt) function s8 (line 609) | s8 BNO055_I2C_bus_read(u8 dev_addr, u8 reg_addr, u8 *reg_data, u8 cnt) function BNO055_delay_msek (line 638) | void BNO055_delay_msek(u32 msek)
Condensed preview — 5 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,060K chars).
[
{
"path": "LICENSE",
"chars": 1519,
"preview": "Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved.\n\nBSD-3-Clause\n\nRedistribution and use in source and binary"
},
{
"path": "README.md",
"chars": 1963,
"preview": "## Table of Contents\r\n- [Introduction](#intro)\r\n- [Version](#ver)\r\n- [Integration details](#integration)\r\n- [Driver file"
},
{
"path": "bno055.c",
"chars": 699800,
"preview": "/**\r\n* Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved.\r\n*\r\n* BSD-3-Clause\r\n*\r\n* Redistribution and use in "
},
{
"path": "bno055.h",
"chars": 275125,
"preview": "/**\r\n* Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved.\r\n*\r\n* BSD-3-Clause\r\n*\r\n* Redistribution and use in "
},
{
"path": "bno055_support.c",
"chars": 25404,
"preview": "/**\r\n* Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved.\r\n*\r\n* BSD-3-Clause\r\n*\r\n* Redistribution and use in "
}
]
About this extraction
This page contains the full source code of the BoschSensortec/BNO055_driver GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 5 files (980.3 KB), approximately 254.4k tokens, and a symbol index with 416 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.