MAV'RIC
|
Driver for the MS5611 barometer. More...
#include <barometer_ms5611.hpp>
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) |
Driver for the MS5611 barometer.
Oversampling ratio.
Barometer_MS5611::Barometer_MS5611 | ( | I2c & | i2c, |
conf_t | config = default_config() |
||
) |
Constructor.
i2c | Reference to I2C device |
float Barometer_MS5611::altitude_gf | ( | void | ) | const [virtual] |
Get the altitude in meters above sea level.
Global frame: (>0 means upward)
Implements Barometer.
float Barometer_MS5611::altitude_gf_raw | ( | void | ) | const [virtual] |
Get the unfiltered altitude in meters above sea level.
Global frame: (>0 means upward)
Implements Barometer.
Barometer_MS5611::conf_t Barometer_MS5611::default_config | ( | void | ) | [inline, static] |
Default Configuration.
bool Barometer_MS5611::init | ( | void | ) | [virtual] |
Initialise the sensor.
Implements Barometer.
uint64_t Barometer_MS5611::last_update_us | ( | void | ) | const [virtual] |
float Barometer_MS5611::pressure | ( | void | ) | const [virtual] |
float Barometer_MS5611::temperature | ( | void | ) | const [virtual] |
bool Barometer_MS5611::update | ( | void | ) | [virtual] |
Main update function Reads new values from sensor.
Implements Barometer.
float Barometer_MS5611::vertical_speed_lf | ( | void | ) | const [virtual] |
Get the vertical speed in meters/second.
NED frame: (>0 means downward)
Implements Barometer.
float Barometer_MS5611::vertical_speed_lf_raw | ( | void | ) | const [virtual] |
Get the unfiltered vertical speed in meters/second.
NED frame: (>0 means downward)
Implements Barometer.