Macros | Enumerations | Functions | Variables
drv_ms5611.c File Reference
#include <breezystm32.h>
#include <limits.h>
#include <math.h>
Include dependency graph for drv_ms5611.c:

Go to the source code of this file.

Macros

#define CMD_ADC_1024   0x04
 
#define CMD_ADC_2048   0x06
 
#define CMD_ADC_256   0x00
 
#define CMD_ADC_4096   0x08
 
#define CMD_ADC_512   0x02
 
#define CMD_ADC_CONV   0x40
 
#define CMD_ADC_D1   0x00
 
#define CMD_ADC_D2   0x10
 
#define CMD_ADC_READ   0x00
 
#define CMD_PROM_RD   0xA0
 
#define CMD_RESET   0x1E
 
#define PROM_NB   8
 
#define REBOOT_PERIOD_MS   1000 * 60 * 30
 

Enumerations

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 }
 

Functions

int8_t calc_crc ()
 
static void convert ()
 
static void master_cb (uint8_t result)
 
void ms5611_async_read (float *pressure, float *temperature)
 
void ms5611_async_update ()
 
bool ms5611_init ()
 
bool ms5611_present ()
 
void pres_read_cb1 (uint8_t result)
 
void pres_read_cb2 (uint8_t result)
 
void pres_start_cb (uint8_t result)
 
bool read_pres_mess ()
 
static bool read_prom ()
 
bool read_temp_mess ()
 
static void reset (void)
 
void reset_cb (uint8_t result)
 
bool start_pres_meas ()
 
bool start_temp_meas ()
 
void temp_read_cb1 (uint8_t result)
 
void temp_read_cb2 (uint8_t result)
 
void temp_start_cb (uint8_t result)
 
void write_zero_cb (uint8_t result)
 

Variables

static const uint8_t ADDR = 0x77
 
bool baro_present_
 
static callback_type_t callback_type_
 
static uint8_t cmd
 
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]
 
static const uint8_t PROM_RD = 0xA0
 
static state_t state_
 
uint8_t temp_buf_ [3]
 
int32_t temp_raw_
 
float temperature_
 
bool waiting_for_cb_
 

Macro Definition Documentation

#define CMD_ADC_1024   0x04

Definition at line 39 of file drv_ms5611.c.

#define CMD_ADC_2048   0x06

Definition at line 40 of file drv_ms5611.c.

#define CMD_ADC_256   0x00

Definition at line 37 of file drv_ms5611.c.

#define CMD_ADC_4096   0x08

Definition at line 41 of file drv_ms5611.c.

#define CMD_ADC_512   0x02

Definition at line 38 of file drv_ms5611.c.

#define CMD_ADC_CONV   0x40

Definition at line 34 of file drv_ms5611.c.

#define CMD_ADC_D1   0x00

Definition at line 35 of file drv_ms5611.c.

#define CMD_ADC_D2   0x10

Definition at line 36 of file drv_ms5611.c.

#define CMD_ADC_READ   0x00

Definition at line 33 of file drv_ms5611.c.

#define CMD_PROM_RD   0xA0

Definition at line 42 of file drv_ms5611.c.

#define CMD_RESET   0x1E

Definition at line 32 of file drv_ms5611.c.

#define PROM_NB   8

Definition at line 43 of file drv_ms5611.c.

#define REBOOT_PERIOD_MS   1000 * 60 * 30

Definition at line 46 of file drv_ms5611.c.

Enumeration Type Documentation

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 76 of file drv_ms5611.c.

enum state_t
Enumerator
START_TEMP 
READ_TEMP 
START_PRESS 
READ_PRESS 

Definition at line 66 of file drv_ms5611.c.

Function Documentation

int8_t calc_crc ( )

Definition at line 118 of file drv_ms5611.c.

static void convert ( )
static

Definition at line 210 of file drv_ms5611.c.

void master_cb ( uint8_t  result)
static

Definition at line 331 of file drv_ms5611.c.

void ms5611_async_read ( float *  pressure,
float *  temperature 
)

Definition at line 452 of file drv_ms5611.c.

void ms5611_async_update ( void  )

Definition at line 405 of file drv_ms5611.c.

bool ms5611_init ( void  )

Definition at line 151 of file drv_ms5611.c.

bool ms5611_present ( void  )

Definition at line 203 of file drv_ms5611.c.

void pres_read_cb1 ( uint8_t  result)

Definition at line 261 of file drv_ms5611.c.

void pres_read_cb2 ( uint8_t  result)

Definition at line 281 of file drv_ms5611.c.

void pres_start_cb ( uint8_t  result)

Definition at line 300 of file drv_ms5611.c.

bool read_pres_mess ( )

Definition at line 384 of file drv_ms5611.c.

static bool read_prom ( )
static

Definition at line 95 of file drv_ms5611.c.

bool read_temp_mess ( )

Definition at line 394 of file drv_ms5611.c.

static void reset ( void  )
static

Definition at line 89 of file drv_ms5611.c.

void reset_cb ( uint8_t  result)

Definition at line 309 of file drv_ms5611.c.

bool start_pres_meas ( )

Definition at line 374 of file drv_ms5611.c.

bool start_temp_meas ( )

Definition at line 364 of file drv_ms5611.c.

void temp_read_cb1 ( uint8_t  result)

Definition at line 252 of file drv_ms5611.c.

void temp_read_cb2 ( uint8_t  result)

Definition at line 271 of file drv_ms5611.c.

void temp_start_cb ( uint8_t  result)

Definition at line 291 of file drv_ms5611.c.

void write_zero_cb ( uint8_t  result)

Definition at line 321 of file drv_ms5611.c.

Variable Documentation

const uint8_t ADDR = 0x77
static

Definition at line 29 of file drv_ms5611.c.

bool baro_present_

Definition at line 64 of file drv_ms5611.c.

callback_type_t callback_type_
static

Definition at line 87 of file drv_ms5611.c.

uint8_t cmd
static

Definition at line 48 of file drv_ms5611.c.

uint32_t last_update_ms_

Definition at line 61 of file drv_ms5611.c.

bool new_data_

Definition at line 63 of file drv_ms5611.c.

uint32_t next_reboot_ms_

Definition at line 60 of file drv_ms5611.c.

uint32_t next_update_ms_

Definition at line 59 of file drv_ms5611.c.

uint8_t pres_buf_[3]

Definition at line 52 of file drv_ms5611.c.

int32_t pres_raw_

Definition at line 54 of file drv_ms5611.c.

float pressure_

Definition at line 56 of file drv_ms5611.c.

uint16_t prom[8]

Definition at line 58 of file drv_ms5611.c.

const uint8_t PROM_RD = 0xA0
static

Definition at line 30 of file drv_ms5611.c.

state_t state_
static

Definition at line 73 of file drv_ms5611.c.

uint8_t temp_buf_[3]

Definition at line 53 of file drv_ms5611.c.

int32_t temp_raw_

Definition at line 55 of file drv_ms5611.c.

float temperature_

Definition at line 57 of file drv_ms5611.c.

bool waiting_for_cb_

Definition at line 62 of file drv_ms5611.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:50