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

Added support for FIFO tagging as an int_pin_config

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

+ 12 - 12
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.7.2 |   16 Oct 2017
-bmi160.h      |   3.7.2 |   16 Oct 2017
-bmi160_defs.h |   3.7.2 |   16 Oct 2017
+bmi160.c      |   3.7.3 |   20 Nov 2017
+bmi160.h      |   3.7.3 |   20 Nov 2017
+bmi160_defs.h |   3.7.3 |   20 Nov 2017
 
 ## Integration details
 * Integrate bmi160.h, bmi160_defs.h and bmi160.c file in to your project.
@@ -176,7 +176,7 @@ rslt = bmi160_soft_reset(&sensor);
 
 ### Configuring interrupts for sensors
 To configure the sensor interrupts, you will first need to create an interrupt 
-structure. You can do this by creating an instance of the structure bmi160_intr_sett.
+structure. You can do this by creating an instance of the structure bmi160_int_settg.
 Then go on to fill in the various parameters as shown below
 
 
@@ -185,7 +185,7 @@ Then go on to fill in the various parameters as shown below
 Note:- User can check the currently active interrupt(any-motion or sig-motion) by checking the **any_sig_sel** of bmi160_dev structure.
 ``` c
 
-struct bmi160_intr_sett int_config;
+struct bmi160_int_settg int_config;
 
 /* Select the Interrupt channel/pin */
 int_config.int_channel = BMI160_INT_CHANNEL_1;// Interrupt channel/pin 1
@@ -209,14 +209,14 @@ int_config.int_type_cfg.acc_any_motion_int.anymotion_dur = 0;// any-motion durat
 int_config.int_type_cfg.acc_any_motion_int.anymotion_thr = 20;// (2-g range) -> (slope_thr) * 3.91 mg, (4-g range) -> (slope_thr) * 7.81 mg, (8-g range) ->(slope_thr) * 15.63 mg, (16-g range) -> (slope_thr) * 31.25 mg 
 
 /* Set the Any-motion interrupt */
-bmi160_set_intr_config(&int_config, &sensor); /* sensor is an instance of the structure bmi160_dev  */
+bmi160_set_int_config(&int_config, &sensor); /* sensor is an instance of the structure bmi160_dev  */
 
 ```
 ### Configuring Flat Interrupt
 #### Example for configuring Flat Interrupt
 ``` c
 
-struct bmi160_intr_sett int_config;
+struct bmi160_int_settg int_config;
 
 /* Select the Interrupt channel/pin */
 int_config.int_channel = BMI160_INT_CHANNEL_1;// Interrupt channel/pin 1
@@ -238,7 +238,7 @@ int_config.int_type_cfg.acc_flat_int.flat_hy = 1;// Flat hysteresis
 int_config.int_type_cfg.acc_flat_int.flat_hold_time = 1;// Flat hold time (0 -> 0 ms, 1 -> 640 ms, 2 -> 1280 ms, 3 -> 2560 ms)
 
 /* Set the Flat interrupt */
-bmi160_set_intr_config(&int_config, &sensor); /* sensor is an instance of the structure bmi160_dev */
+bmi160_set_int_config(&int_config, &sensor); /* sensor is an instance of the structure bmi160_dev */
 
 ```
 
@@ -247,7 +247,7 @@ bmi160_set_intr_config(&int_config, &sensor); /* sensor is an instance of the st
 #### Example for configuring Step Detector Interrupt
 ``` c
 
-struct bmi160_intr_sett int_config;
+struct bmi160_int_settg int_config;
 
 /* Select the Interrupt channel/pin */
 int_config.int_channel = BMI160_INT_CHANNEL_1;// Interrupt channel/pin 1
@@ -267,7 +267,7 @@ int_config.int_type_cfg.acc_step_detect_int.step_detector_mode = BMI160_STEP_DET
 int_config.int_type_cfg.acc_step_detect_int.step_detector_en = BMI160_ENABLE;// 1-enable, 0-disable the step detector
 
 /* Set the Step Detector interrupt */
-bmi160_set_intr_config(&int_config, &sensor); /* sensor is an instance of the structure bmi160_dev */
+bmi160_set_int_config(&int_config, &sensor); /* sensor is an instance of the structure bmi160_dev */
 
 ```
 
@@ -294,14 +294,14 @@ rslt = bmi160_read_step_counter(&step_count,  &sensor);
 ### Unmapping Interrupt
 #### Example for unmapping Step Detector Interrupt
 ``` c
-struct bmi160_intr_sett int_config;
+struct bmi160_int_settg int_config;
 
 /* Deselect the Interrupt channel/pin */
 int_config.int_channel = BMI160_INT_CHANNEL_NONE;
 /* Select the Interrupt type */
 int_config.int_type = BMI160_STEP_DETECT_INT;// Choosing Step Detector interrupt
 /* Set the Step Detector interrupt */
-bmi160_set_intr_config(&int_config, &sensor); /* sensor is an instance of the structure bmi160_dev */
+bmi160_set_int_config(&int_config, &sensor); /* sensor is an instance of the structure bmi160_dev */
 ```
 
 ### Reading interrupt status

+ 7 - 2
bmi160.c

@@ -40,8 +40,8 @@
  * patent rights of the copyright holder.
  *
  * @file    bmi160.c
- * @date    16 Oct 2017
- * @version 3.7.2
+ * @date    20 Nov 2017
+ * @version 3.7.3
  * @brief
  *
  */
@@ -1640,6 +1640,11 @@ int8_t bmi160_set_int_config(struct bmi160_int_settg *int_config, struct bmi160_
 		 /* Fifo water-mark interrupt */
 		rslt = set_fifo_watermark_int(int_config, dev);
 		break;
+	case BMI160_FIFO_TAG_INT_PIN:
+		/* Fifo tagging feature support */
+		/* Configure Interrupt pins */
+		rslt = set_intr_pin_config(int_config, dev);
+		break;
 	default:
 		break;
 	}

+ 2 - 2
bmi160.h

@@ -40,8 +40,8 @@
  * patent rights of the copyright holder.
  *
  * @file    bmi160.h
- * @date    16 Oct 2017
- * @version 3.7.2
+ * @date    20 Nov 2017
+ * @version 3.7.3
  * @brief
  *
  */

+ 5 - 3
bmi160_defs.h

@@ -40,8 +40,8 @@
  * patent rights of the copyright holder.
  *
  * @file    bmi160_defs.h
- * @date    16 Oct 2017
- * @version 3.7.2
+ * @date    20 Nov 2017
+ * @version 3.7.3
  * @brief
  *
  */
@@ -995,7 +995,9 @@ enum bmi160_int_types {
 	/*! fifo full interrupt */
 	BMI160_ACC_GYRO_FIFO_FULL_INT,
 	/*! fifo watermark interrupt */
-	BMI160_ACC_GYRO_FIFO_WATERMARK_INT
+	BMI160_ACC_GYRO_FIFO_WATERMARK_INT,
+	/*! fifo tagging feature support */
+	BMI160_FIFO_TAG_INT_PIN
 };
 
 /*!

+ 5 - 0
changelog.md

@@ -1,6 +1,11 @@
 # Change Log
 All notable changes to bmi160 Sensor API will be documented in this file.
 
+## v3.7.3, 20 Nov 2017
+#### Added
+	- Provided support for FIFO tagging feature by adding 
+	  "BMI160_FIFO_TAG_INT_PIN" case to "bmi160_set_int_config" API
+
 ## v3.7.2, 16 Oct 2017
 #### Added
 	- Aux FIFO support added