aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/lis2dw.py
Commit message (Collapse)AuthorAgeFilesLines
* sensor_lis2dw: add lis3dh sensor and i2c communicationWulfsta2024-11-121-32/+93
| | | | Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
* adxl345: Fix read_axes_map() for non-adxl345 accelerometersKevin O'Connor2024-04-291-1/+1
| | | | | | | | | | | Commit 3f845019 unified the reading of the axes_map configuration variable, but broke the per-sensor scaling capabilities. Pass the scale parameters to read_axes_map() so that it can be implemented per-sensor. Reported by @Neko-vecter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Rework ChipClockUpdater class into FixedFreqReaderKevin O'Connor2024-04-201-20/+10
| | | | | | | Move the sensor_bulk_data message queuing into the class, and then rename that class. This simplifies the users of the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Refactor ChipClockUpdater constructorKevin O'Connor2024-04-201-9/+5
| | | | | | | Build the clock_sync and struct.Struct() in the ChipClockUpdater constructor. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lis2dw: Use extract_samples() for sample timestamp calculationKevin O'Connor2024-04-201-33/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_lis2dw: No need to schedule start of bulk readingKevin O'Connor2024-01-191-11/+7
| | | | | | It's simpler and faster to enable the lis2dw in the python code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Don't assume chip_clock is zero on start of queriesKevin O'Connor2024-01-191-1/+1
| | | | | | | Send an explicit clock query in ChipClockUpdater to seed the initial clock. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_bulk: New C file with helper code for sending bulk sensor measurementsKevin O'Connor2024-01-191-15/+6
| | | | | | | | | | Refactor the low-level "bulk sensor" management code in the mcu. This updates the sensor_adxl345.c, sensor_mpu9250.c, sensor_lis2dw.c, and sensor_angle.c code to use the same "bulk sensor" messages. All of these sensors will now send "sensor_bulk_data" and "sensor_bulk_status" messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_lis2dw: No need to send messages when stopping queriesKevin O'Connor2024-01-191-6/+2
| | | | | | Simplify the mcu code as any messages are ignored by the host anyway. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Simplify the registration of internal clients in BatchBulkHelperKevin O'Connor2023-12-261-2/+3
| | | | | | | | | | | | | | | Previously, the BatchBulkHelper class was designed primarily to register webhook clients, and internal clients used a wrapper class that emulated a webhooks client. Change BatchBulkHelper to support regular internal callbacks, and introduce a new BatchWebhooksClient class that can translate these internal callback to webhooks client messages. This makes it easier to register internal clients that can process the bulk messages every batch interval. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Rework APIDumpHelper() to BatchBulkHelper()Kevin O'Connor2023-12-261-19/+14
| | | | | | | The APIDumpHelper class is mainly intended to help process messages in batches. Rework the class methods to make that more clear. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: New add_mux_endpoint() helper function in APIDumpHelperKevin O'Connor2023-12-261-7/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Move APIDumpHelper() from motion_report.py to bulk_sensor.pyKevin O'Connor2023-12-261-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adxl345: Add a read_axes_map() helper functionKevin O'Connor2023-12-261-6/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adxl345: No need to implement is_measuring()Kevin O'Connor2023-12-261-9/+0
| | | | | | | The APIDumpHelper class already ensures that the start/stop callbacks will only be called when needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Add new ChipClockUpdater helper classKevin O'Connor2023-12-261-38/+11
| | | | | | | All the accelerometers use a standard response for their query_status messages. Create a common helper class to process those responses. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: Add new BulkDataQueue classKevin O'Connor2023-12-261-16/+5
| | | | | | | Move the bulk sample queue collection to a new helper class in bulk_sensor.py. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* bulk_sensor: New file with helper code for reading bulk sensorsKevin O'Connor2023-12-261-7/+7
| | | | | | | Move the ClockSyncRegression class from adxl345.py to a new bulk_sensors.py file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adxl345: Simplify sequence and limit_count upconversionKevin O'Connor2023-12-101-11/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lis2dw12: Add support for lis2dw12 accelerometerbigtreetech2023-08-211-0/+265
lis2dw12 is an accelerometer from STMicroelectronics(https://www.st.com/resource/en/datasheet/lis2dw12.pdf) With better performance than the ADXL345 according to the datasheet. Signed-off-by: XM.Zhou from BigTreeTech zhouxm@biqu3d.com Signed-off-by: Alan.Ma from BigTreeTech tech@biqu3d.com