Skip to content

Commit

Permalink
simplified ADXL system and fixed a typo in Mellow Fly-SB2209 template
Browse files Browse the repository at this point in the history
  • Loading branch information
Frix-x committed Jun 14, 2023
1 parent 5c01546 commit 57ab6ed
Show file tree
Hide file tree
Showing 16 changed files with 106 additions and 51 deletions.
18 changes: 0 additions & 18 deletions config/hardware/accelerometers/adxl345_ebb.cfg

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# This ADXL file is dedicated to be used with ADXL boards
# connected over the SPI bus of the MCU boards on "spi1"

# This include most Mellow toolhead boards such as SHT boards, ...
# But also Octopus, etc...

# If using a toolhead board, be sure to have the pin override in your mcu.cfg (toolhead:ADXL_CS)


[adxl345]
cs_pin: toolhead:ADXL_CS
cs_pin: ADXL_CS
spi_bus: spi1
axes_map: x,y,z

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# This ADXL file is dedicated to be used with ADXL boards
# connected over the SPI bus of the MCU boards on "ssp1"

# This include BTT SKRv1.4, ...


[adxl345]
spi_bus: ssp1
cs_pin: ADXL_CS
axes_map: -z,y,x
spi_bus: ssp1
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
Expand Down
8 changes: 6 additions & 2 deletions config/hardware/accelerometers/adxl345_rpi.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# This file is the recommended way to get an accelerometer connected and used in Klipper
# This ADXL file is dedicated to be used with ADXL boards
# connected over the SPI bus of the RaspberryPi
# It is the official and recommended way to get an
# accelerometer connected and used in Klipper

# Do not forget to also flash the RPi with the Klipper firmware!

[include ../../mcu_definitions/rpi.cfg]


[adxl345]
cs_pin: rpi:None
axes_map: -z,y,x
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
Expand Down
18 changes: 0 additions & 18 deletions config/hardware/accelerometers/adxl345_sb2040.cfg

This file was deleted.

26 changes: 26 additions & 0 deletions config/hardware/accelerometers/adxl345_software_spi.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This ADXL file is dedicated to be used with ADXL boards
# connected over the software SPI bus of the MCU boards

# This include most BTT toolhead boards such as EBB boards, SB2209, SB2240,
# but also some Mellow boards such as the Fly-SB2040, ...
# If using a toolhead board, be sure to have the pin override in your mcu.cfg (toolhead:ADXL_CS)


[adxl345]
cs_pin: ADXL_CS
spi_software_sclk_pin: ADXL_SCLK
spi_software_mosi_pin: ADXL_MOSI
spi_software_miso_pin: ADXL_MISO
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
probe_points:
-1,-1,-1


# Include the IS calibration macros to unlock them when
# an accelerometer is installed on the machine
[include ../../../macros/helpers/resonance_override.cfg]
[include ../../../macros/calibration/IS_shaper_calibrate.cfg]
[include ../../../macros/calibration/IS_vibrations_measurement.cfg]
11 changes: 8 additions & 3 deletions config/hardware/accelerometers/adxl345_usb.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# USB support for RPi pico and KUSBA V2
# Edit the serial line with the correct address.
# This ADXL file is dedicated to be used with ADXL boards
# connected over USB to the pi as dedicated and standalone ADXL-MCU boards

# This include KUSBA, ...


# You need to override the following to be able to set the proper serial in your overrides.cfg file
[mcu adxl]
serial: /dev/serial/by-id/xxx

[adxl345]
cs_pin: adxl:gpio1
spi_bus: spi0a
axes_map: -z,y,x
axes_map: x,y,z

[resonance_tester]
accel_chip: adxl345
Expand Down
6 changes: 6 additions & 0 deletions user_templates/mcu_defaults/toolhead/BTT_EBB36-42_v1.0.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ pin: toolhead:STATUS_NEOPIXEL
[tmc2209 extruder]
uart_pin: toolhead:E_TMCUART

[adxl345]
cs_pin: toolhead:ADXL_CS
spi_software_sclk_pin: toolhead:ADXL_SCLK
spi_software_mosi_pin: toolhead:ADXL_MOSI
spi_software_miso_pin: toolhead:ADXL_MISO

6 changes: 6 additions & 0 deletions user_templates/mcu_defaults/toolhead/BTT_EBB36-42_v1.1.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ pin: toolhead:STATUS_NEOPIXEL
[tmc2209 extruder]
uart_pin: toolhead:E_TMCUART

[adxl345]
cs_pin: toolhead:ADXL_CS
spi_software_sclk_pin: toolhead:ADXL_SCLK
spi_software_mosi_pin: toolhead:ADXL_MOSI
spi_software_miso_pin: toolhead:ADXL_MISO

6 changes: 6 additions & 0 deletions user_templates/mcu_defaults/toolhead/BTT_EBB36-42_v1.2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ pin: toolhead:STATUS_NEOPIXEL
[tmc2209 extruder]
uart_pin: toolhead:E_TMCUART

[adxl345]
cs_pin: toolhead:ADXL_CS
spi_software_sclk_pin: toolhead:ADXL_SCLK
spi_software_mosi_pin: toolhead:ADXL_MOSI
spi_software_miso_pin: toolhead:ADXL_MISO

8 changes: 7 additions & 1 deletion user_templates/mcu_defaults/toolhead/BTT_SB2209_v1.0.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ aliases:

STATUS_NEOPIXEL=MCU_RGB ,

ADXL_CS=MCU_SPI2_CS , ADXL_SCLK=MCU_SPI2_CLK , ADXL_MISO=MCU_SPI2_MISO , ADXL_MOSI=MCU_SPI2_MOSI ,
ADXL_CS=MCU_SPI2_NSS , ADXL_SCLK=MCU_SPI2_CLK , ADXL_MISO=MCU_SPI2_MISO , ADXL_MOSI=MCU_SPI2_MOSI ,
MAX31865_NSS=MCU_SPI1_NSS , MAX31865_CLK=MCU_SPI1_CLK , MAX31865_MOSI=MCU_SPI1_MOSI , MAX31865_MISO = MCU_SPI1_MISO ,


Expand Down Expand Up @@ -67,3 +67,9 @@ pin: toolhead:STATUS_NEOPIXEL
[tmc2209 extruder]
uart_pin: toolhead:E_TMCUART

[adxl345]
cs_pin: toolhead:ADXL_CS
spi_software_sclk_pin: toolhead:ADXL_SCLK
spi_software_mosi_pin: toolhead:ADXL_MOSI
spi_software_miso_pin: toolhead:ADXL_MISO

6 changes: 6 additions & 0 deletions user_templates/mcu_defaults/toolhead/BTT_SB2240_v1.0.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,9 @@ driver_SGT: 30
driver_SEMIN: 2
driver_SEMAX: 8

[adxl345]
cs_pin: toolhead:ADXL_CS
spi_software_sclk_pin: toolhead:ADXL_SCLK
spi_software_mosi_pin: toolhead:ADXL_MOSI
spi_software_miso_pin: toolhead:ADXL_MISO

6 changes: 6 additions & 0 deletions user_templates/mcu_defaults/toolhead/Mellow_SB2040_v1.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ pin: toolhead:STATUS_NEOPIXEL
[tmc2209 extruder]
uart_pin: toolhead:E_TMCUART

[adxl345]
cs_pin: toolhead:ADXL_CS
spi_software_sclk_pin: toolhead:ADXL_SCLK
spi_software_mosi_pin: toolhead:ADXL_MOSI
spi_software_miso_pin: toolhead:ADXL_MISO

3 changes: 3 additions & 0 deletions user_templates/mcu_defaults/toolhead/Mellow_SHT36-42_v1.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ pin: toolhead:STATUS_NEOPIXEL
[tmc2209 extruder]
uart_pin: toolhead:E_TMCUART

[adxl345]
cs_pin: toolhead:ADXL_CS

3 changes: 3 additions & 0 deletions user_templates/mcu_defaults/toolhead/Mellow_SHT36_v2.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ pin: toolhead:STATUS_NEOPIXEL
[tmc2209 extruder]
uart_pin: toolhead:E_TMCUART

[adxl345]
cs_pin: toolhead:ADXL_CS

11 changes: 5 additions & 6 deletions user_templates/printer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,11 @@

# --------------------------------------------------------------------- ACCELEROMETER ----> Select only one line
### --------------------------------------------------------------------------------------
# [include config/hardware/accelerometers/adxl345_rpi.cfg]
# [include config/hardware/accelerometers/adxl345_ebb.cfg]
# [include config/hardware/accelerometers/adxl345_sht.cfg]
# [include config/hardware/accelerometers/adxl345_sb2040.cfg]
# [include config/hardware/accelerometers/adxl345_skr.cfg]
# [include config/hardware/accelerometers/adxl345_usb.cfg]
# [include config/hardware/accelerometers/adxl345_rpi.cfg] # For ADXL plugged directly on the Pi (official and recommended way)
# [include config/hardware/accelerometers/adxl345_software_spi.cfg] # For ADXL plugged in boards such as BTT EBB, SB2209, SB2240, or Mellow Fly-SB2040, ...
# [include config/hardware/accelerometers/adxl345_hardware_spi1.cfg] # For ADXL plugged in Mellow SHT, Octopus, ...
# [include config/hardware/accelerometers/adxl345_hardware_ssp1.cfg] # For ADXL plugged in SKRv1.4, ...
# [include config/hardware/accelerometers/adxl345_usb.cfg] # For KUBSA, ...
# ----------------------------------------------------------------------------------------


Expand Down

0 comments on commit 57ab6ed

Please sign in to comment.