XDK API  3.6.0
Documentation
Macros | Functions | Variables
Magnetometer.c File Reference

This module contains the simplified API for accessing the Magnetometer. More...

#include "BCDS_SensorsInfo.h"
#include "BCDS_Magnetometer.h"
#include "Magnetometer.h"
#include "BCDS_Bmm150Utils.h"
#include "bmm050.h"
+ Include dependency graph for Magnetometer.c:

Macros

#define BCDS_MODULE_ID   BCDS_SENSORS_ID_MAGNETOMETER
 

Functions

static Retcode_T bmm150LibErrorMapping (BMM050_RETURN_FUNCTION_TYPE BMM150_libReturn)
 This function maps error codes returned from BMM150 library to retcode values. More...
 
static void bmmIsrCallback (uint32_t channel, uint32_t edge)
 BMM150 driver callback function that will be called during ISR. More...
 
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...
 
static int8_t mappingEnumForGetFunctions (uint8_t start, uint8_t end, uint8_t getValueToBeTransalated, const uint8_t *lookUpTablePtr)
 
static Retcode_T readMagData (struct bmm050_mag_s32_data_t *magData)
 This function used read the sensor data. More...
 

Variables

static const uint8_t dataRateLookUpTable [MAGNETOMETER_DATARATE_OUT_OF_RANGE]
 
static const uint8_t modeLookUpTable [MAGNETOMETER_POWERMODE_OUT_OF_RANGE]
 
static const uint8_t presetModeLookUpTable [MAGNETOMETER_PRESETMODE_OUT_OF_RANGE]
 

Macro Definition Documentation

#define BCDS_MODULE_ID   BCDS_SENSORS_ID_MAGNETOMETER

Function Documentation

static Retcode_T bmm150LibErrorMapping ( BMM050_RETURN_FUNCTION_TYPE  BMM150_libReturn)
static
Parameters
[in]BMM150_RETURN_FUNCTION_TYPEReturn value from BMM150 library
Return values
RETCODE_OKBMM150 sensor API call success
RETCODE_FAILUREBMM150 sensor API call failed
RETCODE_INVALID_PARAMBMM150 sensor API call failed because of invalid input parameter

+ Here is the caller graph for this function:

static void bmmIsrCallback ( uint32_t  channel,
uint32_t  edge 
)
static
Parameters
[in]channelchannel at which interrupt has occurred
[in]edgeedge at which interrupt has occurred falling(0) or raising edge(1)
Note
Currently interrupt is not supported for BMM150

+ Here is the caller graph for this function:

static int8_t mappingEnumForGetFunctions ( uint8_t  start,
uint8_t  end,
uint8_t  getValueToBeTransalated,
const uint8_t *  lookUpTablePtr 
)
static

+ Here is the caller graph for this function:

static Retcode_T readMagData ( struct bmm050_mag_s32_data_t magData)
static
Parameters
[in]bmm050_mag_s32_data_tstructure to hold the data
Return values
RETCODE_OKBMM150 sensor API call success
RETCODE_FAILUREBMM150 sensor API call failed
RETCODE_INVALID_PARAMBMM150 sensor API call failed because of invalid input parameter

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const uint8_t dataRateLookUpTable[MAGNETOMETER_DATARATE_OUT_OF_RANGE]
static
Initial value:
=
{
UINT8_C(BMM050_DR_10HZ),
UINT8_C(BMM050_DR_02HZ),
UINT8_C(BMM050_DR_06HZ),
UINT8_C(BMM050_DR_08HZ),
UINT8_C(BMM050_DR_15HZ),
UINT8_C(BMM050_DR_20HZ),
UINT8_C(BMM050_DR_25HZ),
}
#define BMM050_DR_15HZ
Definition: bmm050.h:855
#define BMM050_DR_25HZ
Definition: bmm050.h:857
#define BMM050_DR_20HZ
Definition: bmm050.h:856
#define BMM050_DR_06HZ
Definition: bmm050.h:853
#define BMM050_DR_02HZ
Definition: bmm050.h:852
#define BMM050_DR_08HZ
Definition: bmm050.h:854
#define BMM050_DR_10HZ
Definition: bmm050.h:851
const uint8_t modeLookUpTable[MAGNETOMETER_POWERMODE_OUT_OF_RANGE]
static
Initial value:
=
{
}
#define BMM050_NORMAL_MODE
Definition: bmm050.h:760
#define BMM050_FORCED_MODE
Definition: bmm050.h:761
#define BMM050_SUSPEND_MODE
Definition: bmm050.h:762
const uint8_t presetModeLookUpTable[MAGNETOMETER_PRESETMODE_OUT_OF_RANGE]
static
Initial value:
=
{
}
#define BMM050_PRESETMODE_REGULAR
Definition: bmm050.h:826
#define BMM050_PRESETMODE_LOWPOWER
Definition: bmm050.h:825
#define BMM050_PRESETMODE_HIGHACCURACY
Definition: bmm050.h:827

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:49 by doxygen 1.8.8