From 9145ac4deda1e92fefefba89e75115ab17745987 Mon Sep 17 00:00:00 2001 From: Bosch Sensortec Date: Tue, 30 Jun 2020 10:54:30 +0200 Subject: [PATCH] Fixed self-test --- LICENSE | 58 +++++++++---------- bmi08a.c | 10 ++-- bmi08g.c | 4 +- bmi08x.h | 4 +- bmi08x_defs.h | 43 ++++++-------- .../bmi08x_read_synchronized_data_mcu.c | 0 6 files changed, 56 insertions(+), 63 deletions(-) rename examples/generic/{read_syncrhonized_data => read_synchronized_data}/bmi08x_read_synchronized_data_mcu.c (100%) diff --git a/LICENSE b/LICENSE index df241f2..7d08b66 100644 --- a/LICENSE +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/bmi08a.c b/bmi08a.c index a7d6d3e..7cb7007 100644 --- a/bmi08a.c +++ b/bmi08a.c @@ -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 * */ @@ -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) { diff --git a/bmi08g.c b/bmi08g.c index e86eb06..c270dd0 100644 --- a/bmi08g.c +++ b/bmi08g.c @@ -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 * */ diff --git a/bmi08x.h b/bmi08x.h index fa3f138..0f86a41 100644 --- a/bmi08x.h +++ b/bmi08x.h @@ -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 * */ diff --git a/bmi08x_defs.h b/bmi08x_defs.h index 8e721c0..d7ab1b0 100644 --- a/bmi08x_defs.h +++ b/bmi08x_defs.h @@ -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 * */ @@ -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 *****************************/ @@ -689,24 +689,19 @@ 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); @@ -714,15 +709,13 @@ typedef BMI08X_INTF_RET_TYPE (*bmi08x_read_fptr_t)(uint8_t reg_addr, uint8_t *re * @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, diff --git a/examples/generic/read_syncrhonized_data/bmi08x_read_synchronized_data_mcu.c b/examples/generic/read_synchronized_data/bmi08x_read_synchronized_data_mcu.c similarity index 100% rename from examples/generic/read_syncrhonized_data/bmi08x_read_synchronized_data_mcu.c rename to examples/generic/read_synchronized_data/bmi08x_read_synchronized_data_mcu.c