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

Accelerometer Sensor Interface. More...

+ Collaboration diagram for Accelerometer:

Files

file  BCDS_Accelerometer.h
 

Data Structures

struct  Accelerometer_ConfigSlopeIntr_S
 
struct  Accelerometer_Handle_S
 structure to represent corresponding Accelerometer handle More...
 
struct  Accelerometer_InterruptCallback_S
 structure to represent Accelerometer interrupt callback More...
 
struct  Accelerometer_XyzData_S
 
struct  Acceleromter_SensorInfo_S
 

Macros

#define ACCELEROMETER_PARAMETER_DISABLE   UINT8_C(0x00)
 
#define ACCELEROMETER_PARAMETER_ENABLE   UINT8_C(0x01)
 These below macros shall be used by the user to enable/disable interrupt, when the user call the accelerometerConfigInterrupt() API. More...
 

Typedefs

typedef void(* accelDeferredTimeCallback )(void *, uint32_t param)
 This data type represents a function pointer that is used to register deferred interrupt callback. More...
 
typedef enum
Accelerometer_Bandwidth_E 
Accelerometer_Bandwidth_T
 
typedef enum
Accelerometer_Bandwidth_E
Accelerometer_BandwidthPtr_T
 
typedef struct
Accelerometer_ConfigSlopeIntr_S 
Accelerometer_ConfigSlopeIntr_T
 
typedef struct
Accelerometer_ConfigSlopeIntr_S
Accelerometer_ConfigSlopeIntrPtr_T
 
typedef struct
Accelerometer_Handle_S 
Accelerometer_Handle_T
 
typedef struct
Accelerometer_Handle_S
Accelerometer_HandlePtr_T
 
typedef struct
Accelerometer_InterruptCallback_S 
Accelerometer_InterruptCallback_T
 
typedef enum
Accelerometer_InterruptChannel_E 
Accelerometer_InterruptChannel_T
 
typedef enum
Accelerometer_InterruptType_E 
Accelerometer_InterruptType_T
 
typedef enum
Accelerometer_Powermode_E 
Accelerometer_Powermode_T
 
typedef enum
Accelerometer_Powermode_E
Accelerometer_PowermodePtr_T
 
typedef enum Accelerometer_Range_E Accelerometer_Range_T
 
typedef enum
Accelerometer_Range_E
Accelerometer_RangePtr_T
 
typedef enum
Accelerometer_SensorID_E 
Accelerometer_SensorID_T
 
typedef enum
Accelerometer_SleepDuration_E 
Accelerometer_SleepDuration_T
 
typedef enum
Accelerometer_SleepDuration_E
Accelerometer_SleepDurationPtr_T
 
typedef enum
Accelerometer_SlopeInterruptDuration_E 
Accelerometer_SlopeInterruptDuration_T
 
typedef struct
Accelerometer_XyzData_S 
Accelerometer_XyzData_T
 
typedef struct
Accelerometer_XyzData_S
Accelerometer_XyzDataPtr_T
 
typedef struct
Acceleromter_SensorInfo_S 
Acceleromter_SensorInfo_T
 
typedef struct
Acceleromter_SensorInfo_S
Acceleromter_SensorInfoPtr_T
 
typedef void(* accelRealTimeCallback )(void)
 This data type represents a function pointer that is used to register realtime interrupt callback. More...
 

Enumerations

enum  Accelerometer_Bandwidth_E
 
enum  Accelerometer_InterruptChannel_E
 
enum  Accelerometer_InterruptType_E
 
enum  Accelerometer_Powermode_E
 
enum  Accelerometer_Range_E
 
enum  Accelerometer_SensorID_E
 
enum  Accelerometer_SleepDuration_E
 
enum  Accelerometer_SlopeInterruptDuration_E
 

Functions

Retcode_T Accelerometer_configInterrupt (Accelerometer_HandlePtr_T handle, Accelerometer_InterruptChannel_T channel, Accelerometer_InterruptType_T interruptType, void *InterruptTypeParameters)
 Configures the accelerometer Interrupt referenced by the passed handle. More...
 
Retcode_T Accelerometer_deInit (Accelerometer_HandlePtr_T handle)
 DeInitializes the accelerometer referenced by the passed handle. More...
 
Retcode_T Accelerometer_disableInterrupt (Accelerometer_HandlePtr_T handle, Accelerometer_InterruptChannel_T channel, Accelerometer_InterruptType_T interruptType)
 Disable Interrupt type on the specified channel. More...
 
Retcode_T Accelerometer_getBandwidth (Accelerometer_HandlePtr_T handle, Accelerometer_BandwidthPtr_T bandwidth)
 Reads the bandwidth for the accelerometer referenced by the passed handle. More...
 
Retcode_T Accelerometer_getMode (Accelerometer_HandlePtr_T handle, Accelerometer_PowermodePtr_T powermode)
 get the powermode for the accelerometer referenced by the passed handle. More...
 
Retcode_T Accelerometer_getRange (Accelerometer_HandlePtr_T handle, Accelerometer_RangePtr_T range)
 Reads the Range for the accelerometer referenced by the passed handle. More...
 
Retcode_T Accelerometer_getSleepDuration (Accelerometer_HandlePtr_T handle, Accelerometer_SleepDurationPtr_T lowPowerModeSleepDuration)
 Reads the last set sleep duration of accelerometer referenced by the passed handle. More...
 
Retcode_T Accelerometer_init (Accelerometer_HandlePtr_T handle)
 Initializes the accelerometer referenced by the passed handle. More...
 
Retcode_T Accelerometer_readXyzGValue (Accelerometer_HandlePtr_T handle, Accelerometer_XyzDataPtr_T value)
 Reads an milli Gravity values from the accelerometer referenced by the passed handle for the UG correction. More...
 
Retcode_T Accelerometer_readXyzLsbValue (Accelerometer_HandlePtr_T handle, Accelerometer_XyzDataPtr_T value)
 Reads an LSB xyz value from the accelerometer referenced by the passed handle. More...
 
Retcode_T Accelerometer_regDeferredCallback (Accelerometer_HandlePtr_T handle, Accelerometer_InterruptChannel_T intChannel, accelDeferredTimeCallback deferredCallback)
 Register deferred user callback function on the specified channel to indicate user that interrupt has occurred not immediately but at deferred context of RTOS. More...
 
Retcode_T Accelerometer_regRealTimeCallback (Accelerometer_HandlePtr_T handle, Accelerometer_InterruptChannel_T intChannel, accelRealTimeCallback realTimeCallback)
 Register real time user callback function on the specified channel to indicate user that interrupt has occurred. More...
 
Retcode_T Accelerometer_setBandwidth (Accelerometer_HandlePtr_T handle, Accelerometer_Bandwidth_T bandwidth)
 Sets the bandwidth for the accelerometer referenced by the passed handle. More...
 
Retcode_T Accelerometer_setMode (Accelerometer_HandlePtr_T handle, Accelerometer_Powermode_T powermode)
 Sets the powermode for the accelerometer referenced by the passed handle. More...
 
Retcode_T Accelerometer_setRange (Accelerometer_HandlePtr_T handle, Accelerometer_Range_T range)
 Sets the Range for the accelerometer referenced by the passed handle. More...
 
Retcode_T Accelerometer_setSleepDuration (Accelerometer_HandlePtr_T handle, Accelerometer_SleepDuration_T lowPowerModeSleepDuration)
 Sets the SleepDuration for the accelerometer referenced by the passed handle. More...
 

Detailed Description

The interface header exports advance Sensor API's which are used to Initialize Accelerometer sensor, Configure Real Time Interrupts, Differed Interrupts , Modes, Bandwidth, Range & Sleep Duration. Also has API's for reading sensor values & Mode Settings.


Data Structure Documentation

struct Accelerometer_ConfigSlopeIntr_S

structure used to hold the slop interrupt configuration

Data Fields

Accelerometer_SlopeInterruptDuration_T slopeDuration
 
uint8_t slopeEnableX
 
uint8_t slopeEnableY
 
uint8_t slopeEnableZ
 
uint8_t slopeThreshold
 

Field Documentation

Number of data points considered for detecting valid slope threshold interrupt

uint8_t slopeEnableX

variable to indicate slope interrupt for X axis needs to be enabled or not

uint8_t slopeEnableY

variable to indicate slope interrupt for Y axis needs to be enabled or not

uint8_t slopeEnableZ

variable to indicate slope interrupt for Z axis needs to be enabled or not

uint8_t slopeThreshold

variable holds slope threshold range could is from 0 to 255

struct Accelerometer_Handle_S
+ Collaboration diagram for Accelerometer_Handle_S:

Data Fields

Accelerometer_InterruptCallback_T IntChannel1
 
Accelerometer_InterruptCallback_T IntChannel2
 
Acceleromter_SensorInfo_T SensorInformation
 
void * SensorPtr
 

Field Documentation

Structure for interrupt callback in channel 1 of accelerometer sensor

Structure for interrupt callback in channel 2 of accelerometer sensor

Acceleromter_SensorInfo_T SensorInformation

Structure to hold logical identity to accelerometer sensor

void* SensorPtr

Pointer to structure containing hardware specific configuration

struct Accelerometer_InterruptCallback_S
struct Accelerometer_XyzData_S

structure required to collect the XYZ axis data

Data Fields

int32_t xAxisData
 
int32_t yAxisData
 
int32_t zAxisData
 

Field Documentation

int32_t xAxisData
int32_t yAxisData
int32_t zAxisData
struct Acceleromter_SensorInfo_S

structure to hold the accelerometer type and its initialization status

Data Fields

uint8_t initializationStatus
 
Accelerometer_SensorID_T sensorID
 

Field Documentation

uint8_t initializationStatus

value to indicate whether the accelerometer sensor is properly initialized before

logical sensor ID to represents physical accelerometer sensor

Macro Definition Documentation

#define ACCELEROMETER_PARAMETER_DISABLE   UINT8_C(0x00)
#define ACCELEROMETER_PARAMETER_ENABLE   UINT8_C(0x01)

Typedef Documentation

typedef void(* accelDeferredTimeCallback)(void *, uint32_t param)
typedef void(* accelRealTimeCallback)(void)

Enumeration Type Documentation

enum values to represent Bandwidth supported by the accelerometer

Enumerator
ACCELEROMETER_BMA280_BANDWIDTH_7_81HZ 

ID to represent bma280 accel sensor bandwidth 7.81 HZ

ACCELEROMETER_BMA280_BANDWIDTH_15_63HZ 

ID to represent bma280 accel sensor bandwidth 15.63 HZ

ACCELEROMETER_BMA280_BANDWIDTH_31_25HZ 

ID to represent bma280 accel sensor bandwidth 31.25 HZ

ACCELEROMETER_BMA280_BANDWIDTH_62_50HZ 

ID to represent bma280 accel sensor bandwidth 62.50 HZ

ACCELEROMETER_BMA280_BANDWIDTH_125HZ 

ID to represent bma280 accel sensor bandwidth 125 HZ

ACCELEROMETER_BMA280_BANDWIDTH_250HZ 

ID to represent bma280 accel sensor bandwidth 250 HZ

ACCELEROMETER_BMA280_BANDWIDTH_500HZ 

ID to represent bma280 accel sensor bandwidth 500 HZ

ACCELEROMETER_BMI160_BANDWIDTH_0_78HZ 

ID to represent bmi160 accel sensor bandwidth 0.78 HZ

ACCELEROMETER_BMI160_BANDWIDTH_1_56HZ 

ID to represent bmi160 accel sensor bandwidth 1.56 HZ

ACCELEROMETER_BMI160_BANDWIDTH_3_12HZ 

ID to represent bmi160 accel sensor bandwidth 3.12 HZ

ACCELEROMETER_BMI160_BANDWIDTH_6_25HZ 

ID to represent bmi160 accel sensor bandwidth 6.25 HZ

ACCELEROMETER_BMI160_BANDWIDTH_12_5HZ 

ID to represent bmi160 accel sensor bandwidth 12.5 HZ

ACCELEROMETER_BMI160_BANDWIDTH_25HZ 

ID to represent bmi160 accel sensor bandwidth 25 HZ

ACCELEROMETER_BMI160_BANDWIDTH_50HZ 

ID to represent bmi160 accel sensor bandwidth 50 HZ

ACCELEROMETER_BMI160_BANDWIDTH_100HZ 

ID to represent bmi160 accel sensor bandwidth 100 HZ

ACCELEROMETER_BMI160_BANDWIDTH_200HZ 

ID to represent bmi160 accel sensor bandwidth 200 HZ

ACCELEROMETER_BANDWIDTH_OUT_OF_RANGE 

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

Enumeration to represent the Accelerometer interrupt channel

Enumerator
ACCELEROMETER_BMA280_INTERRUPT_CHANNEL1 
ACCELEROMETER_BMA280_INTERRUPT_CHANNEL2 
ACCELEROMETER_INVALID_INTERRUPT_CHANNEL 

enum values to represent various type of interrupt supported for accelerometer

Enumerator
ACCELEROMETER_BMA280_NEW_DATA_INTERRUPT 

ID to represent bma280 new data interrupt type

ACCELEROMETER_BMA280_SLOPE_INTERRUPT 

ID to represent bma280 slope interrupt type

ACCELEROMETER_INVALID_INTERRUPT 

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

enum values to represent Power mode supported by the accelerometer

Enumerator
ACCELEROMETER_BMA280_POWERMODE_NORMAL 

ID to represent bma280 Powermode to normal

ACCELEROMETER_BMA280_POWERMODE_LOWPOWER1 

ID to represent bma280 Powermode to Lowpower1

ACCELEROMETER_BMA280_POWERMODE_SUSPEND 

ID to represent bma280 Powermode to suspend

ACCELEROMETER_BMA280_POWERMODE_DEEPSUSPEND 

ID to represent bma280 Powermode to deep suspend

ACCELEROMETER_BMA280_POWERMODE_LOWPOWER2 

ID to represent bma280 Powermode to Lowpower2

ACCELEROMETER_BMA280_POWERMODE_STANDBY 

ID to represent bma280 Powermode to Standby

ACCELEROMETER_BMI160_POWERMODE_NORMAL 

ID to represent bmi160 Powermode to normal

ACCELEROMETER_BMI160_POWERMODE_LOWPOWER 

ID to represent bmi160 Powermode to Lowpower

ACCELEROMETER_BMI160_POWERMODE_SUSPEND 

ID to represent bmi160 Powermode to suspend

ACCELEROMETER_POWERMODE_OUT_OF_RANGE 

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

enum values to represent Range supported by the accelerometer

Enumerator
ACCELEROMETER_BMA280_RANGE_2G 

ID to represent bma280 range to +/- 2G mode

ACCELEROMETER_BMA280_RANGE_4G 

ID to represent bma280 range to +/- 4G mode

ACCELEROMETER_BMA280_RANGE_8G 

ID to represent bma280 range to +/- 8G mode

ACCELEROMETER_BMA280_RANGE_16G 

ID to represent bma280 range to +/- 16G mode

ACCELEROMETER_BMI160_RANGE_2G 

ID to represent bmi160 range to +/- 2G mode

ACCELEROMETER_BMI160_RANGE_4G 

ID to represent bmi160 range to +/- 4G mode

ACCELEROMETER_BMI160_RANGE_8G 

ID to represent bmi160 range to +/- 8G mode

ACCELEROMETER_BMI160_RANGE_16G 

ID to represent bmi160 range to +/- 16G mode

ACCELEROMETER_RANGE_OUT_OF_BOUND 

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

enum values to represent accelerometer types supported

Enumerator
ACCELEROMETER_BMA280 

ID to represents bma280 accelerometer sensor

ACCELEROMETER_BMI160 

ID to represents bmi160 accelerometer sensor

ACCELEROMETER_INVALID_ID 

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

enum values to represent various sleep duration applicable only in low power mode

Enumerator
ACCELEROMETER_BMA280_SLEEP_DURATION_0_5MS 

ID to represent sleep duration of 0.5 ms

ACCELEROMETER_BMA280_SLEEP_DURATION_1MS 

ID to represent sleep duration to 1 ms

ACCELEROMETER_BMA280_SLEEP_DURATION_2MS 

ID to represent sleep duration to 2 ms

ACCELEROMETER_BMA280_SLEEP_DURATION_4MS 

ID to represent sleep duration to 4 ms

ACCELEROMETER_BMA280_SLEEP_DURATION_6MS 

ID to represent sleep duration to 6 ms

ACCELEROMETER_BMA280_SLEEP_DURATION_10MS 

ID to represent sleep duration to 10 ms

ACCELEROMETER_BMA280_SLEEP_DURATION_25MS 

ID to represent sleep duration to 25 ms

ACCELEROMETER_BMA280_SLEEP_DURATION_50MS 

ID to represent sleep duration to 50 ms

ACCELEROMETER_BMA280_SLEEP_DURATION_100MS 

ID to represent sleep duration to 100 ms

ACCELEROMETER_BMA280_SLEEP_DURATION_500MS 

ID to represent sleep duration to 500 ms

ACCELEROMETER_BMA280_SLEEP_DURATION_1S 

ID to represent sleep duration to 1 s

ACCELEROMETER_SLEEP_DURATION_OUT_OF_RANGE 

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

enum values to represent various slope interrupt duration for accelerometer

Enumerator
ACCELEROMETER_BMA280_SLOPE_DURATION1 

slope threshold interrupt validated considering 1 data point duration

ACCELEROMETER_BMA280_SLOPE_DURATION2 

slope threshold interrupt validated considering 2 data point duration

ACCELEROMETER_BMA280_SLOPE_DURATION3 

slope threshold interrupt validated considering 3 data point duration

ACCELEROMETER_BMA280_SLOPE_DURATION4 

slope threshold interrupt validated considering 4 data point duration

ACCELEROMETER_INVALID_SLOPE_DURATION 

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

Function Documentation

Retcode_T Accelerometer_configInterrupt ( Accelerometer_HandlePtr_T  handle,
Accelerometer_InterruptChannel_T  channel,
Accelerometer_InterruptType_T  interruptType,
void *  InterruptTypeParameters 
)
Parameters
[in]handleHandle to the accelerometer object
[in]channelChannel on which the interrupt line connected to
[in]interruptTypeType of interrupt requested for the specified interrupt channel
[in]InterruptTypeParametersParameter related to interrupted type. Note it is void pointer and hence the user has to give corresponding parameters for the selected interrupt y
Return values
RETCODE_SUCCESSInterrupt Configuration success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle or invalid interrupt type Accelerometer_InterruptType_E.
RETCODE_NOT_SUPPORTEDIn case of not supported.
Returns
In case of other failures refer Bma280Utils_configInterrupt 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 Accelerometer_deInit ( Accelerometer_HandlePtr_T  handle)
Parameters
[in]handleHandle to the accelerometer object
Return values
RETCODE_SUCCESSAccelerometer De-initialization success.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
Returns
In case of any other error refer Bma280Utils_uninitialize or Bmi160Utils_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 Accelerometer_disableInterrupt ( Accelerometer_HandlePtr_T  handle,
Accelerometer_InterruptChannel_T  channel,
Accelerometer_InterruptType_T  interruptType 
)
Parameters
[in]handleHandle to the accelerometer object
[in]channelChannel on which the specified interrupt type to be disabled
[in]interruptTypeType of interrupt to be disabled
Return values
RETCODE_SUCCESSDisabling Interrupt success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle or invalid interrupt type Accelerometer_InterruptType_E.
RETCODE_NOT_SUPPORTEDIn case of not supported.
Returns
In case of other failures refer Bma280Utils_disableInterrupt.
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 Accelerometer_getBandwidth ( Accelerometer_HandlePtr_T  handle,
Accelerometer_BandwidthPtr_T  bandwidth 
)
Parameters
[in]handleHandle to the accelerometer object
[in]bandwidthLast configured bandwidth of accelerometer sensor
Return values
RETCODE_SUCCESSGetting Bandwidth success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of getting bandwidth values other than Accelerometer_Bandwidth_E.
Returns
In case of other failures refer bma2x2LibErrorMapping or bmi160LibErrorMapping 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 Accelerometer_getMode ( Accelerometer_HandlePtr_T  handle,
Accelerometer_PowermodePtr_T  powermode 
)
Parameters
[in]handleHandle to the accelerometer object
[in]powermodeLast configured power mode of accelerometer sensor
Return values
RETCODE_SUCCESSGet mode success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of getting mode values other than Accelerometer_Powermode_E.
Returns
In case of other failures refer bma2x2LibErrorMapping or bmi160LibErrorMapping 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 Accelerometer_getRange ( Accelerometer_HandlePtr_T  handle,
Accelerometer_RangePtr_T  range 
)
Parameters
[in]handleHandle to the accelerometer object
[in]rangeLast configured range of accelerometer sensor
Return values
RETCODE_SUCCESSget Range success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of getting range values other than Accelerometer_Range_E.
Returns
In case of other failures refer bma2x2LibErrorMapping or bmi160LibErrorMapping 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:

+ Here is the caller graph for this function:

Retcode_T Accelerometer_getSleepDuration ( Accelerometer_HandlePtr_T  handle,
Accelerometer_SleepDurationPtr_T  lowPowerModeSleepDuration 
)
Parameters
[in]handleHandle to the accelerometer object
[in]rangeLast configured sleep duration of accelerometer sensor
Return values
RETCODE_SUCCESSGet Sleep Duration success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of getting sleep duration values other than Accelerometer_SleepDuration_E.
Returns
In case of other failures refer bma2x2LibErrorMapping or bmi160LibErrorMapping 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 Accelerometer_init ( Accelerometer_HandlePtr_T  handle)
Parameters
[in]handleHandle to the accelerometer object
Return values
RETCODE_SUCCESSAccelerometer initialization success.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
Returns
In case of any other error refer Bma280Utils_initialize or Bmi160Utils_initialize error codes.
Warning
This function needs to be called before calling any other accelerometer 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 Accelerometer_readXyzGValue ( Accelerometer_HandlePtr_T  handle,
Accelerometer_XyzDataPtr_T  value 
)
Parameters
[in]handleHandle to the accelerometer object
[in]valueParameter in which the accelerometer milli G value of XYZ gets collected
Return values
RETCODE_SUCCESSReading accelerometer xyzGvalue success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
Returns
In case of other failures refer bma2x2LibErrorMapping or bmi160LibErrorMapping 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:

+ Here is the caller graph for this function:

Retcode_T Accelerometer_readXyzLsbValue ( Accelerometer_HandlePtr_T  handle,
Accelerometer_XyzDataPtr_T  value 
)
Parameters
[in]handleHandle to the accelerometer object
[in]valueParameter in which the accelerometer LSB value of XYZ gets collected
Return values
RETCODE_SUCCESSReading accelerometer xyzLsb value success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
Returns
In case of other failures refer bma2x2LibErrorMapping or bmi160LibErrorMapping 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 Accelerometer_regDeferredCallback ( Accelerometer_HandlePtr_T  handle,
Accelerometer_InterruptChannel_T  intChannel,
accelDeferredTimeCallback  deferredCallback 
)
Parameters
[in]handleHandle to the accelerometer object
[in]intChannelChannel on which the deferred callback to be mapped
[in]accelDeferredTimeCallbackuser function pointer to be registered for deferred callback
Return values
RETCODE_SUCCESSRegistering deferred callback is success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle or invalid channel Accelerometer_InterruptChannel_E or NULL callback.
RETCODE_NOT_SUPPORTEDIn case of not supported.
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 Accelerometer_regRealTimeCallback ( Accelerometer_HandlePtr_T  handle,
Accelerometer_InterruptChannel_T  intChannel,
accelRealTimeCallback  realTimeCallback 
)
Parameters
[in]handleHandle to the accelerometer object
[in]intChannelChannel on which the real time callback to be mapped
[in]accelRealTimeCallbackuser function pointer to be registered for real time callback
Return values
RETCODE_SUCCESSRegistering real time callback is success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle or invalid channel Accelerometer_InterruptChannel_E or NULL callback.
RETCODE_NOT_SUPPORTEDIn case of not supported.
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 Accelerometer_setBandwidth ( Accelerometer_HandlePtr_T  handle,
Accelerometer_Bandwidth_T  bandwidth 
)
Parameters
[in]handleHandle to the accelerometer object
[in]bandwidthThe desired bandwidth that needs to be set, BMA280 supports upto 500Hz, Normally the sampling rate of the filtered data depends on the selected filter bandwidth and is always twice the selected bandwidth ( BW = ODR/2).
Return values
RETCODE_SUCCESSBandwidth setting success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of setting bandwidth values other than Accelerometer_Bandwidth_E.
Returns
In case of other failures refer bma2x2LibErrorMapping or bmi160LibErrorMapping API's.
Note
Bandwidth will be depends on the ODR as per the following Table:
Bandwidth Update Time
7.81 HZ 64 ms
15.63 HZ 32 ms
31.25 HZ 16 ms
62.5 HZ 8 ms
125 HZ 4 ms
250 HZ 2 ms
500 HZ 1 ms
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 Accelerometer_setMode ( Accelerometer_HandlePtr_T  handle,
Accelerometer_Powermode_T  powermode 
)
Parameters
[in]handleHandle to the accelerometer object
[in]powermodeThe desired power mode that needs to be set
Return values
RETCODE_SUCCESSSet mode success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of setting mode values other than Accelerometer_Powermode_E.
Returns
In case of other failures refer bma2x2LibErrorMapping or bmi160LibErrorMapping 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 Accelerometer_setRange ( Accelerometer_HandlePtr_T  handle,
Accelerometer_Range_T  range 
)
Parameters
[in]handleHandle to the accelerometer object
[in]rangeThe desired range that needs to be set
Return values
RETCODE_SUCCESSSet Range success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of setting range values other than Accelerometer_Range_E.
Returns
In case of other failures refer bma2x2LibErrorMapping or bmi160LibErrorMapping 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 Accelerometer_setSleepDuration ( Accelerometer_HandlePtr_T  handle,
Accelerometer_SleepDuration_T  lowPowerModeSleepDuration 
)
Parameters
[in]handleHandle to the accelerometer object
[in]lowPowerModeSleepDurationset value for sleep duration
Return values
RETCODE_SUCCESSSet Sleep Duration success.
RETCODE_UNINITIALIZEDif called without initializing the sensor.
RETCODE_INVALID_PARAMIn case of invalid sensor handle.
RETCODE_NOT_SUPPORTEDIn case of setting sleep duration values other than Accelerometer_SleepDuration_E.
Returns
In case of other failures refer bma2x2LibErrorMapping or bmi160LibErrorMapping 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