Due Ingegneri Ed Un Controllore / Giroscopio

Dependencies:   X_NUCLEO_COMMON

Dependents:   Giroscopio_main

Fork of X_NUCLEO_IKS01A1-f2df by Ant Robinson

Embed: (wiki syntax)

« Back to documentation index

GyroSensor Class Reference

GyroSensor Class Reference

An abstract class for a Gyroscope. More...

#include <GyroSensor.h>

Inherits GenericSensor.

Inherited by LSM6DS0, and LSM6DS3.

Public Member Functions

virtual int Get_G_Axes (int32_t *pData)=0
 Get current gyroscope angular rate X/Y/Z-axes values in standard data units [mdps].
virtual int Get_G_AxesRaw (int16_t *pData)=0
 Get current gyroscope raw data X/Y/Z-axes values in device sepcific LSB units.
virtual int Get_G_Sensitivity (float *pfData)=0
 Get gyroscope's current sensitivity [mdps/LSB].
virtual int Get_G_ODR (float *pfData)=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 *pfData)=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 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 Gyroscope.

Definition at line 49 of file GyroSensor.h.


Member Function Documentation

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

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

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

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

Parameters:
[out]pDataPointer to where to store gyroscope 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_G_FS ( float *  pfData ) [pure virtual]

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

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

Implemented in LSM6DS0, and LSM6DS3.

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

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

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

Implemented in LSM6DS0, and LSM6DS3.

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

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

Parameters:
[out]pfDataPointer to where the gyroscope'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_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 LSM6DS0, and LSM6DS3.

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 LSM6DS0, and LSM6DS3.