Shih-Ho Hsieh / Mbed 2 deprecated Motor_XYZ_UI_SPI_I2C_5mag

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

GyroSensor Class Reference

GyroSensor Class Reference

An abstract class for a Gyroscope. More...

#include <GyroSensor.h>

Inherits Component.

Inherited by LSM6DS33.

Public Member Functions

virtual int get_g_axes (int32_t *p_data)=0
 Get current gyroscope angular rate X/Y/Z-axes values in standard data units [mdps].
virtual int get_g_axes_raw (int16_t *p_data)=0
 Get current gyroscope raw data X/Y/Z-axes values in device sepcific LSB units.
virtual int get_g_sensitivity (float *pf_data)=0
 Get gyroscope's current sensitivity [mdps/LSB].
virtual int get_g_odr (float *pf_data)=0
 Get gyroscope's current output data rate [Hz].
virtual int set_g_odr (float odr)=0
 Set gyroscope's output data rate.
virtual int get_g_fs (float *pf_data)=0
 Get gyroscope's full scale value i.e. min/max measurable value [dps].
virtual int set_g_fs (float fs)=0
 Set gyroscope's full scale value i.e. min/max measurable value.
virtual ~GyroSensor ()
 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 Gyroscope.

Definition at line 56 of file GyroSensor.h.


Constructor & Destructor Documentation

virtual ~GyroSensor (  ) [virtual]

Destructor.

Definition at line 123 of file GyroSensor.h.


Member Function Documentation

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

Get current gyroscope angular rate X/Y/Z-axes values in standard data units [mdps].

Parameters:
[out]p_dataPointer to where to store angular rates 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_g_axes_raw ( int16_t *  p_data ) [pure virtual]

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

Parameters:
[out]p_dataPointer to where to store gyroscope 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_g_fs ( float *  pf_data ) [pure virtual]

Get gyroscope's full scale value i.e. min/max measurable value [dps].

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

Implemented in LSM6DS33.

virtual int get_g_odr ( float *  pf_data ) [pure virtual]

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

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

Implemented in LSM6DS33.

virtual int get_g_sensitivity ( float *  pf_data ) [pure virtual]

Get gyroscope's current sensitivity [mdps/LSB].

Parameters:
[out]pf_dataPointer to where the gyroscope'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]

Initializing the component.

Parameters:
[in]initpointer to device specific initalization structure.
Return values:
0in case of success, an error code otherwise.

Implemented in LIS3MDL, LPS25H, and LSM6DS33.

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.

Implemented in LIS3MDL, LPS25H, and LSM6DS33.

virtual int set_g_fs ( float  fs ) [pure virtual]

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

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

Implemented in LSM6DS33.

virtual int set_g_odr ( float  odr ) [pure virtual]

Set gyroscope's output data rate.

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

Implemented in LSM6DS33.