Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Sensor driver for BMP280 sensor via I2C. More...
#include "peripherals/bmp280_i2c.h"
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 |
Sensor driver for BMP280 sensor via I2C.
Definition in file bmp280_i2c.c.
void bmp280_i2c_event | ( | struct Bmp280_I2c * | bmp | ) |
Definition at line 104 of file bmp280_i2c.c.
References BMP280_EOC_BIT, BMP280_NVRAM_COPY_BIT, BMP280_STATUS_CONFIGURE, BMP280_STATUS_GET_CALIB, BMP280_STATUS_READ_DATA_REGS, BMP280_STATUS_READ_STATUS_REG, BMP280_STATUS_UNINIT, i2c_transaction::buf, compensate_pressure(), compensate_temperature(), Bmp280_I2c::data_available, Bmp280_I2c::i2c_trans, I2CTransDone, I2CTransFailed, I2CTransSuccess, Bmp280_I2c::initialized, parse_calib_data(), parse_sensor_data(), i2c_transaction::status, and Bmp280_I2c::status.
Referenced by baro_bmp280_event().
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().
void bmp280_i2c_periodic | ( | struct Bmp280_I2c * | bmp | ) |
Definition at line 57 of file bmp280_i2c.c.
References BMP280_CALIB_DATA_LEN, BMP280_CALIB_LSB_DATA_ADDR, BMP280_CONFIG_LEN, BMP280_CONFIG_REG_ADDR, BMP280_CTRL_MEAS_REG_ADDR, BMP280_DATA_START_REG_ADDR, BMP280_IIR_FILTER_COEFF_2, BMP280_INACTIVITY_62_5_MS, BMP280_OVERSAMPLING_1X_T, BMP280_OVERSAMPLING_8X_P, BMP280_P_T_DATA_LEN, BMP280_POWER_NORMAL_MODE, BMP280_STATUS_CONFIGURE, BMP280_STATUS_GET_CALIB, BMP280_STATUS_READ_DATA_REGS, BMP280_STATUS_READ_STATUS_REG, BMP280_STATUS_REG_ADDR, BMP280_STATUS_UNINIT, i2c_transaction::buf, Bmp280_I2c::data_available, Bmp280_I2c::i2c_p, Bmp280_I2c::i2c_trans, i2c_transceive(), i2c_transmit(), I2CTransDone, Bmp280_I2c::initialized, i2c_transaction::slave_addr, i2c_transaction::status, and Bmp280_I2c::status.
Referenced by baro_bmp280_periodic().
|
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().
|
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, Bmp280_I2c::raw_temperature, t_fine, bmp280_reg_calib_data::t_fine, and Bmp280_I2c::temperature.
Referenced by bmp280_i2c_event().
|
static |
This internal API is used to parse the calibration data, compensates it and store it in device structure (float version)
Definition at line 180 of file bmp280_i2c.c.
References BMP280_CONCAT_BYTES, i2c_transaction::buf, 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_p6, bmp280_reg_calib_data::dig_p7, bmp280_reg_calib_data::dig_p8, bmp280_reg_calib_data::dig_p9, bmp280_reg_calib_data::dig_t1, bmp280_reg_calib_data::dig_t2, bmp280_reg_calib_data::dig_t3, and Bmp280_I2c::i2c_trans.
Referenced by bmp280_i2c_event().
|
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().
int64_t t_fine |
Definition at line 38 of file bmp280_i2c.c.
Referenced by compensate_pressure(), and compensate_temperature().