STMicroelectronics / st-mems-android-linux-drivers-iio

stm mems iio drivers for Android and Linux platforms.
GNU General Public License v2.0
23 stars 1 forks source link

Correct way to implement accel/gyro thresholds on lsm9ds1 #6

Open pengus77 opened 1 year ago

pengus77 commented 1 year ago

Hi, we're noticing an incredibly high number of raised IRQs (about one every 20ms) in android from the lsm9ds1 accelerometer. This situation causes a fixed 20% usage on the CPU. When testing the gyroscope, the situation is the same. What is the correct way to implement thresholds in the code so that a device in static position doesn't flood the kernel with IRQs? We've tried writing to the various THS registers, enabling FIFO THS on INT1, setting DUR and WAIT... everything to no success. The only thing we managed to reduce the CPU to about 2.5% is setting the Decimation to 8. The documentation doesn't really explain what values the registers expect and/or if there's a correct order to set them. Please help :)