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

Magnetometer Interface. More...

+ Collaboration diagram for Magnetometer:

Files

file  BCDS_Magnetometer.h
 

Data Structures

struct  Magnetometer_Handle_S
 structure to represent corresponding Accelerometer handle More...
 
struct  Magnetometer_SensorInfo_S
 
struct  Magnetometer_XyzData_S
 

Typedefs

typedef enum
Magnetometer_DataRate_E 
Magnetometer_DataRate_T
 
typedef enum
Magnetometer_DataRate_E
Magnetometer_DataRatePtr_T
 
typedef struct
Magnetometer_Handle_S 
Magnetometer_Handle_T
 
typedef struct
Magnetometer_Handle_S
Magnetometer_HandlePtr_T
 
typedef enum
Magnetometer_PowerMode_E 
Magnetometer_PowerMode_T
 
typedef enum
Magnetometer_PowerMode_E
Magnetometer_PowerModePtr_T
 
typedef enum
Magnetometer_PresetMode_E 
Magnetometer_PresetMode_T
 
typedef enum
Magnetometer_PresetMode_E
Magnetometer_PresetModePtr_T
 
typedef enum
Magnetometer_SensorID_E 
Magnetometer_SensorID_T
 
typedef struct
Magnetometer_SensorInfo_S 
Magnetometer_SensorInfo_T
 
typedef struct
Magnetometer_SensorInfo_S
Magnetometer_SensorInfoPtr_T
 
typedef struct
Magnetometer_XyzData_S 
Magnetometer_XyzData_T
 
typedef struct
Magnetometer_XyzData_S
Magnetometer_XyzDataPtr_T
 

Enumerations

enum  Magnetometer_DataRate_E
 
enum  Magnetometer_PowerMode_E
 
enum  Magnetometer_PresetMode_E
 
enum  Magnetometer_SensorID_E
 

Functions

Retcode_T Magnetometer_deInit (Magnetometer_HandlePtr_T handle)
 Function to DeInitialize the magnetometer sensor referenced by the passed handle. More...
 
Retcode_T Magnetometer_getDataRate (Magnetometer_HandlePtr_T handle, Magnetometer_DataRatePtr_T datarate)
 Function to read the Datarate of the Magnetometer sensor. More...
 
Retcode_T Magnetometer_getPowerMode (Magnetometer_HandlePtr_T handle, Magnetometer_PowerModePtr_T powerMode)
 Function to read the powermode of the Magnetometer sensor. More...
 
Retcode_T Magnetometer_getPresetMode (Magnetometer_HandlePtr_T handle, Magnetometer_PresetModePtr_T presetMode)
 Function to read the preset mode of the Magnetometer sensor. More...
 
Retcode_T Magnetometer_init (Magnetometer_HandlePtr_T handle)
 Initializes the Magnetometer sensor referenced by the passed handle. More...
 
Retcode_T Magnetometer_readXyzLsbData (Magnetometer_HandlePtr_T handle, Magnetometer_XyzDataPtr_T data)
 Function to Read the magnetometer sensor data referenced by the passed handle. More...
 
Retcode_T Magnetometer_readXyzTeslaData (Magnetometer_HandlePtr_T handle, Magnetometer_XyzDataPtr_T data)
 Function to read micro tesla xyz value from the magnetometer referenced by the passed handle. More...
 
Retcode_T Magnetometer_setDataRate (Magnetometer_HandlePtr_T handle, Magnetometer_DataRate_T datarate)
 Function to set the Datarate of the Magnetometer sensor. More...
 
Retcode_T Magnetometer_setPowerMode (Magnetometer_HandlePtr_T handle, Magnetometer_PowerMode_T powerMode)
 Function to set the powermode of the Magnetometer sensor. More...
 
Retcode_T Magnetometer_setPresetMode (Magnetometer_HandlePtr_T handle, Magnetometer_PresetMode_T presetMode)
 Function to set the preset mode of the Magnetometer sensor. More...
 

Detailed Description

The interface header exports advance Sensor API's which are used to Initialize Magnetometer sensor, Configure Power modes, Data rate & preset mode. Also has API's for reading sensor values & Mode Settings.


Data Structure Documentation

struct Magnetometer_Handle_S
+ Collaboration diagram for Magnetometer_Handle_S:

Data Fields

Magnetometer_SensorInfo_T SensorInformation
 
void * SensorPtr
 

Field Documentation

Magnetometer_SensorInfo_T SensorInformation

Structure to hold logical identity to magnetometer sensor

void* SensorPtr

Pointer to structure containing hardware specific configuration

struct Magnetometer_SensorInfo_S

to hold the Manetometer type and its initialization status

Data Fields

uint8_t initializationStatus
 
Magnetometer_SensorID_T sensorID
 

Field Documentation

uint8_t initializationStatus

value to indicate whether the magnetometer sensor is properly initialized before

logical sensor ID to represents physical magnetometer sensor

struct Magnetometer_XyzData_S

structure required to collect the XYZ axis data

Data Fields

uint16_t resistance
 
int32_t xAxisData
 
int32_t yAxisData
 
int32_t zAxisData
 

Field Documentation

uint16_t resistance
int32_t xAxisData
int32_t yAxisData
int32_t zAxisData

Typedef Documentation

Enumeration Type Documentation

enum values to represent Manetometer datarate modes

Enumerator
MAGNETOMETER_BMM150_DATARATE_10HZ 

ID to represent bmm150 datarate to 10Hz

MAGNETOMETER_BMM150_DATARATE_2HZ 

ID to represent bmm150 datarate to 2Hz

MAGNETOMETER_BMM150_DATARATE_6HZ 

ID to represent bmm150 datarate to 6Hz

MAGNETOMETER_BMM150_DATARATE_8HZ 

ID to represent bmm150 datarate to 8Hz

MAGNETOMETER_BMM150_DATARATE_15HZ 

ID to represent bmm150 datarate to 15Hz

MAGNETOMETER_BMM150_DATARATE_20HZ 

ID to represent bmm150 datarate to 20Hz

MAGNETOMETER_BMM150_DATARATE_25HZ 

ID to represent bmm150 datarate to 25Hz

MAGNETOMETER_BMM150_DATARATE_30HZ 

ID to represent bmm150 datarate to 30Hz

MAGNETOMETER_DATARATE_OUT_OF_RANGE 

This element is used for error handling, User not allowed to use it

enum values to represent Manetometer power modes

Enumerator
MAGNETOMETER_BMM150_POWERMODE_NORMAL 

ID to represent bmm150 Powermode to normal

MAGNETOMETER_BMM150_POWERMODE_FORCE 

ID to represent bmm150 Powermode to forced

MAGNETOMETER_BMM150_POWERMODE_SUSPEND 

ID to represent bmm150 Powermode to suspend

MAGNETOMETER_BMM150_POWERMODE_SLEEP 

ID to represent bmm150 Powermode to sleep

MAGNETOMETER_POWERMODE_OUT_OF_RANGE 

This element is used for error handling, User not allowed to use it

enum values to represent Manetometer preset modes

Enumerator
MAGNETOMETER_BMM150_PRESETMODE_LOWPOWER 

ID to represent bmm150 Presetmode to lowpower

MAGNETOMETER_BMM150_PRESETMODE_REGULAR 

ID to represent bmm150 Presetmode to regular

MAGNETOMETER_BMM150_PRESETMODE_HIGHACCURACY 

ID to represent bmm150 Presetmode to highaccuracy

MAGNETOMETER_BMM150_PRESETMODE_ENHANCED 

ID to represent bmm150 Presetmode to enhanced

MAGNETOMETER_PRESETMODE_OUT_OF_RANGE 

This element is used for error handling, User not allowed to use it

enum values to represent Manetometer types supported

Enumerator
MAGNETOMETER_BMM150 

ID to represents bmm150 magnetometer sensor

MAGNETOMETER_INVALID_ID 

This Specifies maximum number of enum elements and it is used only for error handling

Function Documentation

Retcode_T Magnetometer_deInit ( Magnetometer_HandlePtr_T  handle)
Parameters
[in]handlehandle of the Magnetometer object
Return values
RETCODE_SUCCESSMagnetometer De-initialization success.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
Returns
In case of any other error refer Bmm150Utils_uninitialize error codes.
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.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Retcode_T Magnetometer_getDataRate ( Magnetometer_HandlePtr_T  handle,
Magnetometer_DataRatePtr_T  datarate 
)
Parameters
[in]handlehandle of the Magnetometer object
[in]dataratevariable to store datarate of the sensor
Return values
RETCODE_SUCCESSGetting data rate success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of getting data rate other than Magnetometer_DataRate_E.
Returns
In case of other failures refer bmm150LibErrorMapping API's.
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.

+ Here is the call graph for this function:

Retcode_T Magnetometer_getPowerMode ( Magnetometer_HandlePtr_T  handle,
Magnetometer_PowerModePtr_T  powerMode 
)
Parameters
[in]handlehandle of the Magnetometer object
[in]powerModevariable to be update the powermode
Return values
RETCODE_SUCCESSGetting power mode success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of getting power mode other than Magnetometer_PowerMode_E.
Returns
In case of other failures refer bmm150LibErrorMapping API's.
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.

+ Here is the call graph for this function:

Retcode_T Magnetometer_getPresetMode ( Magnetometer_HandlePtr_T  handle,
Magnetometer_PresetModePtr_T  presetMode 
)
Parameters
[in]handlehandle of the Magnetometer object
[in]presetModevariable to store the presetMode of the sensor
Return values
RETCODE_SUCCESSGetting preset mode success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of getting preset mode other than Magnetometer_PresetMode_E.
Returns
In case of other failures refer bmm150LibErrorMapping API's.
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.

+ Here is the call graph for this function:

Retcode_T Magnetometer_init ( Magnetometer_HandlePtr_T  handle)
Parameters
[in]handlehandle of the Magnetometer object
Return values
RETCODE_SUCCESSMagnetometer initialization success.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
Returns
In case of any other error refer Bmm150Utils_initialize error codes.
Warning
This function needs to be called before calling any other Magnetometer API.
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.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Retcode_T Magnetometer_readXyzLsbData ( Magnetometer_HandlePtr_T  handle,
Magnetometer_XyzDataPtr_T  data 
)
Parameters
[in]handlehandle of the Magnetometer object
[in]dataParameter in which the magnetometer XYZ data gets collected
Return values
RETCODE_SUCCESSReading Magnetometer xyzLsbdata success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle or NULL pointer.
Returns
In case of other failures refer readMagData or Bmm150Utils_remapAxis API's.
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.
Whenever there is an overflow in any axis this API will return the maximum value the sensor could read for that axis below are the maximum value the sensor could read x-axis - 1500, y-axis - 1500, z-axis - 2500

+ Here is the call graph for this function:

Retcode_T Magnetometer_readXyzTeslaData ( Magnetometer_HandlePtr_T  handle,
Magnetometer_XyzDataPtr_T  data 
)
Parameters
[in]handlehandle of the Magnetometer object
[in]dataParameter in which the magnetometer XYZ data gets collected in micro tesla
Return values
RETCODE_SUCCESSReading Magnetometer xyzTesladata success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle or NULL pointer.
Returns
In case of other failures refer readMagData or Bmm150Utils_remapAxis API's.
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.
Whenever there is an overflow in any axis this API will return the maximum value the sensor could read for that axis below are the maximum value the sensor could read x-axis - 20800, y-axis - 20800, z-axis - 40000

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Retcode_T Magnetometer_setDataRate ( Magnetometer_HandlePtr_T  handle,
Magnetometer_DataRate_T  datarate 
)
Parameters
[in]handlehandle of the Magnetometer object
[in]datarateDatarate to be set to the sensor
Return values
RETCODE_SUCCESSSetting data rate success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of setting data rate other than Magnetometer_DataRate_E.
Returns
In case of other failures refer bmm150LibErrorMapping API's.
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.

+ Here is the call graph for this function:

Retcode_T Magnetometer_setPowerMode ( Magnetometer_HandlePtr_T  handle,
Magnetometer_PowerMode_T  powerMode 
)
Parameters
[in]handlehandle of the Magnetometer object
[in]powerModepowermode to be set to the sensor
Return values
RETCODE_SUCCESSSetting power mode success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of setting power mode other than Magnetometer_PowerMode_E.
Returns
In case of other failures refer bmm150LibErrorMapping API's.
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.

+ Here is the call graph for this function:

Retcode_T Magnetometer_setPresetMode ( Magnetometer_HandlePtr_T  handle,
Magnetometer_PresetMode_T  presetMode 
)
Parameters
[in]handlehandle of the Magnetometer object
[in]presetModepresetMode to be set to the sensor
Return values
RETCODE_SUCCESSSetting preset mode success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of setting preset mode other than Magnetometer_PresetMode_E.
Returns
In case of other failures refer bmm150LibErrorMapping API's.
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.

+ Here is the call graph for this function:


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