M5Unit-IMU 0.0.2 git rev:e5b00aa
Loading...
Searching...
No Matches
m5::unit::bmm350::otp_compensation_t Struct Reference

Per-chip OTP compensation coefficients (read out at boot from the sensor's one-time-programmable memory), consumed by compensate_temp() and compensate_mag(). All-zero (default-constructed, aside from t0) is a neutral / pass-through configuration. More...

#include <unit_bmm350_data.hpp>

Public Member Functions

float compensate_temp (const float t_raw) const
 Applies the OTP temperature compensation to a primary-converted temperature (degC)
 
void compensate_mag (float(&m)[3], const float t_comp) const
 Applies per-axis offset/sensitivity/tco/tcs and cross-axis compensation (in-place) to primary-converted uT values, given the already temperature-compensated value from compensate_temp()
 

Public Attributes

float t_sens {}
 Temperature sensitivity coefficient.
 
float t_offs {}
 Temperature offset coefficient.
 
float t0 {23.0f}
 Reference temperature (degC)
 
float offset [3] {}
 Per-axis (x,y,z) offset.
 
float sens [3] {}
 Per-axis (x,y,z) sensitivity coefficient.
 
float tco [3] {}
 Per-axis (x,y,z) temperature coefficient of offset.
 
float tcs [3] {}
 Per-axis (x,y,z) temperature coefficient of sensitivity.
 
float cross [4] {}
 Cross-axis coefficients: [0]=x_y [1]=y_x [2]=z_x [3]=z_y.
 

Detailed Description

Per-chip OTP compensation coefficients (read out at boot from the sensor's one-time-programmable memory), consumed by compensate_temp() and compensate_mag(). All-zero (default-constructed, aside from t0) is a neutral / pass-through configuration.

Formulas re-implemented (not copied) from the Bosch BMM350_SensorAPI (bmm350_get_compensated_mag_xyz_temp_data(), BSD-3-Clause), verified against https://github.com/boschsensortec/BMM350_SensorAPI/blob/main/bmm350.c