pub struct Celsius(pub f32);Expand description
Temperature in degrees Celsius.
Tuple Fields§
§0: f32Implementations§
Source§impl Celsius
impl Celsius
Sourcepub fn to_raw(self) -> Option<i16>
Available on crate feature libm only.
pub fn to_raw(self) -> Option<i16>
libm only.Convert a physical temperature back to the raw 16-bit ADC code.
Inverse of Celsius::from_raw; follows TI datasheet §6.5.2.2
Equation 12 solved for T_ADC_T:
raw = round((T − T_SENS_T0) / T_ADC_RES_INV + T_ADC_T0).
Returns None if self is non-finite or the rounded result
overflows i16.
Trait Implementations§
Source§impl PartialOrd for Celsius
impl PartialOrd for Celsius
impl Copy for Celsius
impl StructuralPartialEq for Celsius
Auto Trait Implementations§
impl Freeze for Celsius
impl RefUnwindSafe for Celsius
impl Send for Celsius
impl Sync for Celsius
impl Unpin for Celsius
impl UnsafeUnpin for Celsius
impl UnwindSafe for Celsius
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