Jamie Satchell / Mbed OS JSatchell_SOFT253ReferredCoursework

Dependencies:   X_NUCLEO_COMMON

Fork of ReferredCoursework2016 by Stage-1 Students SoCEM

Embed: (wiki syntax)

« Back to documentation index

MotionSensor Class Reference

MotionSensor Class Reference

An abstract class for an Accelerometer. More...

#include <MotionSensor.h>

Inherits GenericSensor.

Inherited by LSM6DS0, and LSM6DS3.

Public Member Functions

virtual int Get_X_Axes (int32_t *pData)=0
 Get current accelerometer linear acceleration X/Y/Z-axes values in standard data units [mg].
virtual int Get_X_AxesRaw (int16_t *pData)=0
 Get current accelerometer raw data X/Y/Z-axes values in device sepcific LSB units.
virtual int Get_X_Sensitivity (float *pfData)=0
 Get accelerometer's current sensitivity [mg/LSB].
virtual int Get_X_ODR (float *pfData)=0
 Get accelerometer's current output data rate [Hz].
virtual int Set_X_ODR (float odr)=0
 Set accelerometer's output data rate.
virtual int Get_X_FS (float *pfData)=0
 Get accelerometer's full scale value i.e. min/max measurable value [g].
virtual int Set_X_FS (float fs)=0
 Set accelerometer's full scale value i.e. min/max measurable value.
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 an Accelerometer.

Definition at line 49 of file MotionSensor.h.


Member Function Documentation

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

Get current accelerometer linear acceleration X/Y/Z-axes values in standard data units [mg].

Parameters:
[out]pDataPointer to where to store linear accelerations 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 LSM6DS0, and LSM6DS3.

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

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

Parameters:
[out]pDataPointer to where to store accelerometer 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 LSM6DS0, and LSM6DS3.

virtual int Get_X_FS ( float *  pfData ) [pure virtual]

Get accelerometer's full scale value i.e. min/max measurable value [g].

Parameters:
[out]pfDataPointer to where the accelerometer full scale value is stored to
Returns:
0 in case of success, an error code otherwise

Implemented in LSM6DS0, and LSM6DS3.

virtual int Get_X_ODR ( float *  pfData ) [pure virtual]

Get accelerometer's current output data rate [Hz].

Parameters:
[out]pfDataPointer to where the accelerometer output data rate is stored to
Returns:
0 in case of success, an error code otherwise

Implemented in LSM6DS0, and LSM6DS3.

virtual int Get_X_Sensitivity ( float *  pfData ) [pure virtual]

Get accelerometer's current sensitivity [mg/LSB].

Parameters:
[out]pfDataPointer to where the accelerometer's sensitivity is stored to
Returns:
0 in case of success, an error code otherwise

Implemented in LSM6DS0, and LSM6DS3.

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.

virtual int Set_X_FS ( float  fs ) [pure virtual]

Set accelerometer's full scale value i.e. min/max measurable value.

Parameters:
[in]fsNew full scale value for accelerometer in [g]
Returns:
0 in case of success, an error code otherwise

Implemented in LSM6DS0, and LSM6DS3.

virtual int Set_X_ODR ( float  odr ) [pure virtual]

Set accelerometer's output data rate.

Parameters:
[in]odrNew value for accelerometer's output data rate in [Hz]
Returns:
0 in case of success, an error code otherwise

Implemented in LSM6DS0, and LSM6DS3.