Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
bmp280_i2c.c File Reference

Sensor driver for BMP280 sensor via I2C. More...

+ Include dependency graph for bmp280_i2c.c:

Go to the source code of this file.

Functions

static void parse_sensor_data (struct Bmp280_I2c *bmp)
 local function to extract raw data from i2c buffer and compute compensation with selected precision More...
 
static void parse_calib_data (struct Bmp280_I2c *bmp)
 This internal API is used to parse the calibration data, compensates it and store it in device structure (float version) More...
 
static double compensate_pressure (struct Bmp280_I2c *bmp)
 This internal API is used to compensate the raw pressure data and return the compensated pressure data in integer data type. More...
 
static double compensate_temperature (struct Bmp280_I2c *bmp)
 This internal API is used to compensate the raw temperature data and return the compensated temperature data in float data type. More...
 
void bmp280_i2c_init (struct Bmp280_I2c *bmp, struct i2c_periph *i2c_p, uint8_t addr)
 
void bmp280_i2c_periodic (struct Bmp280_I2c *bmp)
 
void bmp280_i2c_event (struct Bmp280_I2c *bmp)
 

Variables

int64_t t_fine
 

Detailed Description

Sensor driver for BMP280 sensor via I2C.

Definition in file bmp280_i2c.c.

Function Documentation

◆ bmp280_i2c_event()

◆ bmp280_i2c_init()

void bmp280_i2c_init ( struct Bmp280_I2c bmp,
struct i2c_periph i2c_p,
uint8_t  addr 
)

Definition at line 41 of file bmp280_i2c.c.

References BMP280_STATUS_UNINIT, and I2CTransDone.

Referenced by baro_bmp280_init().

+ Here is the caller graph for this function:

◆ bmp280_i2c_periodic()

◆ compensate_pressure()

static double compensate_pressure ( struct Bmp280_I2c bmp)
static

This internal API is used to compensate the raw pressure data and return the compensated pressure data in integer data type.

Definition at line 228 of file bmp280_i2c.c.

References Bmp280_I2c::calib, bmp280_reg_calib_data::dig_p1, bmp280_reg_calib_data::dig_p2, bmp280_reg_calib_data::dig_p3, bmp280_reg_calib_data::dig_p4, bmp280_reg_calib_data::dig_p5, bmp280_reg_calib_data::dig_p7, bmp280_reg_calib_data::dig_p8, bmp280_reg_calib_data::dig_p9, p, Bmp280_I2c::pressure, Bmp280_I2c::raw_pressure, and t_fine.

Referenced by bmp280_i2c_event().

+ Here is the caller graph for this function:

◆ compensate_temperature()

static double compensate_temperature ( struct Bmp280_I2c bmp)
static

This internal API is used to compensate the raw temperature data and return the compensated temperature data in float data type.

Definition at line 205 of file bmp280_i2c.c.

References Bmp280_I2c::calib, bmp280_reg_calib_data::dig_t1, bmp280_reg_calib_data::dig_t2, bmp280_reg_calib_data::dig_t3, f, Bmp280_I2c::raw_temperature, t_fine, bmp280_reg_calib_data::t_fine, and Bmp280_I2c::temperature.

Referenced by bmp280_i2c_event().

+ Here is the caller graph for this function:

◆ parse_calib_data()

static void parse_calib_data ( struct Bmp280_I2c bmp)
static

◆ parse_sensor_data()

static void parse_sensor_data ( struct Bmp280_I2c bmp)
static

local function to extract raw data from i2c buffer and compute compensation with selected precision

Definition at line 153 of file bmp280_i2c.c.

References i2c_transaction::buf, Bmp280_I2c::i2c_trans, Bmp280_I2c::raw_pressure, and Bmp280_I2c::raw_temperature.

Referenced by bmp280_i2c_event().

+ Here is the caller graph for this function:

Variable Documentation

◆ t_fine

int64_t t_fine

Definition at line 38 of file bmp280_i2c.c.

Referenced by compensate_pressure(), and compensate_temperature().