Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Motor_XYZ_UI_SPI_I2C_5mag by
MotionSensor Class Reference
An abstract class for an Accelerometer. More...
#include <MotionSensor.h>
Inherits Component.
Inherited by LSM6DS33.
Public Member Functions | |
virtual int | get_x_axes (int32_t *p_data)=0 |
Get current accelerometer linear acceleration X/Y/Z-axes values in standard data units [mg]. | |
virtual int | get_x_axes_raw (int16_t *p_data)=0 |
Get current accelerometer raw data X/Y/Z-axes values in device sepcific LSB units. | |
virtual int | get_x_sensitivity (float *pf_data)=0 |
Get accelerometer's current sensitivity [mg/LSB]. | |
virtual int | get_x_odr (float *pf_data)=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 *pf_data)=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 | ~MotionSensor () |
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 an Accelerometer.
Definition at line 56 of file MotionSensor.h.
Constructor & Destructor Documentation
virtual ~MotionSensor | ( | ) | [virtual] |
Destructor.
Definition at line 123 of file MotionSensor.h.
Member Function Documentation
virtual int get_x_axes | ( | int32_t * | p_data ) | [pure virtual] |
Get current accelerometer linear acceleration X/Y/Z-axes values in standard data units [mg].
- Parameters:
-
[out] p_data Pointer to where to store linear accelerations 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
Implemented in LSM6DS33.
virtual int get_x_axes_raw | ( | int16_t * | p_data ) | [pure virtual] |
Get current accelerometer raw data X/Y/Z-axes values in device sepcific LSB units.
- Parameters:
-
[out] p_data Pointer to where to store accelerometer 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
Implemented in LSM6DS33.
virtual int get_x_fs | ( | float * | pf_data ) | [pure virtual] |
Get accelerometer's full scale value i.e. min/max measurable value [g].
- Parameters:
-
[out] pf_data Pointer to where the accelerometer full scale value is stored to
- Returns:
- 0 in case of success, an error code otherwise
Implemented in LSM6DS33.
virtual int get_x_odr | ( | float * | pf_data ) | [pure virtual] |
Get accelerometer's current output data rate [Hz].
- Parameters:
-
[out] pf_data Pointer to where the accelerometer output data rate is stored to
- Returns:
- 0 in case of success, an error code otherwise
Implemented in LSM6DS33.
virtual int get_x_sensitivity | ( | float * | pf_data ) | [pure virtual] |
Get accelerometer's current sensitivity [mg/LSB].
- Parameters:
-
[out] pf_data Pointer to where the accelerometer's sensitivity is stored to
- Returns:
- 0 in case of success, an error code otherwise
Implemented in LSM6DS33.
virtual int init | ( | void * | init ) | [pure virtual, inherited] |
virtual int read_id | ( | uint8_t * | id ) | [pure virtual, inherited] |
virtual int set_x_fs | ( | float | fs ) | [pure virtual] |
Set accelerometer's full scale value i.e. min/max measurable value.
- Parameters:
-
[in] fs New full scale value for accelerometer in [g]
- Returns:
- 0 in case of success, an error code otherwise
Implemented in LSM6DS33.
virtual int set_x_odr | ( | float | odr ) | [pure virtual] |
Set accelerometer's output data rate.
- Parameters:
-
[in] odr New value for accelerometer's output data rate in [Hz]
- Returns:
- 0 in case of success, an error code otherwise
Implemented in LSM6DS33.
Generated on Fri Jul 15 2022 03:22:25 by
