added the single measurement mode to the mgm helpers

This commit is contained in:
moleculixz 2024-10-25 14:45:40 +02:00
parent a1b6e2ff89
commit 6c2730b0df

View File

@ -28,6 +28,8 @@ static constexpr uint8_t CMM_REGISTER = 0x01;
static constexpr uint8_t CMM_VALUE = static constexpr uint8_t CMM_VALUE =
SET_CMM_CMZ | SET_CMM_CMY | SET_CMM_CMX | SET_CMM_DRDM | SET_CMM_START; SET_CMM_CMZ | SET_CMM_CMY | SET_CMM_CMX | SET_CMM_DRDM | SET_CMM_START;
static constexpr uint8_t DISABLE_CMM_MODE = 0;
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
/* Cycle count register */ /* Cycle count register */
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
@ -53,6 +55,9 @@ static constexpr uint8_t DATA_READY_VAL = 0b10000000;
static constexpr uint8_t STATUS_REGISTER = 0x34; static constexpr uint8_t STATUS_REGISTER = 0x34;
static constexpr uint8_t REVID_REGISTER = 0x36; static constexpr uint8_t REVID_REGISTER = 0x36;
static constexpr uint8_t POLL_REGISTER = 0;
static constexpr uint8_t POLL_ALL_AXES = 0x70;
// Range in Microtesla. 1 T equals 10000 Gauss (for comparison with LIS3 MGM) // Range in Microtesla. 1 T equals 10000 Gauss (for comparison with LIS3 MGM)
static constexpr uint16_t RANGE = 800; static constexpr uint16_t RANGE = 800;
@ -101,8 +106,16 @@ class CycleCountCommand : public SerialLinkedListAdapter<SerializeIF> {
static constexpr uint32_t MGM_DATASET_ID = READ_DATA; static constexpr uint32_t MGM_DATASET_ID = READ_DATA;
static constexpr uint8_t startSMM = 0;
static constexpr uint8_t readSMM = 1;
static constexpr uint8_t readCMM = 2;
enum MgmPoolIds : lp_id_t { FIELD_STRENGTHS }; enum MgmPoolIds : lp_id_t { FIELD_STRENGTHS };
enum MeasurementMode : uint8_t { SINGLE_MEASUREMENT_MODE , CONTINUOUS_MEASUREMENT_MODE};
class Rm3100PrimaryDataset : public StaticLocalDataSet<3> { class Rm3100PrimaryDataset : public StaticLocalDataSet<3> {
public: public:
Rm3100PrimaryDataset(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, MGM_DATASET_ID) {} Rm3100PrimaryDataset(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, MGM_DATASET_ID) {}