Skip to main content

CalibrationData

Struct CalibrationData 

Source
pub struct CalibrationData {
Show 26 fields pub par_h1: u16, pub par_h2: u16, pub par_h3: i8, pub par_h4: i8, pub par_h5: i8, pub par_h6: u8, pub par_h7: i8, pub par_gh1: i8, pub par_gh2: i16, pub par_gh3: i8, pub par_t1: u16, pub par_t2: i16, pub par_t3: i8, pub par_p1: u16, pub par_p2: i16, pub par_p3: i8, pub par_p4: i16, pub par_p5: i16, pub par_p6: i8, pub par_p7: i8, pub par_p8: i16, pub par_p9: i16, pub par_p10: u8, pub res_heat_range: u8, pub res_heat_val: i8, pub range_sw_err: i8, /* private fields */
}
Expand description

Factory calibration coefficients read from the sensor.

The fields intentionally mirror Bosch’s bme68x_calib_data names so that values and differential-test vectors can be compared without translation.

Fields§

§par_h1: u16

Humidity calibration coefficient H1.

§par_h2: u16

Humidity calibration coefficient H2.

§par_h3: i8

Humidity calibration coefficient H3.

§par_h4: i8

Humidity calibration coefficient H4.

§par_h5: i8

Humidity calibration coefficient H5.

§par_h6: u8

Humidity calibration coefficient H6.

§par_h7: i8

Humidity calibration coefficient H7.

§par_gh1: i8

Gas-heater calibration coefficient GH1.

§par_gh2: i16

Gas-heater calibration coefficient GH2.

§par_gh3: i8

Gas-heater calibration coefficient GH3.

§par_t1: u16

Temperature calibration coefficient T1.

§par_t2: i16

Temperature calibration coefficient T2.

§par_t3: i8

Temperature calibration coefficient T3.

§par_p1: u16

Pressure calibration coefficient P1.

§par_p2: i16

Pressure calibration coefficient P2.

§par_p3: i8

Pressure calibration coefficient P3.

§par_p4: i16

Pressure calibration coefficient P4.

§par_p5: i16

Pressure calibration coefficient P5.

§par_p6: i8

Pressure calibration coefficient P6.

§par_p7: i8

Pressure calibration coefficient P7.

§par_p8: i16

Pressure calibration coefficient P8.

§par_p9: i16

Pressure calibration coefficient P9.

§par_p10: u8

Pressure calibration coefficient P10.

§res_heat_range: u8

Heater resistance range coefficient.

§res_heat_val: i8

Heater resistance value coefficient.

§range_sw_err: i8

Gas range switching-error coefficient.

Implementations§

Source§

impl CalibrationData

Source

pub fn from_register_bytes(bytes: &[u8; 42]) -> Self

Parses the concatenated 42 bytes from Bosch’s three calibration blocks.

Source

pub fn from_register_blocks( block_1: &[u8; 23], block_2: &[u8; 14], block_3: &[u8; 5], ) -> Self

Parses the three discontiguous calibration register blocks.

Source

pub const fn temperature_fine(&self) -> i32

Returns the current Bosch t_fine compensation intermediate.

Source

pub fn canonical_coefficient_bytes(&self) -> [u8; 42]

Encode the immutable factory coefficients in Bosch’s canonical 42-byte register-block layout.

Reserved bytes and unused bits are zeroed. The mutable t_fine compensation intermediate is deliberately excluded, so the result is stable before and after measurements and can identify sensor changes.

Source

pub fn coefficient_fingerprint(&self) -> u64

Stable FNV-1a 64-bit fingerprint of the normalized coefficients.

Prefer the driver’s calibration_fingerprint() method when the exact raw calibration register image is available. This normalized helper is useful for coefficient comparisons, but intentionally omits reserved register bits and bytes.

Trait Implementations§

Source§

impl Clone for CalibrationData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CalibrationData

Source§

impl Debug for CalibrationData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CalibrationData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CalibrationData

Available on crate feature serde only.
Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for CalibrationData

Source§

impl Format for CalibrationData

Available on crate feature defmt only.
Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl From<&CalibrationData> for FloatCalibrationData

Available on crate feature float only.
Source§

fn from(coefficients: &CalibrationData) -> Self

Converts to this type from the input type.
Source§

impl From<CalibrationData> for FloatCalibrationData

Available on crate feature float only.
Source§

fn from(coefficients: CalibrationData) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for CalibrationData

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for CalibrationData

Available on crate feature serde only.
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CalibrationData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.