upm  0.1.8
Sensor/Actuator repository for libmraa (v0.4.5)
 All Data Structures Files Functions Variables Macros Pages
Public Member Functions
GY65 Class Reference

C++ API for GY65 chip (Atmospheric Pressure Sensor) More...

Detailed Description

This file defines the gy65 C++ interface for libgy65

uint32_t presure = 0;
float temperature = 0;
float altitude = 0;
uint32_t sealevel = 0;
sensor = new upm::GY65(0, ADDR);
while (!doWork) {
presure = sensor->getPressure ();
temperature = sensor->getTemperature ();
altitude = sensor->getAltitude ();
sealevel = sensor->getSealevelPressure ();
std::cout << "pressure value = " <<
presure <<
", atitude value = " <<
altitude <<
", sealevel value = " <<
sealevel <<
", temperature = " <<
temperature << std::endl;
usleep (100000);
}

Public Member Functions

 GY65 (int bus, int devAddr, uint8_t mode=BMP085_ULTRAHIGHRES)
 
 ~GY65 ()
 
int32_t getPressure ()
 
int32_t getPressureRaw ()
 
int16_t getTemperatureRaw ()
 
float getTemperature ()
 
int32_t getSealevelPressure (float altitudeMeters=0)
 
float getAltitude (float sealevelPressure=101325)
 
int32_t computeB5 (int32_t UT)
 
uint16_t i2cReadReg_16 (int reg)
 
mraa_result_t i2cWriteReg (uint8_t reg, uint8_t value)
 
uint8_t i2cReadReg_8 (int reg)
 

Constructor & Destructor Documentation

GY65 ( int  bus,
int  devAddr,
uint8_t  mode = BMP085_ULTRAHIGHRES 
)

Instanciates a GY65 object

Parameters
busnumber of used bus
devAddraddress of used i2c device
modeBMP085 mode

Here is the call graph for this function:

~GY65 ( )

GY65 object destructor, basicaly it close i2c connection.

Member Function Documentation

int32_t getPressure ( )

Return calculated pressure

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t getPressureRaw ( )

Get raw pressure data

Here is the call graph for this function:

Here is the caller graph for this function:

int16_t getTemperatureRaw ( )

Get raw temperature data from chip

Here is the call graph for this function:

Here is the caller graph for this function:

float getTemperature ( )

Return calculated temperature

Here is the call graph for this function:

int32_t getSealevelPressure ( float  altitudeMeters = 0)

With given absolute altitude sea level can be calculated

Parameters
altitudeMetersaltitude

Here is the call graph for this function:

float getAltitude ( float  sealevelPressure = 101325)

With given sea level altitude in meters can be calculated

Parameters
sealevelPressureSea level

Here is the call graph for this function:

int32_t computeB5 ( int32_t  UT)

Calculation of B5 (check spec for more information)

Parameters
UT

Here is the caller graph for this function:

uint16_t i2cReadReg_16 ( int  reg)

Read two bytes register

Parameters
regaddress of a register

Here is the caller graph for this function:

mraa_result_t i2cWriteReg ( uint8_t  reg,
uint8_t  value 
)

Write to one byte register

Parameters
regaddress of a register
valuebyte to be written

Here is the caller graph for this function:

uint8_t i2cReadReg_8 ( int  reg)

Read one byte register

Parameters
regaddress of a register

Here is the caller graph for this function:


The documentation for this class was generated from the following files: