Paparazzi UAS  v5.15_devel-88-gb3ad7fe
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
lps25h_i2c.c File Reference

Driver for LPS25H barometer I2C. More...

#include "peripherals/lps25h_i2c.h"
#include "std.h"
#include <stdio.h>
#include <math.h>
+ Include dependency graph for lps25h_i2c.c:

Go to the source code of this file.

Macros

#define Int32FromBuf(buf, idx)   (int32_t)(int8_t)buf[idx+2] << 16 | (uint16_t)buf[idx+1] << 8 | buf[idx];
 

Functions

void lps25h_i2c_init (struct Lps25h_I2c *lps, struct i2c_periph *i2c_p, uint8_t addr)
 
static void lps25h_i2c_tx_reg (struct Lps25h_I2c *lps, uint8_t reg, uint8_t val)
 
static void lps25h_i2c_send_config (struct Lps25h_I2c *lps)
 
void lps25h_i2c_start_configure (struct Lps25h_I2c *lps)
 
void lps25h_i2c_read (struct Lps25h_I2c *lps)
 
float lps25h_readPressureMillibars (int32_t press)
 
float pressureToAltMeters (float pressure_mbar, float altimeter_setting_mbar)
 
void lps25h_i2c_event (struct Lps25h_I2c *lps)
 

Detailed Description

Driver for LPS25H barometer I2C.

Definition in file lps25h_i2c.c.

Macro Definition Documentation

#define Int32FromBuf (   buf,
  idx 
)    (int32_t)(int8_t)buf[idx+2] << 16 | (uint16_t)buf[idx+1] << 8 | buf[idx];

Definition at line 98 of file lps25h_i2c.c.

Referenced by lps25h_i2c_event().

Function Documentation

void lps25h_i2c_read ( struct Lps25h_I2c lps)

Definition at line 87 of file lps25h_i2c.c.

References i2c_transaction::buf, Lps25h_I2c::i2c_p, i2c_submit(), Lps25h_I2c::i2c_trans, I2CTransDone, I2CTransTxRx, Lps25h_I2c::initialized, i2c_transaction::len_r, i2c_transaction::len_w, LPS25H_REG_OUT_XL, i2c_transaction::status, and i2c_transaction::type.

Referenced by lps25h_i2c_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lps25h_i2c_send_config ( struct Lps25h_I2c lps)
static
void lps25h_i2c_start_configure ( struct Lps25h_I2c lps)

Definition at line 76 of file lps25h_i2c.c.

References Lps25h_I2c::i2c_trans, I2CTransDone, I2CTransSuccess, Lps25h_I2c::init_status, LPS25H_CONF_UNINIT, lps25h_i2c_send_config(), and i2c_transaction::status.

Referenced by lps25h_i2c_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lps25h_i2c_tx_reg ( struct Lps25h_I2c lps,
uint8_t  reg,
uint8_t  val 
)
static

Definition at line 48 of file lps25h_i2c.c.

References i2c_transaction::buf, Lps25h_I2c::i2c_p, i2c_submit(), Lps25h_I2c::i2c_trans, I2CTransTx, i2c_transaction::len_r, i2c_transaction::len_w, i2c_transaction::type, and val.

Referenced by lps25h_i2c_send_config().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float lps25h_readPressureMillibars ( int32_t  press)

Definition at line 101 of file lps25h_i2c.c.

float pressureToAltMeters ( float  pressure_mbar,
float  altimeter_setting_mbar 
)

Definition at line 106 of file lps25h_i2c.c.