📌 MKS pins for PSU_CONTROL (#22528)

2.0.x
mks-viva 3 years ago committed by Scott Lahteine
parent a4cd654e48
commit e0fa6ed4f8

@ -26,7 +26,7 @@
#include "../gcode.h" #include "../gcode.h"
#if ENABLED(TFT_LVGL_UI) #if HAS_TFT_LVGL_UI
#include "../../lcd/extui/mks_ui/draw_touch_calibration.h" #include "../../lcd/extui/mks_ui/draw_touch_calibration.h"
#else #else
#include "../../lcd/menu/menu.h" #include "../../lcd/menu/menu.h"
@ -37,7 +37,7 @@
*/ */
void GcodeSuite::M995() { void GcodeSuite::M995() {
#if ENABLED(TFT_LVGL_UI) #if HAS_TFT_LVGL_UI
lv_draw_touch_calibration_screen(); lv_draw_touch_calibration_screen();
#else #else
ui.goto_screen(touch_screen_calibration); ui.goto_screen(touch_screen_calibration);

@ -136,9 +136,17 @@
#endif #endif
// //
// Misc. Functions // Power Supply Control
// //
#define PS_ON_PIN P0_25 // TH3 Connector #if ENABLED(PSU_CONTROL) // MKSPWC
#ifndef PS_ON_PIN
#define PS_ON_PIN P0_25 // SERVO
#endif
#ifndef KILL_PIN
#define KILL_PIN P1_29 // Z+
#define KILL_PIN_STATE HIGH
#endif
#endif
// //
// Ethernet pins // Ethernet pins

@ -215,6 +215,19 @@
#define FAN_PIN P2_04 #define FAN_PIN P2_04
#endif #endif
//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#ifndef PS_ON_PIN
#define PS_ON_PIN P2_00 // SERVO
#endif
#ifndef KILL_PIN
#define KILL_PIN P1_24 // Z+
#define KILL_PIN_STATE HIGH
#endif
#endif
// //
// Misc. Functions // Misc. Functions
// //

@ -226,6 +226,19 @@
// //
#define LED_PIN P1_18 // Used as a status indicator #define LED_PIN P1_18 // Used as a status indicator
//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#ifndef PS_ON_PIN
#define PS_ON_PIN P2_00 // Suggestion (SERVO)
#endif
#ifndef KILL_PIN
#define KILL_PIN P1_24 // Suggestion (Z+)
#define KILL_PIN_STATE HIGH
#endif
#endif
// //
// RGB LED // RGB LED
// //

@ -147,7 +147,7 @@
#define TFT_RS_PIN FSMC_RS_PIN #define TFT_RS_PIN FSMC_RS_PIN
#endif #endif
#if ENABLED(TFT_LVGL_UI) #if HAS_TFT_LVGL_UI
// LVGL // LVGL
#define HAS_SPI_FLASH_FONT 1 #define HAS_SPI_FLASH_FONT 1
#define HAS_GCODE_PREVIEW 1 #define HAS_GCODE_PREVIEW 1

@ -195,9 +195,10 @@
// //
// Misc. Functions // Misc. Functions
// //
//#define POWER_LOSS_PIN PA1 // PW_SO
#if ENABLED(BACKUP_POWER_SUPPLY) #if ENABLED(BACKUP_POWER_SUPPLY)
#define POWER_LOSS_PIN PA2 // PW_DET (UPS) MKSPWC #define POWER_LOSS_PIN PA2 // PW_DET (UPS) MKSPWC
#else
//#define POWER_LOSS_PIN PA1 // PW_SO
#endif #endif
/** /**
@ -217,7 +218,7 @@
// //
#if ENABLED(PSU_CONTROL) #if ENABLED(PSU_CONTROL)
#define KILL_PIN PA2 // PW_DET #define KILL_PIN PA2 // PW_DET
#define KILL_PIN_INVERTING true #define KILL_PIN_STATE HIGH
//#define PS_ON_PIN PA3 // PW_CN /PW_OFF //#define PS_ON_PIN PA3 // PW_CN /PW_OFF
#endif #endif

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

@ -126,6 +126,19 @@
#define FIL_RUNOUT_PIN PB10 // MT_DET #define FIL_RUNOUT_PIN PB10 // MT_DET
//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#ifndef PS_ON_PIN
#define PS_ON_PIN PA14 // PW_OFF
#endif
#ifndef KILL_PIN
#define KILL_PIN PB10 // PW_DET
#define KILL_PIN_STATE HIGH
#endif
#endif
/** /**
* _____ _____ _____ * _____ _____ _____
* (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SD_SCK) 5V | 1 2 | GND * (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SD_SCK) 5V | 1 2 | GND

@ -127,18 +127,29 @@
//#define TEMP_0_CS_PIN PE5 // TC1 - CS1 //#define TEMP_0_CS_PIN PE5 // TC1 - CS1
//#define TEMP_0_CS_PIN PE6 // TC2 - CS2 //#define TEMP_0_CS_PIN PE6 // TC2 - CS2
//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#if HAS_TFT_LVGL_UI
#error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
#endif
#ifndef PS_ON_PIN
#define PS_ON_PIN PB2 // SUICIDE
#endif
#ifndef KILL_PIN
#define KILL_PIN PA2
#define KILL_PIN_STATE HIGH
#endif
#else
#define SUICIDE_PIN PB2
#define SUICIDE_PIN_INVERTING false
#endif
// //
// Misc. Functions // Misc. Functions
// //
#if HAS_TFT_LVGL_UI #if HAS_TFT_LVGL_UI
//#define MKSPWC
#ifdef MKSPWC
#define SUICIDE_PIN PB2 // Enable MKSPWC SUICIDE PIN
#define SUICIDE_PIN_INVERTING false // Enable MKSPWC PIN STATE
#define KILL_PIN PA2 // Enable MKSPWC DET PIN
#define KILL_PIN_STATE true // Enable MKSPWC PIN STATE
#endif
#define MT_DET_1_PIN PA4 // LVGL UI FILAMENT RUNOUT1 PIN #define MT_DET_1_PIN PA4 // LVGL UI FILAMENT RUNOUT1 PIN
#define MT_DET_2_PIN PE6 // LVGL UI FILAMENT RUNOUT2 PIN #define MT_DET_2_PIN PE6 // LVGL UI FILAMENT RUNOUT2 PIN
#define MT_DET_PIN_INVERTING false // LVGL UI filament RUNOUT PIN STATE #define MT_DET_PIN_INVERTING false // LVGL UI filament RUNOUT PIN STATE

@ -191,17 +191,29 @@
//#define TEMP_0_CS_PIN PE5 // TC1 - CS1 //#define TEMP_0_CS_PIN PE5 // TC1 - CS1
//#define TEMP_0_CS_PIN PE6 // TC2 - CS2 //#define TEMP_0_CS_PIN PE6 // TC2 - CS2
//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#if HAS_TFT_LVGL_UI
#error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
#endif
#ifndef PS_ON_PIN
#define PS_ON_PIN PB2 // SUICIDE
#endif
#ifndef KILL_PIN
#define KILL_PIN PA2
#define KILL_PIN_STATE HIGH
#endif
#else
#define SUICIDE_PIN PB2
#define SUICIDE_PIN_INVERTING false
#endif
// //
// Misc. Functions // Misc. Functions
// //
#if HAS_TFT_LVGL_UI #if HAS_TFT_LVGL_UI
//#define MKSPWC
#ifdef MKSPWC
#define SUICIDE_PIN PB2 // Enable MKSPWC SUICIDE PIN
#define SUICIDE_PIN_INVERTING false // Enable MKSPWC PIN STATE
#define KILL_PIN PA2 // Enable MKSPWC DET PIN
#define KILL_PIN_STATE true // Enable MKSPWC PIN STATE
#endif
#define MT_DET_1_PIN PA4 // LVGL UI FILAMENT RUNOUT1 PIN #define MT_DET_1_PIN PA4 // LVGL UI FILAMENT RUNOUT1 PIN
#define MT_DET_2_PIN PE6 // LVGL UI FILAMENT RUNOUT2 PIN #define MT_DET_2_PIN PE6 // LVGL UI FILAMENT RUNOUT2 PIN

@ -179,10 +179,28 @@
//#define TEMP_0_CS_PIN PF11 // TC2 - CS2 //#define TEMP_0_CS_PIN PF11 // TC2 - CS2
#define POWER_LOSS_PIN PA2 // PW_DET #define POWER_LOSS_PIN PA2 // PW_DET
#define PS_ON_PIN PG11 // PW_OFF
#define FIL_RUNOUT_PIN PA4 // MT_DET1 #define FIL_RUNOUT_PIN PA4 // MT_DET1
//#define FIL_RUNOUT_PIN PE6 // MT_DET2 #define FIL_RUNOUT2_PIN PE6 // MT_DET2
//#define FIL_RUNOUT_PIN PG14 // MT_DET3 #define FIL_RUNOUT3_PIN PG14 // MT_DET3
//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#if HAS_TFT_LVGL_UI
#error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
#endif
#ifndef PS_ON_PIN
#define PS_ON_PIN PG11 // SUICIDE
#endif
#ifndef KILL_PIN
#define KILL_PIN PA2
#define KILL_PIN_STATE HIGH
#endif
#else
#define SUICIDE_PIN PG11
#define SUICIDE_PIN_INVERTING false
#endif
// //
// SD Card // SD Card

@ -210,10 +210,8 @@
// //
// Misc. Functions // Misc. Functions
// //
#define MT_DET_1 Y_MAX_PIN #define MT_DET_1 PC5 // Y+
#define MT_DET_2 Z_MAX_PIN #define MT_DET_2 PB12 // Z+
#define PW_DET Y_MAX_PIN
#define PW_OFF Z_MAX_PIN
#ifndef FIL_RUNOUT_PIN #ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN MT_DET_1 #define FIL_RUNOUT_PIN MT_DET_1
@ -222,8 +220,23 @@
#define FIL_RUNOUT2_PIN MT_DET_2 #define FIL_RUNOUT2_PIN MT_DET_2
#endif #endif
//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#ifndef PS_ON_PIN
#define PS_ON_PIN MT_DET_2 // Z+
#endif
#ifndef KILL_PIN
#define KILL_PIN MT_DET_1 // Y+
#define KILL_PIN_STATE HIGH
#endif
#else
#define PW_DET MT_DET_1
#define PW_OFF MT_DET_2
#define POWER_LOSS_PIN PW_DET #define POWER_LOSS_PIN PW_DET
#define PS_ON_PIN PW_OFF #define PS_ON_PIN PW_OFF
#endif
// Random Info // Random Info
#define USB_SERIAL -1 // USB Serial #define USB_SERIAL -1 // USB Serial

@ -189,19 +189,36 @@
#define FIL_RUNOUT2_PIN MT_DET_2_PIN #define FIL_RUNOUT2_PIN MT_DET_2_PIN
#endif #endif
#ifndef POWER_LOSS_PIN
#define POWER_LOSS_PIN PA13 // PW_DET
#endif
#define PS_ON_PIN PB2 // PW_OFF
// //
// Enable MKSPWC support // Enable MKSPWC support
// //
//#define SUICIDE_PIN PB2 //#define SUICIDE_PIN PB2
//#define KILL_PIN PA2
//#define KILL_PIN_INVERTING true
//#define LED_PIN PB2 //#define LED_PIN PB2
//#define KILL_PIN PA2
//#define KILL_PIN_STATE HIGH
//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#if HAS_TFT_LVGL_UI
#error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
#endif
#ifndef PS_ON_PIN
#define PS_ON_PIN PB2 // SUICIDE
#endif
#ifndef KILL_PIN
#define KILL_PIN PA13 // PW_DET
#define KILL_PIN_STATE HIGH
#endif
#else
#define SUICIDE_PIN PB2
#define SUICIDE_PIN_INVERTING false
#endif
#ifndef POWER_LOSS_PIN
#define POWER_LOSS_PIN PA13 // PW_DET
#endif
// Random Info // Random Info
#define USB_SERIAL -1 // USB Serial #define USB_SERIAL -1 // USB Serial

@ -195,12 +195,19 @@
// //
// Misc. Functions // Misc. Functions
// //
//#define POWER_LOSS_PIN PA2 // PW_DET
//#define PS_ON_PIN PA3 // PW_OFF //#define PS_ON_PIN PA3 // PW_OFF
//#define SUICIDE_PIN PB2 // Enable MKSPWC support
//#define KILL_PIN PA2 // Enable MKSPWC support //
//#define KILL_PIN_INVERTING true // Enable MKSPWC support // Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
//#define SUICIDE_PIN PB2 // LED
//#define KILL_PIN PA2 // PW_DET
//#define KILL_PIN_STATE HIGH
#else
//#define POWER_LOSS_PIN PA2 // PW_DET
//#define LED_PIN PB2 //#define LED_PIN PB2
#endif
#ifndef SDCARD_CONNECTION #ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION ONBOARD #define SDCARD_CONNECTION ONBOARD

Loading…
Cancel
Save