using enum for sensitivity now
This commit is contained in:
@ -8,19 +8,29 @@
|
||||
|
||||
namespace MGMLIS3MDL {
|
||||
|
||||
enum set {
|
||||
enum Set {
|
||||
ON, OFF
|
||||
};
|
||||
enum opMode {
|
||||
enum OpMode {
|
||||
LOW, MEDIUM, HIGH, ULTRA
|
||||
};
|
||||
|
||||
enum Sensitivies: uint8_t {
|
||||
GAUSS_4 = 4,
|
||||
GAUSS_8 = 8,
|
||||
GAUSS_12 = 12,
|
||||
GAUSS_16 = 16
|
||||
};
|
||||
|
||||
/* Actually 15, we just round up a bit */
|
||||
static constexpr size_t MAX_BUFFER_SIZE = 16;
|
||||
|
||||
/* Field data register scaling */
|
||||
static constexpr uint8_t GAUSS_TO_MICROTESLA_FACTOR = 100;
|
||||
static constexpr uint16_t FIELD_LSB_PER_GAUSS = 27368;
|
||||
static constexpr float FIELD_LSB_PER_GAUSS_4_SENS = 1.0 / 6842.0;
|
||||
static constexpr float FIELD_LSB_PER_GAUSS_8_SENS = 1.0 / 3421.0;
|
||||
static constexpr float FIELD_LSB_PER_GAUSS_12_SENS = 1.0 / 2281.0;
|
||||
static constexpr float FIELD_LSB_PER_GAUSS_16_SENS = 1.0 / 1711.0;
|
||||
|
||||
static const DeviceCommandId_t READ_CONFIG_AND_DATA = 0x00;
|
||||
static const DeviceCommandId_t SETUP_MGM = 0x01;
|
||||
|
Reference in New Issue
Block a user