Dependencies:   X_NUCLEO_COMMON

Embed: (wiki syntax)

« Back to documentation index

MagneticSensor Class Reference

MagneticSensor Class Reference

An abstract class for a magnetometer. More...

#include <MagneticSensor.h>

Inherits GenericSensor.

Inherited by LIS3MDL.

Public Member Functions

virtual int Get_M_Axes (int32_t *pData)=0
 Get current magnetometer magnetic X/Y/Z-axes values in standard data units [mgauss].
virtual int Get_M_AxesRaw (int16_t *pData)=0
 Get current magnetometer raw data X/Y/Z-axes values in device sepcific LSB units.
virtual int Init (void *ptr)=0
 Initialization of sensor.
virtual int ReadID (uint8_t *id)=0
 Get ID of sensor.

Detailed Description

An abstract class for a magnetometer.

Definition at line 49 of file MagneticSensor.h.


Member Function Documentation

virtual int Get_M_Axes ( int32_t *  pData ) [pure virtual]

Get current magnetometer magnetic X/Y/Z-axes values in standard data units [mgauss].

Parameters:
[out]pDataPointer to where to store magnetic values to. pData must point to an array of (at least) three elements, where: pData[0] corresponds to X-axis, pData[1] corresponds to Y-axis, and pData[2] corresponds to Z-axis.
Returns:
0 in case of success, an error code otherwise

Implemented in LIS3MDL.

virtual int Get_M_AxesRaw ( int16_t *  pData ) [pure virtual]

Get current magnetometer raw data X/Y/Z-axes values in device sepcific LSB units.

Parameters:
[out]pDataPointer to where to store magnetometer raw data to. pData must point to an array of (at least) three elements, where: pData[0] corresponds to X-axis, pData[1] corresponds to Y-axis, and pData[2] corresponds to Z-axis.
Returns:
0 in case of success, an error code otherwise

Implemented in LIS3MDL.

virtual int Init ( void *  ptr ) [pure virtual, inherited]

Initialization of sensor.

Parameters:
[out]ptrPointer to device specific initalization structure
Returns:
0 in case of success, an error code otherwise

Implemented in HTS221, LIS3MDL, LPS25H, LSM6DS0, and LSM6DS3.

virtual int ReadID ( uint8_t *  id ) [pure virtual, inherited]

Get ID of sensor.

Parameters:
[out]idPointer to where to store the ID to
Returns:
0 in case of success, an error code otherwise

Implemented in HTS221, LIS3MDL, LPS25H, LSM6DS0, and LSM6DS3.