diff options
-rw-r--r-- | include/driver/bme680.h | 9 | ||||
-rw-r--r-- | model/driver/bme680.dfa | 24 |
2 files changed, 33 insertions, 0 deletions
diff --git a/include/driver/bme680.h b/include/driver/bme680.h index a054afd..acf6059 100644 --- a/include/driver/bme680.h +++ b/include/driver/bme680.h @@ -451,6 +451,15 @@ class BME680 { */
int8_t getSensorSettings(uint16_t desired_settings);
+ inline void configure(uint8_t os_hum, uint8_t os_pres, uint8_t os_temp, uint8_t run_gas, uint16_t heatr_dur, uint16_t heatr_temp) {
+ tph_sett.os_hum = os_hum;
+ tph_sett.os_pres = os_pres;
+ tph_sett.os_temp = os_temp;
+ gas_sett.run_gas = run_gas;
+ gas_sett.heatr_dur = heatr_dur;
+ gas_sett.heatr_temp = heatr_temp;
+ }
+
inline void setHumidityOversampling(uint8_t os) {
tph_sett.os_hum = os;
}
diff --git a/model/driver/bme680.dfa b/model/driver/bme680.dfa index 72061ce..69e1c63 100644 --- a/model/driver/bme680.dfa +++ b/model/driver/bme680.dfa @@ -136,6 +136,28 @@ transition: - name: degc values: [100, 150, 200, 250, 300] parameter: heater_temperature_degc + configure: + src: [SLEEP, SLEEP_PENDING_ATTR] + dst: SLEEP_PENDING_ATTR + arguments: + - name: os_hum + values: ['BME680_OS_NONE', 'BME680_OS_1X', 'BME680_OS_2X', 'BME680_OS_4X', 'BME680_OS_8X', 'BME680_OS_16X'] + parameter: humidity_oversampling + - name: os_pres + values: ['BME680_OS_NONE', 'BME680_OS_1X', 'BME680_OS_2X', 'BME680_OS_4X', 'BME680_OS_8X', 'BME680_OS_16X'] + parameter: pressure_oversampling + - name: os_temp + values: ['BME680_OS_NONE', 'BME680_OS_1X', 'BME680_OS_2X', 'BME680_OS_4X', 'BME680_OS_8X', 'BME680_OS_16X'] + parameter: temperature_oversampling + - name: run_gas + values: ['BME680_DISABLE_GAS_MEAS', 'BME680_ENABLE_GAS_MEAS'] + parameter: gas_enabled + - name: heatr_dur + values: [10, 30, 60, 100, 150, 200] + parameter: heater_duration_ms + - name: heatr_temp + values: [100, 150, 200, 250, 300] + parameter: heater_temperature_degc setSensorSettings: src: [SLEEP_PENDING_ATTR] dst: SLEEP @@ -145,6 +167,8 @@ transition: setSensorMode: src: [SLEEP] dst: FORCED + codegen: + delay_after_ms: 500 getSensorData: src: [FORCED] dst: SLEEP |