Dear
I am trying to see the tap interrupt(Single and Double). It seems that it doesn't work properly even single tap detection.
Please, review what I enabled and configured the registers for tap sensing. The file attached.
Thanks,
Hello Gideon,
Here is BMI160 double TAP code for your reference.
int8_t rslt = BMI160_OK;
struct bmi160_int_settg int_config;
/* Select the Interrupt channel/pin */
int_config.int_channel = BMI160_INT_CHANNEL_1;// Interrupt channel/pin 1
/* Select the Interrupt type */
int_config.int_type = BMI160_ACC_DOUBLE_TAP_INT;
/* 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_ENABLE;// Choosing active high output
int_config.int_pin_settg.edge_ctrl = BMI160_DISABLE;// 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_80_MILLI_SEC;// latched output
/* Select the Flat interrupt parameters */
int_config.int_type_cfg.acc_tap_int.tap_en = BMI160_ENABLE;//tap enable, 1 - enable, 0 - disable
int_config.int_type_cfg.acc_tap_int.tap_data_src=BMI160_ENABLE;//data source 0- filter & 1 pre-filter
/*tap duration, select the length of the time window for the second shock event for double tap detection,
000 - 50ms, 001 - 100ms, 010 - 150ms, 011 - 200ms, 100 - 250ms, 101 - 375ms, 110 - 500ms, 111 - 700ms*/
int_config.int_type_cfg.acc_tap_int.tap_dur = 2;
int_config.int_type_cfg.acc_tap_int.tap_quiet = BMI160_DISABLE;//tap quiet, 0 - 30ms, 1 - 20ms
int_config.int_type_cfg.acc_tap_int.tap_shock = BMI160_DISABLE;//tap shock duration, 0 - 50ms, 1 - 75ms
int_config.int_type_cfg.acc_tap_int.tap_thr = 2;//tap threshold
/* Set the Flat interrupt */
rslt = bmi160_set_int_config(&int_config, dev); /* sensor is an instance of the structure bmi160_dev */