pub struct TemperatureOffset { /* private fields */ }Expand description
Temperature offset parameters to compensate temperature effects of the sensor’s design-in
using:
T_Ambient_Compensated = T_Ambient + (slope * T_Ambient) + offset
Up to 5 temperature offsets can be stored.
Implementations§
Source§impl TemperatureOffset
impl TemperatureOffset
Sourcepub fn new(
offset: i16,
slope: i16,
time_constant: u16,
slot: u16,
) -> Result<Self, DataError>
pub fn new( offset: i16, slope: i16, time_constant: u16, slot: u16, ) -> Result<Self, DataError>
Creates a new TemperatureOffset configuration with the given scaled parameters:
offset: Constant temperature offset in °C. Applied scale factor: 200slope: Normalized temperature offset slope. Applied scale factor: 10,000time_constant: Time constant determining how fast the new slope and offset are applied.slot: Temperature offset slot to modify. Available slots range from 0 to 4.
§Errors
ValueOutOfRange`: If the values with scaling are not in range.
Trait Implementations§
Source§impl From<TemperatureOffset> for [u16; 4]
impl From<TemperatureOffset> for [u16; 4]
Source§fn from(value: TemperatureOffset) -> Self
fn from(value: TemperatureOffset) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TemperatureOffset
impl RefUnwindSafe for TemperatureOffset
impl Send for TemperatureOffset
impl Sync for TemperatureOffset
impl Unpin for TemperatureOffset
impl UnwindSafe for TemperatureOffset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more