114#ifdef BMP3_FLOAT_COMPENSATION
161static float pow_bmp3(
double base, uint8_t power);
208static uint32_t
pow_bmp3(uint8_t base, uint8_t power);
239static void interleave_reg_addr(
const uint8_t *reg_addr, uint8_t *temp_buff,
const uint8_t *reg_data, uint32_t len);
589 uint16_t *byte_index,
591 uint8_t *parsed_frames);
604 const uint8_t *fifo_buffer,
640static void unpack_time_frame(uint16_t *byte_index,
const uint8_t *fifo_buffer, uint32_t *sensor_time);
649static void get_header_info(uint8_t *header,
const uint8_t *fifo_buffer, uint16_t *byte_index);
769 if ((chip_id == BMP3_CHIP_ID) || (chip_id == BMP390_CHIP_ID))
783 rslt = BMP3_E_DEV_NOT_FOUND;
803 if ((rslt == BMP3_OK) && (reg_data != NULL))
811 reg_addr = reg_addr | 0x80;
815 for (idx = 0; idx < len; idx++)
817 reg_data[idx] = temp_buff[idx + dev->
dummy_byte];
829 rslt = BMP3_E_COMM_FAIL;
834 rslt = BMP3_E_NULL_PTR;
847 uint8_t temp_buff[len * 2];
849 uint8_t reg_addr_cnt;
855 if ((rslt == BMP3_OK) && (reg_addr != NULL) && (reg_data != NULL))
859 temp_buff[0] = reg_data[0];
864 for (reg_addr_cnt = 0; reg_addr_cnt < len; reg_addr_cnt++)
866 reg_addr[reg_addr_cnt] = reg_addr[reg_addr_cnt] & 0x7F;
888 rslt = BMP3_E_COMM_FAIL;
893 rslt = BMP3_E_INVALID_LEN;
898 rslt = BMP3_E_NULL_PTR;
911 int8_t rslt = BMP3_OK;
913 if (settings != NULL)
942 rslt = BMP3_E_NULL_PTR;
956 uint8_t settings_data[BMP3_LEN_GEN_SETT];
958 if (settings != NULL)
960 rslt =
bmp3_get_regs(BMP3_REG_INT_CTRL, settings_data, BMP3_LEN_GEN_SETT, dev);
970 rslt = BMP3_E_NULL_PTR;
992 if ((rslt == BMP3_OK) && (fifo_settings != NULL))
1014 rslt = BMP3_E_NULL_PTR;
1029 uint8_t fifo_sett[3];
1033 if (fifo_settings != NULL)
1035 rslt =
bmp3_get_regs(BMP3_REG_FIFO_CONFIG_1, fifo_sett, len, dev);
1042 rslt = BMP3_E_NULL_PTR;
1058 if ((fifo != NULL) && (fifo_settings != NULL))
1065 if (rslt == BMP3_OK)
1068 if (fifo_settings->
time_en == TRUE)
1082 rslt = BMP3_E_NULL_PTR;
1097 uint8_t reg_data[2];
1098 uint8_t reg_addr[2] = { BMP3_REG_FIFO_WM, BMP3_REG_FIFO_WM + 1 };
1099 uint16_t watermark_len;
1101 if ((fifo != NULL) && (fifo_settings != NULL))
1105 if (rslt == BMP3_OK)
1107 reg_data[0] = BMP3_GET_LSB(watermark_len);
1108 reg_data[1] = BMP3_GET_MSB(watermark_len) & 0x01;
1114 rslt = BMP3_E_NULL_PTR;
1127 uint8_t reg_data[2];
1128 uint8_t reg_addr = BMP3_REG_FIFO_WM;
1130 if (watermark_len != NULL)
1133 if (rslt == BMP3_OK)
1135 *watermark_len = (reg_data[0]) + (reg_data[1] << 8);
1140 rslt = BMP3_E_NULL_PTR;
1154 uint8_t parsed_frames = 0;
1160 if ((rslt == BMP3_OK) && (fifo != NULL) && (data != NULL))
1164 while (byte_index < fifo->byte_count)
1170 if (t_p_frame != FALSE)
1178 if (parsed_frames != 0)
1193 rslt = BMP3_E_NULL_PTR;
1213 if (rslt == BMP3_OK)
1218 if (rslt == BMP3_OK)
1227 rslt = BMP3_E_NULL_PTR;
1239 uint8_t reg_data[2];
1241 if (fifo_length != NULL)
1243 rslt =
bmp3_get_regs(BMP3_REG_FIFO_LENGTH, reg_data, 2, dev);
1246 if (rslt == BMP3_OK)
1249 *fifo_length = BMP3_CONCAT_BYTES(reg_data[1], reg_data[0]);
1254 rslt = BMP3_E_NULL_PTR;
1266 uint8_t reg_addr = BMP3_REG_CMD;
1269 uint8_t soft_rst_cmd = BMP3_SOFT_RESET;
1270 uint8_t cmd_rdy_status;
1271 uint8_t cmd_err_status;
1274 rslt =
bmp3_get_regs(BMP3_REG_SENS_STATUS, &cmd_rdy_status, 1, dev);
1277 if ((cmd_rdy_status & BMP3_CMD_RDY) && (rslt == BMP3_OK))
1283 if (rslt == BMP3_OK)
1289 rslt =
bmp3_get_regs(BMP3_REG_ERR, &cmd_err_status, 1, dev);
1292 if ((cmd_err_status & BMP3_REG_CMD) || (rslt != BMP3_OK))
1296 rslt = BMP3_E_CMD_EXEC_FAILED;
1310 uint8_t reg_addr = BMP3_REG_CMD;
1312 uint8_t fifo_flush_cmd = BMP3_FIFO_FLUSH;
1313 uint8_t cmd_rdy_status;
1314 uint8_t cmd_err_status;
1317 rslt =
bmp3_get_regs(BMP3_REG_SENS_STATUS, &cmd_rdy_status, 1, dev);
1320 if ((cmd_rdy_status & BMP3_CMD_RDY) && (rslt == BMP3_OK))
1326 if (rslt == BMP3_OK)
1332 rslt =
bmp3_get_regs(BMP3_REG_ERR, &cmd_err_status, 1, dev);
1335 if ((cmd_err_status & BMP3_REG_CMD) || (rslt != BMP3_OK))
1339 rslt = BMP3_E_CMD_EXEC_FAILED;
1353 uint8_t last_set_mode;
1358 if ((rslt == BMP3_OK) && (settings != NULL))
1360 uint8_t curr_mode = settings->
op_mode;
1366 if ((last_set_mode != BMP3_MODE_SLEEP) && (rslt == BMP3_OK))
1377 if (rslt == BMP3_OK)
1379 if (curr_mode == BMP3_MODE_NORMAL)
1385 else if (curr_mode == BMP3_MODE_FORCED)
1394 rslt = BMP3_E_NULL_PTR;
1407 if (op_mode != NULL)
1413 *op_mode = BMP3_GET_BITS(*op_mode, BMP3_OP_MODE);
1417 rslt = BMP3_E_NULL_PTR;
1434 uint8_t reg_data[BMP3_LEN_P_T_DATA] = { 0 };
1437 if (comp_data != NULL)
1440 rslt =
bmp3_get_regs(BMP3_REG_DATA, reg_data, BMP3_LEN_P_T_DATA, dev);
1442 if (rslt == BMP3_OK)
1454 rslt = BMP3_E_NULL_PTR;
1470 int8_t rslt = BMP3_OK;
1477 *watermark_len = fifo->
req_frames * BMP3_LEN_P_AND_T_HEADER_DATA;
1482 *watermark_len = fifo->
req_frames * BMP3_LEN_P_OR_T_HEADER_DATA;
1487 rslt = BMP3_W_SENSOR_NOT_ENABLED;
1493 rslt = BMP3_W_INVALID_FIFO_REQ_FRAME_CNT;
1510 uint16_t fifo_size = 512;
1513 for (index = 0; index < fifo_size; index++)
1534 uint16_t *byte_index,
1536 uint8_t *parsed_frames)
1538 uint8_t t_p_frame = FALSE;
1544 *parsed_frames = *parsed_frames + 1;
1545 t_p_frame = BMP3_PRESS_TEMP;
1549 *parsed_frames = *parsed_frames + 1;
1550 t_p_frame = BMP3_TEMP;
1554 *parsed_frames = *parsed_frames + 1;
1555 t_p_frame = BMP3_PRESS;
1562 *byte_index = *byte_index + 1;
1566 *byte_index = *byte_index + 1;
1573 *byte_index = *byte_index + 1;
1585 const uint8_t *fifo_buffer,
1589 *byte_index = *byte_index + BMP3_LEN_P_T_DATA;
1599 *byte_index = *byte_index + BMP3_LEN_T_DATA;
1609 *byte_index = *byte_index + BMP3_LEN_P_DATA;
1616static void unpack_time_frame(uint16_t *byte_index,
const uint8_t *fifo_buffer, uint32_t *sensor_time)
1618 uint16_t index = *byte_index;
1619 uint32_t xlsb = fifo_buffer[index];
1620 uint32_t lsb = ((uint32_t)fifo_buffer[index + 1]) << 8;
1621 uint32_t msb = ((uint32_t)fifo_buffer[index + 2]) << 16;
1623 *sensor_time = msb | lsb | xlsb;
1624 *byte_index = *byte_index + BMP3_LEN_SENSOR_TIME;
1640 data_xlsb = (uint32_t)fifo_buffer[0];
1641 data_lsb = (uint32_t)fifo_buffer[1] << 8;
1642 data_msb = (uint32_t)fifo_buffer[2] << 16;
1644 if (sensor_comp == BMP3_TEMP)
1647 uncomp_data->
temperature = data_msb | data_lsb | data_xlsb;
1650 if (sensor_comp == BMP3_PRESS)
1653 uncomp_data->
pressure = data_msb | data_lsb | data_xlsb;
1656 if (sensor_comp == (BMP3_PRESS_TEMP))
1658 uncomp_data->
temperature = data_msb | data_lsb | data_xlsb;
1661 data_xlsb = (uint32_t)fifo_buffer[3];
1662 data_lsb = (uint32_t)fifo_buffer[4] << 8;
1663 data_msb = (uint32_t)fifo_buffer[5] << 16;
1664 uncomp_data->
pressure = data_msb | data_lsb | data_xlsb;
1671static void get_header_info(uint8_t *header,
const uint8_t *fifo_buffer, uint16_t *byte_index)
1673 *header = fifo_buffer[*byte_index];
1674 *byte_index = *byte_index + 1;
1683 uint8_t conf_err_status;
1688 if (rslt == BMP3_OK)
1693 if (rslt == BMP3_OK)
1696 rslt =
bmp3_get_regs(BMP3_REG_ERR, &conf_err_status, 1, dev);
1699 if (rslt == BMP3_OK)
1701 if (conf_err_status & BMP3_ERR_CONF)
1704 rslt = BMP3_E_CONFIGURATION_ERR;
1719 uint8_t reg_addr = BMP3_REG_PWR_CTRL;
1720 uint8_t op_mode = settings->
op_mode;
1723 uint8_t op_mode_reg_val;
1729 if (rslt == BMP3_OK)
1731 op_mode_reg_val = BMP3_SET_BITS(op_mode_reg_val, BMP3_OP_MODE, op_mode);
1746 uint8_t reg_addr = BMP3_REG_PWR_CTRL;
1749 uint8_t op_mode_reg_val;
1751 rslt =
bmp3_get_regs(BMP3_REG_PWR_CTRL, &op_mode_reg_val, 1, dev);
1753 if (rslt == BMP3_OK)
1756 op_mode_reg_val = op_mode_reg_val & (~(BMP3_OP_MODE_MSK));
1774 if (rslt == BMP3_OK)
1789 uint8_t reg_addr = BMP3_REG_CALIB_DATA;
1792 uint8_t calib_data[BMP3_LEN_CALIB_DATA] = { 0 };
1795 rslt =
bmp3_get_regs(reg_addr, calib_data, BMP3_LEN_CALIB_DATA, dev);
1807static void interleave_reg_addr(
const uint8_t *reg_addr, uint8_t *temp_buff,
const uint8_t *reg_data, uint32_t len)
1811 for (index = 1; index < len; index++)
1813 temp_buff[(index * 2) - 1] = reg_addr[index];
1814 temp_buff[index * 2] = reg_data[index];
1844 settings->
output_mode = BMP3_GET_BITS_POS_0(*reg_data, BMP3_INT_OUTPUT_MODE);
1845 settings->
level = BMP3_GET_BITS(*reg_data, BMP3_INT_LEVEL);
1846 settings->
latch = BMP3_GET_BITS(*reg_data, BMP3_INT_LATCH);
1847 settings->
drdy_en = BMP3_GET_BITS(*reg_data, BMP3_INT_DRDY_EN);
1851 settings->
i2c_wdt_en = BMP3_GET_BITS(*reg_data, BMP3_I2C_WDT_EN);
1852 settings->
i2c_wdt_sel = BMP3_GET_BITS(*reg_data, BMP3_I2C_WDT_SEL);
1861 settings->
op_mode = BMP3_GET_BITS(*reg_data, BMP3_OP_MODE);
1862 settings->
press_en = BMP3_GET_BITS_POS_0(*reg_data, BMP3_PRESS_EN);
1863 settings->
temp_en = BMP3_GET_BITS(*reg_data, BMP3_TEMP_EN);
1875 settings->
press_os = BMP3_GET_BITS_POS_0(reg_data[index], BMP3_PRESS_OS);
1876 settings->
temp_os = BMP3_GET_BITS(reg_data[index], BMP3_TEMP_OS);
1880 settings->
odr = BMP3_GET_BITS_POS_0(reg_data[index], BMP3_ODR);
1884 settings->
iir_filter = BMP3_GET_BITS(reg_data[index], BMP3_IIR_FILTER);
1896 uint8_t reg_addr = BMP3_REG_PWR_CTRL;
1901 if (rslt == BMP3_OK)
1903 if (desired_settings & BMP3_SEL_PRESS_EN)
1907 reg_data = BMP3_SET_BITS_POS_0(reg_data, BMP3_PRESS_EN, settings->
press_en);
1910 if (desired_settings & BMP3_SEL_TEMP_EN)
1914 reg_data = BMP3_SET_BITS(reg_data, BMP3_TEMP_EN, settings->
temp_en);
1933 uint8_t reg_addr[3] = { 0 };
1936 uint8_t reg_data[4];
1941 if (rslt == BMP3_OK)
1947 fill_osr_data(desired_settings, reg_addr, reg_data, &len, settings);
1964 if (settings->
op_mode == BMP3_MODE_NORMAL)
1971 if (rslt == BMP3_OK)
1996 reg_addr = BMP3_REG_INT_CTRL;
1999 if (rslt == BMP3_OK)
2003 if (desired_settings & BMP3_SEL_OUTPUT_MODE)
2006 reg_data = BMP3_SET_BITS_POS_0(reg_data, BMP3_INT_OUTPUT_MODE, int_settings.
output_mode);
2009 if (desired_settings & BMP3_SEL_LEVEL)
2012 reg_data = BMP3_SET_BITS(reg_data, BMP3_INT_LEVEL, int_settings.
level);
2015 if (desired_settings & BMP3_SEL_LATCH)
2018 reg_data = BMP3_SET_BITS(reg_data, BMP3_INT_LATCH, int_settings.
latch);
2021 if (desired_settings & BMP3_SEL_DRDY_EN)
2024 reg_data = BMP3_SET_BITS(reg_data, BMP3_INT_DRDY_EN, int_settings.
drdy_en);
2045 reg_addr = BMP3_REG_IF_CONF;
2048 if (rslt == BMP3_OK)
2050 if (desired_settings & BMP3_SEL_I2C_WDT_EN)
2053 reg_data = BMP3_SET_BITS(reg_data, BMP3_I2C_WDT_EN, adv_settings.
i2c_wdt_en);
2056 if (desired_settings & BMP3_SEL_I2C_WDT)
2059 reg_data = BMP3_SET_BITS(reg_data, BMP3_I2C_WDT_SEL, adv_settings.
i2c_wdt_sel);
2075 uint8_t reg_data[4];
2097 uint32_t meas_t = 234;
2098 uint32_t meas_t_p = 0;
2101 uint32_t odr[18] = {
2102 5000, 10000, 20000, 40000, 80000, 160000, 320000, 640000, 1280000, 2560000, 5120000, 10240000, 20480000,
2103 40960000, 81920000, 163840000, 327680000, 655360000
2134 if (meas_t < odr_duration)
2143 rslt = BMP3_E_INVALID_ODR_OSR_SETTINGS;
2155 uint32_t press_meas_t;
2158#ifdef BMP3_FLOAT_COMPENSATION
2163 uint32_t partial_out;
2166 press_meas_t = (uint32_t)(BMP3_SETTLE_TIME_PRESS + partial_out * BMP3_ADC_CONV_TIME);
2169 return press_meas_t;
2178 uint32_t temp_meas_t;
2181#ifdef BMP3_FLOAT_COMPENSATION
2186 uint32_t partial_out;
2189 temp_meas_t = (uint32_t)(BMP3_SETTLE_TIME_TEMP + partial_out * BMP3_ADC_CONV_TIME);
2207 if (desired_settings & (BMP3_SEL_PRESS_OS | BMP3_SEL_TEMP_OS))
2210 if (desired_settings & BMP3_SEL_PRESS_OS)
2214 reg_data[*len] = BMP3_SET_BITS_POS_0(reg_data[0], BMP3_PRESS_OS, osr_settings.
press_os);
2218 if (desired_settings & BMP3_SEL_TEMP_OS)
2222 reg_data[*len] = BMP3_SET_BITS(reg_data[0], BMP3_TEMP_OS, osr_settings.
temp_os);
2226 addr[*len] = BMP3_REG_OSR;
2240 if (osr_settings->
odr > BMP3_ODR_0_001_HZ)
2242 osr_settings->
odr = BMP3_ODR_0_001_HZ;
2246 reg_data[*len] = BMP3_SET_BITS_POS_0(reg_data[1], BMP3_ODR, osr_settings->
odr);
2249 addr[*len] = BMP3_REG_ODR;
2262 reg_data[*len] = BMP3_SET_BITS(reg_data[3], BMP3_IIR_FILTER, osr_settings.
iir_filter);
2265 addr[*len] = BMP3_REG_CONFIG;
2281 data_xlsb = (uint32_t)reg_data[0];
2282 data_lsb = (uint32_t)reg_data[1] << 8;
2283 data_msb = (uint32_t)reg_data[2] << 16;
2284 uncomp_data->
pressure = data_msb | data_lsb | data_xlsb;
2287 data_xlsb = (uint32_t)reg_data[3];
2288 data_lsb = (uint32_t)reg_data[4] << 8;
2289 data_msb = (uint32_t)reg_data[5] << 16;
2290 uncomp_data->
temperature = data_msb | data_lsb | data_xlsb;
2302 int8_t rslt = BMP3_OK;
2304 if ((uncomp_data != NULL) && (comp_data != NULL) && (calib_data != NULL))
2307 if (sensor_comp == BMP3_PRESS_TEMP)
2319 if (rslt == BMP3_OK)
2324 else if (sensor_comp == BMP3_PRESS)
2340 else if (sensor_comp == BMP3_TEMP)
2359 rslt = BMP3_E_NULL_PTR;
2365#ifdef BMP3_FLOAT_COMPENSATION
2381 temp_var = 0.00390625f;
2382 reg_calib_data->
par_t1 = BMP3_CONCAT_BYTES(reg_data[1], reg_data[0]);
2383 quantized_calib_data->
par_t1 = ((double)reg_calib_data->
par_t1 / temp_var);
2384 reg_calib_data->par_t2 = BMP3_CONCAT_BYTES(reg_data[3], reg_data[2]);
2385 temp_var = 1073741824.0f;
2386 quantized_calib_data->par_t2 = ((double)reg_calib_data->par_t2 / temp_var);
2387 reg_calib_data->par_t3 = (int8_t)reg_data[4];
2388 temp_var = 281474976710656.0f;
2389 quantized_calib_data->par_t3 = ((double)reg_calib_data->par_t3 / temp_var);
2390 reg_calib_data->par_p1 = (int16_t)BMP3_CONCAT_BYTES(reg_data[6], reg_data[5]);
2391 temp_var = 1048576.0f;
2392 quantized_calib_data->par_p1 = ((double)(reg_calib_data->par_p1 - (16384)) / temp_var);
2393 reg_calib_data->par_p2 = (int16_t)BMP3_CONCAT_BYTES(reg_data[8], reg_data[7]);
2394 temp_var = 536870912.0f;
2395 quantized_calib_data->par_p2 = ((double)(reg_calib_data->par_p2 - (16384)) / temp_var);
2396 reg_calib_data->par_p3 = (int8_t)reg_data[9];
2397 temp_var = 4294967296.0f;
2398 quantized_calib_data->par_p3 = ((double)reg_calib_data->par_p3 / temp_var);
2399 reg_calib_data->par_p4 = (int8_t)reg_data[10];
2400 temp_var = 137438953472.0f;
2401 quantized_calib_data->par_p4 = ((double)reg_calib_data->par_p4 / temp_var);
2402 reg_calib_data->par_p5 = BMP3_CONCAT_BYTES(reg_data[12], reg_data[11]);
2406 quantized_calib_data->par_p5 = ((double)reg_calib_data->par_p5 / temp_var);
2407 reg_calib_data->par_p6 = BMP3_CONCAT_BYTES(reg_data[14], reg_data[13]);
2409 quantized_calib_data->par_p6 = ((double)reg_calib_data->par_p6 / temp_var);
2410 reg_calib_data->par_p7 = (int8_t)reg_data[15];
2412 quantized_calib_data->par_p7 = ((double)reg_calib_data->par_p7 / temp_var);
2413 reg_calib_data->par_p8 = (int8_t)reg_data[16];
2414 temp_var = 32768.0f;
2415 quantized_calib_data->par_p8 = ((double)reg_calib_data->par_p8 / temp_var);
2416 reg_calib_data->par_p9 = (int16_t)BMP3_CONCAT_BYTES(reg_data[18], reg_data[17]);
2417 temp_var = 281474976710656.0f;
2418 quantized_calib_data->par_p9 = ((double)reg_calib_data->par_p9 / temp_var);
2419 reg_calib_data->par_p10 = (int8_t)reg_data[19];
2420 temp_var = 281474976710656.0f;
2421 quantized_calib_data->par_p10 = ((double)reg_calib_data->par_p10 / temp_var);
2422 reg_calib_data->par_p11 = (int8_t)reg_data[20];
2423 temp_var = 36893488147419103232.0f;
2424 quantized_calib_data->par_p11 = ((double)reg_calib_data->par_p11 / temp_var);
2437 int8_t rslt = BMP3_OK;
2439 double partial_data1;
2440 double partial_data2;
2454 rslt = BMP3_W_MIN_TEMP;
2460 rslt = BMP3_W_MAX_TEMP;
2477 int8_t rslt = BMP3_OK;
2484 double partial_data1;
2485 double partial_data2;
2486 double partial_data3;
2487 double partial_data4;
2488 double partial_out1;
2489 double partial_out2;
2491 partial_data1 = quantized_calib_data->par_p6 * quantized_calib_data->t_lin;
2492 partial_data2 = quantized_calib_data->par_p7 *
pow_bmp3(quantized_calib_data->t_lin, 2);
2493 partial_data3 = quantized_calib_data->par_p8 *
pow_bmp3(quantized_calib_data->t_lin, 3);
2494 partial_out1 = quantized_calib_data->par_p5 + partial_data1 + partial_data2 + partial_data3;
2495 partial_data1 = quantized_calib_data->par_p2 * quantized_calib_data->t_lin;
2496 partial_data2 = quantized_calib_data->par_p3 *
pow_bmp3(quantized_calib_data->t_lin, 2);
2497 partial_data3 = quantized_calib_data->par_p4 *
pow_bmp3(quantized_calib_data->t_lin, 3);
2498 partial_out2 = uncomp_data->
pressure *
2499 (quantized_calib_data->par_p1 + partial_data1 + partial_data2 + partial_data3);
2501 partial_data2 = quantized_calib_data->par_p9 + quantized_calib_data->par_p10 * quantized_calib_data->t_lin;
2502 partial_data3 = partial_data1 * partial_data2;
2503 partial_data4 = partial_data3 +
pow_bmp3((
double)uncomp_data->
pressure, 3) * quantized_calib_data->par_p11;
2504 comp_press = partial_out1 + partial_out2 + partial_data4;
2506 if (comp_press < BMP3_MIN_PRES_DOUBLE)
2508 comp_press = BMP3_MIN_PRES_DOUBLE;
2509 rslt = BMP3_W_MIN_PRES;
2512 if (comp_press > BMP3_MAX_PRES_DOUBLE)
2514 comp_press = BMP3_MAX_PRES_DOUBLE;
2515 rslt = BMP3_W_MAX_PRES;
2518 (*pressure) = comp_press;
2529 float pow_output = 1;
2533 pow_output = (float) base * pow_output;
2550 reg_calib_data->
par_t1 = BMP3_CONCAT_BYTES(reg_data[1], reg_data[0]);
2551 reg_calib_data->par_t2 = BMP3_CONCAT_BYTES(reg_data[3], reg_data[2]);
2552 reg_calib_data->par_t3 = (int8_t)reg_data[4];
2553 reg_calib_data->par_p1 = (int16_t)BMP3_CONCAT_BYTES(reg_data[6], reg_data[5]);
2554 reg_calib_data->par_p2 = (int16_t)BMP3_CONCAT_BYTES(reg_data[8], reg_data[7]);
2555 reg_calib_data->par_p3 = (int8_t)reg_data[9];
2556 reg_calib_data->par_p4 = (int8_t)reg_data[10];
2557 reg_calib_data->par_p5 = BMP3_CONCAT_BYTES(reg_data[12], reg_data[11]);
2558 reg_calib_data->par_p6 = BMP3_CONCAT_BYTES(reg_data[14], reg_data[13]);
2559 reg_calib_data->par_p7 = (int8_t)reg_data[15];
2560 reg_calib_data->par_p8 = (int8_t)reg_data[16];
2561 reg_calib_data->par_p9 = (int16_t)BMP3_CONCAT_BYTES(reg_data[18], reg_data[17]);
2562 reg_calib_data->par_p10 = (int8_t)reg_data[19];
2563 reg_calib_data->par_p11 = (int8_t)reg_data[20];
2576 int8_t rslt = BMP3_OK;
2577 int64_t partial_data1;
2578 int64_t partial_data2;
2579 int64_t partial_data3;
2580 int64_t partial_data4;
2581 int64_t partial_data5;
2582 int64_t partial_data6;
2586 partial_data2 = (int64_t)(calib_data->
reg_calib_data.par_t2 * partial_data1);
2587 partial_data3 = (int64_t)(partial_data1 * partial_data1);
2588 partial_data4 = (int64_t)partial_data3 * calib_data->
reg_calib_data.par_t3;
2589 partial_data5 = (int64_t)((int64_t)(partial_data2 * 262144) + partial_data4);
2590 partial_data6 = (int64_t)(partial_data5 / 4294967296);
2594 comp_temp = (int64_t)((partial_data6 * 25) / 16384);
2596 if (comp_temp < BMP3_MIN_TEMP_INT)
2598 comp_temp = BMP3_MIN_TEMP_INT;
2599 rslt = BMP3_W_MIN_TEMP;
2602 if (comp_temp > BMP3_MAX_TEMP_INT)
2604 comp_temp = BMP3_MAX_TEMP_INT;
2605 rslt = BMP3_W_MAX_TEMP;
2608 (*temperature) = comp_temp;
2622 int8_t rslt = BMP3_OK;
2624 int64_t partial_data1;
2625 int64_t partial_data2;
2626 int64_t partial_data3;
2627 int64_t partial_data4;
2628 int64_t partial_data5;
2629 int64_t partial_data6;
2631 int64_t sensitivity;
2632 uint64_t comp_press;
2634 partial_data1 = (int64_t)(reg_calib_data->t_lin * reg_calib_data->t_lin);
2635 partial_data2 = (int64_t)(partial_data1 / 64);
2636 partial_data3 = (int64_t)((partial_data2 * reg_calib_data->t_lin) / 256);
2637 partial_data4 = (int64_t)((reg_calib_data->par_p8 * partial_data3) / 32);
2638 partial_data5 = (int64_t)((reg_calib_data->par_p7 * partial_data1) * 16);
2639 partial_data6 = (int64_t)((reg_calib_data->par_p6 * reg_calib_data->t_lin) * 4194304);
2640 offset = (int64_t)((reg_calib_data->par_p5 * 140737488355328) + partial_data4 + partial_data5 + partial_data6);
2641 partial_data2 = (int64_t)((reg_calib_data->par_p4 * partial_data3) / 32);
2642 partial_data4 = (int64_t)((reg_calib_data->par_p3 * partial_data1) * 4);
2643 partial_data5 = (int64_t)((reg_calib_data->par_p2 - (int32_t)16384) * reg_calib_data->t_lin * 2097152);
2645 (int64_t)(((reg_calib_data->par_p1 - (int32_t)16384) * 70368744177664) + partial_data2 + partial_data4 +
2647 partial_data1 = (int64_t)((sensitivity / 16777216) * uncomp_data->
pressure);
2648 partial_data2 = (int64_t)(reg_calib_data->par_p10 * reg_calib_data->t_lin);
2649 partial_data3 = (int64_t)(partial_data2 + ((int32_t)65536 * reg_calib_data->par_p9));
2650 partial_data4 = (int64_t)((partial_data3 * uncomp_data->
pressure) / (int32_t)8192);
2655 partial_data5 = (int64_t)((uncomp_data->
pressure * (partial_data4 / 10)) / (int32_t)512);
2656 partial_data5 = (int64_t)(partial_data5 * 10);
2658 partial_data2 = (int64_t)((reg_calib_data->par_p11 * partial_data6) / (int32_t)65536);
2659 partial_data3 = (int64_t)((int64_t)(partial_data2 * uncomp_data->
pressure) / 128);
2660 partial_data4 = (int64_t)((offset / 4) + partial_data1 + partial_data5 + partial_data3);
2661 comp_press = (((uint64_t)partial_data4 * 25) / (uint64_t)1099511627776);
2663 if (comp_press < BMP3_MIN_PRES_INT)
2665 comp_press = BMP3_MIN_PRES_INT;
2666 rslt = BMP3_W_MIN_PRES;
2669 if (comp_press > BMP3_MAX_PRES_INT)
2671 comp_press = BMP3_MAX_PRES_INT;
2672 rslt = BMP3_W_MAX_PRES;
2675 (*pressure) = comp_press;
2683static uint32_t
pow_bmp3(uint8_t base, uint8_t power)
2685 uint32_t pow_output = 1;
2689 pow_output = base * pow_output;
2704 uint8_t settings_changed = FALSE;
2706 if (sub_settings & desired_settings)
2709 settings_changed = TRUE;
2714 settings_changed = FALSE;
2717 return settings_changed;
2728 if ((dev == NULL) || (dev->
read == NULL) || (dev->
write == NULL) || (dev->
delay_us == NULL) ||
2732 rslt = BMP3_E_NULL_PTR;
2751 uint8_t fifo_config_1_data = reg_data[0];
2752 uint8_t fifo_config_2_data = reg_data[1];
2753 uint8_t fifo_int_ctrl_data = reg_data[2];
2756 fifo_settings->
mode = BMP3_GET_BITS_POS_0(fifo_config_1_data, BMP3_FIFO_MODE);
2757 fifo_settings->
stop_on_full_en = BMP3_GET_BITS(fifo_config_1_data, BMP3_FIFO_STOP_ON_FULL);
2758 fifo_settings->
time_en = BMP3_GET_BITS(fifo_config_1_data, BMP3_FIFO_TIME_EN);
2759 fifo_settings->
press_en = BMP3_GET_BITS(fifo_config_1_data, BMP3_FIFO_PRESS_EN);
2760 fifo_settings->
temp_en = BMP3_GET_BITS(fifo_config_1_data, BMP3_FIFO_TEMP_EN);
2763 fifo_settings->
down_sampling = BMP3_GET_BITS_POS_0(fifo_config_2_data, BMP3_FIFO_DOWN_SAMPLING);
2764 fifo_settings->
filter_en = BMP3_GET_BITS(fifo_config_2_data, BMP3_FIFO_FILTER_EN);
2767 fifo_settings->
ffull_en = BMP3_GET_BITS(fifo_int_ctrl_data, BMP3_FIFO_FULL_EN);
2768 fifo_settings->
fwtm_en = BMP3_GET_BITS(fifo_int_ctrl_data, BMP3_FIFO_FWTM_EN);
2781 uint8_t reg_addr = BMP3_REG_FIFO_CONFIG_1;
2786 if (rslt == BMP3_OK)
2788 if (desired_settings & BMP3_SEL_FIFO_MODE)
2791 reg_data = BMP3_SET_BITS_POS_0(reg_data, BMP3_FIFO_MODE, fifo_settings->
mode);
2794 if (desired_settings & BMP3_SEL_FIFO_STOP_ON_FULL_EN)
2797 reg_data = BMP3_SET_BITS(reg_data, BMP3_FIFO_STOP_ON_FULL, fifo_settings->
stop_on_full_en);
2800 if (desired_settings & BMP3_SEL_FIFO_TIME_EN)
2803 reg_data = BMP3_SET_BITS(reg_data, BMP3_FIFO_TIME_EN, fifo_settings->
time_en);
2806 if (desired_settings & (BMP3_SEL_FIFO_PRESS_EN | BMP3_SEL_FIFO_TEMP_EN))
2809 reg_data = BMP3_SET_BITS(reg_data, BMP3_FIFO_PRESS_EN, fifo_settings->
press_en);
2812 reg_data = BMP3_SET_BITS(reg_data, BMP3_FIFO_TEMP_EN, fifo_settings->
temp_en);
2832 uint8_t reg_addr = BMP3_REG_FIFO_CONFIG_2;
2837 if (rslt == BMP3_OK)
2839 if (desired_settings & BMP3_SEL_FIFO_DOWN_SAMPLING)
2843 reg_data = BMP3_SET_BITS_POS_0(reg_data, BMP3_FIFO_DOWN_SAMPLING, fifo_settings->
down_sampling);
2846 if (desired_settings & BMP3_SEL_FIFO_FILTER_EN)
2849 reg_data = BMP3_SET_BITS(reg_data, BMP3_FIFO_FILTER_EN, fifo_settings->
filter_en);
2868 uint8_t reg_addr = BMP3_REG_INT_CTRL;
2873 if (rslt == BMP3_OK)
2875 if (desired_settings & BMP3_SEL_FIFO_FWTM_EN)
2878 reg_data = BMP3_SET_BITS(reg_data, BMP3_FIFO_FWTM_EN, fifo_settings->
fwtm_en);
2881 if (desired_settings & BMP3_SEL_FIFO_FULL_EN)
2884 reg_data = BMP3_SET_BITS(reg_data, BMP3_FIFO_FULL_EN, fifo_settings->
ffull_en);
2904 reg_addr = BMP3_REG_SENS_STATUS;
2907 if (rslt == BMP3_OK)
2909 status->
sensor.
cmd_rdy = BMP3_GET_BITS(reg_data, BMP3_STATUS_CMD_RDY);
2910 status->
sensor.
drdy_press = BMP3_GET_BITS(reg_data, BMP3_STATUS_DRDY_PRESS);
2911 status->
sensor.
drdy_temp = BMP3_GET_BITS(reg_data, BMP3_STATUS_DRDY_TEMP);
2912 reg_addr = BMP3_REG_EVENT;
2929 rslt =
bmp3_get_regs(BMP3_REG_INT_STATUS, ®_data, 1, dev);
2931 if (rslt == BMP3_OK)
2933 status->
intr.
fifo_wm = BMP3_GET_BITS_POS_0(reg_data, BMP3_INT_STATUS_FWTM);
2934 status->
intr.
fifo_full = BMP3_GET_BITS(reg_data, BMP3_INT_STATUS_FFULL);
2935 status->
intr.
drdy = BMP3_GET_BITS(reg_data, BMP3_INT_STATUS_DRDY);
2952 if (rslt == BMP3_OK)
2954 status->
err.
fatal = BMP3_GET_BITS_POS_0(reg_data, BMP3_ERR_FATAL);
2955 status->
err.
cmd = BMP3_GET_BITS(reg_data, BMP3_ERR_CMD);
2956 status->
err.
conf = BMP3_GET_BITS(reg_data, BMP3_ERR_CONF);
static int8_t set_advance_settings(uint32_t desired_settings, const struct bmp3_settings *settings, struct bmp3_dev *dev)
This internal API sets the advance (i2c_wdt_en, i2c_wdt_sel) settings of the sensor based on the sett...
int8_t bmp3_set_sensor_settings(uint32_t desired_settings, struct bmp3_settings *settings, struct bmp3_dev *dev)
This API sets the power control(pressure enable and temperature enable), over sampling,...
static int8_t set_pwr_ctrl_settings(uint32_t desired_settings, const struct bmp3_settings *settings, struct bmp3_dev *dev)
This internal API sets the pressure enable and temperature enable settings of the sensor.
static int8_t write_power_mode(const struct bmp3_settings *settings, struct bmp3_dev *dev)
This internal API writes the power mode in the sensor.
static void parse_advance_settings(const uint8_t *reg_data, struct bmp3_adv_settings *settings)
This internal API parse the advance (i2c_wdt_en, i2c_wdt_sel) settings and store in the device struct...
static int8_t validate_osr_and_odr_settings(const struct bmp3_settings *settings)
This internal API validate the over sampling, ODR settings of the sensor.
static int8_t get_err_status(struct bmp3_status *status, struct bmp3_dev *dev)
This API gets the fatal, command and configuration error from the sensor.
int8_t bmp3_set_fifo_settings(uint16_t desired_settings, const struct bmp3_fifo_settings *fifo_settings, struct bmp3_dev *dev)
This API sets the fifo_config_1(fifo_mode, fifo_stop_on_full, fifo_time_en, fifo_press_en,...
static void parse_calib_data(const uint8_t *reg_data, struct bmp3_dev *dev)
This internal API is used to parse the calibration data, compensates it and store it in device struct...
static void parse_fifo_sensor_data(uint8_t sensor_comp, const uint8_t *fifo_buffer, struct bmp3_uncomp_data *uncomp_data)
This internal API parses the FIFO data frame from the fifo buffer and fills uncompensated temperature...
static float pow_bmp3(double base, uint8_t power)
This internal API is used to calculate the power functionality for double precision floating point va...
static int8_t fill_fifo_config_1(uint16_t desired_settings, const struct bmp3_fifo_settings *fifo_settings, struct bmp3_dev *dev)
This internal API fills the fifo_config_1(fifo_mode, fifo_stop_on_full, fifo_time_en,...
static void parse_sensor_data(const uint8_t *reg_data, struct bmp3_uncomp_data *uncomp_data)
This internal API is used to parse the pressure and temperature data and store it in the bmp3_uncomp_...
static int8_t set_normal_mode(struct bmp3_settings *settings, struct bmp3_dev *dev)
This internal API sets the normal mode in the sensor.
static int8_t get_int_status(struct bmp3_status *status, struct bmp3_dev *dev)
This API gets the interrupt (fifo watermark, fifo full, data ready) status from the sensor.
static uint8_t parse_fifo_data_frame(uint8_t header, struct bmp3_fifo_data *fifo, uint16_t *byte_index, struct bmp3_uncomp_data *uncomp_data, uint8_t *parsed_frames)
This internal API parse the FIFO data frame from the fifo buffer and fills the byte count,...
static void unpack_press_frame(uint16_t *byte_index, const uint8_t *fifo_buffer, struct bmp3_uncomp_data *uncomp_data)
This internal API unpacks the FIFO data frame from the fifo buffer and fills the byte count and uncom...
static void fill_osr_data(uint32_t desired_settings, uint8_t *addr, uint8_t *reg_data, uint8_t *len, const struct bmp3_settings *settings)
This internal API fills the register address and register data of the the over sampling settings for ...
int8_t bmp3_get_fifo_watermark(uint16_t *watermark_len, struct bmp3_dev *dev)
This API sets the fifo watermark length according to the frames count set by the user in the device s...
static int8_t fill_fifo_int_ctrl(uint16_t desired_settings, const struct bmp3_fifo_settings *fifo_settings, struct bmp3_dev *dev)
This internal API fills the fifo interrupt control(fwtm_en, ffull_en) settings in the reg_data variab...
static void unpack_temp_frame(uint16_t *byte_index, const uint8_t *fifo_buffer, struct bmp3_uncomp_data *uncomp_data)
This internal API unpacks the FIFO data frame from the fifo buffer and fills the byte count and uncom...
static void reset_fifo_index(struct bmp3_fifo_data *fifo)
This internal API resets the FIFO buffer, start index, parsed frame count, configuration change,...
static int8_t get_calib_data(struct bmp3_dev *dev)
This internal API reads the calibration data from the sensor, parse it then compensates it and store ...
int8_t bmp3_set_op_mode(struct bmp3_settings *settings, struct bmp3_dev *dev)
This API sets the power mode of the sensor.
static int8_t get_odr_filter_settings(struct bmp3_settings *settings, struct bmp3_dev *dev)
This internal API gets the over sampling, ODR and filter settings from the sensor.
static void fill_filter_data(uint8_t *addr, uint8_t *reg_data, uint8_t *len, const struct bmp3_settings *settings)
This internal API fills the register address and register data of the the filter settings for burst w...
int8_t bmp3_set_fifo_watermark(const struct bmp3_fifo_data *fifo, const struct bmp3_fifo_settings *fifo_settings, struct bmp3_dev *dev)
This API sets the fifo watermark length according to the frames count set by the user in the device s...
static int8_t put_device_to_sleep(struct bmp3_dev *dev)
This internal API puts the device to sleep mode.
static int8_t convert_frames_to_bytes(uint16_t *watermark_len, const struct bmp3_fifo_data *fifo, const struct bmp3_fifo_settings *fifo_settings)
This internal API converts the no. of frames required by the user to bytes so as to write in the wate...
static int8_t get_sensor_status(struct bmp3_status *status, struct bmp3_dev *dev)
This API gets the command ready, data ready for pressure and temperature, power on reset status from ...
int8_t bmp3_get_status(struct bmp3_status *status, struct bmp3_dev *dev)
This API gets the command ready, data ready for pressure and temperature and interrupt (fifo watermar...
static void parse_pwr_ctrl_settings(const uint8_t *reg_data, struct bmp3_settings *settings)
This internal API parse the power control(power mode, pressure enable and temperature enable) setting...
static int8_t compensate_data(uint8_t sensor_comp, const struct bmp3_uncomp_data *uncomp_data, struct bmp3_data *comp_data, struct bmp3_calib_data *calib_data)
This internal API is used to compensate the pressure or temperature or both the data according to the...
static void unpack_temp_press_frame(uint16_t *byte_index, const uint8_t *fifo_buffer, struct bmp3_uncomp_data *uncomp_data)
This internal API unpacks the FIFO data frame from the fifo buffer and fills the byte count,...
int8_t bmp3_get_fifo_data(struct bmp3_fifo_data *fifo, const struct bmp3_fifo_settings *fifo_settings, struct bmp3_dev *dev)
This API gets the fifo data from the sensor.
static int8_t verify_meas_time_and_odr_duration(uint32_t meas_t, uint32_t odr_duration)
This internal API checks whether the measurement time and ODR duration of the sensor are proper.
int8_t bmp3_get_sensor_data(uint8_t sensor_comp, struct bmp3_data *comp_data, struct bmp3_dev *dev)
This API reads the pressure, temperature or both data from the sensor, compensates the data and store...
static void parse_int_ctrl_settings(const uint8_t *reg_data, struct bmp3_int_ctrl_settings *settings)
This internal API parse the interrupt control(output mode, level, latch and data ready) settings and ...
static void unpack_time_frame(uint16_t *byte_index, const uint8_t *fifo_buffer, uint32_t *sensor_time)
This internal API unpacks the time frame from the fifo data buffer and fills the byte count and updat...
static int8_t null_ptr_check(const struct bmp3_dev *dev)
This internal API is used to validate the device pointer for null conditions.
int8_t bmp3_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, struct bmp3_dev *dev)
This API reads the data from the given register address of the sensor.
int8_t bmp3_get_fifo_settings(struct bmp3_fifo_settings *fifo_settings, struct bmp3_dev *dev)
This API gets the fifo_config_1(fifo_mode, fifo_stop_on_full, fifo_time_en, fifo_press_en,...
static uint8_t are_settings_changed(uint32_t sub_settings, uint32_t settings)
This internal API is used to identify the settings which the user wants to modify in the sensor.
static void interleave_reg_addr(const uint8_t *reg_addr, uint8_t *temp_buff, const uint8_t *reg_data, uint32_t len)
This internal API interleaves the register address between the register data buffer for burst write o...
static int8_t validate_normal_mode_settings(struct bmp3_settings *settings, struct bmp3_dev *dev)
This internal API validate the normal mode settings of the sensor.
int8_t bmp3_get_op_mode(uint8_t *op_mode, struct bmp3_dev *dev)
This API gets the power mode of the sensor.
static int8_t set_int_ctrl_settings(uint32_t desired_settings, const struct bmp3_settings *settings, struct bmp3_dev *dev)
This internal API sets the interrupt control (output mode, level, latch and data ready) settings of t...
int8_t bmp3_extract_fifo_data(struct bmp3_data *data, struct bmp3_fifo_data *fifo, struct bmp3_dev *dev)
This API extracts the temperature and/or pressure data from the FIFO data which is already read from ...
int8_t bmp3_fifo_flush(struct bmp3_dev *dev)
This API performs the soft reset of the sensor.
static int8_t compensate_temperature(double *temperature, const struct bmp3_uncomp_data *uncomp_data, struct bmp3_calib_data *calib_data)
This internal API is used to compensate the raw temperature data and return the compensated temperatu...
static int8_t set_odr_filter_settings(uint32_t desired_settings, struct bmp3_settings *settings, struct bmp3_dev *dev)
This internal API sets the over sampling, ODR and filter settings of the sensor based on the settings...
static void fill_odr_data(uint8_t *addr, uint8_t *reg_data, uint8_t *len, struct bmp3_settings *settings)
This internal API fills the register address and register data of the the ODR settings for burst writ...
int8_t bmp3_set_regs(uint8_t *reg_addr, const uint8_t *reg_data, uint32_t len, struct bmp3_dev *dev)
This API writes the given data to the register address of the sensor.
static uint32_t calculate_temp_meas_time(const struct bmp3_settings *settings)
This internal API calculates the temperature measurement duration of the sensor.
int8_t bmp3_soft_reset(struct bmp3_dev *dev)
This API performs the soft reset of the sensor.
static int8_t compensate_pressure(double *pressure, const struct bmp3_uncomp_data *uncomp_data, const struct bmp3_calib_data *calib_data)
This internal API is used to compensate the pressure data and return the compensated pressure data.
static void parse_odr_filter_settings(const uint8_t *reg_data, struct bmp3_odr_filter_settings *settings)
This internal API parse the over sampling, ODR and filter settings and store in the device structure.
int8_t bmp3_get_fifo_length(uint16_t *fifo_length, struct bmp3_dev *dev)
This API gets the fifo length from the sensor.
static void get_header_info(uint8_t *header, const uint8_t *fifo_buffer, uint16_t *byte_index)
This internal API parses the FIFO buffer and gets the header info.
static void parse_sett_data(const uint8_t *reg_data, struct bmp3_settings *settings)
This internal API parse the power control(power mode, pressure enable and temperature enable),...
int8_t bmp3_get_sensor_settings(struct bmp3_settings *settings, struct bmp3_dev *dev)
This API gets the power control(power mode, pressure enable and temperature enable),...
static uint32_t calculate_press_meas_time(const struct bmp3_settings *settings)
This internal API calculates the pressure measurement duration of the sensor.
static int8_t fill_fifo_config_2(uint16_t desired_settings, const struct bmp3_fifo_settings *fifo_settings, struct bmp3_dev *dev)
This internal API fills the fifo_config_2(fifo_sub_sampling, data_select) settings in the reg_data va...
static void parse_fifo_settings(const uint8_t *reg_data, struct bmp3_fifo_settings *fifo_settings)
This internal API is used to parse the fifo_config_1(fifo_mode, fifo_stop_on_full,...
int8_t bmp3_init(struct bmp3_dev *dev)
This API is the entry point. It performs the selection of I2C/SPI read mechanism according to the sel...
#define BMP3_FIFO_TEMP_FRAME
#define BMP3_FIFO_EMPTY_FRAME
#define BMP3_FIFO_CONFIG_2
#define BMP3_FIFO_PRESS_FRAME
#define BMP3_FIFO_CONFIG_CHANGE
#define BMP3_INTF_RET_SUCCESS
#define BMP3_FIFO_TIME_FRAME
#define BMP3_FIFO_CONFIG_1
#define BMP3_FIFO_ERROR_FRAME
#define BMP3_FIFO_INT_CTRL
#define BMP3_SENSORTIME_OVERHEAD_BYTES
#define BMP3_FIFO_TEMP_PRESS_FRAME
struct bmp3_reg_calib_data reg_calib_data
struct bmp3_quantized_calib_data quantized_calib_data
bmp3 sensor structure which comprises of temperature and pressure data.
BMP3_INTF_RET_TYPE intf_rslt
struct bmp3_calib_data calib_data
bmp3_delay_us_fptr_t delay_us
uint8_t frame_not_available
bmp3 interrupt pin settings
bmp3 odr and filter settings
Quantized Trim Variables.
struct bmp3_int_ctrl_settings int_settings
struct bmp3_adv_settings adv_settings
struct bmp3_odr_filter_settings odr_filter
struct bmp3_sens_status sensor
struct bmp3_err_status err
struct bmp3_int_status intr
bmp3 sensor structure which comprises of un-compensated temperature and pressure data.