Expose gas_valid and heat_stab
The BME680 datasheet recommends to check these values to ensure that a gas reading is valid. To do so, they must be exposed by the library.
This commit is contained in:
parent
500dbd9811
commit
f531e617d6
1 changed files with 13 additions and 0 deletions
13
src/lib.rs
13
src/lib.rs
|
@ -334,6 +334,19 @@ impl FieldData {
|
|||
pub fn gas_resistance_ohm(&self) -> u32 {
|
||||
self.gas_resistance
|
||||
}
|
||||
|
||||
/// Whether a real (and not a dummy) gas reading was performed.
|
||||
pub fn gas_valid(&self) -> bool {
|
||||
self.status & BME680_GASM_VALID_MSK != 0
|
||||
}
|
||||
|
||||
/// Whether the heater target temperature for the gas reading was reached.
|
||||
///
|
||||
/// If this values is `false`, the heating duration was likely too short or
|
||||
/// the target temperature too high.
|
||||
pub fn heat_stable(&self) -> bool {
|
||||
self.status & BME680_HEAT_STAB_MSK != 0
|
||||
}
|
||||
}
|
||||
|
||||
/// Shows if new data is available
|
||||
|
|
Loading…
Reference in a new issue