Skip to content

Commit

Permalink
v3.6.1,
Browse files Browse the repository at this point in the history
SPI support for FIFO reading and parsing logic updated
  • Loading branch information
BST-Github-Admin committed Aug 23, 2017
1 parent b09262f commit e69b947
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
23 changes: 17 additions & 6 deletions bmi160.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
*/
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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*/
Expand Down Expand Up @@ -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*/
Expand Down
6 changes: 3 additions & 3 deletions bmi160.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
*/
Expand Down Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions bmi160_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
*/
Expand Down Expand Up @@ -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)
Expand All @@ -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 */
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit e69b947

Please sign in to comment.