AK8963 setting enums and measurement data (framework independent)
More...
#include <array>
#include <cstdint>
#include <cmath>
Go to the source code of this file.
|
| namespace | m5 |
| | Top level namespace of M5Stack.
|
| |
|
|
constexpr uint32_t | m5::unit::ak8963::interval_ms (const MeasurementMode mode) |
| | Sampling interval (ms) for a continuous measurement rate.
|
| |
|
constexpr uint8_t | m5::unit::ak8963::cntl1_value (const MeasurementMode mode, const OutputBit bit) |
| | REG_CNTL1 value entering a continuous measurement mode.
|
| |
|
|
constexpr float | m5::unit::ak8963::RAW_UT_PER_LSB {4912.0f / 32760.0f} |
| | 16bit-mode sensitivity (µT per raw LSB) = 4912/32760
|
| |
|
constexpr float | m5::unit::ak8963::RAW_UT_PER_LSB_14BIT {4912.0f / 8190.0f} |
| | 14bit-mode sensitivity (µT per raw LSB) = 4912/8190
|
| |
|
constexpr float | m5::unit::ak8963::OUTPUT_LSB_PER_UT {16.0f} |
| | Library-wide magnetometer output scale (raw LSB per µT); see imu_convert_param_t.
|
| |
AK8963 setting enums and measurement data (framework independent)
◆ MeasurementMode
Continuous measurement rate, the subset of Mode this driver measures in.
Mode itself is the raw CNTL1 nibble and includes states the driver owns (FuseRom backs the ASA read, PowerDown backs every mode transition), so only the two continuous rates are offered here. The difference is almost entirely power: a measurement draws 5mA for 7.2ms, so Cont100Hz (10ms period) is on nearly all the time while Cont8Hz (125ms) has a ~6% duty cycle
| Enumerator |
|---|
| Cont8Hz | Continuous measurement, 8Hz.
|
| Cont100Hz | Continuous measurement, 100Hz.
|
◆ Mode
CNTL1 (0x0A) low-nibble operating mode.
| Enumerator |
|---|
| PowerDown | Power-down.
|
| Single | Single measurement.
|
| Cont8Hz | Continuous measurement, 8Hz.
|
| Cont100Hz | Continuous measurement, 100Hz.
|
| SelfTest | Self test.
|
| FuseRom | FUSE-ROM access (ASA readable only here)
|
◆ OutputBit
Output bit width (CNTL1 bit4 BIT)
Full scale is +/-4912µT either way; only the resolution changes. 14bit output is sign-extended and right-aligned, so it needs no shifting – just the coarser sensitivity below
| Enumerator |
|---|
| Bit14 | 14bit (0.6µT/LSB)
|
| Bit16 | 16bit (0.15µT/LSB)
|