Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
MS5611 Class Reference

#include <ms5611.h>

Public Member Functions

bool init (I2C *_i2c)
 
void master_cb (uint8_t result)
 
void pres_read_cb1 (uint8_t result)
 
void pres_read_cb2 (uint8_t result)
 
void pres_start_cb (uint8_t result)
 
bool present ()
 
void read (float *press, float *temp)
 
void reset_cb (uint8_t result)
 
void temp_read_cb1 (uint8_t result)
 
void temp_read_cb2 (uint8_t result)
 
void temp_start_cb (uint8_t result)
 
void update ()
 
void write_zero_cb (uint8_t result)
 

Private Types

enum  : uint8_t {
  RESET = 0x1E, ADC_READ = 0x00, ADC_CONV = 0x40, ADC_D1 = 0x00,
  ADC_D2 = 0x10, ADC_256 = 0x00, ADC_512 = 0x02, ADC_1024 = 0x04,
  ADC_2048 = 0x06, ADC_4096 = 0x08, PROM_RD = 0xA0
}
 
enum  callback_type_t {
  CB_TEMP_READ1, CB_TEMP_READ2, CB_PRES_READ1, CB_PRES_READ2,
  CB_TEMP_START, CB_PRES_START, CB_RESET, CB_WRITE_ZERO
}
 
enum  state_t { START_TEMP = 0, READ_TEMP = 1, START_PRESS = 2, READ_PRESS = 3 }
 

Private Member Functions

int8_t calc_crc ()
 
void convert ()
 
bool read_pres_mess ()
 
bool read_prom ()
 
bool read_temp_mess ()
 
void reset ()
 
bool start_pres_meas ()
 
bool start_temp_meas ()
 

Private Attributes

bool baro_present_
 
callback_type_t callback_type_
 
I2Ci2c_
 
uint32_t last_update_ms_
 
bool new_data_
 
uint32_t next_reboot_ms_
 
uint32_t next_update_ms_
 
uint8_t pres_buf_ [3]
 
int32_t pres_raw_
 
float pressure_
 
uint16_t prom [8]
 
state_t state_
 
uint8_t temp_buf_ [3]
 
int32_t temp_raw_
 
float temperature_
 
bool waiting_for_cb_
 

Static Private Attributes

static const uint8_t ADDR = 0x77
 

Detailed Description

Definition at line 39 of file ms5611.h.

Member Enumeration Documentation

anonymous enum : uint8_t
private
Enumerator
RESET 
ADC_READ 
ADC_CONV 
ADC_D1 
ADC_D2 
ADC_256 
ADC_512 
ADC_1024 
ADC_2048 
ADC_4096 
PROM_RD 

Definition at line 43 of file ms5611.h.

Enumerator
CB_TEMP_READ1 
CB_TEMP_READ2 
CB_PRES_READ1 
CB_PRES_READ2 
CB_TEMP_START 
CB_PRES_START 
CB_RESET 
CB_WRITE_ZERO 

Definition at line 67 of file ms5611.h.

enum MS5611::state_t
private
Enumerator
START_TEMP 
READ_TEMP 
START_PRESS 
READ_PRESS 

Definition at line 58 of file ms5611.h.

Member Function Documentation

int8_t MS5611::calc_crc ( )
private

Definition at line 175 of file ms5611.cpp.

void MS5611::convert ( )
private

Definition at line 236 of file ms5611.cpp.

bool MS5611::init ( I2C _i2c)

Definition at line 39 of file ms5611.cpp.

void MS5611::master_cb ( uint8_t  result)

Definition at line 394 of file ms5611.cpp.

void MS5611::pres_read_cb1 ( uint8_t  result)

Definition at line 319 of file ms5611.cpp.

void MS5611::pres_read_cb2 ( uint8_t  result)

Definition at line 339 of file ms5611.cpp.

void MS5611::pres_start_cb ( uint8_t  result)

Definition at line 358 of file ms5611.cpp.

bool MS5611::present ( )

Definition at line 93 of file ms5611.cpp.

void MS5611::read ( float *  press,
float *  temp 
)

Definition at line 388 of file ms5611.cpp.

bool MS5611::read_pres_mess ( )
private

Definition at line 294 of file ms5611.cpp.

bool MS5611::read_prom ( )
private

Definition at line 152 of file ms5611.cpp.

bool MS5611::read_temp_mess ( )
private

Definition at line 302 of file ms5611.cpp.

void MS5611::reset ( )
private

Definition at line 147 of file ms5611.cpp.

void MS5611::reset_cb ( uint8_t  result)

Definition at line 367 of file ms5611.cpp.

bool MS5611::start_pres_meas ( )
private

Definition at line 286 of file ms5611.cpp.

bool MS5611::start_temp_meas ( )
private

Definition at line 278 of file ms5611.cpp.

void MS5611::temp_read_cb1 ( uint8_t  result)

Definition at line 310 of file ms5611.cpp.

void MS5611::temp_read_cb2 ( uint8_t  result)

Definition at line 329 of file ms5611.cpp.

void MS5611::temp_start_cb ( uint8_t  result)

Definition at line 349 of file ms5611.cpp.

void MS5611::update ( )

Definition at line 100 of file ms5611.cpp.

void MS5611::write_zero_cb ( uint8_t  result)

Definition at line 378 of file ms5611.cpp.

Member Data Documentation

const uint8_t MS5611::ADDR = 0x77
staticprivate

Definition at line 79 of file ms5611.h.

bool MS5611::baro_present_
private

Definition at line 103 of file ms5611.h.

callback_type_t MS5611::callback_type_
private

Definition at line 105 of file ms5611.h.

I2C* MS5611::i2c_
private

Definition at line 90 of file ms5611.h.

uint32_t MS5611::last_update_ms_
private

Definition at line 100 of file ms5611.h.

bool MS5611::new_data_
private

Definition at line 102 of file ms5611.h.

uint32_t MS5611::next_reboot_ms_
private

Definition at line 99 of file ms5611.h.

uint32_t MS5611::next_update_ms_
private

Definition at line 98 of file ms5611.h.

uint8_t MS5611::pres_buf_[3]
private

Definition at line 91 of file ms5611.h.

int32_t MS5611::pres_raw_
private

Definition at line 93 of file ms5611.h.

float MS5611::pressure_
private

Definition at line 95 of file ms5611.h.

uint16_t MS5611::prom[8]
private

Definition at line 97 of file ms5611.h.

state_t MS5611::state_
private

Definition at line 65 of file ms5611.h.

uint8_t MS5611::temp_buf_[3]
private

Definition at line 92 of file ms5611.h.

int32_t MS5611::temp_raw_
private

Definition at line 94 of file ms5611.h.

float MS5611::temperature_
private

Definition at line 96 of file ms5611.h.

bool MS5611::waiting_for_cb_
private

Definition at line 101 of file ms5611.h.


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


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:31