Hi, I have an issue to read single tap from BMI 160. // Power configurations. sensor.accel_cfg.odr = BMI160_ACCEL_ODR_1600HZ; sensor.accel_cfg.range = BMI160_ACCEL_RANGE_2G; sensor.accel_cfg.bw = BMI160_ACCEL_BW_NORMAL_AVG4; sensor.accel_cfg.power = BMI160_ACCEL_LOWPOWER_MODE; sensor.gyro_cfg.odr = BMI160_GYRO_ODR_3200HZ; sensor.gyro_cfg.range = BMI160_GYRO_RANGE_2000_DPS; sensor.gyro_cfg.bw = BMI160_GYRO_BW_NORMAL_MODE; sensor.gyro_cfg.power = BMI160_GYRO_NORMAL_MODE; rslt = bmi160_set_sens_conf(&sensor); // Interrupt Configurations int_config.int_channel = BMI160_INT_CHANNEL_1;// Interrupt channel/pin 1 /* Select the Interrupt type */ int_config.int_type = BMI160_ACC_SINGLE_TAP_INT;// Choosing Single Tap interrupt /* Select the interrupt channel/pin settings */ int_config.int_pin_settg.output_en = BMI160_ENABLE;// Enabling interrupt pins to act as output pin int_config.int_pin_settg.output_mode = BMI160_DISABLE;// Choosing push-pull mode for interrupt pin int_config.int_pin_settg.output_type = BMI160_DISABLE;// Choosing active low output int_config.int_pin_settg.edge_ctrl = BMI160_ENABLE;// Choosing edge triggered output int_config.int_pin_settg.input_en = BMI160_DISABLE;// Disabling interrupt pin to act as input int_config.int_pin_settg.latch_dur = BMI160_LATCH_DUR_NONE;// non-latched output /* Select the Single tap interrupt parameters */ int_config.int_type_cfg.acc_tap_int.tap_thr = 1; int_config.int_type_cfg.acc_tap_int.tap_shock = BMI160_ENABLE; int_config.int_type_cfg.acc_tap_int.tap_quiet = BMI160_ENABLE; int_config.int_type_cfg.acc_tap_int.tap_dur = 1; int_config.int_type_cfg.acc_tap_int.tap_data_src=BMI160_ENABLE; int_config.int_type_cfg.acc_tap_int.tap_en = BMI160_ENABLE; /* Set the Single Tap interrupt */ bmi160_set_int_config(&int_config, &sensor); /* sensor is an instance of the structure bmi160_dev */ // And the reading part int_status_sel = BMI160_INT_STATUS_ALL; rslt = bmi160_get_int_status(int_status_sel, &interrupt, &sensor); if (interrupt.bit.s_tap) { int a = 0; } else { int b = 0; } }
... View more