Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ms5611_i2c.h File Reference

Measurement Specialties (Intersema) MS5611-01BA and MS5607-02BA03 pressure/temperature sensor interface for I2C. More...

#include "mcu_periph/i2c.h"
#include "peripherals/ms5611.h"
+ Include dependency graph for ms5611_i2c.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Ms5611_I2c
 

Functions

void ms5611_i2c_init (struct Ms5611_I2c *ms, struct i2c_periph *i2c_p, uint8_t addr, bool is_ms5607)
 
void ms5611_i2c_start_configure (struct Ms5611_I2c *ms)
 
void ms5611_i2c_start_conversion (struct Ms5611_I2c *ms)
 
void ms5611_i2c_periodic_check (struct Ms5611_I2c *ms)
 Periodic function to ensure proper delay after triggering reset or conversion. More...
 
void ms5611_i2c_event (struct Ms5611_I2c *ms)
 
static void ms5611_i2c_read (struct Ms5611_I2c *ms)
 convenience function to trigger new measurement. More...
 
static void ms5611_i2c_periodic (struct Ms5611_I2c *ms)
 convenience function More...
 

Detailed Description

Measurement Specialties (Intersema) MS5611-01BA and MS5607-02BA03 pressure/temperature sensor interface for I2C.

Definition in file ms5611_i2c.h.


Data Structure Documentation

struct Ms5611_I2c

Definition at line 36 of file ms5611_i2c.h.

+ Collaboration diagram for Ms5611_I2c:
Data Fields
struct Ms5611Data data
volatile bool data_available data ready flag
struct i2c_periph * i2c_p
struct i2c_transaction i2c_trans
bool initialized config done flag
bool is_ms5607 TRUE if MS5607, FALSE if MS5611.
int32_t prom_cnt number of bytes read from PROM
enum Ms5611Status status

Function Documentation

void ms5611_i2c_init ( struct Ms5611_I2c ms,
struct i2c_periph i2c_p,
uint8_t  addr,
bool  is_ms5607 
)
static void ms5611_i2c_periodic ( struct Ms5611_I2c ms)
inlinestatic

convenience function

Definition at line 69 of file ms5611_i2c.h.

References ms5611_i2c_periodic_check(), and ms5611_i2c_read().

Referenced by baro_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ms5611_i2c_periodic_check ( struct Ms5611_I2c ms)

Periodic function to ensure proper delay after triggering reset or conversion.

Should run at 100Hz max. Typical conversion time is 8.22ms at max resolution.

Definition at line 78 of file ms5611_i2c.c.

References i2c_transaction::buf, Ms5611_I2c::i2c_p, Ms5611_I2c::i2c_trans, i2c_transceive(), I2CTransDone, MS5611_ADC_READ, MS5611_PROM_READ, MS5611_STATUS_ADC_D1, MS5611_STATUS_ADC_D2, MS5611_STATUS_CONV_D1, MS5611_STATUS_CONV_D1_OK, MS5611_STATUS_CONV_D2, MS5611_STATUS_CONV_D2_OK, MS5611_STATUS_PROM, MS5611_STATUS_RESET, MS5611_STATUS_RESET_OK, Ms5611_I2c::prom_cnt, i2c_transaction::slave_addr, Ms5611_I2c::status, and i2c_transaction::status.

Referenced by baro_ms5611_periodic_check(), and ms5611_i2c_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ms5611_i2c_read ( struct Ms5611_I2c ms)
inlinestatic

convenience function to trigger new measurement.

(or start configuration if not already initialized) Still need to regularly run ms5611_i2c_periodic_check to complete the measurement.

Definition at line 59 of file ms5611_i2c.h.

References Ms5611_I2c::initialized, ms5611_i2c_start_configure(), and ms5611_i2c_start_conversion().

Referenced by baro_ms5611_read(), and ms5611_i2c_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ms5611_i2c_start_configure ( struct Ms5611_I2c ms)

Definition at line 51 of file ms5611_i2c.c.

References i2c_transaction::buf, Ms5611_I2c::i2c_p, Ms5611_I2c::i2c_trans, i2c_transmit(), Ms5611_I2c::initialized, MS5611_SOFT_RESET, MS5611_STATUS_RESET, MS5611_STATUS_UNINIT, Ms5611_I2c::prom_cnt, i2c_transaction::slave_addr, and Ms5611_I2c::status.

Referenced by ms5611_i2c_read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ms5611_i2c_start_conversion ( struct Ms5611_I2c ms)

Definition at line 62 of file ms5611_i2c.c.

References i2c_transaction::buf, Ms5611_I2c::i2c_p, Ms5611_I2c::i2c_trans, i2c_transmit(), I2CTransDone, MS5611_START_CONV_D1, MS5611_STATUS_CONV_D1, MS5611_STATUS_IDLE, i2c_transaction::slave_addr, Ms5611_I2c::status, and i2c_transaction::status.

Referenced by ms5611_i2c_read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: