Kenji Arai / BME280
Revision:
6:f94ffb546799
Parent:
5:c1f1647004c4
Child:
7:d94871acb463
--- a/BME280.h	Sat Mar 11 04:21:14 2017 +0000
+++ b/BME280.h	Sat Dec 29 05:49:55 2018 +0000
@@ -34,13 +34,37 @@
  *  For more information about the BME280:
  *    http://ae-bst.resource.bosch.com/media/products/dokumente/bme280/BST-BME280_DS001-10.pdf
  */
- 
+
+/*
+ *  Modified by Kenji Arai / JH1PJL
+ *
+ *  http://www.page.sannet.ne.jp/kenjia/index.html
+ *  http://mbed.org/users/kenjiArai/
+ *      Created:    November  21st, 2018
+ *      Revised:    December  10th, 2018
+ *
+ *  Refrence software
+ *  bme280 library
+ *  https://os.mbed.com/users/loopsva/code/bme280/file/96075bee19f0/bme280.h/
+ *      by Kevin Braun
+ *
+ *  BME280_driver 
+ *  https://github.com/BoschSensortec/BME280_driver
+ *      by Bosch Sensortec GmbH
+ *
+ *  Reference formula
+ *  https://keisan.casio.jp/exec/system/1257609530
+ *  https://github.com/arahatashun/cansat/blob/master/bme280.c
+ *
+ */
+
 #ifndef MBED_BME280_H
 #define MBED_BME280_H
 
 #include "mbed.h"
 
 #define DEFAULT_SLAVE_ADDRESS (0x76 << 1)
+#define ANOTHER_SLAVE_ADDRESS (0x77 << 1)
 
 #ifdef _DEBUG
 extern Serial pc;
@@ -49,6 +73,12 @@
 #define DEBUG_PRINT(...)
 #endif
 
+typedef struct {
+    double pressue;
+    double temperatue;
+    double humidity;
+} BME280_Data_TypeDef;
+
 /**  Interface for controlling BME280 Combined humidity and pressure sensor
  *
  * @code
@@ -126,6 +156,33 @@
      */
     float getHumidity(void);
 
+    /** Read all compensated data
+     *
+     */
+    void getAll_compensated_data(BME280_Data_TypeDef *dt);
+
+    /** Read the ID from BME280 sensor
+     *
+     */
+    uint8_t getID(void);
+
+    /** Software reset
+     *
+     */
+    bool resetChip_by_sw(void);
+
+    /** Check BME280 is okay or not
+     *
+     */
+    bool check_chip(void);
+
+#if 0
+    /** Calculate relative altitude
+     *
+     */
+    double calcAltitude_relative(double refernce_pressue);
+#endif
+
 private:
 
     I2C         *i2c_p;