If so, first check any motion example - https://github.com/BoschSensortec/BMI270-Sensor-API/blob/master/examples/bmi270/any_motion_interrupt...
Then, use set_any_motion_config function. There are threshold and select x,y,z.
You can select threshold and x axis only.
Thanks,