Skip to content
Snippets Groups Projects
Commit 0f882940 authored by Daniel Friesel's avatar Daniel Friesel
Browse files

BME680: Add .configure helper function

parent e6a319dc
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment