Official interfaces for ST components.

Dependents:   X_NUCLEO_IKS01A1 mDot_X_NUCLEO_IKS01A1 53L0A1 X_NUCLEO_IKS01A1 ... more

Fork of ST_INTERFACES by Davide Aliprandi

Embed: (wiki syntax)

« Back to documentation index

MagneticSensor Class Reference

MagneticSensor Class Reference

An abstract class for a magnetometer. More...

#include <MagneticSensor.h>

Inherits Component.

Public Member Functions

virtual int get_m_axes (int32_t *p_data)=0
 Get current magnetometer magnetic X/Y/Z-axes values in standard data units [mgauss].
virtual int get_m_axes_raw (int16_t *p_data)=0
 Get current magnetometer raw data X/Y/Z-axes values in device sepcific LSB units.
virtual ~MagneticSensor ()
 Destructor.
virtual int init (void *init)=0
 Initializing the component.
virtual int read_id (uint8_t *id)=0
 Getting the ID of the component.

Detailed Description

An abstract class for a magnetometer.

Definition at line 56 of file MagneticSensor.h.


Constructor & Destructor Documentation

virtual ~MagneticSensor (  ) [virtual]

Destructor.

Definition at line 86 of file MagneticSensor.h.


Member Function Documentation

virtual int get_m_axes ( int32_t *  p_data ) [pure virtual]

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

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

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

Parameters:
[out]p_dataPointer to where to store magnetometer raw data to. p_data must point to an array of (at least) three elements, where: p_data[0] corresponds to X-axis, p_data[1] corresponds to Y-axis, and p_data[2] corresponds to Z-axis.
Returns:
0 in case of success, an error code otherwise
virtual int init ( void *  init ) [pure virtual, inherited]

Initializing the component.

Parameters:
[in]initpointer to device specific initalization structure.
Return values:
0in case of success, an error code otherwise.
virtual int read_id ( uint8_t *  id ) [pure virtual, inherited]

Getting the ID of the component.

Parameters:
[out]idpointer to an allocated variable to store the ID into.
Return values:
0in case of success, an error code otherwise.