|
M5Unit-IMU 0.0.2 git rev:e5b00aa
|
MAG3110 setting enums and measurement data (framework independent) More...
#include <array>#include <cstdint>#include <cmath>Go to the source code of this file.
Classes | |
| struct | m5::unit::mag3110::Data |
| One MAG3110 sample: a 7-byte burst from DR_STATUS (0x00) More... | |
Namespaces | |
| namespace | m5 |
| Top level namespace of M5Stack. | |
Enumerations | |
| enum class | m5::unit::mag3110::DataRate : uint8_t { Rate80Hz , Rate40Hz , Rate20Hz , Rate10Hz , Rate5Hz , Rate2_5Hz , Rate1_25Hz , Rate0_63Hz } |
| Output data rate select (REG_CTRL_REG1 DR[7:5]) More... | |
| enum class | m5::unit::mag3110::OverSampling : uint8_t { X16 , X32 , X64 , X128 } |
| Over sampling ratio (REG_CTRL_REG1 OS[4:3]) More... | |
Functions | |
| constexpr uint32_t | m5::unit::mag3110::output_rate_mhz (const DataRate rate, const OverSampling os) |
| Effective output rate in milli-Hz. | |
| constexpr uint32_t | m5::unit::mag3110::interval_ms (const DataRate rate, const OverSampling os) |
| Sampling interval (ms) for a rate/oversampling pair, rounded up. | |
| constexpr uint8_t | m5::unit::mag3110::ctrl_reg1_active (const DataRate rate, const OverSampling os) |
| REG_CTRL_REG1 value entering continuous ACTIVE measurement (FR and TM left at 0) | |
MAG3110 setting enums and measurement data (framework independent)
|
strong |
Output data rate select (REG_CTRL_REG1 DR[7:5])
Each value is named after the output rate it gives at OverSampling::X16, which is how the datasheet labels them (Table 32); a larger oversampling ratio divides that down. DR on its own fixes the ADC rate and with it the supply current, from 900µA at Rate80Hz to 8.6µA at Rate0_63Hz
|
strong |
Over sampling ratio (REG_CTRL_REG1 OS[4:3])
OS on its own fixes the noise floor: 0.40µT rms at X16 down to 0.25µT rms at X128. It also divides the output rate, so most output rates are reachable from several DataRate/OverSampling pairs whose current and noise differ widely – 10Hz for instance is available at 900/550/275/137.5µA with 0.25/0.30/0.35/0.40µT rms. That trade-off is why the two fields are exposed separately
| Enumerator | |
|---|---|
| X16 | 16x (0.40µT rms) |
| X32 | 32x (0.35µT rms) |
| X64 | 64x (0.30µT rms) |
| X128 | 128x (0.25µT rms) |
|
constexpr |
Sampling interval (ms) for a rate/oversampling pair, rounded up.
|
constexpr |
Effective output rate in milli-Hz.
Oversampling divides the DataRate's rate, exactly as datasheet Table 32 tabulates it