bme680_defs.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. /**
  2. * Copyright (C) 2017 - 2018 Bosch Sensortec GmbH
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. *
  10. * Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. *
  14. * Neither the name of the copyright holder nor the names of the
  15. * contributors may be used to endorse or promote products derived from
  16. * this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  19. * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  20. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  21. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  22. * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
  23. * OR CONTRIBUTORS BE LIABLE FOR ANY
  24. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
  25. * OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO,
  26. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  27. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  29. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  31. * ANY WAY OUT OF THE USE OF THIS
  32. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
  33. *
  34. * The information provided is believed to be accurate and reliable.
  35. * The copyright holder assumes no responsibility
  36. * for the consequences of use
  37. * of such information nor for any infringement of patents or
  38. * other rights of third parties which may result from its use.
  39. * No license is granted by implication or otherwise under any patent or
  40. * patent rights of the copyright holder.
  41. *
  42. * @file bme680_defs.h
  43. * @date 19 Jun 2018
  44. * @version 3.5.9
  45. * @brief
  46. *
  47. */
  48. /*! @file bme680_defs.h
  49. @brief Sensor driver for BME680 sensor */
  50. /*!
  51. * @defgroup BME680 SENSOR API
  52. * @brief
  53. * @{*/
  54. #ifndef BME680_DEFS_H_
  55. #define BME680_DEFS_H_
  56. /********************************************************/
  57. /* header includes */
  58. #ifdef __KERNEL__
  59. #include <linux/types.h>
  60. #include <linux/kernel.h>
  61. #else
  62. #include <stdint.h>
  63. #include <stddef.h>
  64. #endif
  65. /******************************************************************************/
  66. /*! @name Common macros */
  67. /******************************************************************************/
  68. #if !defined(UINT8_C) && !defined(INT8_C)
  69. #define INT8_C(x) S8_C(x)
  70. #define UINT8_C(x) U8_C(x)
  71. #endif
  72. #if !defined(UINT16_C) && !defined(INT16_C)
  73. #define INT16_C(x) S16_C(x)
  74. #define UINT16_C(x) U16_C(x)
  75. #endif
  76. #if !defined(INT32_C) && !defined(UINT32_C)
  77. #define INT32_C(x) S32_C(x)
  78. #define UINT32_C(x) U32_C(x)
  79. #endif
  80. #if !defined(INT64_C) && !defined(UINT64_C)
  81. #define INT64_C(x) S64_C(x)
  82. #define UINT64_C(x) U64_C(x)
  83. #endif
  84. /**@}*/
  85. /**\name C standard macros */
  86. #ifndef NULL
  87. #ifdef __cplusplus
  88. #define NULL 0
  89. #else
  90. #define NULL ((void *) 0)
  91. #endif
  92. #endif
  93. /** BME680 configuration macros */
  94. /** Enable or un-comment the macro to provide floating point data output */
  95. #ifndef BME680_FLOAT_POINT_COMPENSATION
  96. /* #define BME680_FLOAT_POINT_COMPENSATION */
  97. #endif
  98. /** BME680 General config */
  99. #define BME680_POLL_PERIOD_MS UINT8_C(10)
  100. /** BME680 I2C addresses */
  101. #define BME680_I2C_ADDR_PRIMARY UINT8_C(0x76)
  102. #define BME680_I2C_ADDR_SECONDARY UINT8_C(0x77)
  103. /** BME680 unique chip identifier */
  104. #define BME680_CHIP_ID UINT8_C(0x61)
  105. /** BME680 coefficients related defines */
  106. #define BME680_COEFF_SIZE UINT8_C(41)
  107. #define BME680_COEFF_ADDR1_LEN UINT8_C(25)
  108. #define BME680_COEFF_ADDR2_LEN UINT8_C(16)
  109. /** BME680 field_x related defines */
  110. #define BME680_FIELD_LENGTH UINT8_C(15)
  111. #define BME680_FIELD_ADDR_OFFSET UINT8_C(17)
  112. /** Soft reset command */
  113. #define BME680_SOFT_RESET_CMD UINT8_C(0xb6)
  114. /** Error code definitions */
  115. #define BME680_OK INT8_C(0)
  116. /* Errors */
  117. #define BME680_E_NULL_PTR INT8_C(-1)
  118. #define BME680_E_COM_FAIL INT8_C(-2)
  119. #define BME680_E_DEV_NOT_FOUND INT8_C(-3)
  120. #define BME680_E_INVALID_LENGTH INT8_C(-4)
  121. /* Warnings */
  122. #define BME680_W_DEFINE_PWR_MODE INT8_C(1)
  123. #define BME680_W_NO_NEW_DATA INT8_C(2)
  124. /* Info's */
  125. #define BME680_I_MIN_CORRECTION UINT8_C(1)
  126. #define BME680_I_MAX_CORRECTION UINT8_C(2)
  127. /** Register map */
  128. /** Other coefficient's address */
  129. #define BME680_ADDR_RES_HEAT_VAL_ADDR UINT8_C(0x00)
  130. #define BME680_ADDR_RES_HEAT_RANGE_ADDR UINT8_C(0x02)
  131. #define BME680_ADDR_RANGE_SW_ERR_ADDR UINT8_C(0x04)
  132. #define BME680_ADDR_SENS_CONF_START UINT8_C(0x5A)
  133. #define BME680_ADDR_GAS_CONF_START UINT8_C(0x64)
  134. /** Field settings */
  135. #define BME680_FIELD0_ADDR UINT8_C(0x1d)
  136. /** Heater settings */
  137. #define BME680_RES_HEAT0_ADDR UINT8_C(0x5a)
  138. #define BME680_GAS_WAIT0_ADDR UINT8_C(0x64)
  139. /** Sensor configuration registers */
  140. #define BME680_CONF_HEAT_CTRL_ADDR UINT8_C(0x70)
  141. #define BME680_CONF_ODR_RUN_GAS_NBC_ADDR UINT8_C(0x71)
  142. #define BME680_CONF_OS_H_ADDR UINT8_C(0x72)
  143. #define BME680_MEM_PAGE_ADDR UINT8_C(0xf3)
  144. #define BME680_CONF_T_P_MODE_ADDR UINT8_C(0x74)
  145. #define BME680_CONF_ODR_FILT_ADDR UINT8_C(0x75)
  146. /** Coefficient's address */
  147. #define BME680_COEFF_ADDR1 UINT8_C(0x89)
  148. #define BME680_COEFF_ADDR2 UINT8_C(0xe1)
  149. /** Chip identifier */
  150. #define BME680_CHIP_ID_ADDR UINT8_C(0xd0)
  151. /** Soft reset register */
  152. #define BME680_SOFT_RESET_ADDR UINT8_C(0xe0)
  153. /** Heater control settings */
  154. #define BME680_ENABLE_HEATER UINT8_C(0x00)
  155. #define BME680_DISABLE_HEATER UINT8_C(0x08)
  156. /** Gas measurement settings */
  157. #define BME680_DISABLE_GAS_MEAS UINT8_C(0x00)
  158. #define BME680_ENABLE_GAS_MEAS UINT8_C(0x01)
  159. /** Over-sampling settings */
  160. #define BME680_OS_NONE UINT8_C(0)
  161. #define BME680_OS_1X UINT8_C(1)
  162. #define BME680_OS_2X UINT8_C(2)
  163. #define BME680_OS_4X UINT8_C(3)
  164. #define BME680_OS_8X UINT8_C(4)
  165. #define BME680_OS_16X UINT8_C(5)
  166. /** IIR filter settings */
  167. #define BME680_FILTER_SIZE_0 UINT8_C(0)
  168. #define BME680_FILTER_SIZE_1 UINT8_C(1)
  169. #define BME680_FILTER_SIZE_3 UINT8_C(2)
  170. #define BME680_FILTER_SIZE_7 UINT8_C(3)
  171. #define BME680_FILTER_SIZE_15 UINT8_C(4)
  172. #define BME680_FILTER_SIZE_31 UINT8_C(5)
  173. #define BME680_FILTER_SIZE_63 UINT8_C(6)
  174. #define BME680_FILTER_SIZE_127 UINT8_C(7)
  175. /** Power mode settings */
  176. #define BME680_SLEEP_MODE UINT8_C(0)
  177. #define BME680_FORCED_MODE UINT8_C(1)
  178. /** Delay related macro declaration */
  179. #define BME680_RESET_PERIOD UINT32_C(10)
  180. /** SPI memory page settings */
  181. #define BME680_MEM_PAGE0 UINT8_C(0x10)
  182. #define BME680_MEM_PAGE1 UINT8_C(0x00)
  183. /** Ambient humidity shift value for compensation */
  184. #define BME680_HUM_REG_SHIFT_VAL UINT8_C(4)
  185. /** Run gas enable and disable settings */
  186. #define BME680_RUN_GAS_DISABLE UINT8_C(0)
  187. #define BME680_RUN_GAS_ENABLE UINT8_C(1)
  188. /** Buffer length macro declaration */
  189. #define BME680_TMP_BUFFER_LENGTH UINT8_C(40)
  190. #define BME680_REG_BUFFER_LENGTH UINT8_C(6)
  191. #define BME680_FIELD_DATA_LENGTH UINT8_C(3)
  192. #define BME680_GAS_REG_BUF_LENGTH UINT8_C(20)
  193. /** Settings selector */
  194. #define BME680_OST_SEL UINT16_C(1)
  195. #define BME680_OSP_SEL UINT16_C(2)
  196. #define BME680_OSH_SEL UINT16_C(4)
  197. #define BME680_GAS_MEAS_SEL UINT16_C(8)
  198. #define BME680_FILTER_SEL UINT16_C(16)
  199. #define BME680_HCNTRL_SEL UINT16_C(32)
  200. #define BME680_RUN_GAS_SEL UINT16_C(64)
  201. #define BME680_NBCONV_SEL UINT16_C(128)
  202. #define BME680_GAS_SENSOR_SEL (BME680_GAS_MEAS_SEL | BME680_RUN_GAS_SEL | BME680_NBCONV_SEL)
  203. /** Number of conversion settings*/
  204. #define BME680_NBCONV_MIN UINT8_C(0)
  205. #define BME680_NBCONV_MAX UINT8_C(10)
  206. /** Mask definitions */
  207. #define BME680_GAS_MEAS_MSK UINT8_C(0x30)
  208. #define BME680_NBCONV_MSK UINT8_C(0X0F)
  209. #define BME680_FILTER_MSK UINT8_C(0X1C)
  210. #define BME680_OST_MSK UINT8_C(0XE0)
  211. #define BME680_OSP_MSK UINT8_C(0X1C)
  212. #define BME680_OSH_MSK UINT8_C(0X07)
  213. #define BME680_HCTRL_MSK UINT8_C(0x08)
  214. #define BME680_RUN_GAS_MSK UINT8_C(0x10)
  215. #define BME680_MODE_MSK UINT8_C(0x03)
  216. #define BME680_RHRANGE_MSK UINT8_C(0x30)
  217. #define BME680_RSERROR_MSK UINT8_C(0xf0)
  218. #define BME680_NEW_DATA_MSK UINT8_C(0x80)
  219. #define BME680_GAS_INDEX_MSK UINT8_C(0x0f)
  220. #define BME680_GAS_RANGE_MSK UINT8_C(0x0f)
  221. #define BME680_GASM_VALID_MSK UINT8_C(0x20)
  222. #define BME680_HEAT_STAB_MSK UINT8_C(0x10)
  223. #define BME680_MEM_PAGE_MSK UINT8_C(0x10)
  224. #define BME680_SPI_RD_MSK UINT8_C(0x80)
  225. #define BME680_SPI_WR_MSK UINT8_C(0x7f)
  226. #define BME680_BIT_H1_DATA_MSK UINT8_C(0x0F)
  227. /** Bit position definitions for sensor settings */
  228. #define BME680_GAS_MEAS_POS UINT8_C(4)
  229. #define BME680_FILTER_POS UINT8_C(2)
  230. #define BME680_OST_POS UINT8_C(5)
  231. #define BME680_OSP_POS UINT8_C(2)
  232. #define BME680_RUN_GAS_POS UINT8_C(4)
  233. /** Array Index to Field data mapping for Calibration Data*/
  234. #define BME680_T2_LSB_REG (1)
  235. #define BME680_T2_MSB_REG (2)
  236. #define BME680_T3_REG (3)
  237. #define BME680_P1_LSB_REG (5)
  238. #define BME680_P1_MSB_REG (6)
  239. #define BME680_P2_LSB_REG (7)
  240. #define BME680_P2_MSB_REG (8)
  241. #define BME680_P3_REG (9)
  242. #define BME680_P4_LSB_REG (11)
  243. #define BME680_P4_MSB_REG (12)
  244. #define BME680_P5_LSB_REG (13)
  245. #define BME680_P5_MSB_REG (14)
  246. #define BME680_P7_REG (15)
  247. #define BME680_P6_REG (16)
  248. #define BME680_P8_LSB_REG (19)
  249. #define BME680_P8_MSB_REG (20)
  250. #define BME680_P9_LSB_REG (21)
  251. #define BME680_P9_MSB_REG (22)
  252. #define BME680_P10_REG (23)
  253. #define BME680_H2_MSB_REG (25)
  254. #define BME680_H2_LSB_REG (26)
  255. #define BME680_H1_LSB_REG (26)
  256. #define BME680_H1_MSB_REG (27)
  257. #define BME680_H3_REG (28)
  258. #define BME680_H4_REG (29)
  259. #define BME680_H5_REG (30)
  260. #define BME680_H6_REG (31)
  261. #define BME680_H7_REG (32)
  262. #define BME680_T1_LSB_REG (33)
  263. #define BME680_T1_MSB_REG (34)
  264. #define BME680_GH2_LSB_REG (35)
  265. #define BME680_GH2_MSB_REG (36)
  266. #define BME680_GH1_REG (37)
  267. #define BME680_GH3_REG (38)
  268. /** BME680 register buffer index settings*/
  269. #define BME680_REG_FILTER_INDEX UINT8_C(5)
  270. #define BME680_REG_TEMP_INDEX UINT8_C(4)
  271. #define BME680_REG_PRES_INDEX UINT8_C(4)
  272. #define BME680_REG_HUM_INDEX UINT8_C(2)
  273. #define BME680_REG_NBCONV_INDEX UINT8_C(1)
  274. #define BME680_REG_RUN_GAS_INDEX UINT8_C(1)
  275. #define BME680_REG_HCTRL_INDEX UINT8_C(0)
  276. /** BME680 pressure calculation macros */
  277. /*! This max value is used to provide precedence to multiplication or division
  278. * in pressure compensation equation to achieve least loss of precision and
  279. * avoiding overflows.
  280. * i.e Comparing value, BME680_MAX_OVERFLOW_VAL = INT32_C(1 << 30)
  281. */
  282. #define BME680_MAX_OVERFLOW_VAL INT32_C(0x40000000)
  283. /** Macro to combine two 8 bit data's to form a 16 bit data */
  284. #define BME680_CONCAT_BYTES(msb, lsb) (((uint16_t)msb << 8) | (uint16_t)lsb)
  285. /** Macro to SET and GET BITS of a register */
  286. #define BME680_SET_BITS(reg_data, bitname, data) \
  287. ((reg_data & ~(bitname##_MSK)) | \
  288. ((data << bitname##_POS) & bitname##_MSK))
  289. #define BME680_GET_BITS(reg_data, bitname) ((reg_data & (bitname##_MSK)) >> \
  290. (bitname##_POS))
  291. /** Macro variant to handle the bitname position if it is zero */
  292. #define BME680_SET_BITS_POS_0(reg_data, bitname, data) \
  293. ((reg_data & ~(bitname##_MSK)) | \
  294. (data & bitname##_MSK))
  295. #define BME680_GET_BITS_POS_0(reg_data, bitname) (reg_data & (bitname##_MSK))
  296. /** Type definitions */
  297. /*!
  298. * Generic communication function pointer
  299. * @param[in] dev_id: Place holder to store the id of the device structure
  300. * Can be used to store the index of the Chip select or
  301. * I2C address of the device.
  302. * @param[in] reg_addr: Used to select the register the where data needs to
  303. * be read from or written to.
  304. * @param[in/out] reg_data: Data array to read/write
  305. * @param[in] len: Length of the data array
  306. */
  307. typedef int8_t (*bme680_com_fptr_t)(uint8_t dev_id, uint8_t reg_addr, uint8_t *data, uint16_t len);
  308. /*!
  309. * Delay function pointer
  310. * @param[in] period: Time period in milliseconds
  311. */
  312. typedef void (*bme680_delay_fptr_t)(uint32_t period);
  313. /*!
  314. * @brief Interface selection Enumerations
  315. */
  316. enum bme680_intf {
  317. /*! SPI interface */
  318. BME680_SPI_INTF,
  319. /*! I2C interface */
  320. BME680_I2C_INTF
  321. };
  322. /* structure definitions */
  323. /*!
  324. * @brief Sensor field data structure
  325. */
  326. struct bme680_field_data {
  327. /*! Contains new_data, gasm_valid & heat_stab */
  328. uint8_t status;
  329. /*! The index of the heater profile used */
  330. uint8_t gas_index;
  331. /*! Measurement index to track order */
  332. uint8_t meas_index;
  333. #ifndef BME680_FLOAT_POINT_COMPENSATION
  334. /*! Temperature in degree celsius x100 */
  335. int16_t temperature;
  336. /*! Pressure in Pascal */
  337. uint32_t pressure;
  338. /*! Humidity in % relative humidity x1000 */
  339. uint32_t humidity;
  340. /*! Gas resistance in Ohms */
  341. uint32_t gas_resistance;
  342. #else
  343. /*! Temperature in degree celsius */
  344. float temperature;
  345. /*! Pressure in Pascal */
  346. float pressure;
  347. /*! Humidity in % relative humidity x1000 */
  348. float humidity;
  349. /*! Gas resistance in Ohms */
  350. float gas_resistance;
  351. #endif
  352. };
  353. /*!
  354. * @brief Structure to hold the Calibration data
  355. */
  356. struct bme680_calib_data {
  357. /*! Variable to store calibrated humidity data */
  358. uint16_t par_h1;
  359. /*! Variable to store calibrated humidity data */
  360. uint16_t par_h2;
  361. /*! Variable to store calibrated humidity data */
  362. int8_t par_h3;
  363. /*! Variable to store calibrated humidity data */
  364. int8_t par_h4;
  365. /*! Variable to store calibrated humidity data */
  366. int8_t par_h5;
  367. /*! Variable to store calibrated humidity data */
  368. uint8_t par_h6;
  369. /*! Variable to store calibrated humidity data */
  370. int8_t par_h7;
  371. /*! Variable to store calibrated gas data */
  372. int8_t par_gh1;
  373. /*! Variable to store calibrated gas data */
  374. int16_t par_gh2;
  375. /*! Variable to store calibrated gas data */
  376. int8_t par_gh3;
  377. /*! Variable to store calibrated temperature data */
  378. uint16_t par_t1;
  379. /*! Variable to store calibrated temperature data */
  380. int16_t par_t2;
  381. /*! Variable to store calibrated temperature data */
  382. int8_t par_t3;
  383. /*! Variable to store calibrated pressure data */
  384. uint16_t par_p1;
  385. /*! Variable to store calibrated pressure data */
  386. int16_t par_p2;
  387. /*! Variable to store calibrated pressure data */
  388. int8_t par_p3;
  389. /*! Variable to store calibrated pressure data */
  390. int16_t par_p4;
  391. /*! Variable to store calibrated pressure data */
  392. int16_t par_p5;
  393. /*! Variable to store calibrated pressure data */
  394. int8_t par_p6;
  395. /*! Variable to store calibrated pressure data */
  396. int8_t par_p7;
  397. /*! Variable to store calibrated pressure data */
  398. int16_t par_p8;
  399. /*! Variable to store calibrated pressure data */
  400. int16_t par_p9;
  401. /*! Variable to store calibrated pressure data */
  402. uint8_t par_p10;
  403. #ifndef BME680_FLOAT_POINT_COMPENSATION
  404. /*! Variable to store t_fine size */
  405. int32_t t_fine;
  406. #else
  407. /*! Variable to store t_fine size */
  408. float t_fine;
  409. #endif
  410. /*! Variable to store heater resistance range */
  411. uint8_t res_heat_range;
  412. /*! Variable to store heater resistance value */
  413. int8_t res_heat_val;
  414. /*! Variable to store error range */
  415. int8_t range_sw_err;
  416. };
  417. /*!
  418. * @brief BME680 sensor settings structure which comprises of ODR,
  419. * over-sampling and filter settings.
  420. */
  421. struct bme680_tph_sett {
  422. /*! Humidity oversampling */
  423. uint8_t os_hum;
  424. /*! Temperature oversampling */
  425. uint8_t os_temp;
  426. /*! Pressure oversampling */
  427. uint8_t os_pres;
  428. /*! Filter coefficient */
  429. uint8_t filter;
  430. };
  431. /*!
  432. * @brief BME680 gas sensor which comprises of gas settings
  433. * and status parameters
  434. */
  435. struct bme680_gas_sett {
  436. /*! Variable to store nb conversion */
  437. uint8_t nb_conv;
  438. /*! Variable to store heater control */
  439. uint8_t heatr_ctrl;
  440. /*! Run gas enable value */
  441. uint8_t run_gas;
  442. /*! Heater temperature value */
  443. uint16_t heatr_temp;
  444. /*! Duration profile value */
  445. uint16_t heatr_dur;
  446. };
  447. /*!
  448. * @brief BME680 device structure
  449. */
  450. struct bme680_dev {
  451. /*! Chip Id */
  452. uint8_t chip_id;
  453. /*! Device Id */
  454. uint8_t dev_id;
  455. /*! SPI/I2C interface */
  456. enum bme680_intf intf;
  457. /*! Memory page used */
  458. uint8_t mem_page;
  459. /*! Ambient temperature in Degree C */
  460. int8_t amb_temp;
  461. /*! Sensor calibration data */
  462. struct bme680_calib_data calib;
  463. /*! Sensor settings */
  464. struct bme680_tph_sett tph_sett;
  465. /*! Gas Sensor settings */
  466. struct bme680_gas_sett gas_sett;
  467. /*! Sensor power modes */
  468. uint8_t power_mode;
  469. /*! New sensor fields */
  470. uint8_t new_fields;
  471. /*! Store the info messages */
  472. uint8_t info_msg;
  473. /*! Bus read function pointer */
  474. bme680_com_fptr_t read;
  475. /*! Bus write function pointer */
  476. bme680_com_fptr_t write;
  477. /*! delay function pointer */
  478. bme680_delay_fptr_t delay_ms;
  479. /*! Communication function result */
  480. int8_t com_rslt;
  481. };
  482. #endif /* BME680_DEFS_H_ */
  483. /** @}*/
  484. /** @}*/