aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/mpu9250.py
Commit message (Collapse)AuthorAgeFilesLines
* sensor_mpu9250: Fix or improve reliability (#6170)Dr. Matthew Swabey2023-04-191-1/+1
| | | | | | | | | | | | | | | | | | | Fixes common MPU-9250 accelerometer issues for RPi Linux MCU and improves reliability on all other architectures by adjusting the MPU-* reading algorithm to only read whole Klipper messages' worth of data from MPU-* and eliminating many unnecessary checks of the MPU FIFO fill-level that consumed bus bandwidth needed for data transfer. Fixes intermittent "Lost communication with MCU 'rpi'" due to "Timer too close" and transposed / corrupted data due to FIFO overrun/data loss when using MPU-* accelerometers. In addition FIFO overrun checks are performed by testing the MPU interrupt flag vs. inferring from the FIFO fill level. Stress tested for 13hrs with two MPU-6500 attached to one I2C bus on RPi and one on a PR2040 Stress tested for 23hrs with two MPU-6500 attached to one I2C bus on RPi and one on a ATmega328P (Seeduino Nano) Signed-off-by: Matthew Swabey <matthew@swabey.org>
* mpu9250: add MPU6500 (#5767)Yifei Ding2022-11-191-4/+14
| | | Signed-off-by: Yifei Ding <yifeiding@protonmail.com>
* mpu9250: Inline twos_complement() codeKevin O'Connor2022-06-201-10/+5
| | | | | | | Calling python functions can have high overhead. Inline the twos_complement code in the _extract_samples() inner loop. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mpu9250: Use adxl345.AccelCommandHelper directlyKevin O'Connor2022-06-201-70/+1
| | | | | | | | | The MPU9250CommandHelper() class is nearly a duplicate of ADXL345CommandHelper(). Rename ADXL345QueryHelper() to AccelCommandHelper and remove user facing references to "adxl345". Use it directly from mpu9250.py . Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mpu9250: Use adxl345.ClockSyncRegression directlyKevin O'Connor2022-06-201-49/+1
| | | | | | | | The mpu9250.ClockSyncRegression() class is a duplicate of adxl345.ClockSyncRegression(). Remove the duplicate copy and use the code from adxl345.py . Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mpu9250: Use adxl345.AccelQueryHelper directlyKevin O'Connor2022-06-201-73/+2
| | | | | | | | The MPU9250QueryHelper() class is a duplicate of ADXL345QueryHelper(). Rename ADXL345QueryHelper() to AccelQueryHelper() and use it directly from mpu9250.py . Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mpu9250: Adding support for MPU-9250 (and MPU-6050) accelerometerbluesforte2022-06-161-0/+461
Add support for mpu9250 accelerometer over I2C bus. Signed-off-by: Harry Beyel <harry3b9@gmail.com>