21 #define DEV_BME680_I2C_ADDR_PRIMARY 0x76 28 #define DEV_BME680_I2C_ADDR_SECONDARY 0x77 36 #define DEV_BME680_CHIP_ID 0x61 43 #define DEV_BME680_REG_CHIP_ID 0xD0u 51 #define DEV_BME680_REG_VARIANT_ID 0xF0u 59 #define DEV_BME680_REG_SOFT_RESET 0xE0u 66 #define DEV_BME680_REG_FIELD0 0x1Du 73 #define DEV_BME680_REG_RES_HEAT0 0x5Au 80 #define DEV_BME680_REG_GAS_WAIT0 0x64u 87 #define DEV_BME680_REG_CTRL_GAS_0 0x70u 94 #define DEV_BME680_REG_CTRL_GAS_1 0x71u 101 #define DEV_BME680_REG_CTRL_HUM 0x72u 108 #define DEV_BME680_REG_CTRL_MEAS 0x74u 115 #define DEV_BME680_REG_CONFIG 0x75u 122 #define DEV_BME680_REG_COEFF1 0x8Au 129 #define DEV_BME680_REG_COEFF2 0xE1u 136 #define DEV_BME680_REG_COEFF3 0x00u 144 #define DEV_BME680_SOFT_RESET_CMD 0xB6u 152 #define DEV_BME680_VARIANT_GAS_LOW 0x00u 160 #define DEV_BME680_VARIANT_GAS_HIGH 0x01u 177 dev_bme680_oversampling_skip = 0,
178 dev_bme680_oversampling_1x = 1,
179 dev_bme680_oversampling_2x = 2,
180 dev_bme680_oversampling_4x = 3,
181 dev_bme680_oversampling_8x = 4,
182 dev_bme680_oversampling_16x = 5,
191 dev_bme680_iir_filter_off = 0,
192 dev_bme680_iir_filter_1 = 1,
193 dev_bme680_iir_filter_3 = 2,
194 dev_bme680_iir_filter_7 = 3,
195 dev_bme680_iir_filter_15 = 4,
196 dev_bme680_iir_filter_31 = 5,
197 dev_bme680_iir_filter_63 = 6,
198 dev_bme680_iir_filter_127 = 7,
207 dev_bme680_heater_temp_200c = 200,
208 dev_bme680_heater_temp_250c = 250,
209 dev_bme680_heater_temp_300c = 300,
210 dev_bme680_heater_temp_320c = 320,
211 dev_bme680_heater_temp_350c = 350,
212 dev_bme680_heater_temp_400c = 400,
221 dev_bme680_heater_dur_50ms = 50,
222 dev_bme680_heater_dur_100ms = 100,
223 dev_bme680_heater_dur_120ms = 120,
224 dev_bme680_heater_dur_150ms = 150,
225 dev_bme680_heater_dur_200ms = 200,
234 dev_bme680_ambient_temp_0c = 0,
235 dev_bme680_ambient_temp_10c = 10,
236 dev_bme680_ambient_temp_20c = 20,
237 dev_bme680_ambient_temp_25c = 25,
238 dev_bme680_ambient_temp_30c = 30,
239 dev_bme680_ambient_temp_35c = 35,
240 dev_bme680_ambient_temp_40c = 40,
248 dev_bme680_gas_disabled = 0,
249 dev_bme680_gas_enabled = 1,
dev_bme680_iir_filter_t
IIR filter coefficient applied to BME680 temperature/pressure readings.
dev_bme680_ambient_temp_t
Ambient temperature used by the BME680 to compute gas heater control parameters, in degrees Celsius...
dev_bme680_iir_filter_t iir_filter
IIR filter coefficient.
struct hw_deviceio_t hw_deviceio_t
Opaque device I/O handle.
BME680 measurement values.
dev_bme680_gas_mode_t
Whether the BME680's gas heater is enabled.
BME680 runtime configuration.
dev_bme680_heater_duration_t
Gas heater conditioning duration for the BME680 gas sensor, in milliseconds.
float pressure_pa
Pressure in pascals.
dev_bme680_heater_temp_t
Target heater plate temperature for the BME680 gas sensor, in degrees Celsius.
float humidity_pct
Relative humidity in percent.
float temperature_c
Temperature in degrees Celsius.
float gas_resistance_ohms
Gas resistance in ohms.
struct dev_bme680_t dev_bme680_t
Opaque BME680 handle.
dev_bme680_oversampling_t os_temp
Temperature oversampling.
dev_bme680_ambient_temp_t ambient_temp_c
Ambient temperature, used by the heater resistance calculation.
Hardware abstraction headers for on-board peripherals.
bool dev_bme680_read(dev_bme680_t *bme680, dev_bme680_data_t *data)
Read sensor data from BME680.
uint32_t dev_bme680_measurement_duration_ms(const dev_bme680_config_t *config)
Calculate how long a measurement takes to complete for a given configuration.
dev_bme680_heater_temp_t heater_temp_c
Gas heater target temperature.
dev_bme680_oversampling_t os_hum
Humidity oversampling.
dev_bme680_heater_duration_t heater_duration_ms
Gas heater duration.
void dev_bme680_default_config(dev_bme680_config_t *config)
Fill a BME680 config struct with safe defaults.
dev_bme680_oversampling_t os_press
Pressure oversampling.
dev_bme680_t * dev_bme680_init(hw_deviceio_t *device, const dev_bme680_config_t *config)
Initialize a BME680 sensor.
void dev_bme680_deinit(dev_bme680_t *bme680)
Deinitialize a BME680 sensor.
uint8_t dev_bme680_chip_id(const dev_bme680_t *bme680)
Get the detected chip ID.
dev_bme680_oversampling_t
Oversampling rate for a BME680 measurement channel (temperature, pressure, or humidity).