Skip to content

Commit

Permalink
♻️ TMC_SW_* => TMC_SPI_*
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Feb 8, 2024
1 parent 5febc39 commit 41d78a2
Show file tree
Hide file tree
Showing 55 changed files with 298 additions and 296 deletions.
6 changes: 3 additions & 3 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2963,9 +2963,9 @@
* but you can override or define them here.
*/
//#define TMC_USE_SW_SPI
//#define TMC_SW_MOSI -1
//#define TMC_SW_MISO -1
//#define TMC_SW_SCK -1
//#define TMC_SPI_MOSI -1
//#define TMC_SPI_MISO -1
//#define TMC_SPI_SCK -1

// @section tmc/serial

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/DUE/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
* Usually the hardware SPI pins are only available to the LCD. This makes the DUE hard SPI used at the same time
* as the TMC2130 soft SPI the most common setup.
*/
#define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == SD_MOSI_PIN || TMC_SW_##P == SD_MISO_PIN || TMC_SW_##P == SD_SCK_PIN))
#define _IS_HW_SPI(P) (defined(TMC_SPI_##P) && (TMC_SPI_##P == SD_MOSI_PIN || TMC_SPI_##P == SD_MISO_PIN || TMC_SPI_##P == SD_SCK_PIN))

#if HAS_MEDIA && HAS_DRIVER(TMC2130)
#if ENABLED(TMC_USE_SW_SPI)
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/LPC1768/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#if USING_HW_SERIAL0
#define IS_TX0(P) (P == P0_02)
#define IS_RX0(P) (P == P0_03)
#if IS_TX0(TMC_SW_MISO) || IS_RX0(TMC_SW_MOSI)
#if IS_TX0(TMC_SPI_MISO) || IS_RX0(TMC_SPI_MOSI)
#error "Serial port pins (0) conflict with Trinamic SPI pins!"
#elif HAS_PRUSA_MMU1 && (IS_TX0(E_MUX1_PIN) || IS_RX0(E_MUX0_PIN))
#error "Serial port pins (0) conflict with Multi-Material-Unit multiplexer pins!"
Expand All @@ -115,7 +115,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#define IS_RX1(P) (P == P0_16)
#define _IS_TX1_1 IS_TX1
#define _IS_RX1_1 IS_RX1
#if IS_TX1(TMC_SW_SCK)
#if IS_TX1(TMC_SPI_SCK)
#error "Serial port pins (1) conflict with other pins!"
#elif HAS_ROTARY_ENCODER
#if IS_TX1(BTN_EN2) || IS_RX1(BTN_EN1)
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,8 @@
#error "EXTRA_LIN_ADVANCE_K is now ADVANCE_K_EXTRA."
#elif defined(POLAR_SEGMENTS_PER_SECOND) || defined(DELTA_SEGMENTS_PER_SECOND) || defined(SCARA_SEGMENTS_PER_SECOND) || defined(TPARA_SEGMENTS_PER_SECOND)
#error "(POLAR|DELTA|SCARA|TPARA)_SEGMENTS_PER_SECOND is now DEFAULT_SEGMENTS_PER_SECOND."
#elif defined(TMC_SW_MOSI) || defined(TMC_SW_MISO) || defined(TMC_SW_SCK)
#error "TMC_SW_(MOSI|MISO|SCK) is now TMC_SPI_(MOSI|MISO|SCK)."
#endif

// L64xx stepper drivers have been removed
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/stepper/trinamic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enum StealthIndex : uint8_t {
// AI = Axis Enum Index
// SWHW = SW/SH UART selection
#if ENABLED(TMC_USE_SW_SPI)
#define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin<IC##Stepper, L, AI> stepper##ST(ST##_CS_PIN, float(ST##_RSENSE), TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK, ST##_CHAIN_POS)
#define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin<IC##Stepper, L, AI> stepper##ST(ST##_CS_PIN, float(ST##_RSENSE), TMC_SPI_MOSI, TMC_SPI_MISO, TMC_SPI_SCK, ST##_CHAIN_POS)
#else
#define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin<IC##Stepper, L, AI> stepper##ST(ST##_CS_PIN, float(ST##_RSENSE), ST##_CHAIN_POS)
#endif
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/linux/pins_RAMPS_LINUX.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,14 @@
* Default pins for TMC software SPI
*/
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI 66
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI 66
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO 44
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO 44
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK 64
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK 64
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@
// Software SPI pins for TMC2130 stepper drivers
//
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI P0_18 // ETH
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P0_18 // ETH
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO P0_17 // ETH
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_17 // ETH
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK P0_15 // ETH
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_15 // ETH
#endif
#endif

Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@
// When using any TMC SPI-based drivers, software SPI is used
// because pins may be shared with the display or SD card.
#define TMC_USE_SW_SPI
#define TMC_SW_MOSI EXP2_06_PIN
#define TMC_SW_MISO EXP2_01_PIN
#define TMC_SPI_MOSI EXP2_06_PIN
#define TMC_SPI_MISO EXP2_01_PIN
// To minimize pin usage use the same clock pin as the display/SD card reader. (May generate LCD noise.)
#define TMC_SW_SCK EXP2_02_PIN
#define TMC_SPI_SCK EXP2_02_PIN
// If pin 2_06 is unused, it can be used for the clock to avoid the LCD noise.
//#define TMC_SW_SCK P2_06
//#define TMC_SPI_SCK P2_06

#if ENABLED(SOFTWARE_DRIVER_ENABLE)

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@
// Software SPI pins for TMC2130 stepper drivers
//
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI P4_28
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P4_28
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO P0_05
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_05
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK P0_04
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_04
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@
// Software SPI pins for TMC2130 stepper drivers
//
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI P1_17
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P1_17
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO P0_05
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_05
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK P0_04
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_04
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,14 @@
// https://github.com/makerbase-mks/MKS-SBASE/issues/25
#define TMC_USE_SW_SPI
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI P0_03 // AUX1
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P0_03 // AUX1
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO P0_02 // AUX1
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_02 // AUX1
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK P0_26 // TH4
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_26 // TH4
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@
// Software SPI pins for TMC2130 stepper drivers
//
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI P4_28
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P4_28
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO P0_05
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_05
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK P0_04
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_04
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@
// Software SPI pins for TMC2130 stepper drivers
//
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI P1_00 // ETH
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P1_00 // ETH
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO P1_08 // ETH
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P1_08 // ETH
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK P1_09 // ETH
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P1_09 // ETH
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@
// Default pins for TMC software SPI
//
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI P1_16 // Ethernet Expansion - Pin 5
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P1_16 // Ethernet Expansion - Pin 5
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO P1_17 // Ethernet Expansion - Pin 6
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P1_17 // Ethernet Expansion - Pin 6
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK P1_08 // Ethernet Expansion - Pin 7
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P1_08 // Ethernet Expansion - Pin 7
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@
// Default pins for TMC software SPI
//
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI P1_16 // Ethernet Expansion - Pin 5
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P1_16 // Ethernet Expansion - Pin 5
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO P1_17 // Ethernet Expansion - Pin 6
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P1_17 // Ethernet Expansion - Pin 6
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK P1_08 // Ethernet Expansion - Pin 7
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P1_08 // Ethernet Expansion - Pin 7
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/lpc1769/pins_FLY_CDY.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@
// Software SPI pins for TMC2130 stepper drivers
//
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI P0_20
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P0_20
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO P0_19
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_19
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK P0_21
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_21
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@
// Software SPI pins for TMC2130 stepper drivers
//
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI P1_16
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P1_16
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO P0_05
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_05
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK P0_04
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_04
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/pinsDebug_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,14 +489,14 @@
REPORT_NAME_DIGITAL(__LINE__, EXP3_10_PIN)
#endif

#if _EXISTS(TMC_SW_MISO)
REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MISO)
#if _EXISTS(TMC_SPI_MISO)
REPORT_NAME_DIGITAL(__LINE__, TMC_SPI_MISO)
#endif
#if _EXISTS(TMC_SW_MOSI)
REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MOSI)
#if _EXISTS(TMC_SPI_MOSI)
REPORT_NAME_DIGITAL(__LINE__, TMC_SPI_MOSI)
#endif
#if _EXISTS(TMC_SW_SCK)
REPORT_NAME_DIGITAL(__LINE__, TMC_SW_SCK)
#if _EXISTS(TMC_SPI_SCK)
REPORT_NAME_DIGITAL(__LINE__, TMC_SPI_SCK)
#endif
#if _EXISTS(TFTGLCD_CS)
REPORT_NAME_DIGITAL(__LINE__, TFTGLCD_CS)
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/ramps/pins_RAMPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,14 @@
// TMC software SPI
//
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI 66
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI 66
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO 44
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO 44
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK 64
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK 64
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/ramps/pins_RAMPS_S_12.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@
// TMC software SPI
//
#if ENABLED(TMC_USE_SW_SPI)
#ifndef TMC_SW_MOSI
#define TMC_SW_MOSI 51
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI 51
#endif
#ifndef TMC_SW_MISO
#define TMC_SW_MISO 50
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO 50
#endif
#ifndef TMC_SW_SCK
#define TMC_SW_SCK 53
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK 53
#endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/pins/ramps/pins_TT_OSCAR.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@
// Default pins for TMC software SPI
//
//#if ENABLED(TMC_USE_SW_SPI)
// #ifndef TMC_SW_MOSI
// #define TMC_SW_MOSI 66
// #ifndef TMC_SPI_MOSI
// #define TMC_SPI_MOSI 66
// #endif
// #ifndef TMC_SW_MISO
// #define TMC_SW_MISO 44
// #ifndef TMC_SPI_MISO
// #define TMC_SPI_MISO 44
// #endif
// #ifndef TMC_SW_SCK
// #define TMC_SW_SCK 64
// #ifndef TMC_SPI_SCK
// #define TMC_SPI_SCK 64
// #endif
//#endif

Expand Down
Loading

0 comments on commit 41d78a2

Please sign in to comment.