Driver implementation for the BME68X sensor. This file contains the core logic for initializing, configuring, and reading data from the Bosch BME68X gas, temperature, humidity, and pressure sensor.
More...
|
| static int8_t | get_calib_data (struct bme68x_dev *dev) |
| | Read calibration coefficients from the BME68x sensor registers.
|
| |
| static int8_t | read_variant_id (struct bme68x_dev *dev) |
| | Read the sensor variant ID from the device register and store it in the device structure.
|
| |
| static uint8_t | calc_gas_wait (uint16_t dur) |
| | convert duration in milliseconds to encoded register value
|
| |
| static int16_t | calc_temperature (uint32_t temp_adc, struct bme68x_dev *dev) |
| | This internal API is used to calculate the temperature value.
|
| |
| static uint32_t | calc_pressure (uint32_t pres_adc, const struct bme68x_dev *dev) |
| | This internal API is used to calculate the pressure value.
|
| |
| static uint32_t | calc_humidity (uint16_t hum_adc, const struct bme68x_dev *dev) |
| | Calculate relative humidity (in percent, float) from raw ADC value.
|
| |
| static uint32_t | calc_gas_resistance_high (uint16_t gas_res_adc, uint8_t gas_range) |
| | This internal API is used to calculate the gas resistance value in float.
|
| |
| static uint32_t | calc_gas_resistance_low (uint16_t gas_res_adc, uint8_t gas_range, const struct bme68x_dev *dev) |
| | This internal API is used to calculate the gas resistance low value in float.
|
| |
| static uint8_t | calc_res_heat (uint16_t temp, const struct bme68x_dev *dev) |
| |
| static int8_t | read_field_data (uint8_t index, struct bme68x_data *data, struct bme68x_dev *dev) |
| |
| static int8_t | read_all_field_data (struct bme68x_data *const data[], struct bme68x_dev *dev) |
| |
| static int8_t | set_mem_page (uint8_t reg_addr, struct bme68x_dev *dev) |
| |
| static int8_t | get_mem_page (struct bme68x_dev *dev) |
| |
| static int8_t | null_ptr_check (const struct bme68x_dev *dev) |
| |
| static int8_t | set_conf (const struct bme68x_heatr_conf *conf, uint8_t op_mode, uint8_t *nb_conv, struct bme68x_dev *dev) |
| |
| static int8_t | boundary_check (uint8_t *value, uint8_t max, struct bme68x_dev *dev) |
| |
| static uint8_t | calc_heatr_dur_shared (uint16_t dur) |
| |
| static void | swap_fields (uint8_t index1, uint8_t index2, struct bme68x_data *field[]) |
| | Swap two entries in the sensor data pointer array.
|
| |
| static void | sort_sensor_data (uint8_t low_index, uint8_t high_index, struct bme68x_data *field[]) |
| |
| static int8_t | analyze_sensor_data (const struct bme68x_data *data, uint8_t n_meas) |
| | Function to analyze the sensor data.
|
| |
| int8_t | bme68x_init (struct bme68x_dev *dev) |
| | Initializes the BME68X sensor.
|
| |
| int8_t | bme68x_set_regs (const uint8_t *reg_addr, const uint8_t *reg_data, uint32_t len, struct bme68x_dev *dev) |
| | This API writes the given data to the register address of the sensor.
|
| |
| int8_t | bme68x_get_regs (uint8_t reg_addr, uint8_t *reg_data, uint32_t len, struct bme68x_dev *dev) |
| | This API reads the data from the given register address of sensor.
|
| |
| int8_t | bme68x_soft_reset (struct bme68x_dev *dev) |
| | Triggers a software reset on the BME68X sensor.
|
| |
| int8_t | bme68x_set_conf (struct bme68x_conf *conf, struct bme68x_dev *dev) |
| | Sets the oversampling, filter and ODR configurations of the sensor.
|
| |
| int8_t | bme68x_get_conf (struct bme68x_conf *conf, struct bme68x_dev *dev) |
| |
| int8_t | bme68x_set_op_mode (const uint8_t op_mode, struct bme68x_dev *dev) |
| |
| int8_t | bme68x_get_op_mode (uint8_t *op_mode, struct bme68x_dev *dev) |
| |
| uint32_t | bme68x_get_meas_dur (const uint8_t op_mode, struct bme68x_conf *conf, struct bme68x_dev *dev) |
| |
| int8_t | bme68x_get_data (uint8_t op_mode, struct bme68x_data *data, uint8_t *n_data, struct bme68x_dev *dev) |
| |
| int8_t | bme68x_set_heatr_conf (uint8_t op_mode, const struct bme68x_heatr_conf *conf, struct bme68x_dev *dev) |
| |
| int8_t | bme68x_get_heatr_conf (const struct bme68x_heatr_conf *conf, struct bme68x_dev *dev) |
| | This API is used to get the gas configuration of the sensor.
|
| |
| int8_t | bme68x_selftest_check (const struct bme68x_dev *dev) |
| |
| int | initBME688 (void) |
| | Initializes the BME688 sensor over SPI. Performs interface initialization, device reset, and basic data verification.
|
| |
| int | getBME688Data (int count, uint8_t quiet) |
| | Triggers and retrieves measurement data from the BME688.
|
| |
Driver implementation for the BME68X sensor. This file contains the core logic for initializing, configuring, and reading data from the Bosch BME68X gas, temperature, humidity, and pressure sensor.
- Date
- 2023-02-07
- Version
- v4.4.8
- Copyright
- (c) 2023 Bosch Sensortec GmbH. All rights reserved.
- Note
- SPDX-License-Identifier: BSD-3-Clause
and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file bme68x.c.