int_config.int_type_cfg.acc_any_motion_int.anymotion_en = BMI160_DISABLE; // 1- Enable the any-motion, 0- disable any-motion
In your code you disable the any-motion interrupt mapping to the pin. I believe this is an error.
The rest looks good.
INT1 : Any-motion
INT2: Significant Motion
What you most likely want is to enable the Accelerometer data in the FIFO in STREAM mode, so upon overflow, the oldest data is overwritten. When you get an interrupt, you can then read the most recent last 1kB of accelerometer data.
... View more