Driver for Bosch Sensortec BME680 added

BME680 is an ulta-low-power environmental sensor that integrates
temperature, pressure, humidity and gas sensors in only one unit.

- additional includes added to satisfy Travis CI build
- function bme680_force_measurement returns now a boolean
- function bme680_is_measuring returns now boolean
- function bme680_get_measurement_duration added
- heating profiles implemented
- example for heating profiles added
This commit is contained in:
Gunar Schorcht 2017-10-16 18:58:14 +02:00
parent 87a3503f93
commit 76d1cfec75
12 changed files with 3095 additions and 0 deletions

46
examples/bme680/README.md Normal file
View file

@ -0,0 +1,46 @@
# BME680 Driver Examples
These examples demonstrate the usage of the BME680 driver with only one and multiple BME680 sensors.
## Hardware setup
There are examples that are using either I2C or SPI with one or two sensors.
For examples using BME680 sensor as I2C slave, just use GPIO5 (SCL) and GPIO4 (SDA) to connect to the BME680 sensor's I2C interface.
```
+-------------------------+ +--------+
| ESP8266 Bus 0 | | BME680 |
| GPIO 5 (SCL) +---->+ SCL |
| GPIO 4 (SDA) +-----+ SDA |
| | +--------+
+-------------------------+
```
For examples that are using SPI, BME680 sensor has to be connected to SPI bus 1. Since GPIO15 used as default CS signal of SPI bus 1 does not work correctly together with BME680, you have to connect CS to another GPIO pin, e.g., GPIO2.
```
+-------------------------+ +----------+
| ESP8266 Bus 1 | | BME680 |
| GPIO 12 (MISO) <-----< SDO |
| GPIO 13 (MOSI) >-----> SDI |
| GPIO 14 (SCK) >-----> SCK |
| GPIO 2 (CS) >-----> CS |
+-------------------------+ +----------+
```
The example with two sensors use the combination of I2C and SPI.
## Example description
__*bme680_one_sensor*__
This simple example uses only **one sensor** connected either to **I2C** or to **SPI**. Which of these interfaces is used is defined by constant **SPI_USED**. The user task triggers a measurement every second and uses function ```vTaskDelay``` to wait for the measurement results.
__*bme680_two_sensors*__
This example uses **two sensors**. One sensor is connected to **I2C** bus 0 and one sensor is connected to **SPI**. It defines two different user tasks, one for each sensor. It demonstrate the possible approaches to wait for measurement results, active busy waiting using ```bme680_is_measuring``` and passive waiting using *vTaskDelay*.
__*bme680_heating_profiles*__
This simple example uses one **only sensor** connected to **I2C** bus 0 and a sequence of heating profiles. The heating profile is changed with each cycle.