BME680 is an integrated environmental sensor developed specifically for mobile applications and wearables where size and low power consumption are key requirements.
Dependents: Example_DS3231_test
Diff: BME680.h
- Revision:
- 1:85088a918342
- Parent:
- 0:c70b7ececf93
--- a/BME680.h Fri Jul 22 17:38:11 2016 +0000 +++ b/BME680.h Wed Aug 03 15:07:42 2016 +0000 @@ -11,7 +11,7 @@ #define FIXED_POINT_COMPENSATION // no idea what it is for -#define HEATER_C1_ENABLE +//#define HEATER_C1_ENABLE // Sensor Specific constants */ #define BME680_SLEEP_MODE (0x00) @@ -32,7 +32,12 @@ #define BME680_MIN_HUMIDITY_VALUE (double)(0.0) #endif -/// BME680 integrated environmental sensor. This API supports FIXED and FLOATING compenstion. By default it supports FIXED, to use FLOATING user need to disable "FIXED_POINT_COMPENSATION" in the BME680.h file. +/** +* !! MUST CALL init() FIRST !! +* read the chip id and calibration data of the BME680 sensor +* BME680 integrated environmental sensor. This API supports FIXED and FLOATING compenstion. +* By default it supports FIXED, to use FLOATING user need to disable "FIXED_POINT_COMPENSATION" in the BME680.h file. +*/ class BME680 { private: @@ -124,13 +129,27 @@ public: - /// NOT IMPLEMENTED + /** + * TPHG measurements are performed. + * continuously until mode change. + * Between each cycle, the sensor enters stand-by for a period of time according to the odr<3:0> control register. + * Gas sensor heater only operates during gas sub-measurement. + * 100 ms gas wait time, T:X2, P:X16, H:X1 + */ void setSequentialMode(); - - /// NOT IMPLEMENTED + + /** + * Single TPHG cycle is performed. + * Sensor automatically returns to sleep mode afterwards. + * Gas sensor heater only operates during gas sub-measureme. + */ void setForcedMode(); - - /// NOT IMPLEMENTED + + /** + * TPHG measurements are performed continuously until mode change. + * No stand-by occurs between consecutive TPHG cycles. + * Gas sensor heater operates in parallel with TPH measurements. + */ void setParallelMode(); /* @@ -368,7 +387,7 @@ * Note: Only field0 will be updated in forced mode * @param field 0-2 */ - uint32_t getPressureData(int field); + uint32_t getUncompensatedPressureData(int field = 0); /** * [temp1_msb] [temp1_lsb] [temp1_xlsb] @@ -381,7 +400,7 @@ * Note: Only field0 will be updated in forced mode * @param field 0-2 */ - uint32_t getTemp1Data(int field); + uint32_t getUncompensatedTemp1Data(int field = 0); /** * [hum_msb] [hum_lsb] @@ -394,7 +413,7 @@ * Note: Only field0 will be updated in forced mode * @param field 0-2 */ - uint32_t getHumidityData(int field); + uint32_t getUncompensatedHumidityData(int field = 0); /** * [gas_rl] @@ -407,7 +426,7 @@ * Note: Only field0 will be updated in forced mode * @param field 0-2 */ - uint16_t getGasResistanceData(int field); + uint16_t getUncompensatedGasResistanceData(int field = 0); /** * [gas_range_rl] @@ -421,7 +440,7 @@ * Note: Only field0 will be updated in forced mode * @param field 0-2 */ - uint8_t getGasResistanceRange(int field); + uint8_t getGasResistanceRange(int field = 0); // STATUS ######################################################################### @@ -434,7 +453,7 @@ * measurements. Availability of new (yet unread) results is indicated by new_data_0|1|2 flags. * @param field 0-2 */ - bool isNewData(int field); + bool isNewData(int field = 0); /** * [gas_measuring] @@ -444,7 +463,7 @@ * should not be changed when the device is measuring. * @param field 0-2 */ - bool isGasMeasuring(int field); + bool isGasMeasuring(int field = 0); /** * [measuring] @@ -452,7 +471,7 @@ * gas) is running and back to ‘0’ when the results have been transferred to the data registers. * @param field 0-2 */ - bool isMeasuring(int field); + bool isMeasuring(int field = 0); /** * [gas_meas_index_x] @@ -462,7 +481,7 @@ * to 9) is stored in gas_meas_index register. * @param field 0-2 */ - int getGasMeasurementIndex(int field); + int getGasMeasurementIndex(int field = 0); /** * [sub_meas_index_x] @@ -473,7 +492,7 @@ * Note: This index is incremented only if gas conversion is active. * @param field 0-2 */ - int getSubMeasurementIndex(int field); + int getSubMeasurementIndex(int field = 0); /** * [gas_valid_rl] @@ -482,14 +501,14 @@ * real gas conversion (i.e., not a dummy one) is indicated by the gas_valid_rl status register. * @param field 0-2 */ - bool isGasValid(int field); + bool isGasValid(int field = 0); /** * [heat_stab_rl] * Heater temperature stability for target heater resistance is indicated heat_stab_x status bits. * @param field 0-2 */ - bool isHeaterStable(int field); + bool isHeaterStable(int field = 0); // GAS CONTROL #########################################################################