Go to the documentation of this file.
30 #if (DRIVER_SPINDLE_ENABLE & SPINDLE_ENA) && !defined(SPINDLE_ENABLE_PIN)
31 #warning "Selected spindle is not supported!"
34 #if (DRIVER_SPINDLE_ENABLE & SPINDLE_DIR) && !defined(SPINDLE_DIRECTION_PIN)
35 #warning "Selected spindle is not fully supported - no direction output!"
38 #if (DRIVER_SPINDLE_ENABLE & SPINDLE_PWM) && !defined(SPINDLE_PWM_PIN)
39 #warning "Selected spindle is not supported!"
42 #if (DRIVER_SPINDLE1_ENABLE & SPINDLE_PWM) && !defined(SPINDLE1_PWM_PIN)
43 #warning "Selected spindle 1 is not supported!"
48 #if MPG_ENABLE == 1 && !defined(MPG_MODE_PIN)
49 #error "MPG_MODE_PIN must be defined!"
52 #if KEYPAD_ENABLE == 1 && !defined(I2C_STROBE_PIN)
53 #error Keypad plugin not supported!
54 #elif I2C_STROBE_ENABLE && !defined(I2C_STROBE_PIN)
55 #error "I2C strobe not supported!"
58 #if EEPROM_ENABLE == 0
59 #define FLASH_ENABLE 1
61 #define FLASH_ENABLE 0
67 #ifdef STEPPERS_ENABLE_PIN
68 #ifndef STEPPERS_ENABLE_PORT
69 #define STEPPERS_ENABLE_PORT ENABLE_PORT
73 #ifndef XY_ENABLE_PORT
74 #define XY_ENABLE_PORT ENABLE_PORT
78 #define X_ENABLE_PORT ENABLE_PORT
81 #define Y_ENABLE_PORT ENABLE_PORT
85 #define Z_ENABLE_PORT ENABLE_PORT
87 #if defined(M3_ENABLE_PIN) && !defined(M3_ENABLE_PORT)
88 #define M3_ENABLE_PORT ENABLE_PORT
90 #if defined(M4_ENABLE_PIN) && !defined(M4_ENABLE_PORT)
91 #define M4_ENABLE_PORT ENABLE_PORT
93 #if defined(M5_ENABLE_PIN) && !defined(M5_ENABLE_PORT)
94 #define M5_ENABLE_PORT ENABLE_PORT
96 #if defined(M6_ENABLE_PIN) && !defined(M6_ENABLE_PORT)
97 #define M6_ENABLE_PORT ENABLE_PORT
99 #if defined(M7_ENABLE_PIN) && !defined(M7_ENABLE_PORT)
100 #define M7_ENABLE_PORT ENABLE_PORT
107 #define X_STEP_PORT STEP_PORT
110 #define Y_STEP_PORT STEP_PORT
113 #define Z_STEP_PORT STEP_PORT
115 #if defined(M3_STEP_PIN) && !defined(M3_STEP_PORT)
116 #define M3_STEP_PORT STEP_PORT
118 #if defined(M4_STEP_PIN) && !defined(M4_STEP_PORT)
119 #define M4_STEP_PORT STEP_PORT
121 #if defined(M5_STEP_PIN) && !defined(M5_STEP_PORT)
122 #define M5_STEP_PORT STEP_PORT
124 #if defined(M6_STEP_PIN) && !defined(M6_STEP_PORT)
125 #define M6_STEP_PORT STEP_PORT
127 #if defined(M7_STEP_PIN) && !defined(M7_STEP_PORT)
128 #define M7_STEP_PORT STEP_PORT
132 #ifdef DIRECTION_PORT
133 #ifndef X_DIRECTION_PORT
134 #define X_DIRECTION_PORT DIRECTION_PORT
136 #ifndef Y_DIRECTION_PORT
137 #define Y_DIRECTION_PORT DIRECTION_PORT
139 #ifndef Z_DIRECTION_PORT
140 #define Z_DIRECTION_PORT DIRECTION_PORT
142 #if defined(M3_DIRECTION_PIN) && !defined(M3_DIRECTION_PORT)
143 #define M3_DIRECTION_PORT DIRECTION_PORT
145 #if defined(M4_DIRECTION_PIN) && !defined(M4_DIRECTION_PORT)
146 #define M4_DIRECTION_PORT DIRECTION_PORT
148 #if defined(M5_DIRECTION_PIN) && !defined(M5_DIRECTION_PORT)
149 #define M5_DIRECTION_PORT DIRECTION_PORT
151 #if defined(M6_DIRECTION_PIN) && !defined(M6_DIRECTION_PORT)
152 #define M6_DIRECTION_PORT DIRECTION_PORT
154 #if defined(M7_DIRECTION_PIN) && !defined(M7_DIRECTION_PORT)
155 #define M7_DIRECTION_PORT DIRECTION_PORT
160 #ifndef SPINDLE_ENABLE_PORT
161 #define SPINDLE_ENABLE_PORT SPINDLE_PORT
163 #if defined(SPINDLE_PWM_PIN) && !defined(SPINDLE_PWM_PORT)
164 #define SPINDLE_PWM_PORT SPINDLE_PORT
166 #if defined(SPINDLE_DIRECTION_PIN) && !defined(SPINDLE_DIRECTION_PORT)
167 #define SPINDLE_DIRECTION_PORT SPINDLE_PORT
172 #if defined(COOLANT_FLOOD_PIN) && !defined(COOLANT_FLOOD_PORT)
173 #define COOLANT_FLOOD_PORT COOLANT_PORT
175 #if defined(COOLANT_MIST_PIN) && !defined(COOLANT_MIST_PORT)
176 #define COOLANT_MIST_PORT COOLANT_PORT
184 #include "motors/trinamic.h"
186 #ifndef TRINAMIC_MIXED_DRIVERS
187 #define TRINAMIC_MIXED_DRIVERS 1
190 #if TRINAMIC_UART_ENABLE == 1 && !defined(TRINAMIC_STREAM)
191 #define TRINAMIC_STREAM 1
194 #if TRINAMIC_SPI_ENABLE == 1 || TRINAMIC_ENABLE == 2130 || TRINAMIC_ENABLE == 2660 || TRINAMIC_ENABLE == 5160
196 #undef TRINAMIC_SPI_ENABLE
197 #define TRINAMIC_SPI_40BIT (1<<1)
198 #define TRINAMIC_SPI_20BIT (1<<2)
199 #define TRINAMIC_SPI_CS_SINGLE (1<<3)
201 #if TRINAMIC_ENABLE == 2660
203 #define TRINAMIC_SPI_ENABLE (TRINAMIC_SPI_20BIT|TRINAMIC_SPI_CS_SINGLE)
205 #define TRINAMIC_SPI_ENABLE TRINAMIC_SPI_20BIT
209 #define TRINAMIC_SPI_ENABLE (TRINAMIC_SPI_40BIT|TRINAMIC_SPI_CS_SINGLE)
211 #define TRINAMIC_SPI_ENABLE TRINAMIC_SPI_40BIT
219 #define TRINAMIC_I2C 0
221 #if TRINAMIC_ENABLE && TRINAMIC_I2C
222 #define TRINAMIC_MOTOR_ENABLE 1
224 #define TRINAMIC_MOTOR_ENABLE 0
227 #if USB_SERIAL_CDC && defined(SERIAL_PORT)
245 #if MODBUS_ENABLE & MODBUS_RTU_ENABLED
246 #define MODBUS_TEST 1
248 #define MODBUS_TEST 0
251 #if TRINAMIC_ENABLE && TRINAMIC_UART_ENABLE == 1
252 #define TRINAMIC_TEST 1
254 #define TRINAMIC_TEST 0
257 #if KEYPAD_ENABLE == 2 && MPG_ENABLE == 0
258 #define KEYPAD_TEST 1
260 #define KEYPAD_TEST 0
263 #if (MODBUS_TEST + KEYPAD_TEST + (MPG_ENABLE ? 1 : 0) + TRINAMIC_TEST + (BLUETOOTH_ENABLE == 2 ? 1 : 0)) > (SP0 + SP1 + SP2)
264 #error "Too many options that uses a serial port are enabled!"
274 #if MPG_ENABLE && !defined(MPG_STREAM)
280 #if (MODBUS_ENABLE & MODBUS_RTU_ENABLED) && defined(MODBUS_RTU_STREAM) && MODBUS_RTU_STREAM == MPG_STREAM
282 #define MPG_STREAM (MODBUS_RTU_STREAM + 1)
286 #if KEYPAD_ENABLE == 2 && !defined(KEYPAD_STREAM)
288 #define KEYPAD_STREAM MPG_STREAM
290 #define KEYPAD_STREAM 0
292 #define KEYPAD_STREAM 1
294 #if (MODBUS_ENABLE & MODBUS_RTU_ENABLED) && defined(MODBUS_RTU_STREAM) && MODBUS_RTU_STREAM == MPG_STREAM
296 #define KEYPAD_STREAM (MODBUS_RTU_STREAM + 1)
300 #if defined(COPROC_RESET_PIN) && defined(COPROC_BOOT0_PIN)
301 #define COPROC_PASSTHRU 1
303 #define COPROC_PASSTHRU 0
306 #ifndef COPROC_STREAM
308 #define COPROC_STREAM 0
310 #define COPROC_STREAM 1