Просмотр исходного кода

v3.6.1,
SPI support for FIFO reading and parsing logic updated

Bosch Sensortec 8 лет назад
Родитель
Сommit
e69b9472c2
5 измененных файлов с 32 добавлено и 17 удалено
  1. 4 4
      README.md
  2. 17 6
      bmi160.c
  3. 3 3
      bmi160.h
  4. 3 4
      bmi160_defs.h
  5. 5 0
      changelog.md

+ 4 - 4
README.md

@@ -7,9 +7,9 @@ The sensor driver package includes bmi160.h, bmi160.c and bmi160_defs.h files
 ## Version
 ## Version
 File          | Version | Date
 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
 ## Integration details
 * Integrate bmi160.h, bmi160_defs.h and bmi160.c file in to your project.
 * 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);
 rslt = bmi160_read_step_counter(&step_count,  &sensor);
 ```
 ```
 ### Configuring the auxiliary sensor BMM150
 ### 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.
 ### Accessing auxiliary BMM150 with BMM150 APIs via BMI160 secondary interface.
 
 

+ 17 - 6
bmi160.c

@@ -40,8 +40,8 @@
  * patent rights of the copyright holder.
  * patent rights of the copyright holder.
  *
  *
  * @file    bmi160.c
  * @file    bmi160.c
- * @date    04 Aug 2017
- * @version 3.6.0
+ * @date    23 Aug 2017
+ * @version 3.6.1
  * @brief
  * @brief
  *
  *
  */
  */
@@ -1966,6 +1966,11 @@ int8_t bmi160_get_fifo_data(struct bmi160_dev const *dev)
 				dev->fifo->length = dev->fifo->length + 4;
 				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 */
 			/* read only the filled bytes in the FIFO Buffer */
 			rslt = dev->read(dev->id, addr, dev->fifo->data, dev->fifo->length);
 			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;
 			dev->fifo->accel_byte_start_idx = data_index;
 		} else {
 		} else {
 			/* Parsing the FIFO data in header mode */
 			/* 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;
 			dev->fifo->gyro_byte_start_idx = data_index;
 		} else {
 		} else {
 			/* Parsing the FIFO data in header mode */
 			/* 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:
 		default:
 			break;
 			break;
 		}
 		}
+		if (*accel_length == accel_index) {
+			/* Number of frames to read completed */
+			break;
+		}
 	}
 	}
 
 
 	/*Update number of accel data read*/
 	/*Update number of accel data read*/
@@ -5414,6 +5421,10 @@ static void extract_gyro_header_mode(struct bmi160_sensor_data *gyro_data, uint8
 		default:
 		default:
 			break;
 			break;
 		}
 		}
+		if (*gyro_length == gyro_index) {
+			/*Number of frames to read completed*/
+			break;
+		}
 	}
 	}
 
 
 	/*Update number of gyro data read*/
 	/*Update number of gyro data read*/

+ 3 - 3
bmi160.h

@@ -40,8 +40,8 @@
  * patent rights of the copyright holder.
  * patent rights of the copyright holder.
  *
  *
  * @file    bmi160.h
  * @file    bmi160.h
- * @date    04 Aug 2017
- * @version 3.6.0
+ * @date    23 Aug 2017
+ * @version 3.6.1
  * @brief
  * @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);
 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
  *  @note User has to allocate the FIFO buffer along with
  *  corresponding fifo length from his side before calling this API
  *  corresponding fifo length from his side before calling this API

+ 3 - 4
bmi160_defs.h

@@ -40,8 +40,8 @@
  * patent rights of the copyright holder.
  * patent rights of the copyright holder.
  *
  *
  * @file    bmi160_defs.h
  * @file    bmi160_defs.h
- * @date    04 Aug 2017
- * @version 3.6.0
+ * @date    23 Aug 2017
+ * @version 3.6.1
  * @brief
  * @brief
  *
  *
  */
  */
@@ -422,7 +422,7 @@ extern "C"
 #define BMI160_ACCEL_BW_OSR4_AVG1        UINT8_C(0x00)
 #define BMI160_ACCEL_BW_OSR4_AVG1        UINT8_C(0x00)
 #define BMI160_ACCEL_BW_OSR2_AVG2        UINT8_C(0x01)
 #define BMI160_ACCEL_BW_OSR2_AVG2        UINT8_C(0x01)
 #define BMI160_ACCEL_BW_NORMAL_AVG4      UINT8_C(0x02)
 #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_AVG16        UINT8_C(0x04)
 #define BMI160_ACCEL_BW_RES_AVG32        UINT8_C(0x05)
 #define BMI160_ACCEL_BW_RES_AVG32        UINT8_C(0x05)
 #define BMI160_ACCEL_BW_RES_AVG64        UINT8_C(0x06)
 #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_OSR4_MODE         UINT8_C(0x00)
 #define BMI160_GYRO_BW_OSR2_MODE         UINT8_C(0x01)
 #define BMI160_GYRO_BW_OSR2_MODE         UINT8_C(0x01)
 #define BMI160_GYRO_BW_NORMAL_MODE       UINT8_C(0x02)
 #define BMI160_GYRO_BW_NORMAL_MODE       UINT8_C(0x02)
-#define BMI160_GYRO_BW_CIC_MODE          UINT8_C(0x03)
 
 
 /* Output Data Rate settings */
 /* Output Data Rate settings */
 /* Accel Output data rate */
 /* Accel Output data rate */

+ 5 - 0
changelog.md

@@ -1,6 +1,11 @@
 # Change Log
 # Change Log
 All notable changes to bmi160 Sensor API will be documented in this file. 
 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
 ## v3.6.0, 04 Aug 2017
 
 
 #### Added
 #### Added