38#if BMP3_COMPENSATION == BMP3_DOUBLE_PRECISION_COMPENSATION
43#elif BMP3_COMPENSATION == BMP3_SINGLE_PRECISION_COMPENSATION
48#elif BMP3_COMPENSATION == BMP3_INTEGER_COMPENSATION
53#error "BMP3: Unknown compensation type"
66 bmp->i2c_trans.slave_addr = addr;
70 bmp->data_available =
false;
71 bmp->initialized =
false;
84 switch (
bmp->status) {
86 bmp->data_available =
false;
87 bmp->initialized =
false;
128 switch (
bmp->status) {
138 bmp->initialized =
true;
148 bmp->data_available =
true;
158 if (!
bmp->initialized) {
187#if BMP3_COMPENSATION == BMP3_DOUBLE_PRECISION_COMPENSATION
268 *
bmp->quant_calib.par_t3;
274 return bmp->quant_calib.t_lin;
332#elif BMP3_COMPENSATION == BMP3_SINGLE_PRECISION_COMPENSATION
413 *
bmp->quant_calib.par_t3;
419 return bmp->quant_calib.t_lin;
477#elif BMP3_COMPENSATION == BMP3_INTEGER_COMPENSATION
static double bmp3_pow(double base, uint8_t power)
This internal API is used to calculate the power functionality for double precision floating point va...
void bmp3_i2c_event(struct Bmp3_I2c *bmp)
void bmp3_i2c_periodic(struct Bmp3_I2c *bmp)
Start new measurement if sensor ready.
void bmp3_i2c_init(struct Bmp3_I2c *bmp, struct i2c_periph *i2c_p, uint8_t addr)
init function
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 struct...
static double compensate_pressure(struct Bmp3_I2c *bmp)
This internal API is used to compensate the raw pressure data and return the compensated pressure dat...
static double compensate_temperature(struct Bmp3_I2c *bmp)
This internal API is used to compensate the raw temperature data and return the compensated temperatu...
static void parse_sensor_data(struct Bmp3_I2c *bmp)
local function to extract raw data from i2c buffer and compute compensation with selected precision
Sensor driver for BMP3 sensor via I2C.
#define BMP3_SENS_STATUS_REG_ADDR
#define BMP3_CALIB_DATA_LEN
#define BMP3_IIR_FILTER_COEFF_3
#define BMP3_CALIB_DATA_ADDR
#define BMP3_NO_OVERSAMPLING
#define BMP3_OVERSAMPLING_8X
#define BMP3_P_AND_T_HEADER_DATA_LEN
#define BMP3_PWR_CTRL_ADDR
#define BMP3_CONCAT_BYTES(msb, lsb)
static const float offset[]
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
bool i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
@ I2CTransSuccess
transaction successfully finished by I2C driver
@ I2CTransFailed
transaction failed
@ I2CTransDone
transaction set to done by user level
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned long long uint64_t
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
signed char int8_t
Typedef defining 8 bit char type.