Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Sensor driver for BMP3 sensor via I2C. More...
#include "peripherals/bmp3_i2c.h"
Go to the source code of this file.
Functions | |
static void | parse_sensor_data (struct Bmp3_I2c *bmp) |
local function to extract raw data from i2c buffer and compute compensation with selected precision More... | |
static void | parse_calib_data (struct Bmp3_I2c *bmp) |
This internal API is used to parse the calibration data, compensates it and store it in device structure. More... | |
static double | compensate_pressure (struct Bmp3_I2c *bmp) |
This internal API is used to compensate the raw pressure data and return the compensated pressure data in double data type. More... | |
static double | compensate_temperature (struct Bmp3_I2c *bmp) |
This internal API is used to compensate the raw temperature data and return the compensated temperature data in double data type. More... | |
static double | bmp3_pow (double base, uint8_t power) |
This internal API is used to calculate the power functionality for double precision floating point values. More... | |
void | bmp3_i2c_init (struct Bmp3_I2c *bmp, struct i2c_periph *i2c_p, uint8_t addr) |
init function More... | |
void | bmp3_i2c_periodic (struct Bmp3_I2c *bmp) |
Start new measurement if sensor ready. More... | |
void | bmp3_i2c_event (struct Bmp3_I2c *bmp) |
Sensor driver for BMP3 sensor via I2C.
Modified for Paparazzi from SDP3 driver from BoshSensortec see https://github.com/BoschSensortec/BMP3-Sensor-API for original code and license
Definition in file bmp3_i2c.c.
void bmp3_i2c_event | ( | struct Bmp3_I2c * | bmp | ) |
Definition at line 125 of file bmp3_i2c.c.
References BMP3_ALL, BMP3_STATUS_CONFIGURE, BMP3_STATUS_GET_CALIB, BMP3_STATUS_READ_DATA, BMP3_STATUS_UNINIT, i2c_transaction::buf, compensate_pressure(), compensate_temperature(), Bmp3_I2c::data_available, Bmp3_I2c::i2c_trans, I2CTransDone, I2CTransFailed, I2CTransSuccess, Bmp3_I2c::initialized, parse_calib_data(), parse_sensor_data(), i2c_transaction::status, and Bmp3_I2c::status.
Referenced by baro_bmp3_event().
void bmp3_i2c_init | ( | struct Bmp3_I2c * | bmp, |
struct i2c_periph * | i2c_p, | ||
uint8_t | addr | ||
) |
init function
Definition at line 60 of file bmp3_i2c.c.
References BMP3_STATUS_UNINIT, Bmp3_I2c::data_available, Bmp3_I2c::i2c_p, Bmp3_I2c::i2c_trans, I2CTransDone, Bmp3_I2c::initialized, i2c_transaction::slave_addr, i2c_transaction::status, and Bmp3_I2c::status.
Referenced by baro_bmp3_init().
void bmp3_i2c_periodic | ( | struct Bmp3_I2c * | bmp | ) |
Start new measurement if sensor ready.
Definition at line 78 of file bmp3_i2c.c.
References BMP3_ALL, BMP3_CALIB_DATA_ADDR, BMP3_CALIB_DATA_LEN, BMP3_CONFIG_ADDR, BMP3_IIR_FILTER_COEFF_3, BMP3_NO_OVERSAMPLING, BMP3_NORMAL_MODE, BMP3_ODR_50_HZ, BMP3_ODR_ADDR, BMP3_OSR_ADDR, BMP3_OVERSAMPLING_8X, BMP3_P_AND_T_HEADER_DATA_LEN, BMP3_PWR_CTRL_ADDR, BMP3_SENS_STATUS_REG_ADDR, BMP3_STATUS_CONFIGURE, BMP3_STATUS_GET_CALIB, BMP3_STATUS_READ_DATA, BMP3_STATUS_UNINIT, i2c_transaction::buf, Bmp3_I2c::data_available, Bmp3_I2c::i2c_p, Bmp3_I2c::i2c_trans, i2c_transceive(), i2c_transmit(), I2CTransDone, Bmp3_I2c::initialized, i2c_transaction::slave_addr, i2c_transaction::status, and Bmp3_I2c::status.
Referenced by baro_bmp3_periodic().
|
static |
This internal API is used to calculate the power functionality for double precision floating point values.
Definition at line 320 of file bmp3_i2c.c.
Referenced by compensate_pressure().
|
static |
This internal API is used to compensate the raw pressure data and return the compensated pressure data in double data type.
Definition at line 281 of file bmp3_i2c.c.
References bmp3_pow(), bmp3_quantized_calib_data::par_p1, bmp3_quantized_calib_data::par_p10, bmp3_quantized_calib_data::par_p11, bmp3_quantized_calib_data::par_p2, bmp3_quantized_calib_data::par_p3, bmp3_quantized_calib_data::par_p4, bmp3_quantized_calib_data::par_p5, bmp3_quantized_calib_data::par_p6, bmp3_quantized_calib_data::par_p7, bmp3_quantized_calib_data::par_p8, bmp3_quantized_calib_data::par_p9, Bmp3_I2c::pressure, Bmp3_I2c::quant_calib, Bmp3_I2c::raw_pressure, and bmp3_quantized_calib_data::t_lin.
Referenced by bmp3_i2c_event().
|
static |
This internal API is used to compensate the raw temperature data and return the compensated temperature data in double data type.
Definition at line 261 of file bmp3_i2c.c.
References bmp3_quantized_calib_data::par_t1, bmp3_quantized_calib_data::par_t2, bmp3_quantized_calib_data::par_t3, Bmp3_I2c::quant_calib, Bmp3_I2c::raw_temperature, bmp3_quantized_calib_data::t_lin, and Bmp3_I2c::temperature.
Referenced by bmp3_i2c_event().
|
static |
This internal API is used to parse the calibration data, compensates it and store it in device structure.
Definition at line 193 of file bmp3_i2c.c.
References BMP3_CONCAT_BYTES, i2c_transaction::buf, Bmp3_I2c::calib, Bmp3_I2c::i2c_trans, bmp3_reg_calib_data::par_p1, bmp3_quantized_calib_data::par_p1, bmp3_reg_calib_data::par_p10, bmp3_quantized_calib_data::par_p10, bmp3_reg_calib_data::par_p11, bmp3_quantized_calib_data::par_p11, bmp3_reg_calib_data::par_p2, bmp3_quantized_calib_data::par_p2, bmp3_reg_calib_data::par_p3, bmp3_quantized_calib_data::par_p3, bmp3_reg_calib_data::par_p4, bmp3_quantized_calib_data::par_p4, bmp3_reg_calib_data::par_p5, bmp3_quantized_calib_data::par_p5, bmp3_reg_calib_data::par_p6, bmp3_quantized_calib_data::par_p6, bmp3_reg_calib_data::par_p7, bmp3_quantized_calib_data::par_p7, bmp3_reg_calib_data::par_p8, bmp3_quantized_calib_data::par_p8, bmp3_reg_calib_data::par_p9, bmp3_quantized_calib_data::par_p9, bmp3_reg_calib_data::par_t1, bmp3_quantized_calib_data::par_t1, bmp3_reg_calib_data::par_t2, bmp3_quantized_calib_data::par_t2, bmp3_reg_calib_data::par_t3, bmp3_quantized_calib_data::par_t3, and Bmp3_I2c::quant_calib.
Referenced by bmp3_i2c_event().
|
static |
local function to extract raw data from i2c buffer and compute compensation with selected precision
Definition at line 166 of file bmp3_i2c.c.
References i2c_transaction::buf, Bmp3_I2c::i2c_trans, Bmp3_I2c::raw_pressure, and Bmp3_I2c::raw_temperature.
Referenced by bmp3_i2c_event().