Skip to content

Commit

Permalink
Added support for FIFO tagging as an int_pin_config
Browse files Browse the repository at this point in the history
  • Loading branch information
BST-Github-Admin committed Nov 21, 2017
1 parent f506ded commit dcc6447
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 19 deletions.
24 changes: 12 additions & 12 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.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.
Expand Down Expand Up @@ -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


Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 */
```

Expand All @@ -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
Expand All @@ -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 */

```
Expand All @@ -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
Expand Down
9 changes: 7 additions & 2 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 16 Oct 2017
* @version 3.7.2
* @date 20 Nov 2017
* @version 3.7.3
* @brief
*
*/
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 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 16 Oct 2017
* @version 3.7.2
* @date 20 Nov 2017
* @version 3.7.3
* @brief
*
*/
Expand Down
8 changes: 5 additions & 3 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 16 Oct 2017
* @version 3.7.2
* @date 20 Nov 2017
* @version 3.7.3
* @brief
*
*/
Expand Down Expand Up @@ -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
};

/*!
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.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
Expand Down

0 comments on commit dcc6447

Please sign in to comment.