added raw value getters to avoid f32 on eg cortex m0

This commit is contained in:
shufps 2024-07-06 09:28:43 +02:00
parent 64e5c06c83
commit 59bfc207da

View file

@ -255,6 +255,21 @@ impl FieldData {
self.humidity as f32 / 1000f32 self.humidity as f32 / 1000f32
} }
/// Temperature in degree celsius (°C)
pub fn temperature_celsius_raw(&self) -> i16 {
self.temperature
}
/// Pressure in hectopascal (hPA)
pub fn pressure_hpa_raw(&self) -> u32 {
self.pressure
}
/// Humidity in % relative humidity
pub fn humidity_percent_raw(&self) -> u32 {
self.humidity
}
pub fn gas_resistance_ohm(&self) -> u32 { pub fn gas_resistance_ohm(&self) -> u32 {
self.gas_resistance self.gas_resistance
} }