SensorType
Enumeration of sensor types.
@ MAGNETOMETER
Magnetometer sensor.
OperationMode
Enumeration of sensor operation modes.
MagFullScaleRange
Enumeration defining full-scale range settings for the sensor.
MagDownSampleRatio
Enumeration defining down-sample ratios for the sensor.
MagOverSampleRatio
Enumeration defining over-sample ratios for the sensor.
virtual bool setOutputDataRate(float odr)=0
Sets the output data rate for the magnetometer.
bool readData(MagnetometerData &data) override=0
Checks if new data is available from the magnetometer.
virtual bool setDownsamplingRate(MagDownSampleRatio dsr)=0
Sets the downsampling rate for the magnetometer.
MagnetometerBase()
Constructor for the MagnetometerBase class.
virtual uint16_t getOversamplingRate() const
Gets the oversampling rate for the magnetometer.
virtual bool setFullScaleRange(MagFullScaleRange range)=0
Sets the full-scale range for the magnetometer.
virtual bool configMagnetometer(OperationMode mode, MagFullScaleRange range, float data_rate_hz, MagOverSampleRatio osr, MagDownSampleRatio dsr)=0
Configures the magnetometer with the specified settings.
virtual bool setOperationMode(OperationMode mode)=0
Sets the operation mode for the magnetometer.
virtual ~MagnetometerBase()=default
Destructor for the MagnetometerBase class.
virtual float getFullScaleRange() const
Gets the full-scale range for the magnetometer.
uint16_t _oversampling_rate
bool reset() override=0
Resets the magnetometer to its default settings.
virtual float getDeclinationDeg() const
Get the currently set magnetic declination in degrees.
virtual bool setOversamplingRate(MagOverSampleRatio osr)=0
Sets the oversampling rate for the magnetometer.
virtual void setDeclination(float declination_deg)
Set the magnetic declination correction value.
bool isDataReady() override=0
Checks if new data is available from the magnetometer.
virtual OperationMode getOperationMode() const
Gets the operation mode for the magnetometer.
bool selfTest() override=0
Performs a self-test on the magnetometer.
virtual float getDeclinationRad() const
Get the currently set magnetic declination in radians.
Template base class for all sensor implementations.
SensorConfig _config
Current configuration.
Structure representing magnetometer data.
float range
Measurement range.
OperationMode mode
Operation mode.