M5Unit-IMU 0.0.2 git rev:e5b00aa
Loading...
Searching...
No Matches
unit_bmm350_data.hpp File Reference

BMM350 setting enums and measurement data (framework independent) More...

#include <array>
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Classes

struct  m5::unit::bmm350::otp_compensation_t
 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...
 
struct  m5::unit::bmm350::Data
 One measurement (12 bytes burst from REG_MAG_X_XLSB, register 0x31): 9 bytes magnetometer (X,Y,Z, 24bit little-endian each) followed by 3 bytes temperature (24bit little-endian) More...
 

Namespaces

namespace  m5
 Top level namespace of M5Stack.
 

Enumerations

enum class  m5::unit::bmm350::DataRate : uint8_t {
  Rate400Hz = 0x02 , Rate200Hz = 0x03 , Rate100Hz = 0x04 , Rate50Hz = 0x05 ,
  Rate25Hz = 0x06 , Rate12_5Hz = 0x07 , Rate6_25Hz = 0x08 , Rate3_125Hz = 0x09 ,
  Rate1_5625Hz = 0x0A
}
 Output data rate (REG_PMU_CMD_AGGR_SET register 0x04, bits[3:0]) More...
 
enum class  m5::unit::bmm350::Averaging : uint8_t { None , X2 , X4 , X8 }
 Averaging factor (REG_PMU_CMD_AGGR_SET register 0x04, bits[5:4]) More...
 

Functions

constexpr Averaging m5::unit::bmm350::clamp_averaging (const DataRate rate, const Averaging avg)
 Clamps avg to the combination the sensor accepts for the given rate (400Hz allows None only, 200Hz allows up to X2, 100Hz allows up to X4, X8 is only accepted at 50Hz or below)
 
constexpr int32_t m5::unit::bmm350::fix_sign24 (const uint32_t raw)
 Sign-extends a 24bit unsigned register value to a signed 32bit value.
 
constexpr float m5::unit::bmm350::lsb_to_ut_xy ()
 uT per LSB of the raw 24bit magnetometer value, X/Y axes
 
constexpr float m5::unit::bmm350::lsb_to_ut_z ()
 uT per LSB of the raw 24bit magnetometer value, Z axis
 
constexpr float m5::unit::bmm350::temp_res_raw24 ()
 degC per LSB of the raw 24bit temperature ADC value
 

Variables

constexpr float m5::unit::bmm350::TEMP_OFFSET {-25.49f}
 Fixed offset (degC) applied to the primary temperature conversion.
 

Detailed Description

BMM350 setting enums and measurement data (framework independent)

Enumeration Type Documentation

◆ Averaging

enum class m5::unit::bmm350::Averaging : uint8_t
strong

Averaging factor (REG_PMU_CMD_AGGR_SET register 0x04, bits[5:4])

Enumerator
None 

No averaging, 1 sample (LowPower)

X2 

2 samples averaged (Regular, power-on default)

X4 

4 samples averaged (LowNoise)

X8 

8 samples averaged (UltraLowNoise)

◆ DataRate

enum class m5::unit::bmm350::DataRate : uint8_t
strong

Output data rate (REG_PMU_CMD_AGGR_SET register 0x04, bits[3:0])

Enumerator
Rate400Hz 

400Hz

Rate200Hz 

200Hz

Rate100Hz 

100Hz (power-on default)

Rate50Hz 

50Hz

Rate25Hz 

25Hz

Rate12_5Hz 

12.5Hz

Rate6_25Hz 

6.25Hz

Rate3_125Hz 

3.125Hz

Rate1_5625Hz 

1.5625Hz