Commented debug printfs
Dependents: LoRaWAN-NAMote72-Application-Demo_IoTium LoRaWAN-NAMote72-BVS-confirmed-tester-0-7v1_copy LoRaWAN-NAMote72-Application-Demo-good LoRaWAN-NAMote72-Application-Demo
Fork of lib_mpl3115a2 by
Diff: mpl3115a2.h
- Revision:
- 2:0eb8b0ad292b
- Parent:
- 1:3cd1f21925e8
--- a/mpl3115a2.h Fri May 08 01:32:04 2015 +0000 +++ b/mpl3115a2.h Mon Aug 31 21:37:41 2015 +0000 @@ -63,6 +63,19 @@ #define OFF_T_REG 0x2C // Temperature data offset #define OFF_H_REG 0x2D // Altitude data offset + +typedef union { + struct { // at 0x26 + uint8_t SBYB : 1; // 0 0==standby, 1=active + uint8_t OST : 1; // 1 initiate measurement now + uint8_t RST : 1; // 2 software reset + uint8_t OS : 3; // 3,4,5 oversampling ratio + uint8_t RAW : 1; // 6 raw output mode + uint8_t ALT : 1; // 7 0=barometer 1=altitude + } bits; + uint8_t octet; +} mpl_ctrl_reg1_t; + typedef union { struct { // at 0x uint8_t SRC_TCHG : 1; // 0 @@ -87,13 +100,19 @@ void SetModeActive(void); bool GetModeActive(void); void SetModeStandby(void); - float ReadAltitude( void ); - float ReadTemperature( void ); + float ReadAltitude( void ); // returns meters above sea level + float ReadBarometer(void); // returns pascals + float ReadTemperature( void ); // returns celcius void SetModeAltimeter(void); + void SetModeBarometer(void); void ToggleOneShot( void ); + void setOSR(uint8_t); + uint8_t getOSR(void); float Altitude; float Temperature; void service(void); + + mpl_ctrl_reg1_t ctrl_reg1; private: I2C& m_i2c;