MAV'RIC
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
Barometer_MS5611 Class Reference

Driver for the MS5611 barometer. More...

#include <barometer_ms5611.hpp>

Inheritance diagram for Barometer_MS5611:
Inheritance graph
[legend]
Collaboration diagram for Barometer_MS5611:
Collaboration graph
[legend]

List of all members.

Classes

struct  calibration_data_t
struct  conf_t
 Configuration structure. More...

Public Types

enum  state_t { INIT, IDLE, GET_TEMPERATURE, GET_PRESSURE }
 Sensor state. More...
enum  address_t { ADDR_CSBLOW = 0x77, ADDR_CSBHIGH = 0x76 }
enum  oversampling_ratio_t {
  OSR_256 = 0x00, OSR_512 = 0x01, OSR_1024 = 0x02, OSR_2048 = 0x03,
  OSR_4096 = 0x04
}
 Oversampling ratio. More...

Public Member Functions

 Barometer_MS5611 (I2c &i2c, conf_t config=default_config())
 Constructor.
bool init (void)
 Initialise the sensor.
bool update (void)
 Main update function Reads new values from sensor.
uint64_t last_update_us (void) const
 Get the last update time in microseconds.
float pressure (void) const
 Return the pressure (in Pa)
float altitude_gf (void) const
 Get the altitude in meters above sea level.
float altitude_gf_raw (void) const
 Get the unfiltered altitude in meters above sea level.
float vertical_speed_lf (void) const
 Get the vertical speed in meters/second.
float vertical_speed_lf_raw (void) const
 Get the unfiltered vertical speed in meters/second.
float temperature (void) const
 Get sensor temperature.

Static Public Member Functions

static conf_t default_config (void)
 Default Configuration.

Static Public Attributes

static const uint8_t COMMAND_RESET = 0x1E
 Reset sensor.
static const uint8_t COMMAND_GET_CALIBRATION = 0xA2
 Get 16bytes factory configuration from PROM.
static const uint8_t COMMAND_START_PRESSURE_CONV = 0x40
 Start pressure conversion (must add oversampling ratio to this command)
static const uint8_t COMMAND_START_TEMPERATURE_CONV = 0x50
 Start temperature conversion (must add oversampling ratio to this command)
static const uint8_t COMMAND_GET_DATA = 0x00
 Get 3 bytes data (can be pressure or temperature depending of which sampling was started)

Detailed Description

Driver for the MS5611 barometer.


Member Enumeration Documentation

I2C address of the sensor

Enumerator:
ADDR_CSBLOW 

I2C address when CSB pin is connected to GND.

ADDR_CSBHIGH 

I2C address when CSB pin is connected to VCC.

Oversampling ratio.

Enumerator:
OSR_256 

256 : resolution 0.065mbar, sampling time 0.54ms

OSR_512 

512 : resolution 0.042mbar, sampling time 1.06ms

OSR_1024 

1024 : resolution 0.027mbar, sampling time 2.08ms

OSR_2048 

2048 : resolution 0.018mbar, sampling time 4.13ms

OSR_4096 

4096 : resolution 0.012mbar, sampling time 8.22ms

Sensor state.

Enumerator:
INIT 

Sensor is not responding, will retry.

IDLE 

First run, start temperature sampling.

GET_TEMPERATURE 

Read temperature from sensor, start pressure sampling.

GET_PRESSURE 

Read pressure from sensor, start temperature sampling.


Constructor & Destructor Documentation

Constructor.

Parameters:
i2cReference to I2C device

Member Function Documentation

float Barometer_MS5611::altitude_gf ( void  ) const [virtual]

Get the altitude in meters above sea level.

Global frame: (>0 means upward)

Returns:
Value

Implements Barometer.

Here is the caller graph for this function:

float Barometer_MS5611::altitude_gf_raw ( void  ) const [virtual]

Get the unfiltered altitude in meters above sea level.

Global frame: (>0 means upward)

Returns:
Value

Implements Barometer.

Here is the call graph for this function:

Default Configuration.

Returns:
config
bool Barometer_MS5611::init ( void  ) [virtual]

Initialise the sensor.

Returns:
Success

Implements Barometer.

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t Barometer_MS5611::last_update_us ( void  ) const [virtual]

Get the last update time in microseconds.

Returns:
Value

Implements Barometer.

float Barometer_MS5611::pressure ( void  ) const [virtual]

Return the pressure (in Pa)

Returns:
Value

Implements Barometer.

float Barometer_MS5611::temperature ( void  ) const [virtual]

Get sensor temperature.

Returns:
Value

Implements Barometer.

bool Barometer_MS5611::update ( void  ) [virtual]

Main update function Reads new values from sensor.

Returns:
Success

Implements Barometer.

Here is the call graph for this function:

float Barometer_MS5611::vertical_speed_lf ( void  ) const [virtual]

Get the vertical speed in meters/second.

NED frame: (>0 means downward)

Returns:
Value

Implements Barometer.

Here is the caller graph for this function:

float Barometer_MS5611::vertical_speed_lf_raw ( void  ) const [virtual]

Get the unfiltered vertical speed in meters/second.

NED frame: (>0 means downward)

Returns:
Value

Implements Barometer.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines