19 #include "simpletools.h" 27 #if defined(__cplusplus) 38 #define FAHRENHEIT (1) 78 #ifndef BME680_OS_NONE 79 #define BME680_OS_NONE (0) 84 #define BME680_OS_1X (1) 89 #define BME680_OS_2X (2) 94 #define BME680_OS_4X (3) 99 #define BME680_OS_8X (4) 103 #ifndef BME680_OS_16X 104 #define BME680_OS_16X (5) 110 #ifndef BME680_FILTER_SIZE_0 111 #define BME680_FILTER_SIZE_0 (0) 115 #ifndef BME680_FILTER_SIZE_1 116 #define BME680_FILTER_SIZE_1 (1) 120 #ifndef BME680_FILTER_SIZE_3 121 #define BME680_FILTER_SIZE_3 (2) 125 #ifndef BME680_FILTER_SIZE_7 126 #define BME680_FILTER_SIZE_7 (3) 130 #ifndef BME680_FILTER_SIZE_15 131 #define BME680_FILTER_SIZE_15 (4) 135 #ifndef BME680_FILTER_SIZE_31 136 #define BME680_FILTER_SIZE_31 (5) 140 #ifndef BME680_FILTER_SIZE_63 141 #define BME680_FILTER_SIZE_63 (6) 145 #ifndef BME680_FILTER_SIZE_127 146 #define BME680_FILTER_SIZE_127 (7) 151 #ifndef BME680_SETTING_AMB_TEMP 152 #define BME680_SETTING_AMB_TEMP (0) 156 #ifndef BME680_SETTING_HEATER_TEMP 157 #define BME680_SETTING_HEATER_TEMP (1) 161 #ifndef BME680_SETTING_HEATER_DURATION 162 #define BME680_SETTING_HEATER_DURATION (2) 166 #ifndef BME680_SETTING_FILTER_SIZE 167 #define BME680_SETTING_FILTER_SIZE (3) 171 #ifndef BME680_SETTING_TEMP_SAMPLES 172 #define BME680_SETTING_TEMP_SAMPLES (4) 176 #ifndef BME680_SETTING_PRESSURE_SAMPLES 177 #define BME680_SETTING_PRESSURE_SAMPLES (5) 181 #ifndef BME680_SETTING_HUMIDITY_SAMPLES 182 #define BME680_SETTING_HUMIDITY_SAMPLES (6) 188 unsigned char dev_id;
195 unsigned short heater_temp;
196 unsigned char heater_duration;
197 unsigned char filter_size;
198 unsigned char temp_oversample;
199 unsigned char pres_oversample;
200 unsigned char hum_oversample;
201 short sensor_reading_period;
204 unsigned short par_h1;
205 unsigned short par_h2;
209 unsigned char par_h6;
214 unsigned short par_t1;
217 unsigned short par_p1;
226 unsigned char par_p10;
228 unsigned char res_heat_range;
233 unsigned char status;
234 unsigned char gas_index;
235 unsigned char meas_index;
240 float gas_resistance;
319 void bme680_write(
bme680_t *dev,
unsigned char reg_addr,
unsigned char *reg_data,
unsigned short len);
333 void bme680_read(
bme680_t *dev,
unsigned char reg_addr,
unsigned char *reg_data,
unsigned short len);
427 #if defined(__cplusplus) float bme680_gasResistance(bme680_t *dev)
Retrieve the relative humidity as a percentage from the last read of the BME680 device.
Definition: bme680_gasResistance.c:21
char bme680_loadSettings(bme680_t *dev)
Loads settings values that have been saved in the bme680_t structure into the BME680 sensor...
Definition: bme680_settings.c:21
void bme680_read(bme680_t *dev, unsigned char reg_addr, unsigned char *reg_data, unsigned short len)
Internal function used to write values to the specified registers of the BME680 sensor.
Definition: bme680_comms.c:21
void bme680_begin(bme680_t *dev)
Internal function used to set the values in the bme680_t structure to their default values...
Definition: bme680_begin.c:20
char bme680_readSensor(bme680_t *dev)
Instructs the BME680 sensor to take a reading. Readings take approximately 200ms and should be retir...
Definition: bme680_read.c:20
void bme680_heaterEnable(bme680_t *dev)
Allows the BME680 to send current to the heating element for its gas sensor.
Definition: bme680_heater.c:21
void bme680_configure(bme680_t *dev, char setting, int value)
Change configurable settings for the BME680 sensor.
Definition: bme680_settings.c:72
void bme680_close(bme680_t *dev)
Close and free the memory used by the bme680 device structure.
Definition: bme680_init.c:52
float bme680_pressure(bme680_t *dev, char unit)
Retrieve the temperature from the last read of the BME680 device.
Definition: bme680_pressure.c:20
void bme680_write(bme680_t *dev, unsigned char reg_addr, unsigned char *reg_data, unsigned short len)
Internal function used to read values from the specified registers of the BME680 sensor.
Definition: bme680_comms.c:36
bme680_t * bme680_openI2C(i2c *i2c_bus, char i2c_addr)
Initialize a BME680 sensor into i2c mode.
Definition: bme680_init.c:20
bme680_t * bme680_openSPI(char pin_sdo, char pin_clk, char pin_sdi, char pin_cs)
Initialize a BME680 sensor into 4-wire SPI mode.
Definition: bme680_init.c:35
float bme680_humidity(bme680_t *dev)
Retrieve the relative humidity as a percentage from the last read of the BME680 device.
Definition: bme680_humidity.c:21
float bme680_altitude(bme680_t *dev, char unit)
Retrieve the estimated altitude from the last read of the BME680 device.
Definition: bme680_altitude.c:20
float bme680_temperature(bme680_t *dev, char unit)
Retrieve the temperature from the last read of the BME680 device.
Definition: bme680_temperature.c:21
void bme680_heaterDisable(bme680_t *dev)
Turns off the current that the BME680 sends to the heating element for its gas sensor.
Definition: bme680_heater.c:30