Add ADXL355 accelerometer support over SPI#7215
Open
entemomoh2 wants to merge 8 commits intoKlipper3d:masterfrom
Open
Add ADXL355 accelerometer support over SPI#7215entemomoh2 wants to merge 8 commits intoKlipper3d:masterfrom
entemomoh2 wants to merge 8 commits intoKlipper3d:masterfrom
Conversation
Signed-off-by: Sven Thiele <thiele61@gmx.de>
Signed-off-by: Sven Thiele <thiele61@gmx.de>
Signed-off-by: Sven Thiele <thiele61@gmx.de>
Signed-off-by: Sven Thiele <thiele61@gmx.de>
Author
Collaborator
|
Thanks. In general it seems useful. I have some questions/comments:
@dmbutyugin - fyi. Cheers, |
Author
|
Hi @KevinOConnor, thanks for reviewing! I changed the documentation to reduce redundancies while keeping examples where I deemed necessary and changed the copyright statements. If you want me to, I can condense it even more. Best regards |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds ADXL355 accelerometer support over SPI for Klipper resonance measurement and input shaper workflows.
It includes:
What’s Included
Added src/sensor_adxl355.c
Added MCU commands:
config_adxl355
query_adxl355
query_adxl355_status
Wired build/config:
src/Makefile: CONFIG_WANT_ADXL355
src/Kconfig: new WANT_ADXL355 option and NEED_SENSOR_BULK dependency update
Added klippy/extras/adxl355.py
Uses bulk_sensor.FixedFreqReader + BatchBulkHelper pattern
Supports:
ACCELEROMETER_QUERY
ACCELEROMETER_MEASURE
ACCELEROMETER_DEBUG_READ
ACCELEROMETER_DEBUG_WRITE
Supports axes_map and ADXL355 ODR rate values
Validates device IDs (DEVID_AD, DEVID_MST, PARTID)
Handles ADXL355 variants that always read POWER_CTL.STANDBY back as 0
Keeps strict register write verification for all other cases
Updated:
Validation
Test environment:
OctoPi / Raspberry Pi host MCU ([mcu rpi])
ADXL355 connected via SPI (spidev0.0)
Build/runtime checks performed:
make -j4 successful (including sensor_adxl355.c)
Host module import/compile sanity check successful
RPi host MCU updated and restarted with ADXL355 commands present
Command checks:
ACCELEROMETER_DEBUG_READ CHIP=adxl355 REG=0x00 -> 0xadACCELEROMETER_DEBUG_READ CHIP=adxl355 REG=0x01 -> 0x1dACCELEROMETER_DEBUG_READ CHIP=adxl355 REG=0x02 -> 0xedACCELEROMETER_QUERY CHIP=adxl355returns live XYZ valuesACCELEROMETER_MEASUREstart/stop generates CSV data (/tmp/adxl355-smoketest.csv)Notes
This series follows existing accelerometer bulk-sensor architecture and command conventions.
The standby readback quirk handling is intentionally narrow (only REG_POWER_CTL, only standby-bit mismatch) to avoid weakening register verification behavior.
Please let me know if there are any issues/bugs right away. This is my first PR but I hope it's useful and done right :)
Heads-up: I created the initial driver as a derivative of adxl345 because I only had a 355 on hand and finished proper integration using AI. I tested the features on my Ender 2 Pro and validated everything there.