XDK API  3.6.0
Documentation
Files | Data Structures | Typedefs | Enumerations | Functions
Calibrated Magnetometer

Virtual Calibrated Magnetometer Sensor based on BMM150. More...

+ Collaboration diagram for Calibrated Magnetometer:

Files

file  BCDS_CalibratedMag.h
 

Data Structures

struct  CalibratedMag_XyzGaussData_S
 
struct  CalibratedMag_XyzLsbData_S
 
struct  CalibratedMag_XyzMicroTesla_S
 

Typedefs

typedef struct
CalibratedMag_XyzMicroTesla_S
CalibMag_XyzMicroTeslaDataPtr_T
 
typedef float CalibratedMag_GaussData_T
 
typedef void * CalibratedMag_HandlePtr_T
 
typedef int32_t CalibratedMag_LsbData_T
 
typedef float CalibratedMag_MicroTeslaData_T
 
typedef struct
CalibratedMag_XyzGaussData_S 
CalibratedMag_XyzGaussData_T
 
typedef struct
CalibratedMag_XyzGaussData_S
CalibratedMag_XyzGaussDataPtr_T
 
typedef struct
CalibratedMag_XyzLsbData_S 
CalibratedMag_XyzLsbData_T
 
typedef struct
CalibratedMag_XyzLsbData_S
CalibratedMag_XyzLsbDataPtr_T
 
typedef struct
CalibratedMag_XyzMicroTesla_S 
CalibratedMag_XyzMicroTesla_T
 

Enumerations

enum  CalibratedMag_CalibStatus_E
 

Functions

 BCDS_DEPRECATED (typedef enum CalibratedMag_CalibStatus_E CalibratedMag_CalibStatus_T)
 
 BCDS_DEPRECATED (typedef enum CalibratedMag_CalibStatus_E *CalibratedMag_CalibStatusPtr_T)
 
 BCDS_DEPRECATED (Retcode_T CalibratedMag_getStatus(CalibratedMag_CalibStatusPtr_T calibMagStatus))
 Reads calibration accuracy status from calibrated magnetometer. More...
 
Retcode_T CalibratedMag_deInit (void)
 Deinitializes the calibrated Magnetometer sensor. More...
 
Retcode_T CalibratedMag_init (CalibratedMag_HandlePtr_T handle)
 Initializes the calibrated magnetometer sensor. More...
 
Retcode_T CalibratedMag_readMicroTeslaVal (CalibMag_XyzMicroTeslaDataPtr_T calibMagData)
 Reads 'micro tesla' xyz values from calibrated magnetometer. More...
 
Retcode_T CalibratedMag_readXyzGaussVal (CalibratedMag_XyzGaussDataPtr_T calibMagData)
 Reads 'gauss' xyz values from calibrated magnetometer. More...
 
Retcode_T CalibratedMag_readXyzLsbVal (CalibratedMag_XyzLsbDataPtr_T calibMagData)
 Reads 'LSB' xyz values from calibrated magnetometer. More...
 

Detailed Description

Calibrated Magnetometer is a virtual sensor that provides calibrated magnetometer data.
i.e., Zero-B offsets are removed from the magnetic field data.

Magnetometer Calibration method :
Magnetometer calibration is done by leaving the device in flat position a few seconds, and making a '8' figure motion. '8' figure motion may be done more than once for a proper calibration.
Refer the link on how to calibrate: https://www.youtube.com/watch?v=sP3d00Hr14o

Calibrated Magnetometer data is read in three different units.

Note
- To know the accuracy of calibration done, use CalibratedMag_getStatus() API
- To get proper calibrated magnetometer data, make sure that the calibration accuracy is CALIBRATED_MAG_STATUS_HIGH before reading the data.

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


Data Structure Documentation

struct CalibratedMag_XyzGaussData_S

Struct that holds calibrated magnetometer data in gauss units

Data Fields

CalibratedMag_GaussData_T xAxisData
 
CalibratedMag_GaussData_T yAxisData
 
CalibratedMag_GaussData_T zAxisData
 

Field Documentation

calibrated magnetometer x-axis gauss data

calibrated magnetometer y-axis gauss data

calibrated magnetometer z-axis gauss data

struct CalibratedMag_XyzLsbData_S

Struct that holds calibrated magnetometer data in lsb units

Data Fields

CalibratedMag_LsbData_T xAxisData
 
CalibratedMag_LsbData_T yAxisData
 
CalibratedMag_LsbData_T zAxisData
 

Field Documentation

calibrated magnetometer x-axis lsb data

calibrated magnetometer y-axis lsb data

calibrated magnetometer z-axis lsb data

struct CalibratedMag_XyzMicroTesla_S

Struct that holds calibrated Magnetometer data in micro tesla units

Data Fields

CalibratedMag_MicroTeslaData_T xAxisData
 
CalibratedMag_MicroTeslaData_T yAxisData
 
CalibratedMag_MicroTeslaData_T zAxisData
 

Field Documentation

calibrated magnetometer x-axis micro tesla data

calibrated magnetometer y-axis micro tesla data

calibrated magnetometer z-axis micro tesla data

Typedef Documentation

data type for calibrated magnetometer gauss data

Defines the handle for calibrated magnetometer object. This handle is required for the initialisation of calibrated accelerometer

typedef int32_t CalibratedMag_LsbData_T

custom data types for calibrated magnetometer data data type for calibrated magnetometer lsb data

data type for calibrated magnetometer micro tesla data

Enumeration Type Documentation

enum that defines calibration status of calibrated magnetometer

Enumerator
CALIBRATED_MAG_STATUS_UNRELIABLE 

unreliable calibration status of calibrated magnetometer

CALIBRATED_MAG_STATUS_LOW 

low calibration status of calibrated magnetometer

CALIBRATED_MAG_STATUS_MEDIUM 

medium calibration status of calibrated magnetometer

CALIBRATED_MAG_STATUS_HIGH 

high calibration status of calibrated magnetometer

Function Documentation

BCDS_DEPRECATED ( typedef enum CalibratedMag_CalibStatus_E  CalibratedMag_CalibStatus_T)
BCDS_DEPRECATED ( typedef enum CalibratedMag_CalibStatus_E CalibratedMag_CalibStatusPtr_T)
BCDS_DEPRECATED ( Retcode_T   CalibratedMag_getStatusCalibratedMag_CalibStatusPtr_T calibMagStatus)
Deprecated:
since version v3.0.1
Parameters
[out]calibMagStatusoutput parameter in which the magnetometer calibration status will be written to, from within the function
Return values
RETCODE_SUCCESSReading calibration accuracy status from calibrated gyroscope success.
RETCODE_INVALID_PARAMIn case calibMagData is NULL pointer.
RETCODE_OKReading calibration accuracy status from calibrated gyroscope success.
RETCODE_NULL_POINTERIn case calibMagData is NULL pointer.
Note
There are four levels of calibration accuracy
  • CALIBRATED_MAG_STATUS_UNRELIABLE
  • CALIBRATED_MAG_STATUS_LOW
  • CALIBRATED_MAG_STATUS_MEDIUM
  • CALIBRATED_MAG_STATUS_HIGH
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_getSensorErrorCode API to know the sensor return code present in BCDS_SensorErrorType_E.
Retcode_T CalibratedMag_deInit ( void  )
Return values
RETCODE_OKCalibrated Magnetometer sensor De-initialization success.
RETCODE_FAILURECalibrated Magnetometer sensor De-initialization failure.
Warning
This API needs to be called when we require to stop the calibrated Magnetometer 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_getSensorErrorCode API to know the sensor return code present in BCDS_SensorErrorType_E.
Retcode_T CalibratedMag_init ( CalibratedMag_HandlePtr_T  handle)
Parameters
[in]CalibratedMag_HandlePtr_Tthe handle to the calibrated magnetometer object that should be initialized
Return values
RETCODE_OKcalibrated magnetometer initialization success.
RETCODE_NULL_POINTERIn case of invalid sensor handle.
Warning
This API needs to be called before calling any other function of the calibrated magnetometer.
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_getSensorErrorCode API to know the sensor return code present in BCDS_SensorErrorType_E.
Retcode_T CalibratedMag_readMicroTeslaVal ( CalibMag_XyzMicroTeslaDataPtr_T  calibMagData)
Parameters
[out]calibMagDataoutput parameter in which the calibrated magnetometer data will be written to, from within the function
Return values
RETCODE_OKReading calibrated magnetometer micro tesla xyz value success.
RETCODE_UNINITIALIZEDIf called without initializing the sensor.
RETCODE_NULL_POINTERIn case calibMagData 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_getSensorErrorCode API to know the sensor return code present in BCDS_SensorErrorType_E.
Retcode_T CalibratedMag_readXyzGaussVal ( CalibratedMag_XyzGaussDataPtr_T  calibMagData)
Parameters
[out]calibMagDataoutput parameter in which the calibrated magnetometer data will be written to, from within the function
Return values
RETCODE_OKReading calibrated magnetometer gauss xyz value success.
RETCODE_UNINITIALIZEDIf called without initializing the sensor.
RETCODE_NULL_POINTERIn case calibMagData 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_getSensorErrorCode API to know the sensor return code present in BCDS_SensorErrorType_E.
Retcode_T CalibratedMag_readXyzLsbVal ( CalibratedMag_XyzLsbDataPtr_T  calibMagData)
Parameters
[out]calibMagDataoutput parameter in which the calibrated magnetometer data will be written to, from within the function
Return values
RETCODE_OKReading calibrated magnetometer xyzLsb value success.
RETCODE_UNINITIALIZEDIf called without initializing the sensor.
RETCODE_NULL_POINTERIn case calibMagData 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_getSensorErrorCode API to know the sensor return code present in BCDS_SensorErrorType_E.

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:51 by doxygen 1.8.8