Browse Source

📌 MKS pins for PSU_CONTROL (#22528)

mks-viva 3 years ago
parent
commit
c1a533b45e
No account linked to committer's email address

+ 2
- 2
Marlin/src/gcode/lcd/M995.cpp View File

@@ -26,7 +26,7 @@
26 26
 
27 27
 #include "../gcode.h"
28 28
 
29
-#if ENABLED(TFT_LVGL_UI)
29
+#if HAS_TFT_LVGL_UI
30 30
   #include "../../lcd/extui/mks_ui/draw_touch_calibration.h"
31 31
 #else
32 32
   #include "../../lcd/menu/menu.h"
@@ -37,7 +37,7 @@
37 37
  */
38 38
 void GcodeSuite::M995() {
39 39
 
40
-  #if ENABLED(TFT_LVGL_UI)
40
+  #if HAS_TFT_LVGL_UI
41 41
     lv_draw_touch_calibration_screen();
42 42
   #else
43 43
     ui.goto_screen(touch_screen_calibration);

+ 10
- 2
Marlin/src/pins/lpc1768/pins_MKS_SBASE.h View File

@@ -136,9 +136,17 @@
136 136
 #endif
137 137
 
138 138
 //
139
-// Misc. Functions
139
+// Power Supply Control
140 140
 //
141
-#define PS_ON_PIN                          P0_25  // TH3 Connector
141
+#if ENABLED(PSU_CONTROL)                          // MKSPWC
142
+  #ifndef PS_ON_PIN
143
+    #define PS_ON_PIN                      P0_25  // SERVO
144
+  #endif
145
+  #ifndef KILL_PIN
146
+    #define KILL_PIN                       P1_29  // Z+
147
+    #define KILL_PIN_STATE                  HIGH
148
+  #endif
149
+#endif
142 150
 
143 151
 //
144 152
 // Ethernet pins

+ 13
- 0
Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h View File

@@ -216,6 +216,19 @@
216 216
 #endif
217 217
 
218 218
 //
219
+// Power Supply Control
220
+//
221
+#if ENABLED(PSU_CONTROL)                          // MKSPWC
222
+  #ifndef PS_ON_PIN
223
+    #define PS_ON_PIN                      P2_00  // SERVO
224
+  #endif
225
+  #ifndef KILL_PIN
226
+    #define KILL_PIN                       P1_24  // Z+
227
+    #define KILL_PIN_STATE                  HIGH
228
+  #endif
229
+#endif
230
+
231
+//
219 232
 // Misc. Functions
220 233
 //
221 234
 #define LED_PIN                            P1_18  // Used as a status indicator

+ 13
- 0
Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h View File

@@ -227,6 +227,19 @@
227 227
 #define LED_PIN                            P1_18  // Used as a status indicator
228 228
 
229 229
 //
230
+// Power Supply Control
231
+//
232
+#if ENABLED(PSU_CONTROL)                          // MKSPWC
233
+  #ifndef PS_ON_PIN
234
+    #define PS_ON_PIN                      P2_00  // Suggestion (SERVO)
235
+  #endif
236
+  #ifndef KILL_PIN
237
+    #define KILL_PIN                       P1_24  // Suggestion (Z+)
238
+    #define KILL_PIN_STATE                  HIGH
239
+  #endif
240
+#endif
241
+
242
+//
230 243
 // RGB LED
231 244
 //
232 245
 #if ENABLED(RGB_LED)

+ 1
- 1
Marlin/src/pins/stm32f1/pins_CHITU3D_common.h View File

@@ -147,7 +147,7 @@
147 147
   #define TFT_RS_PIN                 FSMC_RS_PIN
148 148
 #endif
149 149
 
150
-#if ENABLED(TFT_LVGL_UI)
150
+#if HAS_TFT_LVGL_UI
151 151
   // LVGL
152 152
   #define HAS_SPI_FLASH_FONT                   1
153 153
   #define HAS_GCODE_PREVIEW                    1

+ 3
- 2
Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h View File

@@ -195,9 +195,10 @@
195 195
 //
196 196
 // Misc. Functions
197 197
 //
198
-//#define POWER_LOSS_PIN                    PA1   // PW_SO
199 198
 #if ENABLED(BACKUP_POWER_SUPPLY)
200 199
   #define POWER_LOSS_PIN                    PA2   // PW_DET (UPS) MKSPWC
200
+#else
201
+  //#define POWER_LOSS_PIN                  PA1   // PW_SO
201 202
 #endif
202 203
 
203 204
 /**
@@ -217,7 +218,7 @@
217 218
 //
218 219
 #if ENABLED(PSU_CONTROL)
219 220
   #define KILL_PIN                          PA2   // PW_DET
220
-  #define KILL_PIN_INVERTING                true
221
+  #define KILL_PIN_STATE                   HIGH
221 222
   //#define PS_ON_PIN                       PA3   // PW_CN /PW_OFF
222 223
 #endif
223 224
 

+ 5
- 6
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h View File

@@ -183,12 +183,11 @@
183 183
 // Misc. Functions
184 184
 //
185 185
 #if HAS_TFT_LVGL_UI
186
-  //#define MKSPWC
187
-  #ifdef MKSPWC
188
-    #define SUICIDE_PIN                     PB2   // Enable MKSPWC SUICIDE PIN
189
-    #define SUICIDE_PIN_INVERTING          false  // Enable MKSPWC PIN STATE
190
-    #define KILL_PIN                        PA2   // Enable MKSPWC DET PIN
191
-    #define KILL_PIN_STATE                  true  // Enable MKSPWC PIN STATE
186
+  #if ENABLED(PSU_CONTROL)                        // MKSPWC
187
+    #define SUICIDE_PIN                     PB2   // PW_OFF
188
+    #define SUICIDE_PIN_INVERTING          false
189
+    #define KILL_PIN                        PA2   // PW_DET
190
+    #define KILL_PIN_STATE                  HIGH
192 191
   #endif
193 192
 
194 193
   #define MT_DET_1_PIN                      PA4   // LVGL UI FILAMENT RUNOUT1 PIN

+ 16
- 3
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h View File

@@ -126,6 +126,19 @@
126 126
 
127 127
 #define FIL_RUNOUT_PIN                      PB10  // MT_DET
128 128
 
129
+//
130
+// Power Supply Control
131
+//
132
+#if ENABLED(PSU_CONTROL)                          // MKSPWC
133
+  #ifndef PS_ON_PIN
134
+    #define PS_ON_PIN                       PA14  // PW_OFF
135
+  #endif
136
+  #ifndef KILL_PIN
137
+    #define KILL_PIN                        PB10  // PW_DET
138
+    #define KILL_PIN_STATE                  HIGH
139
+  #endif
140
+#endif
141
+
129 142
 /**
130 143
  *                _____                                      _____                                     _____
131 144
  *  (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC)          (MISO) PB14 | 1 2 | PB13 (SD_SCK)                  5V | 1 2 | GND
@@ -158,7 +171,7 @@
158 171
   #elif ENABLED(MKS_MINI_12864_V3)
159 172
     #define DOGLCD_CS                       PA4
160 173
     #define DOGLCD_A0                       PA5
161
-    #define LCD_PINS_DC                     DOGLCD_A0
174
+    #define LCD_PINS_DC                DOGLCD_A0
162 175
     #define LCD_BACKLIGHT_PIN               -1
163 176
     #define LCD_RESET_PIN                   PA6
164 177
     #define NEOPIXEL_PIN                    PA7
@@ -189,8 +202,8 @@
189 202
 //
190 203
 // SD Card
191 204
 //
192
-#define SPI_DEVICE                          2
193
-#define ONBOARD_SPI_DEVICE                  2
205
+#define SPI_DEVICE                             2
206
+#define ONBOARD_SPI_DEVICE                     2
194 207
 #define SDSS                           SD_SS_PIN
195 208
 #define SDCARD_CONNECTION                ONBOARD
196 209
 #define SD_DETECT_PIN                       PC10

+ 19
- 8
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h View File

@@ -128,17 +128,28 @@
128 128
 //#define TEMP_0_CS_PIN                     PE6   // TC2 - CS2
129 129
 
130 130
 //
131
-// Misc. Functions
131
+// Power Supply Control
132 132
 //
133
-#if HAS_TFT_LVGL_UI
134
-  //#define MKSPWC
135
-  #ifdef MKSPWC
136
-    #define SUICIDE_PIN                     PB2   // Enable MKSPWC SUICIDE PIN
137
-    #define SUICIDE_PIN_INVERTING          false  // Enable MKSPWC PIN STATE
138
-    #define KILL_PIN                        PA2   // Enable MKSPWC DET PIN
139
-    #define KILL_PIN_STATE                  true  // Enable MKSPWC PIN STATE
133
+#if ENABLED(PSU_CONTROL)                          // MKSPWC
134
+  #if HAS_TFT_LVGL_UI
135
+    #error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
136
+  #endif
137
+  #ifndef PS_ON_PIN
138
+    #define PS_ON_PIN                       PB2   // SUICIDE
140 139
   #endif
140
+  #ifndef KILL_PIN
141
+    #define KILL_PIN                        PA2
142
+    #define KILL_PIN_STATE                  HIGH
143
+  #endif
144
+#else
145
+  #define SUICIDE_PIN                       PB2
146
+  #define SUICIDE_PIN_INVERTING            false
147
+#endif
141 148
 
149
+//
150
+// Misc. Functions
151
+//
152
+#if HAS_TFT_LVGL_UI
142 153
   #define MT_DET_1_PIN                      PA4   // LVGL UI FILAMENT RUNOUT1 PIN
143 154
   #define MT_DET_2_PIN                      PE6   // LVGL UI FILAMENT RUNOUT2 PIN
144 155
   #define MT_DET_PIN_INVERTING             false  // LVGL UI filament RUNOUT PIN STATE

+ 19
- 7
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h View File

@@ -192,16 +192,28 @@
192 192
 //#define TEMP_0_CS_PIN                     PE6   // TC2 - CS2
193 193
 
194 194
 //
195
+// Power Supply Control
196
+//
197
+#if ENABLED(PSU_CONTROL)                          // MKSPWC
198
+  #if HAS_TFT_LVGL_UI
199
+    #error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
200
+  #endif
201
+  #ifndef PS_ON_PIN
202
+    #define PS_ON_PIN                       PB2   // SUICIDE
203
+  #endif
204
+  #ifndef KILL_PIN
205
+    #define KILL_PIN                        PA2
206
+    #define KILL_PIN_STATE                  HIGH
207
+  #endif
208
+#else
209
+  #define SUICIDE_PIN                       PB2
210
+  #define SUICIDE_PIN_INVERTING            false
211
+#endif
212
+
213
+//
195 214
 // Misc. Functions
196 215
 //
197 216
 #if HAS_TFT_LVGL_UI
198
-  //#define MKSPWC
199
-  #ifdef MKSPWC
200
-    #define SUICIDE_PIN                     PB2   // Enable MKSPWC SUICIDE PIN
201
-    #define SUICIDE_PIN_INVERTING          false  // Enable MKSPWC PIN STATE
202
-    #define KILL_PIN                        PA2   // Enable MKSPWC DET PIN
203
-    #define KILL_PIN_STATE                  true  // Enable MKSPWC PIN STATE
204
-  #endif
205 217
 
206 218
   #define MT_DET_1_PIN                      PA4   // LVGL UI FILAMENT RUNOUT1 PIN
207 219
   #define MT_DET_2_PIN                      PE6   // LVGL UI FILAMENT RUNOUT2 PIN

+ 21
- 3
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h View File

@@ -179,10 +179,28 @@
179 179
 //#define TEMP_0_CS_PIN                     PF11  // TC2 - CS2
180 180
 
181 181
 #define POWER_LOSS_PIN                      PA2   // PW_DET
182
-#define PS_ON_PIN                           PG11  // PW_OFF
183 182
 #define FIL_RUNOUT_PIN                      PA4   // MT_DET1
184
-//#define FIL_RUNOUT_PIN                    PE6   // MT_DET2
185
-//#define FIL_RUNOUT_PIN                    PG14  // MT_DET3
183
+#define FIL_RUNOUT2_PIN                     PE6   // MT_DET2
184
+#define FIL_RUNOUT3_PIN                     PG14  // MT_DET3
185
+
186
+//
187
+// Power Supply Control
188
+//
189
+#if ENABLED(PSU_CONTROL)                          // MKSPWC
190
+  #if HAS_TFT_LVGL_UI
191
+    #error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
192
+  #endif
193
+  #ifndef PS_ON_PIN
194
+    #define PS_ON_PIN                       PG11  // SUICIDE
195
+  #endif
196
+  #ifndef KILL_PIN
197
+    #define KILL_PIN                        PA2
198
+    #define KILL_PIN_STATE                  HIGH
199
+  #endif
200
+#else
201
+  #define SUICIDE_PIN                       PG11
202
+  #define SUICIDE_PIN_INVERTING            false
203
+#endif
186 204
 
187 205
 //
188 206
 // SD Card

+ 19
- 6
Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h View File

@@ -210,10 +210,8 @@
210 210
 //
211 211
 // Misc. Functions
212 212
 //
213
-#define MT_DET_1                       Y_MAX_PIN
214
-#define MT_DET_2                       Z_MAX_PIN
215
-#define PW_DET                         Y_MAX_PIN
216
-#define PW_OFF                         Z_MAX_PIN
213
+#define MT_DET_1                            PC5   // Y+
214
+#define MT_DET_2                            PB12  // Z+
217 215
 
218 216
 #ifndef FIL_RUNOUT_PIN
219 217
   #define FIL_RUNOUT_PIN                MT_DET_1
@@ -222,8 +220,23 @@
222 220
   #define FIL_RUNOUT2_PIN               MT_DET_2
223 221
 #endif
224 222
 
225
-#define POWER_LOSS_PIN                    PW_DET
226
-#define PS_ON_PIN                         PW_OFF
223
+//
224
+// Power Supply Control
225
+//
226
+#if ENABLED(PSU_CONTROL)                          // MKSPWC
227
+  #ifndef PS_ON_PIN
228
+    #define PS_ON_PIN                   MT_DET_2  // Z+
229
+  #endif
230
+  #ifndef KILL_PIN
231
+    #define KILL_PIN                    MT_DET_1  // Y+
232
+    #define KILL_PIN_STATE                  HIGH
233
+  #endif
234
+#else
235
+  #define PW_DET                        MT_DET_1
236
+  #define PW_OFF                        MT_DET_2
237
+  #define POWER_LOSS_PIN                  PW_DET
238
+  #define PS_ON_PIN                       PW_OFF
239
+#endif
227 240
 
228 241
 // Random Info
229 242
 #define USB_SERIAL                          -1    // USB Serial

+ 26
- 9
Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h View File

@@ -189,19 +189,36 @@
189 189
   #define FIL_RUNOUT2_PIN           MT_DET_2_PIN
190 190
 #endif
191 191
 
192
-#ifndef POWER_LOSS_PIN
193
-  #define POWER_LOSS_PIN                    PA13  // PW_DET
194
-#endif
195
-#define PS_ON_PIN                           PB2   // PW_OFF
196
-
197 192
 //
198 193
 // Enable MKSPWC support
199 194
 //
200 195
 //#define SUICIDE_PIN                       PB2
196
+//#define LED_PIN                           PB2
201 197
 //#define KILL_PIN                          PA2
202
-//#define KILL_PIN_INVERTING                true
198
+//#define KILL_PIN_STATE                    HIGH
203 199
 
204
-//#define LED_PIN                           PB2
200
+//
201
+// Power Supply Control
202
+//
203
+#if ENABLED(PSU_CONTROL)                          // MKSPWC
204
+  #if HAS_TFT_LVGL_UI
205
+    #error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
206
+  #endif
207
+  #ifndef PS_ON_PIN
208
+    #define PS_ON_PIN                       PB2   // SUICIDE
209
+  #endif
210
+  #ifndef KILL_PIN
211
+    #define KILL_PIN                        PA13  // PW_DET
212
+    #define KILL_PIN_STATE                  HIGH
213
+  #endif
214
+#else
215
+  #define SUICIDE_PIN                       PB2
216
+  #define SUICIDE_PIN_INVERTING            false
217
+#endif
218
+
219
+#ifndef POWER_LOSS_PIN
220
+  #define POWER_LOSS_PIN                    PA13  // PW_DET
221
+#endif
205 222
 
206 223
 // Random Info
207 224
 #define USB_SERIAL              -1  // USB Serial
@@ -222,8 +239,8 @@
222 239
 
223 240
 // MKS TEST
224 241
 #if ENABLED(MKS_TEST)
225
-  #define MKS_TEST_POWER_LOSS_PIN           PA13   // PW_DET
226
-  #define MKS_TEST_PS_ON_PIN                PB2    // PW_OFF
242
+  #define MKS_TEST_POWER_LOSS_PIN           PA13  // PW_DET
243
+  #define MKS_TEST_PS_ON_PIN                PB2   // PW_OFF
227 244
 #endif
228 245
 
229 246
 //

+ 12
- 5
Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h View File

@@ -195,12 +195,19 @@
195 195
 //
196 196
 // Misc. Functions
197 197
 //
198
-//#define POWER_LOSS_PIN                    PA2   // PW_DET
199 198
 //#define PS_ON_PIN                         PA3   // PW_OFF
200
-//#define SUICIDE_PIN                       PB2   // Enable MKSPWC support
201
-//#define KILL_PIN                          PA2   // Enable MKSPWC support
202
-//#define KILL_PIN_INVERTING                true  // Enable MKSPWC support
203
-//#define LED_PIN                           PB2
199
+
200
+//
201
+// Power Supply Control
202
+//
203
+#if ENABLED(PSU_CONTROL)                          // MKSPWC
204
+  //#define SUICIDE_PIN                     PB2   // LED
205
+  //#define KILL_PIN                        PA2   // PW_DET
206
+  //#define KILL_PIN_STATE                  HIGH
207
+#else
208
+  //#define POWER_LOSS_PIN                  PA2   // PW_DET
209
+  //#define LED_PIN                         PB2
210
+#endif
204 211
 
205 212
 #ifndef SDCARD_CONNECTION
206 213
   #define SDCARD_CONNECTION ONBOARD

Loading…
Cancel
Save