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

Functions

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_burst_read (u8 addr_u8, u8 *data_u8, u32 len_u32)
 This API reads the data from the given register continuously. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_bw (u8 *bw_u8)
 This API is used to get the bandwidth of the sensor in the register 0x10 bit from 0 to 4. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_cal_rdy (u8 *cal_rdy_u8)
 This API is used to get the status of fast offset compensation(cal_rdy) in the register 0x36 bit 4(Read Only Possible) More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_durn (u8 channel_u8, u8 *durn_u8)
 This API is used to get the duration of Low, High, Slope and slow no motion interrupts in the registers. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_data_output_reg (u8 *output_reg_u8)
 This API is used to get the fifo data in the register 0x3F bit 0 to 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_data_select (u8 *fifo_data_select_u8)
 This API is used to get the axis enable of fifo data select in the register 0x3E bit 0 and 1. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_frame_count (u8 *frame_count_u8)
 This API read fifo frame count from location 0Eh bit position 0 to 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_mode (u8 *fifo_mode_u8)
 This API is used to get the status of fifo (fifo_mode) in the register 0x3E bit 6 and 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_overrun (u8 *fifo_overrun_u8)
 This API read fifo overrun from location 0Eh bit position 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_stat (u8 *stat_fifo_u8)
 This API reads fifo overrun and fifo frame counter status register byte from location 0Eh. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_wml_trig (u8 *fifo_wml_trig)
 This API is used to get the fifo water mark level trigger in the register 0x30 bit from 0 to 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_flat_hold_time (u8 *flat_hold_time_u8)
 This API is used to get the interrupt enable of flat hold time(flat_hold_time) in the register 0x2F bit 4 and 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_flat_hyst (u8 *flat_hyst_u8)
 This API is used to get the interrupt enable of flat hysteresis("flat_hy) in the register 0x2F bit 0 to 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_high_bw (u8 *high_bw_u8)
 This API is used to get high bandwidth in the register 0x13 bit 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_i2c_wdt (u8 channel_u8, u8 *i2c_wdt_u8)
 This API is used to get the i2c watch dog timer period and I2C interface mode is selected in the register 0x34 bit 1 and 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr1_fifo_full (u8 *intr1_fifo_full_u8)
 This API is used to get the fifo full interrupt1 in the register 0x1A bit 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr1_fifo_wm (u8 *intr1_fifo_wm_u8)
 This API is used to get the fifo watermark interrupt1 data in the register 0x1A bit 1. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr2_fifo_full (u8 *intr2_fifo_full_u8)
 This API is used to get the fifo full interrupt2 in the register 0x1A bit 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr2_fifo_wm (u8 *intr2_fifo_wm_u8)
 This API is used to get the fifo watermark interrupt2 data in the register 0x1A bit 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_double_tap (u8 channel_u8, u8 *intr_double_tap_u8)
 This API is used to get the interrupt enable of double tap interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_enable (u8 intr_type_u8, u8 *value_u8)
 This API is used to get interrupt enable bits of the sensor in the registers 0x16 and 0x17. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_fifo_full (u8 *fifo_full_u8)
 This API is used to get the interrupt fifo full enable interrupt status in the register 0x17 bit 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_fifo_wm (u8 *fifo_wm_u8)
 This API is used to get the interrupt fifo watermark enable interrupt status in the register 0x17 bit 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_flat (u8 channel_u8, u8 *intr_flat_u8)
 This API is used to get the interrupt enable of flat interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_high_g (u8 channel_u8, u8 *intr_high_g_u8)
 This API is used to get the interrupt enable of high_g interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_level (u8 channel_u8, u8 *intr_level_u8)
 This API is used to get Active Level status in the register 0x20. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_low_g (u8 channel_u8, u8 *intr_low_g_u8)
 This API is used to get the interrupt enable of low_g interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_orient (u8 channel_u8, u8 *intr_orient_u8)
 This API is used to get the interrupt status of orient interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_orient_stat (u8 *stat_orient_u8)
 This API read orient, high-sign and high-first-xyz status register byte from location 0Ch. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_output_type (u8 channel_u8, u8 *intr_output_type_u8)
 This API is used to get the interrupt output type in the register 0x20. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_single_tap (u8 channel_u8, u8 *intr_single_tap_u8)
 This API is used to get the interrupt enable of single tap interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_slope (u8 channel_u8, u8 *intr_slope_u8)
 This API is used to get the interrupt enable of slope interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_slow_no_motion (u8 channel_u8, u8 *intr_slow_no_motion_u8)
 This API is used to get the interrupt enable of slow/no motion interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_stat (u8 *intr_stat_u8)
 This API read interrupt status of flat, orient, single tap, double tap, slow no motion, slope, highg and lowg from location 09h. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_tap_stat (u8 *stat_tap_u8)
 This API read tap-sign, tap-first-xyz slope-sign, slope-first-xyz status register byte from location 0Bh. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_latch_intr (u8 *latch_intr_u8)
 This API is used to get the latch duration in the register 0x21 bit from 0 to 3. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_low_g_mode (u8 *low_g_mode_u8)
 This API is used to get low_g mode in the registers 0x24 bit 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_low_high_g_hyst (u8 channel_u8, u8 *hyst_u8)
 This API is used to get the low high hysteresis in the registers 0x24. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_new_data (u8 channel_u8, u8 *intr_newdata_u8)
 This API is used to get the interrupt status of new data in the register 0x19. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_nvmprog_mode (u8 *nvmprog_mode_u8)
 This API is used to get the nvm program mode(nvm_prog_mode)in the register 0x33 bit 0. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_nvmprog_ready (u8 *nvprog_ready_u8)
 This API is used to get the nvm program ready in the register bit 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_nvmprog_remain (u8 *nvprog_remain_u8)
 This API is used to set the nvm program ready in the register bit 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_offset (u8 channel_u8, s8 *offset_u8)
 This API is used to get the status of offset (offset_x, offset_y and offset_z) in the registers 0x38,0x39 and 0x3A. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_offset_target (u8 channel_u8, u8 *offset_u8)
 This API is used to get the status of offset target axis(offset_target_x, offset_target_y and offset_target_z) and cut_off in the register 0x37. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_orient_block (u8 *orient_block_u8)
 This API is used to get the orient block in the register 0x2C bit 2 and 3. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_orient_enable (u8 *orient_enable_u8)
 This API is used to get the interrupt enable of orient ud_enable in the register 0x2D bit 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_orient_hyst (u8 *orient_hyst_u8)
 This API is used to get the orient hysteresis in the register 0x2C bit 4 to 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_orient_mode (u8 *orient_mode_u8)
 This API is used to get the orient mode in the register 0x2C bit 0 and 1. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_power_mode (u8 *power_mode_u8)
 This API is used to get the operating modes of the sensor in the register 0x11 and 0x12. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_range (u8 *range_u8)
 This API is used to get the ranges(g values) of the sensor in the register 0x0F bit from 0 to 3. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_selftest_axis (u8 *selftest_axis_u8)
 This API is for to get the self test axis(self_test_axis) in the register ox32 bit 0 to 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_selftest_sign (u8 *selftest_sign_u8)
 This API is for to get the Self Test sign(selftest_sign) in the register 0x32 bit 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_shadow_dis (u8 *shadow_dis_u8)
 This API is used to get shadow dis in the register 0x13 bit 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_sleep_durn (u8 *sleep_durn_u8)
 This API is used to get the sleep duration of the sensor in the register 0x11 Register 0x11 - bit from 0 to 3. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_sleep_timer_mode (u8 *sleep_timer_u8)
 This API is used to get the sleep timer mode in the register 0x12 bit 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_slow_comp (u8 channel_u8, u8 *slow_comp_u8)
 This API is used to get slow compensation(hp_x_enable, hp_y_enable and hp_z_enable) enable in the register 0x36 bit 0 to 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_slow_no_motion (u8 channel_u8, u8 *slow_no_motion_u8)
 This API is used to get the interrupt status of slow/no motion select and slow no motion enable xyz interrupt in the register 0x18 bit from 0 to 3. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_source (u8 channel_u8, u8 *intr_source_u8)
 This API is used to get the source data status of source data, source slow no motion, source slope, source high and source low in the register 0x1E bit from 0 to 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_spi3 (u8 *spi3_u8)
 This API is used to get the enable status of spi3 in the register 0x34 bit 0. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_tap_durn (u8 *tap_durn_u8)
 This API is used to get the tap duration in the register 0x2A bit form 0 to 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_tap_quiet (u8 *tap_quiet_u8)
 This API is used to get the tap quiet in the register 0x2A bit 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_tap_sample (u8 *tap_sample_u8)
 This API is used to get the tap sample in the register 0x2B bit 6 and 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_tap_shock (u8 *tap_shock_u8)
 This API is used to get the tap shock form the register 0x2A bit 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_tap_thres (u8 *tap_thres_u8)
 This API is used to get the tap threshold in the register 0x2B bit from 0 to 4. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_theta (u8 channel_u8, u8 *theta_u8)
 This API is used to get the theta value of orient and flat interrupts. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_thres (u8 channel_u8, u8 *thres_u8)
 This API is used to get the threshold of Low, High, Slope and slow no motion interrupts in the registers. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_init (struct bma2x2_t *bma2x2)
 This function is used for initialize bus read and bus write functions assign the chip id and device address chip id is read in the register 0x00 bit from 0 to 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_eight_resolution_x (s8 *accel_x_s8)
 This API reads acceleration data X values from location 02h and 03h bit resolution support 8bit. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_eight_resolution_xyz (struct bma2x2_accel_eight_resolution *accel)
 This API reads acceleration of 8 bit resolution data of X,Y,Z values from location 03h , 05h and 07h. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_eight_resolution_xyzt (struct bma2x2_accel_eight_resolution_temp *accel)
 This API reads accelerometer data X,Y,Z values and temperature data from location 0x02 to 0x08. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_eight_resolution_y (s8 *accel_y_s8)
 This API reads acceleration data Y values of 8bit resolution from location 05h. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_eight_resolution_z (s8 *accel_z_s8)
 This API reads acceleration data Z values of 8bit resolution from location 07h. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_x (s16 *accel_x_s16)
 This API reads acceleration data X values from location 02h and 03h. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_xyz (struct bma2x2_accel_data *accel)
 This API reads acceleration data X,Y,Z values from location 02h to 07h. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_xyzt (struct bma2x2_accel_data_temp *accel)
 This API reads accelerometer data X,Y,Z values and temperature data from location 02h to 08h. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_y (s16 *accel_y_s16)
 This API reads acceleration data Y values from location 04h and 05h. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_z (s16 *accel_z_s16)
 This API reads acceleration data Z values from location 06h and 07h. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_reg (u8 adr_u8, u8 *data_u8, u8 len_u8)
 This API reads the data from the given register address. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_temp (s8 *temp_s8)
 This API is used to read the temp from register 0x08. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_rst_intr (u8 rst_intr_u8)
 This API is used to set the reset interrupt in the register 0x21 bit 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_bw (u8 bw_u8)
 This API is used to set the bandwidth of the sensor in the register 0x10 bit from 0 to 4. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_cal_trigger (u8 cal_trigger_u8)
 This API is used to set the status of fast offset compensation(cal_rdy) in the register 0x36 bit 4(Read Only Possible) More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_durn (u8 channel_u8, u8 durn_u8)
 This API is used to set the duration of Low, High, Slope and slow no motion interrupts in the registers. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_fifo_data_select (u8 fifo_data_select_u8)
 This API is used to set the axis enable of fifo data select in the register 0x3E bit 0 and 1. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_fifo_mode (u8 fifo_mode_u8)
 This API is used to set the status of fifo (fifo_mode) in the register 0x3E bit 6 and 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_fifo_wml_trig (u8 fifo_wml_trig)
 This API is used to set the fifo water mark level trigger in the register 0x30 bit from 0 to 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_flat_hold_time (u8 flat_hold_time_u8)
 This API is used to set the interrupt enable of flat hold time(flat_hold_time) in the register 0x2F bit 4 and 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_flat_hyst (u8 flat_hyst_u8)
 This API is used to set the interrupt enable of flat hysteresis("flat_hy) in the register 0x2F bit 0 to 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_high_bw (u8 high_bw_u8)
 This API is used to write high bandwidth in the register 0x13 bit 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_i2c_wdt (u8 channel_u8, u8 i2c_wdt_u8)
 This API is used to set the i2c watch dog timer period and I2C interface mode is selected in the register 0x34 bit 1 and 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr1_fifo_full (u8 intr1_fifo_full_u8)
 This API is used to set the fifo full interrupt1 in the register 0x1A bit 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr1_fifo_wm (u8 intr1_fifo_wm_u8)
 This API is used to set the fifo watermark interrupt1 data in the register 0x1A bit 1. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr2_fifo_full (u8 intr2_fifo_full_u8)
 This API is used to set the fifo full interrupt2 in the register 0x1A bit 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr2_fifo_wm (u8 intr2_fifo_wm_u8)
 This API is used to set the fifo watermark interrupt2 data in the register 0x1A bit 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_double_tap (u8 channel_u8, u8 intr_double_tap_u8)
 This API is used to set the interrupt enable of double tap interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_enable (u8 intr_type_u8, u8 value_u8)
 This API is used to set interrupt enable bits of the sensor in the registers 0x16 and 0x17. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_fifo_full (u8 fifo_full_u8)
 This API is used to set the interrupt fifo full enable interrupt status in the register 0x17 bit 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_fifo_wm (u8 fifo_wm_u8)
 This API is used to set the interrupt fifo watermark enable interrupt status in the register 0x17 bit 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_flat (u8 channel_u8, u8 intr_flat_u8)
 This API is used to set the interrupt enable of flat interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_high_g (u8 channel_u8, u8 intr_high_g_u8)
 This API is used to set the interrupt enable of high_g interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_level (u8 channel_u8, u8 intr_level_u8)
 This API is used to set Active Level status in the register 0x20. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_low_g (u8 channel_u8, u8 intr_low_u8)
 This API is used to set the interrupt enable of low_g interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_orient (u8 channel_u8, u8 intr_orient_u8)
 This API is used to set the interrupt status of orient interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_output_type (u8 channel_u8, u8 intr_output_type_u8)
 This API is used to set the interrupt output type in the register 0x20. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_single_tap (u8 channel_u8, u8 intr_single_tap_u8)
 This API is used to set the interrupt enable of single tap interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_slope (u8 channel_u8, u8 intr_slope_u8)
 This API is used to set the interrupt enable of slope interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_slow_no_motion (u8 channel_u8, u8 intr_slow_no_motion_u8)
 This API is used to set the interrupt enable of slow/no motion interrupt in the register 0x19 and 0x1B. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_latch_intr (u8 latch_intr_u8)
 This API is used to set the latch duration in the register 0x21 bit from 0 to 3. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_low_g_mode (u8 low_g_mode_u8)
 This API is used to set low_g mode in the registers 0x24 bit 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_low_high_g_hyst (u8 channel_u8, u8 hyst_u8)
 This API is used to set the low high hysteresis in the registers 0x24. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_mode_value (u8 power_mode_u8)
 This API is used to assign the power mode values modes of the sensor in the register 0x11 and 0x12. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_new_data (u8 channel_u8, u8 intr_newdata_u8)
 This API is used to set the interrupt status of new data in the register 0x19. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_nvmprog_mode (u8 nvmprog_mode_u8)
 This API is used to set the nvm program mode(nvm_prog_mode)in the register 0x33 bit 0. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_nvprog_trig (u8 nvprog_trig_u8)
 This API is used to set the value of nvm program trig in the register 0x33 bit 1. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_offset (u8 channel_u8, s8 offset_u8)
 This API is used to set the status of offset (offset_x, offset_y and offset_z) in the registers 0x38,0x39 and 0x3A. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_offset_rst (u8 offset_rst_u8)
 This API is used to set the offset reset(offset_reset) in the register 0x36 bit 7(Write only possible) More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_offset_target (u8 channel_u8, u8 offset_u8)
 This API is used to set the status of offset target axis(offset_target_x, offset_target_y and offset_target_z) and cut_off in the register 0x37. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_orient_block (u8 orient_block_u8)
 This API is used to set the orient block in the register 0x2C bit 2 and 3. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_orient_enable (u8 orient_enable_u8)
 This API is used to set the interrupt enable of orient ud_enable in the register 0x2D bit 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_orient_hyst (u8 orient_hyst_u8)
 This API is used to set the orient hysteresis in the register 0x2C bit 4 to 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_orient_mode (u8 orient_mode_u8)
 This API is used to set the orient mode in the register 0x2C bit 0 and 1. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_power_mode (u8 power_mode_u8)
 This API is used to set the operating modes of the sensor in the register 0x11 and 0x12. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_range (u8 range_u8)
 This API is used to set the ranges(g values) of the sensor in the register 0x0F bit from 0 to 3. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_selftest_axis (u8 selftest_axis_u8)
 This API is for to set the self test axis(self_test_axis) in the register ox32 bit 0 to 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_selftest_sign (u8 selftest_sign_u8)
 This API is for to set the Self Test sign(selftest_sign) in the register 0x32 bit 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_shadow_dis (u8 shadow_dis_u8)
 This API is used to set shadow dis in the register 0x13 bit 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_sleep_durn (u8 sleep_durn_u8)
 This API is used to set the sleep duration of the sensor in the register 0x11 Register 0x11 - bit from 0 to 3. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_sleep_timer_mode (u8 sleep_timer_u8)
 This API is used to set the sleep timer mode in the register 0x12 bit 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_slow_comp (u8 channel_u8, u8 slow_comp_u8)
 This API is used to set slow compensation(hp_x_enable, hp_y_enable and hp_z_enable) enable in the register 0x36 bit 0 to 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_slow_no_motion (u8 channel_u8, u8 slow_no_motion_u8)
 This API is used to set the interrupt status of slow/no motion select and slow no motion enable xyz interrupt in the register 0x18 bit from 0 to 3. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_source (u8 channel_u8, u8 intr_source_u8)
 This API is used to set the source data status of source data, source slow no motion, source slope, source high and source low in the register 0x1E bit from 0 to 5. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_spi3 (u8 spi3_u8)
 This API is used to set the enable status of spi3 in the register 0x34 bit 0. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_tap_durn (u8 tap_durn_u8)
 This API is used to set the tap duration in the register 0x2A bit form 0 to 2. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_tap_quiet (u8 tap_quiet_u8)
 This API is used to set the tap quiet in the register 0x2A bit 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_tap_sample (u8 tap_sample_u8)
 This API is used to set the tap sample in the register 0x2B bit 6 and 7. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_tap_shock (u8 tap_shock_u8)
 This API is used to set the tap shock form the register 0x2A bit 6. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_tap_thres (u8 tap_thres_u8)
 This API is used to set the tap threshold in the register 0x2B bit from 0 to 4. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_theta (u8 channel_u8, u8 theta_u8)
 This API is used to set the theta value of orient and flat interrupts. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_thres (u8 channel_u8, u8 thres_u8)
 This API is used to set the threshold of Low, High, Slope and slow no motion interrupts in the registers. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_soft_rst (void)
 This function is used for the soft reset The soft reset register will be written with 0xB6 in the register 0x14. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_update_image (void)
 This API is used to update the register values. More...
 
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_write_reg (u8 adr_u8, u8 *data_u8, u8 len_u8)
 This API gives data to the given register and the data is written in the corresponding register address. More...
 

Variables

static struct bma2x2_tp_bma2x2
 
u8 V_BMA2x2RESOLUTION_U8 = BMA2x2_14_RESOLUTION
 

Function Documentation

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_burst_read ( u8  addr_u8,
u8 data_u8,
u32  len_u32 
)
Parameters
addr_u8-> Address of the register
data_u8-> The data from the register
len_u32-> no of bytes to read
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_bw ( u8 bw_u8)
Parameters
bw_u8: The value of bandwidth
bw_u8 result
0x08 BMA2x2_BW_7_81HZ
0x09 BMA2x2_BW_15_63HZ
0x0A BMA2x2_BW_31_25HZ
0x0B BMA2x2_BW_62_50HZ
0x0C BMA2x2_BW_125HZ
0x0D BMA2x2_BW_250HZ
0x0E BMA2x2_BW_500HZ
0x0F BMA2x2_BW_1000HZ
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_cal_rdy ( u8 cal_rdy_u8)
Parameters
cal_rdy_u8The value of cal_ready
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_durn ( u8  channel_u8,
u8 durn_u8 
)
Note
LOW_DURN -> register 0x22 bit form 0 to 7
HIGH_DURN -> register 0x25 bit form 0 to 7
SLOPE_DURN -> register 0x27 bit form 0 to 1
SLO_NO_MOT_DURN -> register 0x27 bit form 2 to 7
Parameters
channel_u8The value of duration select
channel_u8 result
0 BMA2x2_ACCEL_LOW_DURN
1 BMA2x2_ACCEL_HIGH_DURN
2 BMA2x2_ACCEL_SLOPE_DURN
3 BMA2x2_ACCEL_SLOW_NO_MOTION_DURN
durn_u8The value of duration
Note
:
Duration result
BMA2x2_ACCEL_LOW_DURN Low-g interrupt trigger
- delay according to([durn_u8 +1]*2)ms
- range from 2ms to 512ms. default is 20ms
BMA2x2_ACCEL_HIGH_DURN high-g interrupt trigger
- delay according to([durn_u8 +1]*2)ms
- range from 2ms to 512ms. default is 32ms
BMA2x2_ACCEL_SLOPE_DURNslope interrupt trigger
- if[durn_u8<1:0>+1] consecutive data points
- are above the slope interrupt threshold
SLO_NO_MOT_DURN Refer data sheet for clear information
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_data_output_reg ( u8 output_reg_u8)
Parameters
output_reg_u8: The value of fifo data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_data_select ( u8 fifo_data_select_u8)
Parameters
fifo_data_select_u8: The value of FIFO axis data select
fifo_data_select_u8 result
0x00 XYZ
0x01 Y
0x02 X
0x03 Z
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_frame_count ( u8 frame_count_u8)
Parameters
frame_count_u8: The status of fifo frame count
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_mode ( u8 fifo_mode_u8)
Parameters
fifo_mode_u8: The value of fifo mode
fifo_mode_u8 result
0x00 BYPASS
0x01 FIFO
0x02 STREAM
0x03 RESERVED
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_overrun ( u8 fifo_overrun_u8)
Parameters
fifo_overrun_u8: The status of fifo overrun
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_stat ( u8 stat_fifo_u8)
Parameters
stat_fifo_u8: The status of fifo overrun and frame counter
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_fifo_wml_trig ( u8 fifo_wml_trig)
Parameters
fifo_wml_trigThe value of fifo watermark trigger level
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_flat_hold_time ( u8 flat_hold_time_u8)
Parameters
flat_hold_time_u8: The value of flat hold time
flat_hold_time_u8 result
0x00 0ms
0x01 512ms
0x02 1024ms
0x03 2048ms
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_flat_hyst ( u8 flat_hyst_u8)
Parameters
flat_hyst_u8: The value of flat hysteresis
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_high_bw ( u8 high_bw_u8)
Parameters
high_bw_u8: The value of high bandwidth
high_bw_u8 result
0 Unfiltered High Bandwidth
1 Filtered Low Bandwidth
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_i2c_wdt ( u8  channel_u8,
u8 i2c_wdt_u8 
)
Parameters
channel_u8The i2c option selection
channel_u8 result
0 BMA2x2_ACCEL_I2C_SELECT
1 BMA2x2_ACCEL_I2C_ENABLE
i2c_wdt_u8watch dog timer period and I2C interface mode is selected
BMA2x2_ACCEL_I2C_SELECTresult
0x00 Disable the watchdog at SDI pin
0x01 Enable watchdog
BMA2x2_I2C_ENABLE result
0x00 1ms
0x01 50ms
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr1_fifo_full ( u8 intr1_fifo_full_u8)
Parameters
intr1_fifo_full_u8: The value of fifo full interrupt enable
intr1_fifo_full_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr1_fifo_wm ( u8 intr1_fifo_wm_u8)
Parameters
intr1_fifo_wm_u8: The value of interrupt1 FIFO watermark enable
intr1_fifo_wm_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr2_fifo_full ( u8 intr2_fifo_full_u8)
Parameters
intr2_fifo_full_u8: Thee vale of fifo full enable
intr2_fifo_full_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr2_fifo_wm ( u8 intr2_fifo_wm_u8)
Parameters
intr2_fifo_wm_u8: The value of interrupt1 FIFO watermark enable
intr2_fifo_wm_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_double_tap ( u8  channel_u8,
u8 intr_double_tap_u8 
)
Note
INTR1_double -> register 0x19 bit 4
INTR2_double -> register 0x1B bit 4
Parameters
channel_u8The value of double tap selection
channel_u8 result
0 BMA2x2_ACCEL_INTR1_DOUBLE_TAP
1 BMA2x2_ACCEL_INTR2_DOUBLE_TAP
intr_double_tap_u8The double tap interrupt enable value
intr_double_tap_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_enable ( u8  intr_type_u8,
u8 value_u8 
)
Note
It reads the flat enable, orient enable,
single tap enable, double tap enable
slope-x enable, slope-y enable, slope-z enable,
fifo watermark enable,
fifo full enable, data enable, low-g enable,
high-z enable, high-y enable
high-z enable
Parameters
intr_type_u8The value of interrupts
intr_type_u8 result
0 BMA2x2_LOW_G_INTR
1 BMA2x2_HIGH_G_X_INTR
2 BMA2x2_HIGH_G_Y_INTR
3 BMA2x2_HIGH_G_Z_INTR
4 BMA2x2_DATA_ENABLE
5 SLOPE_X_INTR
6 SLOPE_Y_INTR
7 SLOPE_Z_INTR
8 SINGLE_TAP_INTR
9 SINGLE_TAP_INTR
10 ORIENT_INT
11 FLAT_INT
value_u8: The value of interrupts enable
value_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_fifo_full ( u8 fifo_full_u8)
Parameters
fifo_full_u8The value of fifo full interrupt enable
fifo_full_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_fifo_wm ( u8 fifo_wm_u8)
Parameters
fifo_wm_u8: the value FIFO Water Mark
fifo_wm_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_flat ( u8  channel_u8,
u8 intr_flat_u8 
)
Note
INTR1_flat -> register 0x19 bit 7
INTR2_flat -> register 0x1B bit 7
Parameters
channel_u8The value of flat interrupt select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_FLAT
1 BMA2x2_ACCEL_INTR2_FLAT
intr_flat_u8The flat interrupt enable value
intr_flat_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_high_g ( u8  channel_u8,
u8 intr_high_g_u8 
)
Note
INTR1_high_g -> register 0x19 bit 1
INTR2_high_g -> register 0x1B bit 1
Parameters
channel_u8The value of high_g interrupt selection
channel_u8 result
0 BMA2x2_ACCEL_INTR1_HIGH_G
1 BMA2x2_ACCEL_INTR2_HIGH_G
intr_high_g_u8: the value of high_g interrupt
intr_high_g_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_level ( u8  channel_u8,
u8 intr_level_u8 
)
Note
INTR1 -> bit 0
INTR2 -> bit 2
Parameters
channel_u8The value of Active Level select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_LEVEL
1 BMA2x2_ACCEL_INTR2_LEVEL
intr_level_u8The Active Level status enable value
intr_level_u8 result
0x01 ACTIVE_HIGH
0x00 ACTIVE_LOW
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_low_g ( u8  channel_u8,
u8 intr_low_g_u8 
)
Note
INTR1_Low_g -> register 0x19 bit 0
INTR2_Low_g -> register 0x1B bit 0
Parameters
channel_u8: The value of low interrupt selection channel
channel_u8 result
0 BMA2x2_ACCEL_INTR1_LOW_G
1 BMA2x2_ACCEL_INTR2_LOW_G
intr_low_g_u8: the value of low_g interrupt
intr_low_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_orient ( u8  channel_u8,
u8 intr_orient_u8 
)
Note
INTR1_orient -> register 0x19 bit 6
INTR2_orient -> register 0x1B bit 6
Parameters
channel_u8The value of orient interrupt select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_ORIENT
1 BMA2x2_ACCEL_INTR2_ORIENT
intr_orient_u8The value of orient interrupt enable
intr_orient_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_orient_stat ( u8 stat_orient_u8)
Parameters
stat_orient_u8: The status of orient and high
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_output_type ( u8  channel_u8,
u8 intr_output_type_u8 
)
Note
INTR1 -> bit 1
INTR2 -> bit 3
Parameters
channel_u8The value of output type select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_OUTPUT
1 BMA2x2_ACCEL_INTR2_OUTPUT
intr_output_type_u8The value of output type select
intr_source_u8 result
0x01 OPEN_DRAIN
0x00 PUSS_PULL
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_single_tap ( u8  channel_u8,
u8 intr_single_tap_u8 
)
Note
INTR1_single_tap -> register 0x19 bit 5
INTR2_single_tap -> register 0x1B bit 5
Parameters
channel_u8The value of single tap interrupt select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_SINGLE_TAP
1 BMA2x2_ACCEL_INTR2_SINGLE_TAP
intr_single_tap_u8The single tap interrupt enable value
intr_single_tap_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_slope ( u8  channel_u8,
u8 intr_slope_u8 
)
Note
INTR1_slope -> register 0x19 bit 2
INTR2_slope -> register 0x1B bit 2
Parameters
channel_u8the value of slope channel select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_SLOPE
1 BMA2x2_ACCEL_INTR2_SLOPE
intr_slope_u8: The slope value enable value
intr_slope_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_slow_no_motion ( u8  channel_u8,
u8 intr_slow_no_motion_u8 
)
Note
INTR1_slow_no_motion -> register 0x19 bit 3
INTR2_slow_no_motion -> register 0x1B bit 3
Parameters
channel_u8: The value of slow/no motion selection
channel_u8 result
0 BMA2x2_INTR1_SLOW_NO_MOTION
1 BMA2x2_INTR2_SLOW_NO_MOTION
intr_slow_no_motion_u8the slow_no_motion enable value
intr_slow_no_motion_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_stat ( u8 intr_stat_u8)
Parameters
intr_stat_u8: The value of interrupt status
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr_tap_stat ( u8 stat_tap_u8)
Parameters
stat_tap_u8: The status of tap and slope
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_latch_intr ( u8 latch_intr_u8)
Parameters
latch_intr_u8The value of latch duration
latch_intr_u8 result
0x00 BMA2x2_LATCH_DURN_NON_LATCH
0x01 BMA2x2_LATCH_DURN_250MS
0x02 BMA2x2_LATCH_DURN_500MS
0x03 BMA2x2_LATCH_DURN_1S
0x04 BMA2x2_LATCH_DURN_2S
0x05 BMA2x2_LATCH_DURN_4S
0x06 BMA2x2_LATCH_DURN_8S
0x07 BMA2x2_LATCH_DURN_LATCH
0x08 BMA2x2_LATCH_DURN_NON_LATCH1
0x09 BMA2x2_LATCH_DURN_250US
0x0A BMA2x2_LATCH_DURN_500US
0x0B BMA2x2_LATCH_DURN_1MS
0x0C BMA2x2_LATCH_DURN_12_5MS
0x0D BMA2x2_LATCH_DURN_25MS
0x0E BMA2x2_LATCH_DURN_50MS
0x0F BMA2x2_LATCH_DURN_LATCH1
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_low_g_mode ( u8 low_g_mode_u8)
Parameters
low_g_mode_u8The value of Low_G mode
low_g_mode_u8 g-result
0x00 LOW_G_SINGLE_AXIS_MODE
0x01 LOW_G_SUMMING_MODE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_low_high_g_hyst ( u8  channel_u8,
u8 hyst_u8 
)
Note
LOW_G_HYST -> bit form 0 to 1
HIGH_G_HYST -> bit from 6 to 7
Parameters
channel_u8The value of hysteresis selection
channel_u8 result
0 BMA2x2_ACCEL_LOW_G_HYST
1 BMA2x2_ACCEL_HIGH_G_HYST
hyst_u8The hysteresis data
Note
LOW HYSTERESIS
Hysteresis of low-g interrupt according to (hyst_u8 * 125)mg
HIGH HYSTERESIS
High hysteresis depends on the accel range selection
g-range High Hysteresis
2g (thres_u8 * 125) mg
4g (thres_u8 * 250) mg
8g (thres_u8 * 500) mg
16g (thres_u8 * 1000) mg
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_new_data ( u8  channel_u8,
u8 intr_newdata_u8 
)
Note
INTR1_data -> register 0x19 bit 0
INTR2_data -> register 0x19 bit 7
Parameters
channel_u8The value of new data interrupt select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_NEWDATA
1 BMA2x2_ACCEL_INTR2_NEWDATA
intr_newdata_u8The new data interrupt enable value
intr_newdata_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_nvmprog_mode ( u8 nvmprog_mode_u8)
Parameters
nvmprog_mode_u8: The value of nvm program mode
nvmprog_mode_u8 result
0x00 Disable program mode
0x01 Enable program mode
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_nvmprog_ready ( u8 nvprog_ready_u8)
Parameters
nvprog_ready_u8The value of nvm program ready
nvprog_ready_u8 result
0x00 nvm write/update operation is in progress
0x01 nvm is ready to accept a new write
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_nvmprog_remain ( u8 nvprog_remain_u8)
Parameters
nvprog_remain_u8The value of nvm program ready
nvprog_remain_u8 result
0x00 nvm write/update operation is in progress
0x01 nvm is ready to accept a new write
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_offset ( u8  channel_u8,
s8 offset_u8 
)
Note
offset_x -> register 0x38 bit 0 to 7
offset_y -> register 0x39 bit 0 to 7
offset_z -> register 0x3A bit 0 to 7
Parameters
channel_u8The value of offset selection
channel_u8 result
0 BMA2x2_ACCEL_X_AXIS
1 BMA2x2_ACCEL_Y_AXIS
2 BMA2x2_ACCEL_Z_AXIS
offset_u8The value of offset
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_offset_target ( u8  channel_u8,
u8 offset_u8 
)
Note
CUT_OFF -> bit 0
OFFSET_TRIGGER_X -> bit 1 and 2
OFFSET_TRIGGER_Y -> bit 3 and 4
OFFSET_TRIGGER_Z -> bit 5 and 6
Parameters
channel_u8The value of offset axis selection
channel_u8 result
0 BMA2x2_ACCEL_CUT_OFF
1 BMA2x2_ACCEL_OFFSET_TRIGGER_X
2 BMA2x2_ACCEL_OFFSET_TRIGGER_Y
2 BMA2x2_ACCEL_OFFSET_TRIGGER_Z
offset_u8The offset target value
CUT_OFF result
0 1Hz
1 10Hz
OFFSET_TRIGGER result
0x00 0g
0x01 +1g
0x02 -1g
0x03 0g
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_orient_block ( u8 orient_block_u8)
Parameters
orient_block_u8: The value of orient block
orient_mode_u8 result
0x00 no blocking
0x01 theta blocking or
| acceleration slope in any axis > 1.5g 0x02 | theta blocking or | acceleration slope in any axis > 0.2g | acceleration in any axis > 1.5g 0x03 | theta blocking or | acceleration slope in any axis > 0.4g | acceleration in any axis > 1.5g | value of orient is not stable for at lease 100ms
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_orient_enable ( u8 orient_enable_u8)
Parameters
orient_enable_u8: The value of orient ud_enable
orient_enable_u8 result
0x00 Generates Interrupt
0x01 Do not generate interrupt
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_orient_hyst ( u8 orient_hyst_u8)
Parameters
orient_hyst_u8: The value of orient hysteresis
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_orient_mode ( u8 orient_mode_u8)
Parameters
orient_mode_u8: The value of orient mode
orient_mode_u8 result
0x00 symmetrical
0x01 high asymmetrical
0x02 low asymmetrical
0x03 symmetrical
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_power_mode ( u8 power_mode_u8)
Note
Register 0x11 - bit from 5 to 7
Register 0x12 - bit from 5 and 6
Parameters
power_mode_u8: The value of power mode
power_mode_u8 value 0x11 0x12
BMA2x2_MODE_NORMAL 0 0x00 0x00
BMA2x2_MODE_LOWPOWER1 1 0x02 0x00
BMA2x2_MODE_SUSPEND 2 0x06 0x00
BMA2x2_MODE_DEEP_SUSPEND 3 0x01 0x00
BMA2x2_MODE_LOWPOWER2 4 0x02 0x01
BMA2x2_MODE_STANDBY 5 0x04 0x00
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_range ( u8 range_u8)
Parameters
range_u8: The value of range
range_u8 result
0x03 BMA2x2_RANGE_2G
0x05 BMA2x2_RANGE_4G
0x08 BMA2x2_RANGE_8G
0x0C BMA2x2_RANGE_16G
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_selftest_axis ( u8 selftest_axis_u8)
Parameters
selftest_axis_u8: The value of selftest axis
selftest_axis_u8 result
0x00 self test disable
0x01 x-axis
0x02 y-axis
0x03 z-axis
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_selftest_sign ( u8 selftest_sign_u8)
Parameters
selftest_sign_u8: The value of self test sign
selftest_sign_u8 result
0x00 negative sign
0x01 positive sign
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_shadow_dis ( u8 shadow_dis_u8)
Parameters
shadow_dis_u8: The value of shadow dis
shadow_dis_u8 result
0 MSB is Locked
1 No MSB Locking
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_sleep_durn ( u8 sleep_durn_u8)
Parameters
sleep_durn_u8: The value of sleep duration time
sleep_durn_u8 result
0x05 BMA2x2_SLEEP_DURN_0_5MS
0x06 BMA2x2_SLEEP_DURN_1MS
0x07 BMA2x2_SLEEP_DURN_2MS
0x08 BMA2x2_SLEEP_DURN_4MS
0x09 BMA2x2_SLEEP_DURN_6MS
0x0A BMA2x2_SLEEP_DURN_10MS
0x0B BMA2x2_SLEEP_DURN_25MS
0x0C BMA2x2_SLEEP_DURN_50MS
0x0D BMA2x2_SLEEP_DURN_100MS
0x0E BMA2x2_SLEEP_DURN_500MS
0x0F BMA2x2_SLEEP_DURN_1S
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_sleep_timer_mode ( u8 sleep_timer_u8)
Parameters
sleep_timer_u8: The value of sleep timer mode
sleep_timer_u8 result
0 enable EventDrivenSampling(EDT)
1 enable Equidistant sampling mode(EST)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_slow_comp ( u8  channel_u8,
u8 slow_comp_u8 
)
Note
SLOW_COMP_X -> bit 0
SLOW_COMP_Y -> bit 1
SLOW_COMP_Z -> bit 2
Parameters
channel_u8The value of slow compensation selection
channel_u8 result
0 BMA2x2_ACCEL_SLOW_COMP_X
1 BMA2x2_ACCEL_SLOW_COMP_Y
2 BMA2x2_ACCEL_SLOW_COMP_Z
slow_comp_u8The value of slow compensation enable
slow_comp_u8 result
0x00 Disable
0x01 Enable
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_slow_no_motion ( u8  channel_u8,
u8 slow_no_motion_u8 
)
Parameters
channel_u8: The value of slow/no motion select
channel_u8 result
0 BMA2x2_ACCEL_SLOW_NO_MOTION_ENABLE_X
1 BMA2x2_ACCEL_SLOW_NO_MOTION_ENABLE_Y
2 BMA2x2_ACCEL_SLOW_NO_MOTION_ENABLE_Z
3 BMA2x2_ACCEL_SLOW_NO_MOTION_ENABLE_SEL
slow_no_motion_u8: The value of slow no motion interrupt enable
slow_no_motion_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_source ( u8  channel_u8,
u8 intr_source_u8 
)
Parameters
channel_u8: The value of source select
channel_u8 result
0 BMA2x2_ACCEL_SOURCE_LOW_G
1 BMA2x2_ACCEL_SOURCE_HIGH_G
2 BMA2x2_ACCEL_SOURCE_SLOPE
3 BMA2x2_ACCEL_SOURCE_SLOW_NO_MOTION
4 BMA2x2_ACCEL_SOURCE_TAP
5 BMA2x2_ACCEL_SOURCE_DATA
intr_source_u8The source status enable value
intr_source_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_spi3 ( u8 spi3_u8)
Parameters
spi3_u8: The value of SPI 3 or 4 wire enable
spi3_u8 result
0x00 spi4
0x01 spi3
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_tap_durn ( u8 tap_durn_u8)
Parameters
tap_durn_u8The value of tap duration
tap_durn_u8 result
0x00 TAP_DURN_50_MS
0x01 TAP_DURN_100_MS
0x02 TAP_DURN_150_MS
0x03 TAP_DURN_200_MS
0x04 TAP_DURN_250_MS
0x05 TAP_DURN_375_MS
0x06 TAP_DURN_500_MS
0x07 TAP_DURN_700_MS
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_tap_quiet ( u8 tap_quiet_u8)
Parameters
tap_quiet_u8: The value of tap quiet
tap_quiet_u8 result
0x00 TAP_QUIET_30_MS
0x01 TAP_QUIET_20_MS
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_tap_sample ( u8 tap_sample_u8)
Parameters
*tap_sample_u8: The value of tap sample
tap_sample_u8 result
0x00 2 samples
0x01 4 samples
0x02 8 samples
0x03 16 samples
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_tap_shock ( u8 tap_shock_u8)
Parameters
tap_shock_u8The value of tap shock
tap_shock_u8 result
0x00 TAP_SHOCK_50_MS
0x01 TAP_SHOCK_75_MS
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_tap_thres ( u8 tap_thres_u8)
Parameters
tap_thres_u8: The value of tap threshold
Note
Tap threshold of single and double tap corresponding to accel range
range Tap threshold
2g (tap_thres_u8 * 62.5)mg
4g (tap_thres_u8 * 125)mg
8g (tap_thres_u8 * 250)mg
16g (tap_thres_u8 * 500)mg
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_theta ( u8  channel_u8,
u8 theta_u8 
)
Note
ORIENT_THETA -> register 0x2D bit 0 to 5
FLAT_THETA -> register 0x2E bit 0 to 5
Parameters
channel_u8The value of theta selection
channel_u8 result
0x00 BMA2x2_ACCEL_ORIENT_THETA
0x01 BMA2x2_ACCEL_FLAT_THETA
Note
FLAT_THETA : Defines a blocking angle between 0 deg to 44.8 deg
ORIENT_THETA : Defines threshold for detection of flat position in range from 0 deg to 44.8 deg
Parameters
theta_u8The value of theta
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_thres ( u8  channel_u8,
u8 thres_u8 
)
Note
LOW_THRES -> register 0x23 bit form 0 to 7
HIGH_THRES -> register 0x26 bit form 0 to 7
SLOPE_THRES -> register 0x28 bit form 0 to 7
SLO_NO_MOT_THRES -> register 0x29 bit form 0 to 7
Parameters
channel_u8The value of threshold selection
channel_u8 result
0 BMA2x2_ACCEL_LOW_THRES
1 BMA2x2_ACCEL_HIGH_THRES
2 BMA2x2_ACCEL_SLOPE_THRES
3 BMA2x2_ACCEL_SLOW_NO_MOTION_THRES
thres_u8The threshold value of selected interrupts
Note
: LOW-G THRESHOLD
Threshold result
BMA2x2_ACCEL_LOW_THRES Low-threshold interrupt trigger
| according to(thres_u8 * 7.81) mg | range from 0g to 1.992g | default is 375mg
: HIGH-G THRESHOLD
Threshold of high-g interrupt according to accel g range
g-range High-g threshold
2g (thres_u8 * 7.81) mg
4g (thres_u8 * 15.63) mg
8g (thres_u8 * 31.25) mg
16g (thres_u8 * 62.5) mg
: SLOPE THRESHOLD
Threshold of slope interrupt according to accel g range
g-range Slope threshold
2g (thres_u8 * 3.19) mg
4g (thres_u8 * 7.81) mg
8g (thres_u8 * 15.63) mg
16g (thres_u8 * 31.25) mg
: SLOW NO MOTION THRESHOLD
Threshold of slow no motion interrupt according to accel g range
g-range slow no motion threshold
2g (thres_u8 * 3.19) mg
4g (thres_u8 * 7.81) mg
8g (thres_u8 * 15.63) mg
16g (thres_u8 * 31.25) mg
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_init ( struct bma2x2_t bma2x2)
Parameters
bma2x2: structure pointer
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
Note
While changing the parameter of the bma2x2_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)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_eight_resolution_x ( s8 accel_x_s8)
Parameters
accel_x_s8: pointer holding the data of accel X
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_eight_resolution_xyz ( struct bma2x2_accel_eight_resolution accel)
Parameters
accel: pointer holding the data of accel
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_eight_resolution_xyzt ( struct bma2x2_accel_eight_resolution_temp accel)
Parameters
accel: The value of accel xyz and temperature data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_eight_resolution_y ( s8 accel_y_s8)
Parameters
accel_y_s8The data of y
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_eight_resolution_z ( s8 accel_z_s8)

@aram accel_z_s8 : the data of z

Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_x ( s16 accel_x_s16)
Parameters
accel_x_s16: pointer holding the data of accel X
value resolution
0 BMA2x2_12_RESOLUTION
1 BMA2x2_10_RESOLUTION
2 BMA2x2_14_RESOLUTION
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_xyz ( struct bma2x2_accel_data accel)
Parameters
accel: pointer holding the data of accel
value resolution
0 BMA2x2_12_RESOLUTION
1 BMA2x2_10_RESOLUTION
2 BMA2x2_14_RESOLUTION
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_xyzt ( struct bma2x2_accel_data_temp accel)
Parameters
accel: The value of accel xyz and temperature data
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_y ( s16 accel_y_s16)
Parameters
accel_y_s16: pointer holding the data of accel Y
value resolution
0 BMA2x2_12_RESOLUTION
1 BMA2x2_10_RESOLUTION
2 BMA2x2_14_RESOLUTION
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_accel_z ( s16 accel_z_s16)
Parameters
accel_z_s16: pointer holding the data of accel Z
value resolution
0 BMA2x2_12_RESOLUTION
1 BMA2x2_10_RESOLUTION
2 BMA2x2_14_RESOLUTION
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_reg ( u8  adr_u8,
u8 data_u8,
u8  len_u8 
)
Parameters
adr_u8-> Address of the register
data_u8-> The data from the register
len_u8-> no of bytes to read
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_temp ( s8 temp_s8)
Parameters
temp_s8The value of temperature
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_rst_intr ( u8  rst_intr_u8)
Parameters
rst_intr_u8The value of reset interrupt
rst_intr_u8 result
0x01 clear any latch interrupt
0x00 keep latch interrupt active
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_bw ( u8  bw_u8)
Parameters
bw_u8: The value of bandwidth
bw_u8 result
0x08 BMA2x2_BW_7_81HZ
0x09 BMA2x2_BW_15_63HZ
0x0A BMA2x2_BW_31_25HZ
0x0B BMA2x2_BW_62_50HZ
0x0C BMA2x2_BW_125HZ
0x0D BMA2x2_BW_250HZ
0x0E BMA2x2_BW_500HZ
0x0F BMA2x2_BW_1000HZ
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

500 Hz 1000 uS

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_cal_trigger ( u8  cal_trigger_u8)
Parameters
cal_trigger_u8The value of cal_ready
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_durn ( u8  channel_u8,
u8  durn_u8 
)
Note
LOW_DURN -> register 0x22 bit form 0 to 7
HIGH_DURN -> register 0x25 bit form 0 to 7
SLOPE_DURN -> register 0x27 bit form 0 to 1
SLO_NO_MOT_DURN -> register 0x27 bit form 2 to 7
Parameters
channel_u8The value of duration select
channel_u8 result
0 BMA2x2_ACCEL_LOW_DURN
1 BMA2x2_ACCEL_HIGH_DURN
2 BMA2x2_ACCEL_SLOPE_DURN
3 BMA2x2_ACCEL_SLOW_NO_MOTION_DURN
durn_u8The value of duration
Note
:
Duration result
BMA2x2_ACCEL_LOW_DURN Low-g interrupt trigger
- delay according to([durn_u8 +1]*2)ms
- range from 2ms to 512ms. default is 20ms
BMA2x2_ACCEL_HIGH_DURN high-g interrupt trigger
- delay according to([durn_u8 +1]*2)ms
- range from 2ms to 512ms. default is 32ms
BMA2x2_ACCEL_SLOPE_DURNslope interrupt trigger
- if[durn_u8<1:0>+1] consecutive data points
- are above the slope interrupt threshold
SLO_NO_MOT_DURN Refer data sheet for clear information
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_fifo_data_select ( u8  fifo_data_select_u8)
Parameters
fifo_data_select_u8: The value of FIFO axis data select
fifo_data_select_u8 result
0x00 XYZ
0x01 Y
0x02 X
0x03 Z
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_fifo_mode ( u8  fifo_mode_u8)
Parameters
fifo_mode_u8: The value of fifo mode
fifo_mode_u8 result
0x00 BYPASS
0x01 FIFO
0x02 STREAM
0x03 RESERVED
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the call graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_fifo_wml_trig ( u8  fifo_wml_trig)
Parameters
fifo_wml_trigThe value of fifo watermark trigger level
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_flat_hold_time ( u8  flat_hold_time_u8)
Parameters
flat_hold_time_u8: The value of flat hold time
flat_hold_time_u8 result
0x00 0ms
0x01 512ms
0x02 1024ms
0x03 2048ms
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_flat_hyst ( u8  flat_hyst_u8)
Parameters
flat_hyst_u8: The value of flat hysteresis
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_high_bw ( u8  high_bw_u8)
Parameters
high_bw_u8: The value of high bandwidth
high_bw_u8 result
0 Unfiltered High Bandwidth
1 Filtered Low Bandwidth
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_i2c_wdt ( u8  channel_u8,
u8  i2c_wdt_u8 
)
Parameters
channel_u8The i2c option selection
channel_u8 result
0 BMA2x2_ACCEL_I2C_SELECT
1 BMA2x2_ACCEL_I2C_ENABLE
i2c_wdt_u8watch dog timer period and I2C interface mode is selected
BMA2x2_ACCEL_I2C_SELECTresult
0x00 Disable the watchdog at SDI pin
0x01 Enable watchdog
BMA2x2_I2C_ENABLE result
0x00 1ms
0x01 50ms
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr1_fifo_full ( u8  intr1_fifo_full_u8)
Parameters
intr1_fifo_full_u8: The value of fifo full interrupt enable
intr1_fifo_full_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr1_fifo_wm ( u8  intr1_fifo_wm_u8)
Parameters
intr1_fifo_wm_u8: The value of interrupt1 FIFO watermark enable
intr1_fifo_wm_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr2_fifo_full ( u8  intr2_fifo_full_u8)
Parameters
intr2_fifo_full_u8: Thee vale of fifo full enable
intr2_fifo_full_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr2_fifo_wm ( u8  intr2_fifo_wm_u8)
Parameters
intr2_fifo_wm_u8: The value of interrupt1 FIFO watermark enable
intr2_fifo_wm_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_double_tap ( u8  channel_u8,
u8  intr_double_tap_u8 
)
Note
INTR1_double -> register 0x19 bit 4
INTR2_double -> register 0x1B bit 4
Parameters
channel_u8The value of double tap selection
channel_u8 result
0 BMA2x2_ACCEL_INTR1_DOUBLE_TAP
1 BMA2x2_ACCEL_INTR2_DOUBLE_TAP
intr_double_tap_u8The double tap interrupt enable value
intr_double_tap_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_enable ( u8  intr_type_u8,
u8  value_u8 
)
Note
It reads the flat enable, orient enable,
single tap enable, double tap enable
slope-x enable, slope-y enable, slope-z enable,
fifo watermark enable,
fifo full enable, data enable, low-g enable,
high-z enable, high-y enable
high-z enable
Parameters
intr_type_u8The value of interrupts
intr_type_u8 result
0 BMA2x2_LOW_G_INTR
1 BMA2x2_HIGH_G_X_INTR
2 BMA2x2_HIGH_G_Y_INTR
3 BMA2x2_HIGH_G_Z_INTR
4 BMA2x2_DATA_ENABLE
5 SLOPE_X_INTR
6 SLOPE_Y_INTR
7 SLOPE_Z_INTR
8 SINGLE_TAP_INTR
9 SINGLE_TAP_INTR
10 ORIENT_INT
11 FLAT_INT
value_u8: The value of interrupts enable
value_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_fifo_full ( u8  fifo_full_u8)
Parameters
fifo_full_u8The value of fifo full interrupt enable
fifo_full_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_fifo_wm ( u8  fifo_wm_u8)
Parameters
fifo_wm_u8: the value FIFO Water Mark
fifo_wm_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_flat ( u8  channel_u8,
u8  intr_flat_u8 
)
Note
INTR1_flat -> register 0x19 bit 7
INTR2_flat -> register 0x1B bit 7
Parameters
channel_u8The value of flat interrupt select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_FLAT
1 BMA2x2_ACCEL_INTR2_FLAT
intr_flat_u8The flat interrupt enable value
intr_flat_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_high_g ( u8  channel_u8,
u8  intr_high_g_u8 
)
Note
INTR1_high_g -> register 0x19 bit 1
INTR2_high_g -> register 0x1B bit 1
Parameters
channel_u8The value of high_g interrupt selection
channel_u8 result
0 BMA2x2_ACCEL_INTR1_HIGH_G
1 BMA2x2_ACCEL_INTR2_HIGH_G
intr_high_g_u8: the value of high_g interrupt
intr_high_g_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_level ( u8  channel_u8,
u8  intr_level_u8 
)
Note
INTR1 -> bit 0
INTR2 -> bit 2
Parameters
channel_u8The value of Active Level select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_LEVEL
1 BMA2x2_ACCEL_INTR2_LEVEL
intr_level_u8The Active Level status enable value
intr_level_u8 result
0x01 ACTIVE_HIGH
0x00 ACTIVE_LOW
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_low_g ( u8  channel_u8,
u8  intr_low_u8 
)
Note
INTR1_Low_g -> register 0x19 bit 0
INTR2_Low_g -> register 0x1B bit 0
Parameters
channel_u8: The value of low interrupt selection channel
channel_u8 result
0 BMA2x2_ACCEL_INTR1_LOW_G
1 BMA2x2_ACCEL_INTR2_LOW_G
intr_low_u8: the value of low_g interrupt
intr_low_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_orient ( u8  channel_u8,
u8  intr_orient_u8 
)
Note
INTR1_orient -> register 0x19 bit 6
INTR2_orient -> register 0x1B bit 6
Parameters
channel_u8The value of orient interrupt select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_ORIENT
1 BMA2x2_ACCEL_INTR2_ORIENT
intr_orient_u8The value of orient interrupt enable
intr_orient_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_output_type ( u8  channel_u8,
u8  intr_output_type_u8 
)
Note
INTR1 -> bit 1
INTR2 -> bit 3
Parameters
channel_u8The value of output type select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_OUTPUT
1 BMA2x2_ACCEL_INTR2_OUTPUT
intr_output_type_u8The value of output type select
intr_source_u8 result
0x01 OPEN_DRAIN
0x00 PUSS_PULL
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_single_tap ( u8  channel_u8,
u8  intr_single_tap_u8 
)
Note
INTR1_single_tap -> register 0x19 bit 5
INTR2_single_tap -> register 0x1B bit 5
Parameters
channel_u8The value of single tap interrupt select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_SINGLE_TAP
1 BMA2x2_ACCEL_INTR2_SINGLE_TAP
intr_single_tap_u8The single tap interrupt enable value
intr_single_tap_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_slope ( u8  channel_u8,
u8  intr_slope_u8 
)
Note
INTR1_slope -> register 0x19 bit 2
INTR2_slope -> register 0x1B bit 2
Parameters
channel_u8the value of slope channel select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_SLOPE
1 BMA2x2_ACCEL_INTR2_SLOPE
intr_slope_u8: The slope value enable value
intr_slope_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_intr_slow_no_motion ( u8  channel_u8,
u8  intr_slow_no_motion_u8 
)
Note
INTR1_slow_no_motion -> register 0x19 bit 3
INTR2_slow_no_motion -> register 0x1B bit 3
Parameters
channel_u8: The value of slow/no motion selection
channel_u8 result
0 BMA2x2_INTR1_SLOW_NO_MOTION
1 BMA2x2_INTR2_SLOW_NO_MOTION
intr_slow_no_motion_u8the slow_no_motion enable value
intr_slow_no_motion_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_latch_intr ( u8  latch_intr_u8)
Parameters
latch_intr_u8The value of latch duration
latch_intr_u8 result
0x00 BMA2x2_LATCH_DURN_NON_LATCH
0x01 BMA2x2_LATCH_DURN_250MS
0x02 BMA2x2_LATCH_DURN_500MS
0x03 BMA2x2_LATCH_DURN_1S
0x04 BMA2x2_LATCH_DURN_2S
0x05 BMA2x2_LATCH_DURN_4S
0x06 BMA2x2_LATCH_DURN_8S
0x07 BMA2x2_LATCH_DURN_LATCH
0x08 BMA2x2_LATCH_DURN_NON_LATCH1
0x09 BMA2x2_LATCH_DURN_250US
0x0A BMA2x2_LATCH_DURN_500US
0x0B BMA2x2_LATCH_DURN_1MS
0x0C BMA2x2_LATCH_DURN_12_5MS
0x0D BMA2x2_LATCH_DURN_25MS
0x0E BMA2x2_LATCH_DURN_50MS
0x0F BMA2x2_LATCH_DURN_LATCH1
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_low_g_mode ( u8  low_g_mode_u8)
Parameters
low_g_mode_u8The value of Low_G mode
low_g_mode_u8 result
0x00 LOW_G_SINGLE_AXIS_MODE
0x01 LOW_G_SUMMING_MODE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_low_high_g_hyst ( u8  channel_u8,
u8  hyst_u8 
)
Note
LOW_G_HYST -> bit form 0 to 1
HIGH_G_HYST -> bit from 6 to 7
Parameters
channel_u8The value of hysteresis selection
channel_u8 result
0 BMA2x2_ACCEL_LOW_G_HYST
1 BMA2x2_ACCEL_HIGH_G_HYST
hyst_u8The hysteresis data
Note
LOW HYSTERESIS
Hysteresis of low-g interrupt according to (hyst_u8 * 125)mg
HIGH HYSTERESIS
High hysteresis depends on the accel range selection
g-range High Hysteresis
2g (thres_u8 * 125) mg
4g (thres_u8 * 250) mg
8g (thres_u8 * 500) mg
16g (thres_u8 * 1000) mg
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_mode_value ( u8  power_mode_u8)
Note
Register 0x11 - bit from 5 to 7
Register 0x12 - bit from 5 and 6
Parameters
power_mode_u8: The value of power mode
power_mode_u8 value 0x11 0x12
BMA2x2_MODE_NORMAL 0 0x00 0x00
BMA2x2_MODE_LOWPOWER1 1 0x02 0x00
BMA2x2_MODE_SUSPEND 2 0x06 0x00
BMA2x2_MODE_DEEP_SUSPEND 3 0x01 0x00
BMA2x2_MODE_LOWPOWER2 4 0x02 0x01
BMA2x2_MODE_STANDBY 5 0x04 0x00
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_new_data ( u8  channel_u8,
u8  intr_newdata_u8 
)
Note
INTR1_data -> register 0x19 bit 0
INTR2_data -> register 0x19 bit 7
Parameters
channel_u8The value of new data interrupt select
channel_u8 result
0 BMA2x2_ACCEL_INTR1_NEWDATA
1 BMA2x2_ACCEL_INTR2_NEWDATA
intr_newdata_u8The new data interrupt enable value
intr_newdata_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_nvmprog_mode ( u8  nvmprog_mode_u8)
Parameters
nvmprog_mode_u8: The value of nvm program mode
nvmprog_mode_u8 result
0x00 Disable program mode
0x01 Enable program mode
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_nvprog_trig ( u8  nvprog_trig_u8)
Parameters
nvprog_trig_u8The value of nvm program trig
nvprog_trig_u8 result
0x00 Do not trigger nvm program
0x01 Trigger nvm program
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_offset ( u8  channel_u8,
s8  offset_u8 
)
Note
offset_x -> register 0x38 bit 0 to 7
offset_y -> register 0x39 bit 0 to 7
offset_z -> register 0x3A bit 0 to 7
Parameters
channel_u8The value of offset selection
channel_u8 result
0 BMA2x2_ACCEL_X_AXIS
1 BMA2x2_ACCEL_Y_AXIS
2 BMA2x2_ACCEL_Z_AXIS
offset_u8The value of offset
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_offset_rst ( u8  offset_rst_u8)
Parameters
offset_rst_u8The offset reset value
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_offset_target ( u8  channel_u8,
u8  offset_u8 
)
Note
CUT_OFF -> bit 0
OFFSET_TRIGGER_X -> bit 1 and 2
OFFSET_TRIGGER_Y -> bit 3 and 4
OFFSET_TRIGGER_Z -> bit 5 and 6
Parameters
channel_u8The value of offset axis selection
channel_u8 result
0 BMA2x2_ACCEL_CUT_OFF
1 BMA2x2_ACCEL_OFFSET_TRIGGER_X
2 BMA2x2_ACCEL_OFFSET_TRIGGER_Y
2 BMA2x2_ACCEL_OFFSET_TRIGGER_Z
offset_u8The offset target value
CUT_OFF result
0 1Hz
1 10Hz
OFFSET_TRIGGER result
0x00 0g
0x01 +1g
0x02 -1g
0x03 0g
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_orient_block ( u8  orient_block_u8)
Parameters
orient_block_u8: The value of orient block
orient_mode_u8 result
0x00 no blocking
0x01 theta blocking or
| acceleration slope in any axis > 1.5g 0x02 | theta blocking or | acceleration slope in any axis > 0.2g | acceleration in any axis > 1.5g 0x03 | theta blocking or | acceleration slope in any axis > 0.4g | acceleration in any axis > 1.5g | value of orient is not stable for at lease 100ms
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_orient_enable ( u8  orient_enable_u8)
Parameters
orient_enable_u8: The value of orient ud_enable
orient_enable_u8 result
0x00 Generates Interrupt
0x01 Do not generate interrupt
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_orient_hyst ( u8  orient_hyst_u8)
Parameters
orient_hyst_u8: The value of orient hysteresis
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_orient_mode ( u8  orient_mode_u8)
Parameters
orient_mode_u8: The value of orient mode
orient_mode_u8 result
0x00 symmetrical
0x01 high asymmetrical
0x02 low asymmetrical
0x03 symmetrical
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_power_mode ( u8  power_mode_u8)
Note
Register 0x11 - bit from 5 to 7
Register 0x12 - bit from 5 and 6
Parameters
power_mode_u8: The value of power mode
power_mode_u8 value 0x11 0x12
BMA2x2_MODE_NORMAL 0 0x00 0x00
BMA2x2_MODE_LOWPOWER1 1 0x02 0x00
BMA2x2_MODE_SUSPEND 2 0x06 0x00
BMA2x2_MODE_DEEP_SUSPEND 3 0x01 0x00
BMA2x2_MODE_LOWPOWER2 4 0x02 0x01
BMA2x2_MODE_STANDBY 5 0x04 0x00
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:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_range ( u8  range_u8)
Parameters
range_u8: The value of range
range_u8 result
0x03 BMA2x2_RANGE_2G
0x05 BMA2x2_RANGE_4G
0x08 BMA2x2_RANGE_8G
0x0C BMA2x2_RANGE_16G
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_selftest_axis ( u8  selftest_axis_u8)
Parameters
selftest_axis_u8: The value of selftest axis
selftest_axis_u8 result
0x00 self test disable
0x01 x-axis
0x02 y-axis
0x03 z-axis
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_selftest_sign ( u8  selftest_sign_u8)
Parameters
selftest_sign_u8: The value of self test sign
selftest_sign_u8 result
0x00 negative sign
0x01 positive sign
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_shadow_dis ( u8  shadow_dis_u8)
Parameters
shadow_dis_u8: The value of shadow dis
shadow_dis_u8 result
0 MSB is Locked
1 No MSB Locking
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_sleep_durn ( u8  sleep_durn_u8)
Parameters
sleep_durn_u8: The value of sleep duration time
sleep_durn_u8 result
0x05 BMA2x2_SLEEP_DURN_0_5MS
0x06 BMA2x2_SLEEP_DURN_1MS
0x07 BMA2x2_SLEEP_DURN_2MS
0x08 BMA2x2_SLEEP_DURN_4MS
0x09 BMA2x2_SLEEP_DURN_6MS
0x0A BMA2x2_SLEEP_DURN_10MS
0x0B BMA2x2_SLEEP_DURN_25MS
0x0C BMA2x2_SLEEP_DURN_50MS
0x0D BMA2x2_SLEEP_DURN_100MS
0x0E BMA2x2_SLEEP_DURN_500MS
0x0F BMA2x2_SLEEP_DURN_1S
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

1 SECS

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_sleep_timer_mode ( u8  sleep_timer_u8)
Parameters
sleep_timer_u8: The value of sleep timer mode
sleep_timer_u8 result
0 enable EventDrivenSampling(EDT)
1 enable Equidistant sampling mode(EST)
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_slow_comp ( u8  channel_u8,
u8  slow_comp_u8 
)
Note
SLOW_COMP_X -> bit 0
SLOW_COMP_Y -> bit 1
SLOW_COMP_Z -> bit 2
Parameters
channel_u8The value of slow compensation selection
channel_u8 result
0 BMA2x2_ACCEL_SLOW_COMP_X
1 BMA2x2_ACCEL_SLOW_COMP_Y
2 BMA2x2_ACCEL_SLOW_COMP_Z
slow_comp_u8The value of slow compensation enable
slow_comp_u8 result
0x00 Disable
0x01 Enable
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_slow_no_motion ( u8  channel_u8,
u8  slow_no_motion_u8 
)
Parameters
channel_u8: The value of slow/no motion select
channel_u8 result
0 BMA2x2_ACCEL_SLOW_NO_MOTION_ENABLE_X
1 BMA2x2_ACCEL_SLOW_NO_MOTION_ENABLE_Y
2 BMA2x2_ACCEL_SLOW_NO_MOTION_ENABLE_Z
3 BMA2x2_ACCEL_SLOW_NO_MOTION_ENABLE_SEL
slow_no_motion_u8: The value of slow no motion interrupt enable
slow_no_motion_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_source ( u8  channel_u8,
u8  intr_source_u8 
)
Parameters
channel_u8: The value of source select
channel_u8 result
0 BMA2x2_ACCEL_SOURCE_LOW_G
1 BMA2x2_ACCEL_SOURCE_HIGH_G
2 BMA2x2_ACCEL_SOURCE_SLOPE
3 BMA2x2_ACCEL_SOURCE_SLOW_NO_MOTION
4 BMA2x2_ACCEL_SOURCE_TAP
5 BMA2x2_ACCEL_SOURCE_DATA
intr_source_u8The source status enable value
intr_source_u8 result
0x00 INTR_DISABLE
0x01 INTR_ENABLE
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_spi3 ( u8  spi3_u8)
Parameters
spi3_u8: The value of SPI 3 or 4 wire enable
spi3_u8 result
0x00 spi4
0x01 spi3
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_tap_durn ( u8  tap_durn_u8)
Parameters
tap_durn_u8The value of tap duration
tap_durn_u8 result
0x00 TAP_DURN_50_MS
0x01 TAP_DURN_100_MS
0x02 TAP_DURN_150_MS
0x03 TAP_DURN_200_MS
0x04 TAP_DURN_250_MS
0x05 TAP_DURN_375_MS
0x06 TAP_DURN_500_MS
0x07 TAP_DURN_700_MS
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_tap_quiet ( u8  tap_quiet_u8)
Parameters
tap_quiet_u8: The value of tap quiet
tap_quiet_u8 result
0x00 TAP_QUIET_30_MS
0x01 TAP_QUIET_20_MS
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_tap_sample ( u8  tap_sample_u8)
Parameters
*tap_sample_u8: The value of tap sample
tap_sample_u8 result
0x00 2 samples
0x01 4 samples
0x02 8 samples
0x03 16 samples
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_tap_shock ( u8  tap_shock_u8)
Parameters
tap_shock_u8The value of tap shock
tap_shock_u8 result
0x00 TAP_SHOCK_50_MS
0x01 TAP_SHOCK_75_MS
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_tap_thres ( u8  tap_thres_u8)
Parameters
tap_thres_u8: The value of tap threshold
Note
Tap threshold of single and double tap corresponding to accel range
range Tap threshold
2g (tap_thres_u8 * 62.5)mg
4g (tap_thres_u8 * 125)mg
8g (tap_thres_u8 * 250)mg
16g (tap_thres_u8 * 500)mg
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_theta ( u8  channel_u8,
u8  theta_u8 
)
Note
ORIENT_THETA -> register 0x2D bit 0 to 5
FLAT_THETA -> register 0x2E bit 0 to 5
Parameters
channel_u8The value of theta selection
channel_u8 result
0x00 BMA2x2_ACCEL_ORIENT_THETA
0x01 BMA2x2_ACCEL_FLAT_THETA
Note
FLAT_THETA : Defines a blocking angle between 0 deg to 44.8 deg
ORIENT_THETA : Defines threshold for detection of flat position in range from 0 deg to 44.8 deg
Parameters
theta_u8The value of theta
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_set_thres ( u8  channel_u8,
u8  thres_u8 
)
Note
LOW_THRES -> register 0x23 bit form 0 to 7
HIGH_THRES -> register 0x26 bit form 0 to 7
SLOPE_THRES -> register 0x28 bit form 0 to 7
SLO_NO_MOT_THRES -> register 0x29 bit form 0 to 7
Parameters
channel_u8The value of threshold selection
channel_u8 result
0 BMA2x2_ACCEL_LOW_THRES
1 BMA2x2_ACCEL_HIGH_THRES
2 BMA2x2_ACCEL_SLOPE_THRES
3 BMA2x2_ACCEL_SLOW_NO_MOTION_THRES
thres_u8The threshold value of selected interrupts
Note
: LOW-G THRESHOLD
Threshold result
BMA2x2_ACCEL_LOW_THRES Low-threshold interrupt trigger
| according to(thres_u8 * 7.81) mg | range from 0g to 1.992g | default is 375mg
: HIGH-G THRESHOLD
Threshold of high-g interrupt according to accel g range
g-range High-g threshold
2g (thres_u8 * 7.81) mg
4g (thres_u8 * 15.63) mg
8g (thres_u8 * 31.25) mg
16g (thres_u8 * 62.5) mg
: SLOPE THRESHOLD
Threshold of slope interrupt according to accel g range
g-range Slope threshold
2g (thres_u8 * 3.19) mg
4g (thres_u8 * 7.81) mg
8g (thres_u8 * 15.63) mg
16g (thres_u8 * 31.25) mg
: SLOW NO MOTION THRESHOLD
Threshold of slow no motion interrupt according to accel g range
g-range slow no motion threshold
2g (thres_u8 * 3.19) mg
4g (thres_u8 * 7.81) mg
8g (thres_u8 * 15.63) mg
16g (thres_u8 * 31.25) mg
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_soft_rst ( void  )
Parameters
None
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

To reset the sensor 0xB6 value_u8 will be written

BMA2x2_RETURN_FUNCTION_TYPE bma2x2_update_image ( void  )
Parameters
None
Returns
results of bus communication function
Return values
0-> Success
-1-> Error
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_write_reg ( u8  adr_u8,
u8 data_u8,
u8  len_u8 
)
Parameters
adr_u8-> Address of the register
data_u8-> The data to the register
len_u8-> no of bytes to read
Returns
results of bus communication function
Return values
0-> Success
-1-> Error

+ Here is the caller graph for this function:

Variable Documentation

struct bma2x2_t* p_bma2x2
static

Copyright (C) 2015 - 2016 Bosch Sensortec GmbH

bma2x2.c Date: 2016/03/11 Revision: 2.0.4 $

Usage: Sensor Driver for BMA2x2 sensor

License:

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the copyright holder nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE

The information provided is believed to be accurate and reliable. The copyright holder assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted by implication or otherwise under any patent or patent rights of the copyright holder.

file <BMA2x2> brief <Sensor driver="" for="" bma2x2>="">

user defined code to be added here ...

u8 V_BMA2x2RESOLUTION_U8 = BMA2x2_14_RESOLUTION

Based on Bit resolution value_u8 should be modified


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