LibDriver BME680
Loading...
Searching...
No Matches
driver_bme680.h File Reference

driver bme680 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_bme680.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bme680_handle_s
 bme680 handle structure definition More...
struct  bme680_info_s
 bme680 information structure definition More...

Macros

#define DRIVER_BME680_LINK_INIT(HANDLE, STRUCTURE)
 initialize bme680_handle_t structure
#define DRIVER_BME680_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_BME680_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_BME680_LINK_IIC_READ(HANDLE, FUC)
 link iic_read function
#define DRIVER_BME680_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_BME680_LINK_SPI_INIT(HANDLE, FUC)
 link spi_init function
#define DRIVER_BME680_LINK_SPI_DEINIT(HANDLE, FUC)
 link spi_deinit function
#define DRIVER_BME680_LINK_SPI_READ(HANDLE, FUC)
 link spi_read function
#define DRIVER_BME680_LINK_SPI_WRITE(HANDLE, FUC)
 link spi_write function
#define DRIVER_BME680_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_BME680_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct bme680_handle_s bme680_handle_t
 bme680 handle structure definition
typedef struct bme680_info_s bme680_info_t
 bme680 information structure definition

Enumerations

enum  bme680_bool_t { BME680_BOOL_FALSE = 0x00 , BME680_BOOL_TRUE = 0x01 }
 bme680 bool enumeration definition More...
enum  bme680_interface_t { BME680_INTERFACE_IIC = 0x00 , BME680_INTERFACE_SPI = 0x01 }
 bme680 interface enumeration definition More...
enum  bme680_address_t { BME680_ADDRESS_ADO_LOW = (0x76 << 1) , BME680_ADDRESS_ADO_HIGH = (0x77 << 1) }
 bme680 address enumeration definition More...
enum  bme680_oversampling_t {
  BME680_OVERSAMPLING_SKIP = 0x00 , BME680_OVERSAMPLING_x1 = 0x01 , BME680_OVERSAMPLING_x2 = 0x02 , BME680_OVERSAMPLING_x4 = 0x03 ,
  BME680_OVERSAMPLING_x8 = 0x04 , BME680_OVERSAMPLING_x16 = 0x05
}
 bme680 oversampling enumeration definition More...
enum  bme680_mode_t { BME680_MODE_SLEEP = 0x00 , BME680_MODE_FORCED = 0x01 }
 bme680 mode enumeration definition More...
enum  bme680_filter_t {
  BME680_FILTER_OFF = 0x00 , BME680_FILTER_COEFF_1 = 0x01 , BME680_FILTER_COEFF_3 = 0x02 , BME680_FILTER_COEFF_7 = 0x03 ,
  BME680_FILTER_COEFF_15 = 0x04 , BME680_FILTER_COEFF_31 = 0x05 , BME680_FILTER_COEFF_63 = 0x06 , BME680_FILTER_COEFF_127 = 0x07
}
 bme680 filter enumeration definition More...
enum  bme680_spi_wire_t { BME680_SPI_WIRE_4 = 0x00 , BME680_SPI_WIRE_3 = 0x01 }
 bme680 spi wire enumeration definition More...

Functions

uint8_t bme680_info (bme680_info_t *info)
 get chip's information
uint8_t bme680_set_interface (bme680_handle_t *handle, bme680_interface_t interface)
 set the interface
uint8_t bme680_get_interface (bme680_handle_t *handle, bme680_interface_t *interface)
 get the interface
uint8_t bme680_set_addr_pin (bme680_handle_t *handle, bme680_address_t addr_pin)
 set the iic address pin
uint8_t bme680_get_addr_pin (bme680_handle_t *handle, bme680_address_t *addr_pin)
 get the iic address pin
uint8_t bme680_init (bme680_handle_t *handle)
 initialize the chip
uint8_t bme680_deinit (bme680_handle_t *handle)
 close the chip
uint8_t bme680_read (bme680_handle_t *handle, uint32_t *temperature_raw, float *temperature_c, uint32_t *pressure_raw, float *pressure_pa, uint32_t *humidity_raw, float *humidity_percentage, uint16_t *adc_raw, uint8_t *adc_range, float *ohms, uint8_t *index)
 read the temperature pressure humidity and gas resistance
uint8_t bme680_read_temperature_pressure_humidity (bme680_handle_t *handle, uint32_t *temperature_raw, float *temperature_c, uint32_t *pressure_raw, float *pressure_pa, uint32_t *humidity_raw, float *humidity_percentage)
 read the temperature pressure and humidity data
uint8_t bme680_read_pressure (bme680_handle_t *handle, uint32_t *pressure_raw, float *pressure_pa)
 read the pressure data
uint8_t bme680_read_temperature (bme680_handle_t *handle, uint32_t *temperature_raw, float *temperature_c)
 read the temperature data
uint8_t bme680_read_humidity (bme680_handle_t *handle, uint32_t *humidity_raw, float *humidity_percentage)
 read the humidity data
uint8_t bme680_read_gas_resistance (bme680_handle_t *handle, uint16_t *adc_raw, uint8_t *adc_range, float *ohms, uint8_t *index)
 read the gas resistance
uint8_t bme680_soft_reset (bme680_handle_t *handle)
 soft reset
uint8_t bme680_set_humidity_oversampling (bme680_handle_t *handle, bme680_oversampling_t oversampling)
 set humidity oversampling
uint8_t bme680_get_humidity_oversampling (bme680_handle_t *handle, bme680_oversampling_t *oversampling)
 get humidity oversampling
uint8_t bme680_set_temperature_oversampling (bme680_handle_t *handle, bme680_oversampling_t oversampling)
 set temperature oversampling
uint8_t bme680_get_temperature_oversampling (bme680_handle_t *handle, bme680_oversampling_t *oversampling)
 get temperature oversampling
uint8_t bme680_set_pressure_oversampling (bme680_handle_t *handle, bme680_oversampling_t oversampling)
 set pressure oversampling
uint8_t bme680_get_pressure_oversampling (bme680_handle_t *handle, bme680_oversampling_t *oversampling)
 get pressure oversampling
uint8_t bme680_set_mode (bme680_handle_t *handle, bme680_mode_t mode)
 set mode
uint8_t bme680_get_mode (bme680_handle_t *handle, bme680_mode_t *mode)
 get mode
uint8_t bme680_set_filter (bme680_handle_t *handle, bme680_filter_t filter)
 set filter
uint8_t bme680_get_filter (bme680_handle_t *handle, bme680_filter_t *filter)
 get filter
uint8_t bme680_set_spi_wire (bme680_handle_t *handle, bme680_spi_wire_t spi)
 set spi wire
uint8_t bme680_get_spi_wire (bme680_handle_t *handle, bme680_spi_wire_t *spi)
 get spi wire
uint8_t bme680_set_spi_wire_3_data_interrupt (bme680_handle_t *handle, bme680_bool_t enable)
 enable or disable spi wire3 data interrupt
uint8_t bme680_get_spi_wire_3_data_interrupt (bme680_handle_t *handle, bme680_bool_t *enable)
 get spi wire3 data interrupt status
uint8_t bme680_get_new_data_status (bme680_handle_t *handle, bme680_bool_t *enable)
 get new data status
uint8_t bme680_get_gas_measuring_status (bme680_handle_t *handle, bme680_bool_t *enable)
 get gas measuring status
uint8_t bme680_get_measuring_status (bme680_handle_t *handle, bme680_bool_t *enable)
 get measuring status
uint8_t bme680_get_gas_measuring_index (bme680_handle_t *handle, uint8_t *index)
 get gas measuring index
uint8_t bme680_get_gas_valid_status (bme680_handle_t *handle, bme680_bool_t *enable)
 get gas valid status
uint8_t bme680_get_heater_stability_status (bme680_handle_t *handle, bme680_bool_t *enable)
 get heater stability status
uint8_t bme680_set_heat_off (bme680_handle_t *handle, bme680_bool_t enable)
 enable or disable heat off
uint8_t bme680_get_heat_off (bme680_handle_t *handle, bme680_bool_t *enable)
 get heat off status
uint8_t bme680_set_run_gas (bme680_handle_t *handle, bme680_bool_t enable)
 enable or disable run gas
uint8_t bme680_get_run_gas (bme680_handle_t *handle, bme680_bool_t *enable)
 get run gas status
uint8_t bme680_set_convert_index (bme680_handle_t *handle, uint8_t index)
 set convert index
uint8_t bme680_get_convert_index (bme680_handle_t *handle, uint8_t *index)
 get convert index
uint8_t bme680_set_idac_heat (bme680_handle_t *handle, uint8_t index, uint8_t reg)
 set idac heat
uint8_t bme680_get_idac_heat (bme680_handle_t *handle, uint8_t index, uint8_t *reg)
 get idac heat
uint8_t bme680_set_resistance_heat (bme680_handle_t *handle, uint8_t index, uint8_t reg)
 set resistance heat
uint8_t bme680_get_resistance_heat (bme680_handle_t *handle, uint8_t index, uint8_t *reg)
 get resistance heat
uint8_t bme680_set_gas_wait (bme680_handle_t *handle, uint8_t index, uint8_t reg)
 set gas wait
uint8_t bme680_get_gas_wait (bme680_handle_t *handle, uint8_t index, uint8_t *reg)
 get gas wait
uint8_t bme680_resistance_heat_convert_to_register (bme680_handle_t *handle, float degree_celsius, uint8_t *reg)
 convert the resistance heat to the register raw data
uint8_t bme680_gas_wait_convert_to_register (bme680_handle_t *handle, uint16_t ms, uint8_t *reg)
 convert the gas wait to the register raw data
uint8_t bme680_idac_heat_convert_to_register (bme680_handle_t *handle, float ma, uint8_t *reg)
 convert the idac heat to the register raw data
uint8_t bme680_idac_heat_convert_to_data (bme680_handle_t *handle, uint8_t reg, float *ma)
 convert the register raw data to idac heat
uint8_t bme680_set_reg (bme680_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t bme680_get_reg (bme680_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 get the chip register

Detailed Description

driver bme680 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2025-07-15

history

Date Version Author Description
2025/07/15 1.0 Shifeng Li first upload

Definition in file driver_bme680.h.