XDK API  3.6.0
Documentation
Functions | Variables
bmg160.c File Reference
#include "bmg160.h"
+ Include dependency graph for bmg160.c:

Functions

BMG160_RETURN_FUNCTION_TYPE bmg160_burst_read (u8 v_addr_u8, u8 *v_data_u8, u32 v_len_u32)
 This API reads the data from the given register. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_enable_fast_offset (void)
 This API is used to enable fast offset in the register 0x32 bit 3 it is a write only register. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_any_motion_durn_sample (u8 *v_durn_sample_u8)
 This API is used to get the any motion Duration samples in the register 0x1C bit 4 and 5. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_any_motion_enable_axis (u8 v_channel_u8, u8 *v_any_motion_axis_u8)
 This API is used to get the status of Any motion interrupt axis(X,Y,Z) enable channel. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_any_motion_thres (u8 *v_any_motion_thres_u8)
 This API is used to get Any motion Threshold in the register 0x1B bit from 0 to 6. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_auto_offset_enable (u8 *v_offset_enable_u8)
 This API is used to get the auto offset(auto_offset_enable) interrupt enable bits of the sensor in the registers 0x15 bit 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_auto_sleep_durn (u8 *v_durn_u8)
 This API is used to get the auto sleep duration in the register 0x12 bit 0 to 2. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_awake_durn (u8 *v_awake_durn_u8)
 This API is used to get the awake Duration in the register 0x1C bit 6 and 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_bw (u8 *v_bw_u8)
 This API is used to get the gyro bandwidth in the register 0x10 bits from 0 to 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_enable (u8 *v_data_enable_u8)
 This API is used to get the data(data_enable) interrupt enable bits of the sensor in the registers 0x15 bit 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_X (s16 *v_data_x_s16)
 Reads Rate data X in the registers 0x02 to 0x03. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_XYZ (struct bmg160_data_t *data)
 Reads data X,Y and Z from register location 0x02 to 0x07. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_XYZI (struct bmg160_data_t *data)
 Reads data X,Y,Z and Interrupts from register location 0x02 to 0x07. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_Y (s16 *v_data_y_s16)
 Reads Rate data Y in the registers 0x04 to 0x05. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_Z (s16 *v_data_z_s16)
 Reads Rate data Z in the registers 0x06 to 0x07. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fast_offset_enable_axis (u8 *v_fast_offset_u8)
 This API read the Fast offset enable v_axis_u8(X,Y and Z) in the register 0x32. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_FIFO_data_reg (u8 *v_fifo_data_u8)
 Reads FIFO data from location 0x3F. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_data_select (u8 *v_fifo_data_select_u8)
 This API is used to get the status of fifo data select in the register 0x3E bit 0 and 1. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_enable (u8 *v_fifo_enable_u8)
 This API is used to get the fifo(fifo_enable) interrupt enable bits of the sensor in the registers 0x15 bit 6. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_frame_count (u8 *v_fifo_frame_count_u8)
 this API is used to get the fifo frame counter in the register 0x0E bit 0 to 6 More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_mode (u8 *v_fifo_mode_u8)
 This API is used to get the status of fifo mode in the register 0x3E bit 6 and 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_overrun (u8 *v_fifo_overrun_u8)
 this API is used to get the fifo over run in the register 0x0E bit 7 More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_stat_reg (u8 *v_fifo_stat_u8)
 this api is used to read the fifo status of frame_counter and overrun in the register 0x0E More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_tag (u8 *v_fifo_tag_u8)
 This API is used to get the status of FIFO tag in the register 0x3D bit 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_wm_enable (u8 *v_fifo_wm_enable_u8)
 This API is used to get the status of fifo water mark in the register 0x1E bit 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_wm_level (u8 *v_fifo_wm_level_u8)
 This API is used to get Water Mark Level in the register 0x3D bit from 0 to 6. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_gp (u8 v_param_u8, u8 *v_gp_u8)
 This API is used to get the status of general purpose register in the register 0x3A and 0x3B. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_high_bw (u8 *v_high_bw_u8)
 This API is used to get data high bandwidth in the register 0x13 bit 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_highrate_durn_axis (u8 v_channel_u8, u8 *v_highrate_durn_axis_u8)
 This API is used to get the status of High duration of X,Y,Z axis in the registers 0x23, 0x25 and 0x27. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_highrate_enable_axis (u8 v_channel_u8, u8 *v_enable_u8)
 This API is used to get the status of High Enable Channel X,Y,Z in the registers 0x22, 0x24 and 0x26. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_highrate_hyst (u8 v_channel_u8, u8 *v_highrate_hyst_u8)
 This API is used to get the status of High Hysteresis of X,Y,Z axis in the registers 0x22,0x24 and 0x26. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_highrate_thres (u8 v_channel_u8, u8 *v_highrate_thres_u8)
 This API is used to get the value of High rate Threshold of X,Y,Z axis in the registers 0x22, 0x24 and 0x26. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_i2c_wdt (u8 v_channel_u8, u8 *v_i2c_wdt_u8)
 This API is used to get the status of i2c wdt select and enable in the register 0x34. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr1_any_motion (u8 *v_int1r_any_motion_u8)
 This API is used to get the any motion(int1_any) interrupt1 enable bits of the sensor in the registers 0x17 bit 1. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr1_fifo (u8 *v_intr_fifo_u8)
 This API is used to get the fifo(int1_fifo) interrupt1 enable bits of the sensor in the registers 0x18 bit 5. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr1_highrate (u8 *v_intr1_u8)
 This API is used to get the high rate(int1_high) interrupt1 enable bits of the sensor in the registers 0x17 bit 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr2_any_motion (u8 *v_intr2_any_motion_u8)
 This API is used to get the any motion(int2_any_motion) interrupt2 enable bits of the sensor in the registers 0x19 bit 1. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr2_fifo (u8 *v_intr_fifo_u8)
 This API is used to get the fifo(int2_fifo) interrupt2 enable bits of the sensor in the registers 0x18 bit 5. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr2_highrate (u8 *v_intr2_highrate_u8)
 This API is used to get the high rate(int2_high_rate) interrupt2 enable bits of the sensor in the registers 0x19 bit 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr2_offset (u8 v_axis_u8, u8 *v_intr2_offset_u8)
 This API is used to get the fast offset(intr2_fast_offset) and auto offset(intr2_auto_offset) of interrupt2 in the register 0x18. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_data (u8 v_axis_u8, u8 *v_intr_data_u8)
 This API is used to get the data interrupt1 and interrupt2(int1_data and int2_data) in the register 0x18. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_level (u8 v_param_u8, u8 *v_intr_level_u8)
 This API is used to get Active Level status in the register 0x16. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_offset (u8 v_axis_u8, u8 *v_intr1_offset_u8)
 This API is used to get the fast offset(int1_fast_offset) and auto offset(int1_auto_offset) of interrupt1 in the register 0x18. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_output_type (u8 v_param_u8, u8 *v_intr_output_type_u8)
 This API is used to get the output type status in the register 0x16. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_stat_reg_one (u8 *v_stat1_data_u8)
 This api used to reads the interrupt status of data, auto_offset, fast_offset and fifo_int in the register 0x0A. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_stat_reg_three (u8 *v_stat3_data_u8)
 This api used to reads the interrupt status of high_rate sign, high_rate first_z, high_rate first_x and high_rate first_y in the register 0x0C. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_stat_reg_two (u8 *v_stat2_data_u8)
 This api used to reads the interrupt status of. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_stat_reg_zero (u8 *v_stat0_data_u8)
 This api used to reads interrupt status of any motion and high rate in the register 0x09. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_latch_intr (u8 *v_latch_intr_u8)
 This API is used to get the Latch interrupt in the register 0x21 bit from 0 to 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_latch_stat (u8 *v_latch_stat_u8)
 This API is used to get the Latch Status in the register 0x21 bit 4. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_nvm_prog_mode (u8 *nvm_prog_mode)
 This API is used to get the status of nvm program mode in the register 0x33 bit 0. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_nvm_rdy (u8 *v_nvm_rdy_u8)
 This API is used to get the status of nvm program in the register 0x33 bit 2. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_nvm_remain (u8 *v_nvm_remain_u8)
 This API is used to get the status of nvm program remain in the register 0x33 bit from 4 to 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_offset (u8 v_axis_u8, s16 *v_offset_s16)
 This API is used to get the value of offset X, Y and Z in the registers 0x36, 0x37, 0x38, 0x39 and 0x3A the offset is a 12bit value. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_offset_unfilt (u8 v_param_u8, u8 *v_offset_unfilt_u8)
 This API is used to get the slow offset and fast offset unfilt data in the register 0x1A and 1B. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_offset_word_length (u8 v_channel_u8, u8 *v_offset_word_length_u8)
 This API is used to get Fast Offset WordLength and Auto Offset WordLength in the register 0x32. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_pmu_ext_tri_select (u8 *v_pwu_ext_tri_select_u8)
 This API used to get the status of External Trigger selection in the register 0x12h bits from 4 to 5. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_power_mode (u8 *v_power_mode_u8)
 This API is used to get the operating modes of the sensor in the registers 0x11 and 0x12. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_range_reg (u8 *v_range_u8)
 This API is used to get the range in the register 0x0F bits from 0 to 2. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_shadow_dis (u8 *v_shadow_dis_u8)
 This API is used to get the shadow dis in the register 0x13 bit 6. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_sleep_durn (u8 *v_durn_u8)
 This API is used to get the sleep duration in the register 0x11 bit 1 to 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_slow_offset_durn (u8 *v_offset_durn_u8)
 This API is used to get Slow Offset duration status in the register 0x31 bit 4,5 and 6. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_slow_offset_enable_axis (u8 v_channel_u8, u8 *v_slow_offset_u8)
 This API is used to get Slow Offset Enable channel X,Y,Z in the register 0x31. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_slow_offset_thres (u8 *v_offset_thres_u8)
 This API is used to get Slow Offset Threshold status in the register 0x31 bit 6 and 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_spi3 (u8 *v_spi3_u8)
 This API is used to get the status of spi3 in the register 0x34 bit 0. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_temp (s8 *v_temp_s8)
 Reads Temperature from register location 0x08. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_get_unfilt_data (u8 v_param_u8, u8 *v_unfilt_data_u8)
 This API is used to get the any motion and high rate unfilt data in the register 0x1A. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_init (struct bmg160_t *bmg160)
 This function is used for initialize the bus read and bus write functions and assign the chip id and I2C address of the gyro chip id is read in the register 0x00 bit from 0 to 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_read_register (u8 v_addr_u8, u8 *v_data_u8, u8 v_len_u8)
 This API reads the data from the given register. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_selftest (u8 *v_result_u8)
 This API is used to to do selftest to sensor sensor in the register 0x3C. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_any_motion_durn_sample (u8 v_durn_sample_u8)
 This API is used to set the any motion Duration samples in the register 0x1C bit 4 and 5. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_any_motion_enable_axis (u8 v_channel_u8, u8 v_any_motion_axis_u8)
 This API is used to set the status of Any motion interrupt axis(X,Y,Z) enable channel. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_any_motion_thres (u8 v_any_motion_thres_u8)
 This API is used to set Any motion Threshold in the register 0x1B bit from 0 to 6. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_auto_offset_enable (u8 v_offset_enable_u8)
 This API is used to set the auto offset(auto_offset_enable) interrupt enable bits of the sensor in the registers 0x15 bit 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_auto_sleep_durn (u8 v_durn_u8, u8 v_bw_u8)
 This API is used to set the auto sleep duration in the register 0x12 bit 0 to 2. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_awake_durn (u8 v_awake_durn_u8)
 This API is used to set the awake Duration in the register 0x1C bit 6 and 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_bw (u8 v_bw_u8)
 This API is used to set the gyro bandwidth in the register 0x10 bits from 0 to 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_data_enable (u8 v_data_enable_u8)
 This API is used to set the data(data_enable) interrupt enable bits of the sensor in the registers 0x15 bit 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fast_offset_enable_axis (u8 v_channel_u8, u8 v_fast_offset_u8)
 This API set the Fast offset enable v_axis_u8(X,Y and Z) in the register 0x32. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_data_select (u8 v_fifo_data_select_u8)
 This API is used to set the status of fifo data select in the register 0x3E bit 0 and 1. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_enable (u8 v_fifo_enable_u8)
 This API is used to set the fifo(fifo_enable) interrupt enable bits of the sensor in the registers 0x15 bit 6. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_mode (u8 v_fifo_mode_u8)
 This API is used to set the status of fifo mode in the register 0x3E bit 6 and 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_tag (u8 v_fifo_tag_u8)
 This API is used to set the status of FIFO tag in the register 0x3D bit 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_wm_enable (u8 v_fifo_wm_enable_u8)
 This API is used to set the status of fifo water mark in the register 0x1E bit 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_wm_level (u8 v_fifo_wm_level_u8)
 This API is used to set Water Mark Level in the register 0x3D bit from 0 to 6. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_gp (u8 v_param_u8, u8 v_gp_u8)
 This API is used to set the status of general purpose register in the register 0x3A and 0x3B. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_high_bw (u8 v_high_bw_u8)
 This API is used to set data high bandwidth in the register 0x13 bit 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_highrate_durn_axis (u8 v_channel_u8, u8 v_highrate_durn_axis_u8)
 This API is used to set the value of High duration of X,Y,Z axis in the registers 0x23, 0x25 and 0x27. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_highrate_enable_axis (u8 v_channel_u8, u8 v_enable_u8)
 This API is used to set the status of High Enable Channel X,Y,Z in the registers 0x22, 0x24 and 0x26. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_highrate_hyst (u8 v_channel_u8, u8 v_highrate_hyst_u8)
 This API is used to set the status of High Hysteresis of X,Y,Z axis in the registers 0x22,0x24 and 0x26. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_highrate_thres (u8 v_channel_u8, u8 v_highrate_thres_u8)
 This API is used to set the value of High rate Threshold of X,Y,Z axis in the registers 0x22, 0x24 and 0x26. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_i2c_wdt (u8 v_channel_u8, u8 v_i2c_wdt_u8)
 This API is used to set the status of i2c wdt select and enable in the register 0x34. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr1_any_motion (u8 v_int1r_any_motion_u8)
 This API is used to set the any motion(int1_any) interrupt1 enable bits of the sensor in the registers 0x17 bit 1. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr1_highrate (u8 v_intr1_u8)
 This API is used to set the high rate(int1_high) interrupt1 enable bits of the sensor in the registers 0x17 bit 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr1_offset (u8 v_axis_u8, u8 v_intr1_offset_u8)
 This API is used to set the fast offset(int1_fast_offset) and auto offset(int1_auto_offset) of interrupt1 in the register 0x18. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr2_any_motion (u8 v_intr2_any_motion_u8)
 This API is used to set the any motion(int2_any_motion) interrupt2 enable bits of the sensor in the registers 0x19 bit 1. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr2_highrate (u8 v_intr2_highrate_u8)
 This API is used to set the high rate(int2_high_rate) interrupt2 enable bits of the sensor in the registers 0x19 bit 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr2_offset (u8 v_axis_u8, u8 v_intr2_offset_u8)
 This API is used to set the fast offset(intr2_fast_offset) and auto offset(intr2_auto_offset) of interrupt2 in the register 0x18. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr_data (u8 v_axis_u8, u8 v_intr_data_u8)
 This API is used to set the data interrupt1 and interrupt2(int1_data and int2_data) in the register 0x18. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr_fifo (u8 v_axis_u8, u8 v_intr_fifo_u8)
 This API is used to set the value of the fifo interrupt1 and interrupt2(int1_fifo and int2_fifo) in the register 0x18. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr_level (u8 v_param_u8, u8 v_intr_level_u8)
 This API is used to set Active Level status in the register 0x16. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr_output_type (u8 v_param_u8, u8 v_intr_output_type_u8)
 This API is used to set the output type status in the register 0x16. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_latch_intr (u8 v_latch_intr_u8)
 This API is used to set the Latch interrupt in the register 0x21 bit from 0 to 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_latch_stat (u8 v_latch_stat_u8)
 This API is used to set the Latch Status in the register 0x21 bit 4. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_nvm_load (u8 v_nvm_load_u8)
 This API is used to set the status of nvm program remain in the register 0x33 bit from 4 to 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_nvm_prog_mode (u8 nvm_prog_mode)
 This API is used to set the status of nvm program mode in the register 0x33 bit 0. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_nvm_prog_trig (u8 nvm_prog_trig)
 This API is used to set the status of nvm ready in the register 0x33 bit 1. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_offset (u8 v_axis_u8, s16 v_offset_s16)
 This API is used to set the value of offset X, Y and Z in the registers 0x36, 0x37, 0x38, 0x39 and 0x3A the offset is a 12bit value. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_offset_rst (u8 v_offset_rst_u8)
 This API is used to set the offset Reset in the register 0x21 bit 6. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_offset_unfilt (u8 v_param_u8, u8 v_offset_unfilt_u8)
 This API is used to set the slow offset and fast offset unfilt data in the register 0x1A and 1B. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_offset_word_length (u8 v_channel_u8, u8 v_offset_word_length_u8)
 This API is used to set Fast Offset WordLength and Auto Offset WordLength in the register 0x32. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_pmu_ext_tri_select (u8 v_pwu_ext_tri_select_u8)
 This API used to set the status of External Trigger selection in the register 0x12h bits from 4 to 5. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_power_mode (u8 v_power_mode_u8)
 This API is used to set the operating modes of the sensor in the registers 0x11 and 0x12. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_range_reg (u8 v_range_u8)
 This API is used to set the range in the register 0x0F bits from 0 to 2. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_rst_intr (u8 v_rst_int_u8)
 This API is used to set the Interrupt Reset in the register 0x21 bit 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_shadow_dis (u8 v_shadow_dis_u8)
 This API is used to set the shadow dis in the register 0x13 bit 6. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_sleep_durn (u8 v_durn_u8)
 This API is used to set the sleep duration in the register 0x11 bit 1 to 3. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_slow_offset_durn (u8 v_offset_durn_u8)
 This API is used to set Slow Offset duration status in the register 0x31 bit 4,5 and 6. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_slow_offset_enable_axis (u8 v_channel_u8, u8 v_slow_offset_u8)
 This API is used to set Slow Offset Enable channel X,Y,Z in the register 0x31. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_slow_offset_thres (u8 v_offset_thres_u8)
 This API is used to set Slow Offset Threshold status in the register 0x31 bit 6 and 7. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_soft_rst (void)
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_spi3 (u8 v_spi3_u8)
 This API is used to set the status of spi3 in the register 0x34 bit 0. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_set_unfilt_data (u8 v_param_u8, u8 v_unfilt_data_u8)
 This API is used to set the any motion and high rate unfilt data in the register 0x1A. More...
 
BMG160_RETURN_FUNCTION_TYPE bmg160_write_register (u8 v_addr_u8, u8 *v_data_u8, u8 v_len_u8)
 This API write the data to the given register. More...
 

Variables

static struct bmg160_tp_bmg160
 

Function Documentation

BMG160_RETURN_FUNCTION_TYPE bmg160_burst_read ( u8  v_addr_u8,
u8 v_data_u8,
u32  v_len_u32 
)
Parameters
v_addr_u8-> Address of the register
v_data_u8-> The data from the register
v_len_u32-> no of bytes to read
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_enable_fast_offset ( void  )
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_any_motion_durn_sample ( u8 v_durn_sample_u8)
Parameters
v_durn_sample_u8: The value of any motion duration samples
value Samples
0x00 4 samples
0x01 8 samples
0x02 12 samples
0x03 16 samples
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_any_motion_enable_axis ( u8  v_channel_u8,
u8 v_any_motion_axis_u8 
)
Note
BMG160_X_AXIS -> bit 0
BMG160_Y_AXIS -> bit 1
BMG160_Z_AXIS -> bit 2
Parameters
v_channel_u8: The value of Any Enable channel number
v_channel_u8 axis
0 BMG160_X_AXIS
1 BMG160_Y_AXIS
2 BMG160_Z_AXIS
v_data_u8The value of Any motion axis enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_any_motion_thres ( u8 v_any_motion_thres_u8)
Parameters
v_any_motion_thres_u8: The value of any_motion Threshold
Note
Any motion threshold can be calculate using
((1+ v_any_motion_thres_u8)*16LSB)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_auto_offset_enable ( u8 v_offset_enable_u8)
Parameters
v_offset_enable_u8: The value of offset enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_auto_sleep_durn ( u8 v_durn_u8)
Parameters
v_durn_u8: The value of gyro auto sleep duration
sleep duration value
not allowed 0
4ms 1
5ms 2
8ms 3
10ms 4
15ms 5
20ms 6
40ms 7
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_get_awake_durn ( u8 v_awake_durn_u8)
Parameters
v_awake_durn_u8: The value of awake Duration
value Duration
0x00 8 samples
0x01 16 samples
0x02 32 samples
0x03 64 samples
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_bw ( u8 v_bw_u8)
Parameters
v_bw_u8The value of gyro bandwidth
value bandwidth
0x00 BMG160_BW_500_HZ
0x01 BMG160_BW_230_HZ
0x02 BMG160_BW_116_HZ
0x03 BMG160_BW_47_HZ
0x04 BMG160_BW_23_HZ
0x05 BMG160_BW_12_HZ
0x06 BMG160_BW_64_HZ
0x07 BMG160_BW_32_HZ
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_enable ( u8 v_data_enable_u8)
Parameters
v_data_enable_u8: The value of data enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_X ( s16 v_data_x_s16)
Parameters
v_data_x_s16The value of gyro x axis data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_XYZ ( struct bmg160_data_t data)
Parameters
dataThe value of gyro xyz axis data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_XYZI ( struct bmg160_data_t data)
Parameters
dataThe value of gyro xyz axis data and interrupt status
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_Y ( s16 v_data_y_s16)
Parameters
v_data_y_s16The value of gyro y axis data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_data_Z ( s16 v_data_z_s16)
Parameters
v_data_z_s16The value of gyro z axis data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fast_offset_enable_axis ( u8 v_fast_offset_u8)
Note
X_AXIS -> bit 0
Y_AXIS -> bit 1
Z_AXIS -> bit 2
Parameters
v_fast_offset_u8The value of fast offset enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_FIFO_data_reg ( u8 v_fifo_data_u8)
Parameters
v_fifo_data_u8: The data of fifo
Returns
results of bus communication function
Return values
0-> Success
-1-> Error result of communication routines
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_data_select ( u8 v_fifo_data_select_u8)
Parameters
v_fifo_data_select_u8: The value of fifo data selection
data selection value
X,Y and Z (DEFAULT) 0
X only 1
Y only 2
Z only 3
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_enable ( u8 v_fifo_enable_u8)
Parameters
v_fifo_enable_u8: The value of fifo enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_frame_count ( u8 v_fifo_frame_count_u8)
Parameters
v_fifo_frame_count_u8The value of fifo frame counter
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_mode ( u8 v_fifo_mode_u8)
Parameters
v_fifo_mode_u8: The value of fifo mode
mode value
BYPASS 0
FIFO 1
STREAM 2
RESERVED 3
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_overrun ( u8 v_fifo_overrun_u8)
Parameters
v_fifo_overrun_u8The value of fifo over run
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_stat_reg ( u8 v_fifo_stat_u8)
Note
frame_counter > bit from 0 to 6
overrun -> bit 7
Parameters
v_fifo_stat_u8: The value of fifo overrun and fifo counter
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_tag ( u8 v_fifo_tag_u8)
Parameters
v_fifo_tag_u8: The value of fifo tag enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_wm_enable ( u8 v_fifo_wm_enable_u8)
Parameters
v_fifo_wm_enable_u8: The value of fifo water mark enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_wm_level ( u8 v_fifo_wm_level_u8)
Parameters
v_fifo_wm_level_u8: The value of fifo water mark level
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_gp ( u8  v_param_u8,
u8 v_gp_u8 
)
Parameters
v_param_u8The value of general purpose register select
v_param_u8 value
BMG160_GP0 0
BMG160_GP1 1
v_gp_u8The value of general purpose register
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_high_bw ( u8 v_high_bw_u8)
Parameters
v_high_bw_u8: The value of high bandwidth
value Description
1 unfiltered
0 filtered
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_highrate_durn_axis ( u8  v_channel_u8,
u8 v_highrate_durn_axis_u8 
)
Note
X_AXIS - 0x23 bit form 0 to 7
Y_AXIS - 0x25 bit form 0 to 7
Z_AXIS - 0x27 bit form 0 to 7
Parameters
v_channel_u8The value of High Duration channel number
v_channel_u8 value
BMG160_X_AXIS 0
BMG160_Y_AXIS 1
BMG160_Z_AXIS 2
v_highrate_durn_axis_u8The value of high duration
Note
High rate duration can be calculated by using the formula
High_durn = ((1+v_highrate_durn_axis_u8)*2.5ms)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_highrate_enable_axis ( u8  v_channel_u8,
u8 v_enable_u8 
)
Note
X_AXIS - 0x22 bit 0
Y_AXIS - 0x24 bit 0
Z_AXIS - 0x26 bit 0
Parameters
v_channel_u8: The value of high enable channel number
v_channel_u8 value
BMG160_X_AXIS 0
BMG160_Y_AXIS 1
BMG160_Z_AXIS 2
v_enable_u8The value of high axis enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_highrate_hyst ( u8  v_channel_u8,
u8 v_highrate_hyst_u8 
)
Note
X_AXIS - 0x22 bit 6 and 7
Y_AXIS - 0x24 bit 6 and 7
Z_AXIS - 0x26 bit 6 and 7
Parameters
v_channel_u8The value of high Hysteresis channel number
v_channel_u8 value
BMG160_X_AXIS 0
BMG160_Y_AXIS 1
BMG160_Z_AXIS 2
v_highrate_hyst_u8The value of high Hysteresis
Note
High hysteresis can be calculated by
High_hyst = ((255+256 *v_highrate_hyst_u8) * 4LSB)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_highrate_thres ( u8  v_channel_u8,
u8 v_highrate_thres_u8 
)
Note
X_AXIS - 0x22 bit from 1 to 5
Y_AXIS - 0x24 bit from 1 to 5
Z_AXIS - 0x26 bit from 1 to 5
Parameters
v_channel_u8: The value of high threshold channel number
v_channel_u8 value
BMG160_X_AXIS 0
BMG160_Y_AXIS 1
BMG160_Z_AXIS 2
v_highrate_thres_u8the high threshold value
Note
High Threshold can be calculated by
High_thres = ((255+256 *v_highrate_thres_u8) * 4LSB)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_i2c_wdt ( u8  v_channel_u8,
u8 v_i2c_wdt_u8 
)
Note
i2c_wdt_select -> bit 1
i2c_wdt_enable -> bit 2
Parameters
v_channel_u8The value of i2c wdt channel number
v_channel_u8 value
BMG160_I2C_WDT_ENABLE 1
BMG160_I2C_WDT_SELECT 0
v_i2c_wdt_u8The value of I2C enable and WDT select
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr1_any_motion ( u8 v_int1r_any_motion_u8)
Parameters
v_int1r_any_motion_u8: The value of any motion interrupt1
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr1_fifo ( u8 v_intr_fifo_u8)
Parameters
v_intr_fifo_u8: The interrupt1 fifo value
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr1_highrate ( u8 v_intr1_u8)
Parameters
v_intr1_u8: The value of interrupt1 high_rate enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr2_any_motion ( u8 v_intr2_any_motion_u8)
Parameters
v_intr2_any_motion_u8: The value of interrupt2 any_motion
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr2_fifo ( u8 v_intr_fifo_u8)
Parameters
v_intr_fifo_u8: The interrupt2 fifo value
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr2_highrate ( u8 v_intr2_highrate_u8)
Parameters
v_intr2_highrate_u8: The interrupt2 high_rate value
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr2_offset ( u8  v_axis_u8,
u8 v_intr2_offset_u8 
)
Note
int2_fast_offset -> bit 6
int2_auto_offset -> bit 4
Parameters
v_axis_u8The value of fast/auto offset interrupts selection
v_axis_u8 Data interrupt
1 BMG160_FAST_OFFSET
2 BMG160_AUTO_OFFSET
v_intr2_offset_u8The value of fast/auto offset enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_data ( u8  v_axis_u8,
u8 v_intr_data_u8 
)
Note
INT1 -> bit 0
INT2 -> bit 7
Parameters
v_axis_u8data interrupt selection
v_axis_u8 Data interrupt
0 BMG160_INTR1_DATA
1 BMG160_INTR2_DATA
v_intr_data_u8The value of data interrupt1 or interrupt2
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_level ( u8  v_param_u8,
u8 v_intr_level_u8 
)
Note
INT1 -> bit 0
INT2 -> bit 2
Parameters
v_param_u8The value of Active Level selection number
v_param_u8Active Level
0 BMG160_INTR1
1 BMG160_INTR2
v_intr_level_u8The value of Active Level status value
value Active Level
1 Active HIGH
0 Active LOW
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_offset ( u8  v_axis_u8,
u8 v_intr1_offset_u8 
)
Note
int1_fast_offset -> bit 1
int1_auto_offset -> bit 3
Parameters
v_axis_u8The value of fast/auto offset interrupts selection
v_axis_u8 Data interrupt
1 BMG160_FAST_OFFSET
2 BMG160_AUTO_OFFSET
v_intr1_offset_u8The value of fast/auto offset
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_output_type ( u8  v_param_u8,
u8 v_intr_output_type_u8 
)
Note
INT1 -> bit 1
INT2 -> bit 3
Parameters
v_param_u8The value of output type selection number
v_param_u8output type
0 BMG160_INTR1
1 BMG160_INTR2
v_intr_output_type_u8The value of output type
value output
1 open drain
0 push pull
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_stat_reg_one ( u8 v_stat1_data_u8)
Note
data bit -> 7
auto_offset bit -> 6
fast_offset bit -> 5
fifo_int bit -> 4
Parameters
v_stat1_data_u8: The interrupt status of data, auto_offset, fast_offset and fifo_int
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_stat_reg_three ( u8 v_stat3_data_u8)
Note
high_rate sign bit -> 3
high_rate first_z bit -> 2
high_rate first_x bit -> 1
high_rate first_y bit -> 0
high_rate first_y bit -> 0
Parameters
v_stat3_data_u8: The interrupt status of high_rate sign, high_rate first_z, high_rate first_x and high_rate first_y
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_stat_reg_two ( u8 v_stat2_data_u8)
Note
any motion sign, any motion first_z, any motion first_x and any motion first_y in the register 0x0B
any motion sign bit -> 3
any motion first_z bit -> 2
any motion first_x bit -> 1
any motion first_y bit -> 0
Parameters
v_stat2_data_u8: Pointer holding the the interrupt status of any motion sign, any motion first_z, any motion first_x and any motion first_y
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_intr_stat_reg_zero ( u8 v_stat0_data_u8)
Note
any motion bit -> 2
high rate bit -> 1
Parameters
v_stat0_data_u8: The interrupt status of any motion and high rate
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_latch_intr ( u8 v_latch_intr_u8)
Parameters
v_latch_intr_u8: The value of latch interrupt
Latch Interrupt Value
BMG160_NON_LATCH 0x00
BMG160_LATCH_250_MS 0x01
BMG160_LATCH_500_MS 0x02
BMG160_LATCH_1_SEC 0x03
BMG160_LATCH_2_SEC 0x04
BMG160_LATCH_4_SEC 0x05
BMG160_LATCH_8_SEC 0x06
BMG160_LATCH_LATCHED 0x07
BMG160_LATCH_NON_LATCHED 0x08
BMG160_LATCH_250_MICRO_SEC 0x09
BMG160_LATCH_500_MICRO_SEC 0x0A
BMG160_LATCH_1_MILLI_SEC 0x0B
BMG160_LATCH_12.5_MILLI_SEC 0x0C
BMG160_LATCH_25_MILLI_SEC 0x0D
BMG160_LATCH_50_MILLI_SEC 0x0E
BMG160_LATCH_LATCHED 0x0F
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_latch_stat ( u8 v_latch_stat_u8)
Parameters
v_latch_stat_u8: The value of latch status
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_nvm_prog_mode ( u8 nvm_prog_mode)
Parameters
nvm_prog_modeThe value of nvm program mode
value Description
1 Unlock
0 Lock nvm write
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_nvm_rdy ( u8 v_nvm_rdy_u8)
Parameters
v_nvm_rdy_u8The value of nvm program
value Description
1 NVM write is in progress
0 NVM is ready to accept a new write
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_nvm_remain ( u8 v_nvm_remain_u8)
Parameters
v_nvm_remain_u8The value of nvm program
value Description
1 Do not trigger
0 Trigger
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_offset ( u8  v_axis_u8,
s16 v_offset_s16 
)
Note
X_AXIS ->
bit 0 and 1 is available in the register 0x3A bit 2 and 3
bit 2 and 3 is available in the register 0x36 bit 6 and 7
bit 4 to 11 is available in the register 0x37 bit 0 to 7
Y_AXIS ->
bit 0 is available in the register 0x3A bit 1
bit 1,2 and 3 is available in the register 0x36 bit 3,4 and 5
bit 4 to 11 is available in the register 0x38 bit 0 to 7
Z_AXIS ->
bit 0 is available in the register 0x3A bit 0
bit 1,2 and 3 is available in the register 0x36 bit 0,1 and 3
bit 4 to 11 is available in the register 0x39 bit 0 to 7
Parameters
v_axis_u8: The value of offset axis selection
v_axis_u8 value
BMG160_X_AXIS 1
BMG160_Y_AXIS 0
BMG160_Z_AXIS 0
v_offset_s16The value of offset
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_offset_unfilt ( u8  v_param_u8,
u8 v_offset_unfilt_u8 
)
Note
slow_offset_unfilt -> 0x1A bit 5
fast_offset_unfilt -> 0x1B bit 7
Parameters
v_param_u8The value of fast/slow offset unfilt data selection
v_param_u8 offset selection
0 BMG160_SLOW_OFFSET
1 BMG160_FAST_OFFSET
v_offset_unfilt_u8The value of fast/slow offset unfilt data
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_offset_word_length ( u8  v_channel_u8,
u8 v_offset_word_length_u8 
)
Note
fast_offset_wordlength -> bit 4 and 5
auto_offset_wordlength -> bit 6 and 7
Parameters
v_channel_u8The value of WordLengthchannel number
v_channel_u8 value
BMG160_AUTO_OFFSET_WL 0
BMG160_FAST_OFFSET_WL 1
v_offset_word_length_u8The value of offset word length
value word length
0x00 32 samples
0x01 64 samples
0x02 128 samples
0x03 256 samples
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_pmu_ext_tri_select ( u8 v_pwu_ext_tri_select_u8)
Parameters
v_pwu_ext_tri_select_u8: The value of External Trigger selection
v_pwu_ext_tri_select_u8 Trigger source
0x00 No
0x01 INT1 pin
0x02 INT2 pin
0x03 SDO pin(SPI3 mode)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_power_mode ( u8 v_power_mode_u8)
Parameters
v_power_mode_u8:The value of power mode
value power mode
0 BMG160_MODE_NORMAL
1 BMG160_MODE_SUSPEND
2 BMG160_MODE_DEEPSUSPEND
3 BMG160_MODE_FASTPOWERUP
4 BMG160_MODE_ADVANCEDPOWERSAVING
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_get_range_reg ( u8 v_range_u8)
Parameters
v_range_u8: The value of gyro range
value range
0x00 BMG160_RANGE_2000
0x01 BMG160_RANGE_1000
0x02 BMG160_RANGE_500
0x03 BMG160_RANGE_250
0x04 BMG160_RANGE_125
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_get_shadow_dis ( u8 v_shadow_dis_u8)
Parameters
v_shadow_dis_u8: The value of shadow dis
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_sleep_durn ( u8 v_durn_u8)
Parameters
v_durn_u8: The value of sleep duration
sleep duration value
2ms 0
4ms 1
5ms 2
8ms 3
10ms 4
15ms 5
18ms 6
20ms 7
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_slow_offset_durn ( u8 v_offset_durn_u8)
Parameters
v_offset_durn_u8: The value of Slow Offset duration
value Duration
0x00 40ms
0x01 80ms
0x02 160ms
0x03 320ms
0x04 640ms
0x05 1280ms
0x06 unused
0x07 unused
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_slow_offset_enable_axis ( u8  v_channel_u8,
u8 v_slow_offset_u8 
)
Note
X_AXIS -> bit 0
Y_AXIS -> bit 1
Z_AXIS -> bit 2
Parameters
v_channel_u8The value of slow offset channel number
v_channel_u8 value
BMG160_X_AXIS 0
BMG160_Y_AXIS 1
BMG160_Z_AXIS 2
v_slow_offset_u8The slow offset value
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_slow_offset_thres ( u8 v_offset_thres_u8)
Parameters
v_offset_thres_u8: The value of slow offset Threshold
value threshold
0x00 0.1 degree/sec
0x01 0.2 degree/sec
0x02 0.5 degree/sec
0x03 1 degree/sec
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_spi3 ( u8 v_spi3_u8)
Parameters
v_spi3_u8: The value of spi3 enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_temp ( s8 v_temp_s8)
Parameters
v_temp_s8The value of temperature
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_get_unfilt_data ( u8  v_param_u8,
u8 v_unfilt_data_u8 
)
Note
any_unfilt_data -> bit 1
high_unfilt_data -> bit 3
Parameters
v_param_u8The value of any/high offset unfilt data selection
v_param_u8 offset selection
1 BMG160_HIGHRATE_UNFILT_DATA
3 BMG160_ANY_MOTION_UNFILT_DATA
v_unfilt_data_u8The value of any/high unfilt data
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_init ( struct bmg160_t bmg160)
Parameters
bmg160structure pointer.
Note
While changing the parameter of the bmg160_t consider the following point:
Changing the reference value of the parameter will changes the local copy or local reference make sure your changes will not affect the reference value of the parameter (Better case don't change the reference value of the parameter)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_read_register ( u8  v_addr_u8,
u8 v_data_u8,
u8  v_len_u8 
)
Parameters
v_addr_u8-> Address of the register
v_data_u8-> The data from the register
v_len_u8-> no of bytes to read
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_selftest ( u8 v_result_u8)
Parameters
v_result_u8The value of self test
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_any_motion_durn_sample ( u8  v_durn_sample_u8)
Parameters
v_durn_sample_u8: The value of any motion duration samples
value Samples
0x00 4 samples
0x01 8 samples
0x02 12 samples
0x03 16 samples
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_any_motion_enable_axis ( u8  v_channel_u8,
u8  v_any_motion_axis_u8 
)
Note
BMG160_X_AXIS -> bit 0
BMG160_Y_AXIS -> bit 1
BMG160_Z_AXIS -> bit 2
Parameters
v_channel_u8: The value of Any Enable channel number
v_channel_u8 axis
0 BMG160_X_AXIS
1 BMG160_Y_AXIS
2 BMG160_Z_AXIS
v_any_motion_axis_u8The value of Any motion axis enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_any_motion_thres ( u8  v_any_motion_thres_u8)
Parameters
v_any_motion_thres_u8: The value of any_motion Threshold
Note
Any motion threshold can be calculate using
((1+ v_any_motion_thres_u8)*16LSB)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_auto_offset_enable ( u8  v_offset_enable_u8)
Parameters
v_offset_enable_u8: The value of offset enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_auto_sleep_durn ( u8  v_durn_u8,
u8  v_bw_u8 
)
Parameters
v_durn_u8: The value of gyro auto sleep duration
sleep duration value
not allowed 0
4ms 1
5ms 2
8ms 3
10ms 4
15ms 5
20ms 6
40ms 7
v_bw_u8: The value of selected bandwidth
v_bw_u8 value
C_BMG160_NO_FILTER_U8X 0
C_BMG160_BW_230HZ_U8X 1
C_BMG160_BW_116HZ_u8X 2
C_BMG160_BW_47HZ_u8X 3
C_BMG160_BW_23HZ_u8X 4
C_BMG160_BW_12HZ_u8X 5
C_BMG160_BW_64HZ_u8X 6
C_BMG160_BW_32HZ_u8X 7
Note
: sleep duration depends on selected power mode and bandwidth
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_set_awake_durn ( u8  v_awake_durn_u8)
Parameters
v_awake_durn_u8: The value of awake Duration
value Duration
0x00 8 samples
0x01 16 samples
0x02 32 samples
0x03 64 samples
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_bw ( u8  v_bw_u8)
Parameters
v_bw_u8The value of gyro bandwidth
value bandwidth
0x00 BMG160_BW_500_HZ
0x01 BMG160_BW_230_HZ
0x02 BMG160_BW_116_HZ
0x03 BMG160_BW_47_HZ
0x04 BMG160_BW_23_HZ
0x05 BMG160_BW_12_HZ
0x06 BMG160_BW_64_HZ
0x07 BMG160_BW_32_HZ
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_set_data_enable ( u8  v_data_enable_u8)
Parameters
v_data_enable_u8: The value of data enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fast_offset_enable_axis ( u8  v_channel_u8,
u8  v_fast_offset_u8 
)
Note
X_AXIS -> bit 0
Y_AXIS -> bit 1
Z_AXIS -> bit 2
Parameters
v_channel_u8The value of fast offset channel select
v_channel_u8 value
BMG160_X_AXIS 0
BMG160_Y_AXIS 1
BMG160_Z_AXIS 2
v_fast_offset_u8The value of fast offset enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_data_select ( u8  v_fifo_data_select_u8)
Parameters
v_fifo_data_select_u8: The value of fifo data selection
data selection value
X,Y and Z (DEFAULT) 0
X only 1
Y only 2
Z only 3
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_enable ( u8  v_fifo_enable_u8)
Parameters
v_fifo_enable_u8: The value of fifo enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_mode ( u8  v_fifo_mode_u8)
Parameters
v_fifo_mode_u8: The value of fifo mode
mode value
BYPASS 0
FIFO 1
STREAM 2
RESERVED 3
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_tag ( u8  v_fifo_tag_u8)
Parameters
v_fifo_tag_u8: The value of fifo tag enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_wm_enable ( u8  v_fifo_wm_enable_u8)
Parameters
v_fifo_wm_enable_u8: The value of fifo water mark enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_fifo_wm_level ( u8  v_fifo_wm_level_u8)
Parameters
v_fifo_wm_level_u8: The value of fifo water mark level
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_gp ( u8  v_param_u8,
u8  v_gp_u8 
)
Parameters
v_param_u8The value of general purpose register select
v_param_u8 value
BMG160_GP0 0
BMG160_GP1 1
v_gp_u8The value of general purpose register
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_high_bw ( u8  v_high_bw_u8)
Parameters
v_high_bw_u8: The value of high bandwidth
value Description
1 unfiltered
0 filtered
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_set_highrate_durn_axis ( u8  v_channel_u8,
u8  v_highrate_durn_axis_u8 
)
Note
X_AXIS - 0x23 bit form 0 to 7
Y_AXIS - 0x25 bit form 0 to 7
Z_AXIS - 0x27 bit form 0 to 7
Parameters
v_channel_u8The value of High Duration channel number
v_channel_u8 value
BMG160_X_AXIS 0
BMG160_Y_AXIS 1
BMG160_Z_AXIS 2
v_highrate_durn_axis_u8The value of high duration
Note
High rate duration can be calculated by using the formula
High_durn = ((1+v_highrate_durn_axis_u8)*2.5ms)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_highrate_enable_axis ( u8  v_channel_u8,
u8  v_enable_u8 
)
Note
X_AXIS - 0x22 bit 0
Y_AXIS - 0x24 bit 0
Z_AXIS - 0x26 bit 0
Parameters
v_channel_u8: The value of high enable channel number
v_channel_u8 value
BMG160_X_AXIS 0
BMG160_Y_AXIS 1
BMG160_Z_AXIS 2
v_enable_u8The value of high axis enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_highrate_hyst ( u8  v_channel_u8,
u8  v_highrate_hyst_u8 
)
Note
X_AXIS - 0x22 bit 6 and 7
Y_AXIS - 0x24 bit 6 and 7
Z_AXIS - 0x26 bit 6 and 7
Parameters
v_channel_u8The value of high Hysteresis channel number
v_channel_u8 value
BMG160_X_AXIS 0
BMG160_Y_AXIS 1
BMG160_Z_AXIS 2
v_highrate_hyst_u8The value of high Hysteresis
Note
High hysteresis can be calculated by
High_hyst = ((255+256 *v_highrate_hyst_u8) * 4LSB)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_highrate_thres ( u8  v_channel_u8,
u8  v_highrate_thres_u8 
)
Note
X_AXIS - 0x22 bit from 1 to 5
Y_AXIS - 0x24 bit from 1 to 5
Z_AXIS - 0x26 bit from 1 to 5
Parameters
v_channel_u8: The value of high threshold channel number
v_channel_u8 value
BMG160_X_AXIS 0
BMG160_Y_AXIS 1
BMG160_Z_AXIS 2
v_highrate_thres_u8the high threshold value
Note
High Threshold can be calculated by
High_thres = ((255+256 *v_highrate_thres_u8) * 4LSB)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_i2c_wdt ( u8  v_channel_u8,
u8  v_i2c_wdt_u8 
)
Note
i2c_wdt_select -> bit 1
i2c_wdt_enable -> bit 2
Parameters
v_channel_u8The value of i2c wdt channel number
v_channel_u8 value
BMG160_I2C_WDT_ENABLE 1
BMG160_I2C_WDT_SELECT 0
v_i2c_wdt_u8The value of I2C enable and WDT select
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr1_any_motion ( u8  v_int1r_any_motion_u8)
Parameters
v_int1r_any_motion_u8: The value of any motion interrupt1
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr1_highrate ( u8  v_intr1_u8)
Parameters
v_intr1_u8: The value of interrupt1 high_rate enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr1_offset ( u8  v_axis_u8,
u8  v_intr1_offset_u8 
)
Note
int1_fast_offset -> bit 1
int1_auto_offset -> bit 3
Parameters
v_axis_u8The value of fast/auto offset interrupts selection
v_axis_u8 Data interrupt
1 BMG160_FAST_OFFSET
2 BMG160_AUTO_OFFSET
v_intr1_offset_u8The value of fast/auto offset
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr2_any_motion ( u8  v_intr2_any_motion_u8)
Parameters
v_intr2_any_motion_u8: The value of interrupt2 any_motion
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr2_highrate ( u8  v_intr2_highrate_u8)
Parameters
v_intr2_highrate_u8: The interrupt2 high_rate value
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr2_offset ( u8  v_axis_u8,
u8  v_intr2_offset_u8 
)
Note
int2_fast_offset -> bit 6
int2_auto_offset -> bit 4
Parameters
v_axis_u8The value of fast/auto offset interrupts selection
v_axis_u8 Data interrupt
1 BMG160_FAST_OFFSET
2 BMG160_AUTO_OFFSET
v_intr2_offset_u8The value of fast/auto offset enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr_data ( u8  v_axis_u8,
u8  v_intr_data_u8 
)
Note
INT1 -> bit 0
INT2 -> bit 7
Parameters
v_axis_u8data interrupt selection
v_axis_u8 Data interrupt
0 BMG160_INTR1_DATA
1 BMG160_INTR2_DATA
v_intr_data_u8The value of data interrupt1 or interrupt2
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr_fifo ( u8  v_axis_u8,
u8  v_intr_fifo_u8 
)
Note
int1_fifo -> bit 2
int2_fifo -> bit 5
Parameters
v_axis_u8The value of fifo interrupts selection
v_axis_u8 fifo interrupt
0 BMG160_INTR1
1 BMG160_INTR2
v_intr_fifo_u8the value of int1_fifo/int2_fifo enable/disable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr_level ( u8  v_param_u8,
u8  v_intr_level_u8 
)
Note
INT1 -> bit 0
INT2 -> bit 2
Parameters
v_param_u8The value of Active Level selection number
v_param_u8Active Level
0 BMG160_INTR1
1 BMG160_INTR2
v_intr_level_u8The value of Active Level status value
value Active Level
1 Active HIGH
0 Active LOW
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_intr_output_type ( u8  v_param_u8,
u8  v_intr_output_type_u8 
)
Note
INT1 -> bit 1
INT2 -> bit 3
Parameters
v_param_u8The value of output type selection number
v_param_u8output type
0 BMG160_INTR1
1 BMG160_INTR2
v_intr_output_type_u8The value of output type
value output
1 open drain
0 push pull
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_latch_intr ( u8  v_latch_intr_u8)
Parameters
v_latch_intr_u8: The value of latch interrupt
Latch Interrupt Value
BMG160_NON_LATCH 0x00
BMG160_LATCH_250_MS 0x01
BMG160_LATCH_500_MS 0x02
BMG160_LATCH_1_SEC 0x03
BMG160_LATCH_2_SEC 0x04
BMG160_LATCH_4_SEC 0x05
BMG160_LATCH_8_SEC 0x06
BMG160_LATCH_LATCHED 0x07
BMG160_LATCH_NON_LATCHED 0x08
BMG160_LATCH_250_MICRO_SEC 0x09
BMG160_LATCH_500_MICRO_SEC 0x0A
BMG160_LATCH_1_MILLI_SEC 0x0B
BMG160_LATCH_12.5_MILLI_SEC 0x0C
BMG160_LATCH_25_MILLI_SEC 0x0D
BMG160_LATCH_50_MILLI_SEC 0x0E
BMG160_LATCH_LATCHED 0x0F
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_latch_stat ( u8  v_latch_stat_u8)
Parameters
v_latch_stat_u8: The value of latch status
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_nvm_load ( u8  v_nvm_load_u8)
Parameters
v_nvm_load_u8The value of nvm program
value Description
1 Do not trigger
0 Trigger
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_nvm_prog_mode ( u8  nvm_prog_mode)
Parameters
nvm_prog_modeThe value of nvm program mode
value Description
1 Unlock
0 Lock nvm write
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_nvm_prog_trig ( u8  nvm_prog_trig)
Parameters
nvm_prog_trigThe value of nvm program
value Description
1 program seq in progress
0 program seq finished
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_offset ( u8  v_axis_u8,
s16  v_offset_s16 
)
Note
X_AXIS ->
bit 0 and 1 is available in the register 0x3A bit 2 and 3
bit 2 and 3 is available in the register 0x36 bit 6 and 7
bit 4 to 11 is available in the register 0x37 bit 0 to 7
Y_AXIS ->
bit 0 is available in the register 0x3A bit 1
bit 1,2 and 3 is available in the register 0x36 bit 3,4 and 5
bit 4 to 11 is available in the register 0x38 bit 0 to 7
Z_AXIS ->
bit 0 is available in the register 0x3A bit 0
bit 1,2 and 3 is available in the register 0x36 bit 0,1 and 3
bit 4 to 11 is available in the register 0x39 bit 0 to 7
Parameters
v_axis_u8: The value of offset axis selection
v_axis_u8 value
BMG160_X_AXIS 1
BMG160_Y_AXIS 0
BMG160_Z_AXIS 0
v_offset_s16The value of offset
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_offset_rst ( u8  v_offset_rst_u8)
Parameters
v_offset_rst_u8the value of reset offset
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_offset_unfilt ( u8  v_param_u8,
u8  v_offset_unfilt_u8 
)
Note
slow_offset_unfilt -> 0x1A bit 5
fast_offset_unfilt -> 0x1B bit 7
Parameters
v_param_u8The value of fast/slow offset unfilt data selection
v_param_u8 offset selection
0 BMG160_SLOW_OFFSET
1 BMG160_FAST_OFFSET
v_offset_unfilt_u8The value of fast/slow offset unfilt data
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_offset_word_length ( u8  v_channel_u8,
u8  v_offset_word_length_u8 
)
Note
fast_offset_wordlength -> bit 4 and 5
auto_offset_wordlength -> bit 6 and 7
Parameters
v_channel_u8The value of WordLengthchannel number
v_channel_u8 value
BMG160_AUTO_OFFSET_WL 0
BMG160_FAST_OFFSET_WL 1
v_offset_word_length_u8The value of offset word length
value word length
0x00 32 samples
0x01 64 samples
0x02 128 samples
0x03 256 samples
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_pmu_ext_tri_select ( u8  v_pwu_ext_tri_select_u8)
Parameters
v_pwu_ext_tri_select_u8: The value of External Trigger selection
v_pwu_ext_tri_select_u8 Trigger source
0x00 No
0x01 INT1 pin
0x02 INT2 pin
0x03 SDO pin(SPI3 mode)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_power_mode ( u8  v_power_mode_u8)
Parameters
v_power_mode_u8:The value of power mode
value power mode
0 BMG160_MODE_NORMAL
1 BMG160_MODE_SUSPEND
2 BMG160_MODE_DEEPSUSPEND
3 BMG160_MODE_FASTPOWERUP
4 BMG160_MODE_ADVANCEDPOWERSAVING
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_set_range_reg ( u8  v_range_u8)
Parameters
v_range_u8: The value of gyro range
value range
0x00 BMG160_RANGE_2000
0x01 BMG160_RANGE_1000
0x02 BMG160_RANGE_500
0x03 BMG160_RANGE_250
0x04 BMG160_RANGE_125
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_set_rst_intr ( u8  v_rst_int_u8)
Parameters
v_rst_int_u8the value of reset interrupt
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_shadow_dis ( u8  v_shadow_dis_u8)
Parameters
v_shadow_dis_u8: The value of shadow dis
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_sleep_durn ( u8  v_durn_u8)
Parameters
v_durn_u8: The value of sleep duration
sleep duration value
2ms 0
4ms 1
5ms 2
8ms 3
10ms 4
15ms 5
18ms 6
20ms 7
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMG160_RETURN_FUNCTION_TYPE bmg160_set_slow_offset_durn ( u8  v_offset_durn_u8)
Parameters
v_offset_durn_u8: The value of Slow Offset duration
value Duration
0x00 40ms
0x01 80ms
0x02 160ms
0x03 320ms
0x04 640ms
0x05 1280ms
0x06 unused
0x07 unused
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_slow_offset_enable_axis ( u8  v_channel_u8,
u8  v_slow_offset_u8 
)
Note
X_AXIS -> bit 0
Y_AXIS -> bit 1
Z_AXIS -> bit 2
Parameters
v_channel_u8The value of slow offset channel number
v_channel_u8 value
BMG160_X_AXIS 0
BMG160_Y_AXIS 1
BMG160_Z_AXIS 2
v_slow_offset_u8The slow offset value
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_slow_offset_thres ( u8  v_offset_thres_u8)
Parameters
v_offset_thres_u8: The value of slow offset Threshold
value threshold
0x00 0.1 degree/sec
0x01 0.2 degree/sec
0x02 0.5 degree/sec
0x03 1 degree/sec
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_soft_rst ( void  )

This function is used for the soft reset The soft reset register will be written with 0xB6 in the register 0x14.

Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_spi3 ( u8  v_spi3_u8)
Parameters
v_spi3_u8: The value of spi3 enable
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_set_unfilt_data ( u8  v_param_u8,
u8  v_unfilt_data_u8 
)
Note
any_unfilt_data -> bit 1
high_unfilt_data -> bit 3
Parameters
v_param_u8The value of any/high offset unfilt data selection
v_param_u8 offset selection
1 BMG160_HIGHRATE_UNFILT_DATA
3 BMG160_ANY_MOTION_UNFILT_DATA
v_unfilt_data_u8The value of any/high unfilt data
value Description
1 BMG160_ENABLE
0 BMG160_DISABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMG160_RETURN_FUNCTION_TYPE bmg160_write_register ( u8  v_addr_u8,
u8 v_data_u8,
u8  v_len_u8 
)
Parameters
v_addr_u8-> Address of the register
v_data_u8-> The data from the register
v_len_u8-> no of bytes to read
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

Variable Documentation

struct bmg160_t* p_bmg160
static

file bmg160.c brief Driver for BMG160


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