Macros | Functions | Variables
Gyroscope.c File Reference
#include "BCDS_SensorsInfo.h"
#include "BCDS_Gyroscope.h"
#include "Gyroscope.h"
#include "BCDS_Bmg160Utils.h"
#include <bmi160.h>
#include <bmg160.h>
#include "BCDS_Bmi160Utils.h"
+ Include dependency graph for Gyroscope.c:

Macros

#define BCDS_MODULE_ID   BCDS_SENSORS_ID_GYROSCOPE
 

Functions

static Retcode_T bmg160LibErrorMapping (BMG160_RETURN_FUNCTION_TYPE BMG160_libReturn)
 This function maps error codes returned from BMG160 library to retcode values. More...
 
static void bmgIsrCallback (uint32_t channel, uint32_t edge)
 BMG160 driver callback function that will be called during ISR. More...
 
static Retcode_T BMI160_libErrorMapping (BMI160_RETURN_FUNCTION_TYPE BMI160_libReturn)
 This function maps error codes returned from BMI160 library to retcode values. More...
 
Retcode_T Gyroscope_deInit (Gyroscope_HandlePtr_T handle)
 Function to DeInitializes the Gyroscope referenced by the passed handle. More...
 
Retcode_T Gyroscope_getBandwidth (Gyroscope_HandlePtr_T handle, Gyroscope_BandwidthPtr_T bandwidth)
 Reads the bandwidth for the Gyroscope referenced by the passed handle. More...
 
Retcode_T Gyroscope_getMode (Gyroscope_HandlePtr_T handle, Gyroscope_PowermodePtr_T powermode)
 Reads the power mode for the Gyroscope by the passed handle. More...
 
Retcode_T Gyroscope_getRange (Gyroscope_HandlePtr_T handle, Gyroscope_RangePtr_T range)
 Reads the Range for the Gyroscope referenced by the passed handle. More...
 
Retcode_T Gyroscope_init (Gyroscope_HandlePtr_T handle)
 Function to initialize Gyroscope.This needs to be called before calling any other API. More...
 
Retcode_T Gyroscope_readXyzDegreeValue (Gyroscope_HandlePtr_T handle, Gyroscope_XyzDataPtr_T gyrodata)
 Reads an Xyz degree value from the Gyroscope referenced by the passed handle. More...
 
Retcode_T Gyroscope_readXyzValue (Gyroscope_HandlePtr_T handle, Gyroscope_XyzDataPtr_T gyrodata)
 Reads an xyz values from the Gyroscope referenced by the passed handle. More...
 
Retcode_T Gyroscope_setAutoSleepDuration (Gyroscope_HandlePtr_T handle, Gyroscope_AutoSleepDuration_T lowPowerModeSleepDuration, Gyroscope_Bandwidth_T bandwidthForAutoSleep)
 Sets the Auto-SleepDuration for Gyroscope referenced by the passed handle. More...
 
Retcode_T Gyroscope_setBandwidth (Gyroscope_HandlePtr_T handle, Gyroscope_Bandwidth_T bandwidth)
 Sets the bandwidth for the Gyroscope referenced by the passed handle. More...
 
Retcode_T Gyroscope_setMode (Gyroscope_HandlePtr_T handle, Gyroscope_Powermode_T powermode)
 Sets the powermode for the Gyroscope by the passed handle. More...
 
Retcode_T Gyroscope_setRange (Gyroscope_HandlePtr_T handle, Gyroscope_Range_T range)
 Sets the Range for the Gyroscope by the passed handle. More...
 
Retcode_T Gyroscope_setSleepDuration (Gyroscope_HandlePtr_T handle, Gyroscope_SleepDuration_T lowPowerModeSleepDuration)
 Sets the SleepDuration for Gyroscope referenced by the passed handle. More...
 
static int8_t mappingEnumForGetFunctions (uint8_t start, uint8_t end, uint8_t getValueToBeTransalated, const uint8_t *lookUpTablePtr)
 

Variables

static const uint8_t autoSleepDurationValueLookUpTable [GYROSCOPE_BMG160_AUTOSLEEP_DURATION_OUT_OF_RANGE]
 
static uint16_t bmgRangeValue = BMG160SUPPORT_2000S_RANGE
 
static uint16_t bmiRangeValue = BMI160SUPPORT_2000S_RANGE
 
static const uint8_t bwLookUpTable [GYROSCOPE_BANDWIDTH_OUT_OF_RANGE]
 
static const uint8_t getModeLookUpTable [GYROSCOPE_POWERMODE_OUT_OF_RANGE]
 
static const uint8_t modeLookUpTable [GYROSCOPE_POWERMODE_OUT_OF_RANGE]
 
static const uint8_t rangeLookUpTable [GYROSCOPE_OUT_OF_RANGE]
 
static const uint16_t rangeValueLookUpTable [GYROSCOPE_OUT_OF_RANGE]
 
static const uint8_t sleepDurationValueLookUpTable [GYROSCOPE_BMG160_SLEEP_DURATION_OUT_OF_RANGE]
 

Detailed Description

This module contains the simplified API for accessing the gyro sensor

Macro Definition Documentation

#define BCDS_MODULE_ID   BCDS_SENSORS_ID_GYROSCOPE

Function Documentation

static Retcode_T bmg160LibErrorMapping ( BMG160_RETURN_FUNCTION_TYPE  BMG160_libReturn)
static
Parameters
[in]BMG160_RETURN_FUNCTION_TYPEReturn value from BMG160 library
Return values
RETCODE_OKBMG160 sensor API call success
RETCODE_FAILUREBMG160 sensor API call failed
RETCODE_INVALID_PARAMBMG160 sensor API call failed because of invalid input parameter

+ Here is the caller graph for this function:

static void bmgIsrCallback ( 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 BMG160

+ Here is the caller graph for this function:

static Retcode_T BMI160_libErrorMapping ( BMI160_RETURN_FUNCTION_TYPE  BMI160_libReturn)
static
Parameters
[in]BMI160_RETURN_FUNCTION_TYPEReturn value from BMI160 library
Return values
RETCODE_OKBMI160 sensor API call success
RETCODE_FAILUREBMI160 sensor API call failed

+ 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:

Variable Documentation

const uint8_t autoSleepDurationValueLookUpTable[GYROSCOPE_BMG160_AUTOSLEEP_DURATION_OUT_OF_RANGE]
static
Initial value:
=
{
}
#define BCDS_BMG160_5MS_AUTO_SLEEP_DURN_U8X
Definition: Gyroscope.h:116
#define BCDS_BMG160_8MS_AUTO_SLEEP_DURN_U8X
Definition: Gyroscope.h:117
#define BCDS_BMG160_4MS_AUTO_SLEEP_DURN_U8X
Definition: Gyroscope.h:115
#define BCDS_BMG160_15MS_AUTO_SLEEP_DURN_U8X
Definition: Gyroscope.h:119
#define BCDS_BMG160_NO_AUTO_SLEEP_DURN_U8X
Definition: Gyroscope.h:114
#define BCDS_BMG160_20MS_AUTO_SLEEP_DURN_U8X
Definition: Gyroscope.h:120
#define BCDS_BMG160_10MS_AUTO_SLEEP_DURN_U8X
Definition: Gyroscope.h:118
uint16_t bmgRangeValue = BMG160SUPPORT_2000S_RANGE
static
uint16_t bmiRangeValue = BMI160SUPPORT_2000S_RANGE
static
const uint8_t bwLookUpTable[GYROSCOPE_BANDWIDTH_OUT_OF_RANGE]
static
Initial value:
=
{
}
#define C_BMG160_BW_47HZ_U8X
Definition: bmg160.h:1606
#define BCDS_BMI160_GYRO_OUTPUT_DATA_RATE_50HZ
Definition: Gyroscope.h:94
#define C_BMG160_BW_64HZ_U8X
Definition: bmg160.h:1609
#define BCDS_BMI160_GYRO_OUTPUT_DATA_RATE_1600HZ
Definition: Gyroscope.h:99
#define BCDS_BMI160_GYRO_OUTPUT_DATA_RATE_200HZ
Definition: Gyroscope.h:96
#define C_BMG160_BW_116HZ_U8X
Definition: bmg160.h:1605
#define C_BMG160_NO_FILTER_U8X
Definition: bmg160.h:1603
#define C_BMG160_BW_230HZ_U8X
Definition: bmg160.h:1604
#define BCDS_BMI160_GYRO_OUTPUT_DATA_RATE_100HZ
Definition: Gyroscope.h:95
#define C_BMG160_BW_23HZ_U8X
Definition: bmg160.h:1607
#define C_BMG160_BW_12HZ_U8X
Definition: bmg160.h:1608
#define C_BMG160_BW_32HZ_U8X
Definition: bmg160.h:1610
#define BCDS_BMI160_GYRO_OUTPUT_DATA_RATE_800HZ
Definition: Gyroscope.h:98
#define BCDS_BMI160_GYRO_OUTPUT_DATA_RATE_400HZ
Definition: Gyroscope.h:97
#define BCDS_BMI160_GYRO_OUTPUT_DATA_RATE_25HZ
Definition: Gyroscope.h:93
const uint8_t getModeLookUpTable[GYROSCOPE_POWERMODE_OUT_OF_RANGE]
static
Initial value:
=
{
}
#define BMG160_MODE_SUSPEND
Definition: bmg160.h:1385
#define BMG160_MODE_NORMAL
Definition: bmg160.h:1383
#define BMG160_MODE_DEEPSUSPEND
Definition: bmg160.h:1384
#define BCDS_BMI160_GYRO_MODE_NORMAL
Definition: Gyroscope.h:105
#define BMG160_MODE_ADVANCEDPOWERSAVING
Definition: bmg160.h:1387
#define BMG160_MODE_FASTPOWERUP
Definition: bmg160.h:1386
#define BCDS_BMI160_GYRO_MODE_SUSPEND
Definition: Gyroscope.h:104
const uint8_t modeLookUpTable[GYROSCOPE_POWERMODE_OUT_OF_RANGE]
static
Initial value:
=
{
UINT8_C(GYRO_MODE_NORMAL),
}
#define BMG160_MODE_SUSPEND
Definition: bmg160.h:1385
#define BMG160_MODE_NORMAL
Definition: bmg160.h:1383
#define BMG160_MODE_DEEPSUSPEND
Definition: bmg160.h:1384
#define GYRO_MODE_SUSPEND
Definition: bmi160.h:3506
#define GYRO_MODE_FASTSTARTUP
Definition: bmi160.h:3508
#define BMG160_MODE_ADVANCEDPOWERSAVING
Definition: bmg160.h:1387
#define BMG160_MODE_FASTPOWERUP
Definition: bmg160.h:1386
#define GYRO_MODE_NORMAL
Definition: bmi160.h:3507
const uint8_t rangeLookUpTable[GYROSCOPE_OUT_OF_RANGE]
static
Initial value:
=
{
}
#define BCDS_BMI160_GYRO_RANGE_250_DEG_SEC
Definition: Gyroscope.h:111
#define BCDS_BMI160_GYRO_RANGE_125_DEG_SEC
Definition: Gyroscope.h:112
#define BMG160SUPPORT_BSTLIB_250S_RANGE
Definition: Gyroscope.h:71
#define BCDS_BMI160_GYRO_RANGE_1000_DEG_SEC
Definition: Gyroscope.h:109
#define BMG160SUPPORT_BSTLIB_1000S_RANGE
Definition: Gyroscope.h:73
#define BCDS_BMI160_GYRO_RANGE_500_DEG_SEC
Definition: Gyroscope.h:110
#define BMG160SUPPORT_BSTLIB_2000S_RANGE
Definition: Gyroscope.h:74
#define BMG160SUPPORT_BSTLIB_125S_RANGE
Definition: Gyroscope.h:70
#define BMG160SUPPORT_BSTLIB_500S_RANGE
Definition: Gyroscope.h:72
const uint16_t rangeValueLookUpTable[GYROSCOPE_OUT_OF_RANGE]
static
Initial value:
= {
}
#define BMG160SUPPORT_1000S_RANGE
Definition: Gyroscope.h:68
#define BMI160SUPPORT_500S_RANGE
Definition: Gyroscope.h:79
#define BMG160SUPPORT_500S_RANGE
Definition: Gyroscope.h:67
#define BMI160SUPPORT_1000S_RANGE
Definition: Gyroscope.h:80
#define BMG160SUPPORT_125S_RANGE
Definition: Gyroscope.h:65
#define BMI160SUPPORT_125S_RANGE
Definition: Gyroscope.h:77
#define BMG160SUPPORT_250S_RANGE
Definition: Gyroscope.h:66
#define BMG160SUPPORT_2000S_RANGE
Definition: Gyroscope.h:69
#define BMI160SUPPORT_250S_RANGE
Definition: Gyroscope.h:78
const uint8_t sleepDurationValueLookUpTable[GYROSCOPE_BMG160_SLEEP_DURATION_OUT_OF_RANGE]
static
Initial value:
= {
}
#define C_BMG160_5MS_SLEEP_DURN_U8X
Definition: Gyroscope.h:86
#define C_BMG160_8MS_SLEEP_DURN_U8X
Definition: Gyroscope.h:87
#define C_BMG160_15MS_SLEEP_DURN_U8X
Definition: Gyroscope.h:89
#define C_BMG160_4MS_SLEEP_DURN_U8X
Definition: Gyroscope.h:85
#define C_BMG160_10MS_SLEEP_DURN_U8X
Definition: Gyroscope.h:88
#define C_BMG160_NO_SLEEP_DURN_U8X
Definition: Gyroscope.h:84

This documentation file has been automatically generated on Wed May 6 2020 20:45:16 by doxygen 1.8.8