Skip to content

Commit

Permalink
Fixed self-test
Browse files Browse the repository at this point in the history
  • Loading branch information
BST-Github-Admin authored and kegov committed Jun 30, 2020
1 parent becf8fa commit 9145ac4
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 63 deletions.
58 changes: 29 additions & 29 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
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
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.
10 changes: 5 additions & 5 deletions bmi08a.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @file bmi08a.c
* @date 2020-06-08
* @version v1.5.2
* @date 2020-06-26
* @version v1.5.3
*
*/

Expand Down Expand Up @@ -2425,9 +2425,9 @@ static int8_t validate_accel_self_test(const struct bmi08x_sensor_data *accel_po
/*! Structure for difference of accel values in mg */
struct bmi08a_selftest_delta_limit accel_data_diff_mg = { 0 };

accel_data_diff.x = (uint16_t) (BMI08X_ABS(accel_pos->x) + BMI08X_ABS(accel_neg->x));
accel_data_diff.y = (uint16_t) (BMI08X_ABS(accel_pos->y) + BMI08X_ABS(accel_neg->y));
accel_data_diff.z = (uint16_t) (BMI08X_ABS(accel_pos->z) + BMI08X_ABS(accel_neg->z));
accel_data_diff.x = (uint16_t)BMI08X_ABS(accel_pos->x - accel_neg->x);
accel_data_diff.y = (uint16_t)BMI08X_ABS(accel_pos->y - accel_neg->y);
accel_data_diff.z = (uint16_t)BMI08X_ABS(accel_pos->z - accel_neg->z);

if (variant == BMI085_VARIANT)
{
Expand Down
4 changes: 2 additions & 2 deletions bmi08g.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @file bmi08g.c
* @date 2020-06-08
* @version v1.5.2
* @date 2020-06-26
* @version v1.5.3
*
*/

Expand Down
4 changes: 2 additions & 2 deletions bmi08x.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @file bmi08x.h
* @date 2020-06-08
* @version v1.5.2
* @date 2020-06-26
* @version v1.5.3
*
*/

Expand Down
43 changes: 18 additions & 25 deletions bmi08x_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @file bmi08x_defs.h
* @date 2020-06-08
* @version v1.5.2
* @date 2020-06-26
* @version v1.5.3
*
*/

Expand Down Expand Up @@ -678,8 +678,8 @@ enum bmi08x_intf {

/*! @name Enum to define BMA4 variants */
enum bmi08x_variant {
BMI085_VARIANT = 1,
BMI088_VARIANT
BMI085_VARIANT = 0,
BMI088_VARIANT = 1
};

/*************************** Data structures *****************************/
Expand All @@ -689,40 +689,33 @@ enum bmi08x_variant {
/*!
* @brief Bus communication function pointer which should be mapped to
* the platform specific read and write functions of the user
*
* @note : dev_addr is used for I2C read/write operations only.
* For SPI read/write operations this is dummy variable.
*/

/*!
* @brief Bus communication function pointer which should be mapped to
* the platform specific read functions of the user
*
* @param[in] reg_addr : Register address from which data is read.
* @param[out] read_data : Pointer to data buffer where read data is stored.
* @param[in] len : Number of bytes of data to be read.
* @param[in, out] intf_ptr : Void pointer that can enable the linking of descriptors
* for interface related call backs.
*
* @retval BMI08X_INTF_RET_SUCCESS -> Success.
* @retval != BMI08X_INTF_RET_SUCCESS -> Fail.
*
* @param[in] reg_addr : 8bit register address of the sensor
* @param[out] reg_data : Data from the specified address
* @param[in] length : Length of the reg_data array
* @param[in,out] intf_ptr : Void pointer that can enable the linking of descriptors
* for interface related callbacks
* @retval 0 for Success
* @retval Non-zero for Failure
*/
typedef BMI08X_INTF_RET_TYPE (*bmi08x_read_fptr_t)(uint8_t reg_addr, uint8_t *read_data, uint32_t len, void *intf_ptr);

/*!
* @brief Bus communication function pointer which should be mapped to
* the platform specific write functions of the user
*
* @param[in] reg_addr : Register address to which the data is written.
* @param[in] read_data : Pointer to data buffer in which data to be written
* is stored.
* @param[in] len : Number of bytes of data to be written.
* @param[in, out] intf_ptr : Void pointer that can enable the linking of descriptors
* for interface related call backs
*
* @retval BMI08X_INTF_RET_SUCCESS -> Success.
* @retval != BMI08X_INTF_RET_SUCCESS -> Fail.
* @param[in] reg_addr : 8bit register address of the sensor
* @param[out] reg_data : Data to the specified address
* @param[in] length : Length of the reg_data array
* @param[in,out] intf_ptr : Void pointer that can enable the linking of descriptors
* for interface related callbacks
* @retval 0 for Success
* @retval Non-zero for Failure
*
*/
typedef BMI08X_INTF_RET_TYPE (*bmi08x_write_fptr_t)(uint8_t reg_addr, const uint8_t *read_data, uint32_t len,
Expand Down

0 comments on commit 9145ac4

Please sign in to comment.