diff --git a/README.md b/README.md index a365066..b2cad4f 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ The sensor driver package includes bmi160.h, bmi160.c and bmi160_defs.h files ## Version File | Version | Date --------------|---------|--------------- -bmi160.c | 3.6.0 | 04 Aug 2017 -bmi160.h | 3.6.0 | 04 Aug 2017 -bmi160_defs.h | 3.6.0 | 04 Aug 2017 +bmi160.c | 3.6.1 | 23 Aug 2017 +bmi160.h | 3.6.1 | 23 Aug 2017 +bmi160_defs.h | 3.6.1 | 23 Aug 2017 ## Integration details * Integrate bmi160.h, bmi160_defs.h and bmi160.c file in to your project. @@ -294,7 +294,7 @@ uint16_t step_count = 0;//stores the step counter value rslt = bmi160_read_step_counter(&step_count, &sensor); ``` ### Configuring the auxiliary sensor BMM150 -It is assumend that secondary interface of bmi160 has external pull-up resistor in order to access the auxiliary sensor bmm150. +It is assumed that secondary interface of bmi160 has external pull-up resistor in order to access the auxiliary sensor bmm150. ### Accessing auxiliary BMM150 with BMM150 APIs via BMI160 secondary interface. diff --git a/bmi160.c b/bmi160.c index f5a5208..4a3114d 100644 --- a/bmi160.c +++ b/bmi160.c @@ -40,8 +40,8 @@ * patent rights of the copyright holder. * * @file bmi160.c - * @date 04 Aug 2017 - * @version 3.6.0 + * @date 23 Aug 2017 + * @version 3.6.1 * @brief * */ @@ -1966,6 +1966,11 @@ int8_t bmi160_get_fifo_data(struct bmi160_dev const *dev) dev->fifo->length = dev->fifo->length + 4; } + if (dev->interface == BMI160_SPI_INTF) { + /* SPI read mask */ + addr = addr | BMI160_SPI_RD_MASK; + } + /* read only the filled bytes in the FIFO Buffer */ rslt = dev->read(dev->id, addr, dev->fifo->data, dev->fifo->length); } @@ -2118,8 +2123,7 @@ int8_t bmi160_extract_accel(struct bmi160_sensor_data *accel_data, uint8_t *acce dev->fifo->accel_byte_start_idx = data_index; } else { /* Parsing the FIFO data in header mode */ - extract_accel_header_mode(accel_data, &accel_index, dev); - *accel_length = accel_index; + extract_accel_header_mode(accel_data, accel_length, dev); } } @@ -2158,8 +2162,7 @@ int8_t bmi160_extract_gyro(struct bmi160_sensor_data *gyro_data, uint8_t *gyro_l dev->fifo->gyro_byte_start_idx = data_index; } else { /* Parsing the FIFO data in header mode */ - extract_gyro_header_mode(gyro_data, &gyro_index, dev); - *gyro_length = gyro_index; + extract_gyro_header_mode(gyro_data, gyro_length, dev); } } @@ -5198,6 +5201,10 @@ static void extract_accel_header_mode(struct bmi160_sensor_data *accel_data, uin default: break; } + if (*accel_length == accel_index) { + /* Number of frames to read completed */ + break; + } } /*Update number of accel data read*/ @@ -5414,6 +5421,10 @@ static void extract_gyro_header_mode(struct bmi160_sensor_data *gyro_data, uint8 default: break; } + if (*gyro_length == gyro_index) { + /*Number of frames to read completed*/ + break; + } } /*Update number of gyro data read*/ diff --git a/bmi160.h b/bmi160.h index cec6038..a137fe1 100644 --- a/bmi160.h +++ b/bmi160.h @@ -40,8 +40,8 @@ * patent rights of the copyright holder. * * @file bmi160.h - * @date 04 Aug 2017 - * @version 3.6.0 + * @date 23 Aug 2017 + * @version 3.6.1 * @brief * */ @@ -334,7 +334,7 @@ int8_t bmi160_read_aux_data_auto_mode(uint8_t *aux_data, const struct bmi160_dev int8_t bmi160_perform_self_test(uint8_t select_sensor, struct bmi160_dev *dev); /*! - * @brief This API reads the data from fifo buffer. + * @brief This API reads data from the fifo buffer. * * @note User has to allocate the FIFO buffer along with * corresponding fifo length from his side before calling this API diff --git a/bmi160_defs.h b/bmi160_defs.h index 2e3ab21..7dc994d 100644 --- a/bmi160_defs.h +++ b/bmi160_defs.h @@ -40,8 +40,8 @@ * patent rights of the copyright holder. * * @file bmi160_defs.h - * @date 04 Aug 2017 - * @version 3.6.0 + * @date 23 Aug 2017 + * @version 3.6.1 * @brief * */ @@ -422,7 +422,7 @@ extern "C" #define BMI160_ACCEL_BW_OSR4_AVG1 UINT8_C(0x00) #define BMI160_ACCEL_BW_OSR2_AVG2 UINT8_C(0x01) #define BMI160_ACCEL_BW_NORMAL_AVG4 UINT8_C(0x02) -#define BMI160_ACCEL_BW_CIC_AVG8 UINT8_C(0x03) +#define BMI160_ACCEL_BW_RES_AVG8 UINT8_C(0x03) #define BMI160_ACCEL_BW_RES_AVG16 UINT8_C(0x04) #define BMI160_ACCEL_BW_RES_AVG32 UINT8_C(0x05) #define BMI160_ACCEL_BW_RES_AVG64 UINT8_C(0x06) @@ -431,7 +431,6 @@ extern "C" #define BMI160_GYRO_BW_OSR4_MODE UINT8_C(0x00) #define BMI160_GYRO_BW_OSR2_MODE UINT8_C(0x01) #define BMI160_GYRO_BW_NORMAL_MODE UINT8_C(0x02) -#define BMI160_GYRO_BW_CIC_MODE UINT8_C(0x03) /* Output Data Rate settings */ /* Accel Output data rate */ diff --git a/changelog.md b/changelog.md index 44874dd..22c2cb2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,11 @@ # Change Log All notable changes to bmi160 Sensor API will be documented in this file. +## v3.6.1, 23 Aug 2017 + +#### Changed +* SPI support for FIFO reading and parsing logic update + ## v3.6.0, 04 Aug 2017 #### Added