Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nickshl/DevBoy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'STM32F415APP/DevCore/Libraries/BoschBME280.h')
-rw-r--r--STM32F415APP/DevCore/Libraries/BoschBME280.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/STM32F415APP/DevCore/Libraries/BoschBME280.h b/STM32F415APP/DevCore/Libraries/BoschBME280.h
index fe38c35..a46abfb 100644
--- a/STM32F415APP/DevCore/Libraries/BoschBME280.h
+++ b/STM32F415APP/DevCore/Libraries/BoschBME280.h
@@ -1,8 +1,8 @@
//******************************************************************************
-// @file DevCfg.h
+// @file BoschBME280.h
// @author Nicolai Shlapunov
//
-// @details Bosch BMPE280: Library, header
+// @details Bosch BME280: Library, header
//
// @section LICENSE
//
@@ -118,7 +118,7 @@ class BoschBME280
// *************************************************************************
// *** Initialize ******************************************************
// *************************************************************************
- Result Initialize();
+ Result Initialize(uint8_t addr = BME280_ADDRESS);
// *************************************************************************
// *** SetSampling *****************************************************
@@ -150,10 +150,25 @@ class BoschBME280
// *************************************************************************
int32_t GetHumidity_x1024(void);
+ // *************************************************************************
+ // *** GetTemperature **************************************************
+ // *************************************************************************
+ inline float GetTemperature(void) {return ((float)GetTemperature_x100() / 100.0F);}
+
+ // *************************************************************************
+ // *** GetPressure *****************************************************
+ // *************************************************************************
+ inline float GetPressure(void) {return ((float)GetPressure_x256() / 256.0F);}
+
+ // *************************************************************************
+ // *** GetHumidity *****************************************************
+ // *************************************************************************
+ inline float GetHumidity(void) {return ((float)GetHumidity_x1024() / 1024.0F);}
+
private:
// *** default I2C address **********************************************
- const uint8_t BME280_ADDRESS = 0x76;
+ static const uint8_t BME280_ADDRESS = 0x76;
// *** Register addresses *********************************************
enum Registers
@@ -301,6 +316,13 @@ class BoschBME280
// *** Reverse byte order in array *************************************
// *************************************************************************
Result ReverseArray(uint8_t* dst, uint8_t* src, uint32_t size);
+
+ // *************************************************************************
+ // *** Private: Constructors and assign operator - prevent copying *****
+ // *************************************************************************
+ BoschBME280();
+ BoschBME280(const BoschBME280&);
+ BoschBME280& operator=(const BoschBME280);
};
#endif