Files | Data Structures | Typedefs | Enumerations | Functions

Virtual Gravity sensor on BMI160. More...

+ Collaboration diagram for Gravity:

Files

file  BCDS_Gravity.h
 

Data Structures

struct  Gravity_XyzGData_S
 
struct  Gravity_XyzLsbData_S
 
struct  Gravity_XyzMps2Data_S
 

Typedefs

typedef float Gravity_GData_T
 
typedef void * Gravity_HandlePtr_T
 
typedef int32_t Gravity_LsbData_T
 
typedef float Gravity_Mps2Data_T
 
typedef enum Gravity_Status_E Gravity_Status_T
 
typedef enum Gravity_Status_EGravity_StatusPtr_T
 
typedef struct Gravity_XyzGData_S Gravity_XyzGData_T
 
typedef struct Gravity_XyzGData_SGravity_XyzGDataPtr_T
 
typedef struct Gravity_XyzLsbData_S Gravity_XyzLsbData_T
 
typedef struct
Gravity_XyzLsbData_S
Gravity_XyzLsbDataPtr_T
 
typedef struct
Gravity_XyzMps2Data_S 
Gravity_XyzMps2Data_T
 
typedef struct
Gravity_XyzMps2Data_S
Gravity_XyzMps2DataPtr_T
 

Enumerations

enum  Gravity_Status_E
 

Functions

Retcode_T Gravity_deInit (void)
 Deinitializes the gravity sensor. More...
 
Retcode_T Gravity_init (Gravity_HandlePtr_T handle)
 Initializes the gravity sensor. More...
 
Retcode_T Gravity_readXyzGValue (Gravity_XyzGDataPtr_T gravityData)
 Reads 'g' xyz values from gravity. More...
 
Retcode_T Gravity_readXyzLsbValue (Gravity_XyzLsbDataPtr_T gravityData)
 Reads 'LSB' xyz values from Gravity. More...
 
Retcode_T Gravity_readXyzMps2Value (Gravity_XyzMps2DataPtr_T gravityData)
 Reads 'm/(s^2)' xyz values from Gravity. More...
 

Detailed Description

Gravity is a virtual sensor that provides gravity data.
i.e., Zero-g offsets are removed from the acceleration data

Accelerometer Calibration method :
Accelerometer calibration is done by rotating the device to +/-90 degrees in all axis.
It takes some time for the accelerometer to calibrate.

Gravity data is read in three different units.

Note
- To know the accuracy of calibration done, use Gravity_getStatus() API
- To get proper gravity data, make sure that the calibration accuracy is GRAVITY_HIGH before reading the data.

Limitations of gravity:
This sensor cannot be used while using virtual sensor fingerPrint.


Data Structure Documentation

struct Gravity_XyzGData_S

Struct that holds gravity data in g units

Data Fields

CalibratedAccel_GData_T xAxisData
 
CalibratedAccel_GData_T yAxisData
 
CalibratedAccel_GData_T zAxisData
 

Field Documentation

gravity x-axis g data

gravity y-axis g data

gravity z-axis g data

struct Gravity_XyzLsbData_S

Struct that holds gravity data in lsb units

Data Fields

CalibratedAccel_LsbData_T xAxisData
 
CalibratedAccel_LsbData_T yAxisData
 
CalibratedAccel_LsbData_T zAxisData
 

Field Documentation

gravity x-axis lsb data

gravity y-axis lsb data

gravity z-axis lsb data

struct Gravity_XyzMps2Data_S

Struct that holds gravity data in m/s2 units

Data Fields

CalibratedAccel_Mps2Data_T xAxisData
 
CalibratedAccel_Mps2Data_T yAxisData
 
CalibratedAccel_Mps2Data_T zAxisData
 

Field Documentation

gravity x-axis m/s2 data

gravity y-axis m/s2 data

gravity z-axis m/s2 data

Typedef Documentation

typedef float Gravity_GData_T

data type for gravity g data

typedef void* Gravity_HandlePtr_T

Defines the handle for gravity object. This handle is required for the initialisation of gravity

typedef int32_t Gravity_LsbData_T

custom data types for gravity data data type for gravity lsb data

typedef float Gravity_Mps2Data_T

data type for gravity m/s2 data

Enumeration Type Documentation

enum that defines calibration status of gravity

Enumerator
GRAVITY_UNRELIABLE 

unreliable calibration status of gravity

GRAVITY_LOW 

low calibration status of gravity

GRAVITY_MEDIUM 

medium calibration status of gravity

GRAVITY_HIGH 

high calibration status of gravity

Function Documentation

Retcode_T Gravity_deInit ( void  )
Return values
RETCODE_OKGravity sensor De-initialization success.
RETCODE_FAILUREGravity sensor De-initialization failure.
Warning
This API needs to be called when we require to stop the gravity data reading.
Note
The return value consist of (First 1 MSByte represents Package ID, Next Byte represents Severity and Last 2 LSBytes represents error code).
Pass the return value of this function to #BCDS_getUserErrorCode() API to know the user type return code present in #BCDS_SensorErrorType.h.
Retcode_T Gravity_init ( Gravity_HandlePtr_T  handle)
Parameters
[in]Gravity_HandlePtr_Tthe handle to the gravity object that should be initialized
Return values
RETCODE_OKGravity initialization success.
RETCODE_NULL_POINTERIn case of invalid sensor handle.
RETCODE_UNINITIALIZEDIf called without initializing the sensor.
Warning
This API needs to be called before calling any other function of the gravity sensor.
Note
Refer #XdkSensorHandle.h for selecting the proper handle.
The return value consist of (First 1 MSByte represents Package ID, Next Byte represents Severity and Last 2 LSBytes represents error code).
Pass the return value of this function to #BCDS_getUserErrorCode() API to know the user type return code present in #BCDS_SensorErrorType.h.
Retcode_T Gravity_readXyzGValue ( Gravity_XyzGDataPtr_T  gravityData)
Parameters
[out]gravityDataoutput parameter in which the gravity data will be written to, from within the function
Return values
RETCODE_OKReading gravity 'g' xyz value success.
RETCODE_UNINITIALIZEDIf called without initializing the sensor.
RETCODE_NULL_POINTERIn case gravityData is NULL pointer.
Note
The return value consist of (First 1 MSByte represents Package ID, Next Byte represents Severity and Last 2 LSBytes represents error code).
Pass the return value of this function to #BCDS_getUserErrorCode() API to know the user type return code present in #BCDS_SensorErrorType.h.
Retcode_T Gravity_readXyzLsbValue ( Gravity_XyzLsbDataPtr_T  gravityData)
Parameters
[out]gravityDataoutput parameter in which the gravity data will be written to, from within the function
Return values
RETCODE_OKReading gravity xyzLsb value success.
RETCODE_UNINITIALIZEDIf called without initializing the sensor.
RETCODE_NULL_POINTERIn case gravityData is NULL pointer.
Note
The return value consist of (First 1 MSByte represents Package ID, Next Byte represents Severity and Last 2 LSBytes represents error code).
Pass the return value of this function to #BCDS_getUserErrorCode() API to know the user type return code present in #BCDS_SensorErrorType.h.
Retcode_T Gravity_readXyzMps2Value ( Gravity_XyzMps2DataPtr_T  gravityData)
Parameters
[out]gravityDataoutput parameter in which the gravity data will be written to, from within the function
Return values
RETCODE_OKReading gravity 'm/(s^2)' xyz value success.
RETCODE_UNINITIALIZEDIf called without initializing the sensor.
RETCODE_NULL_POINTERIn case gravityData is NULL pointer.
Note
The return value consist of (First 1 MSByte represents Package ID, Next Byte represents Severity and Last 2 LSBytes represents error code).
Pass the return value of this function to #BCDS_getUserErrorCode() API to know the user type return code present in #BCDS_SensorErrorType.h.

This documentation file has been automatically generated on Fri Oct 4 2019 03:47:38 by doxygen 1.8.8