Add DGUS_LCD_UI_RELOADED (#21931)

This commit is contained in:
mrv96
2021-09-07 02:51:04 +02:00
committed by Scott Lahteine
parent f434915ad6
commit 9d73fcb959
31 changed files with 4966 additions and 8 deletions

View File

@ -0,0 +1,173 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
constexpr uint8_t DGUS_LINE_LEN = 32;
constexpr uint8_t DGUS_STATUS_LEN = 32;
constexpr uint8_t DGUS_FILE_COUNT = 5;
constexpr uint8_t DGUS_FILENAME_LEN = 32;
constexpr uint8_t DGUS_ELLAPSED_LEN = 15;
constexpr uint8_t DGUS_LEVEL_GRID_SIZE = 25;
constexpr uint8_t DGUS_MACHINE_LEN = 24;
constexpr uint8_t DGUS_BUILDVOLUME_LEN = 24;
constexpr uint8_t DGUS_VERSION_LEN = 16;
constexpr uint8_t DGUS_PRINTTIME_LEN = 24;
constexpr uint8_t DGUS_LONGESTPRINT_LEN = 24;
constexpr uint8_t DGUS_FILAMENTUSED_LEN = 24;
constexpr uint8_t DGUS_GCODE_LEN = 32;
enum class DGUS_Addr : uint16_t {
MESSAGE_Line1 = 0x1100, // 0x1100 - 0x111F
MESSAGE_Line2 = 0x1120, // 0x1120 - 0x113F
MESSAGE_Line3 = 0x1140, // 0x1140 - 0x115F
MESSAGE_Line4 = 0x1160, // 0x1160 - 0x117F
// READ-ONLY VARIABLES
SCREENCHANGE = 0x2000, // Screen change request. Data contains target screen in low byte.
SCREENCHANGE_SD = 0x2001, // Only change if SD card present.
SCREENCHANGE_Idle = 0x2002, // Only change if not printing.
SCREENCHANGE_Printing = 0x2003, // Only change if printing.
SD_SelectFile = 0x2004, // Data: file index (0-4)
SD_Scroll = 0x2005, // Data: DGUS_Data::Scroll
SD_Print = 0x2006,
STATUS_Abort = 0x2007, // Popup / Data: DGUS_Data::Popup
STATUS_Pause = 0x2008, // Popup / Data: DGUS_Data::Popup
STATUS_Resume = 0x2009, // Popup / Data: DGUS_Data::Popup
ADJUST_SetFeedrate = 0x200A, // Type: Integer (16 bits signed)
ADJUST_SetFlowrate_CUR = 0x200B, // Type: Integer (16 bits signed)
#if EXTRUDERS > 1
ADJUST_SetFlowrate_E0 = 0x200C, // Type: Integer (16 bits signed)
ADJUST_SetFlowrate_E1 = 0x200D, // Type: Integer (16 bits signed)
#endif
ADJUST_SetBabystep = 0x200E, // Type: Fixed point, 2 decimals (16 bits signed)
ADJUST_Babystep = 0x200F, // Data: DGUS_Data::Adjust
TEMP_Preset = 0x2010, // Popup / Data: DGUS_Data::TempPreset
TEMP_SetTarget_Bed = 0x2011, // Type: Integer (16 bits signed)
TEMP_SetTarget_H0 = 0x2012, // Type: Integer (16 bits signed)
#if HOTENDS > 1
TEMP_SetTarget_H1 = 0x2013, // Type: Integer (16 bits signed)
#endif
TEMP_Cool = 0x2014, // Data: DGUS_Data::Heater
STEPPER_Control = 0x2015, // Popup / Data: DGUS_Data::Control
LEVEL_OFFSET_Set = 0x2016, // Type: Fixed point, 2 decimals (16 bits signed)
LEVEL_OFFSET_Step = 0x2017, // Data: DGUS_Data::Adjust
LEVEL_OFFSET_SetStep = 0x2018, // Data: DGUS_Data::StepSize
LEVEL_MANUAL_Point = 0x2019, // Data: point index (1-5)
LEVEL_AUTO_Probe = 0x201A,
LEVEL_AUTO_Disable = 0x201B,
FILAMENT_Select = 0x201C, // Data: DGUS_Data::Extruder
FILAMENT_SetLength = 0x201D, // Type: Integer (16 bits unsigned)
FILAMENT_Move = 0x201E, // Data: DGUS_Data::FilamentMove
MOVE_Home = 0x201F, // Data: DGUS_Data::Axis
MOVE_SetX = 0x2020, // Type: Fixed point, 1 decimal (16 bits signed)
MOVE_SetY = 0x2021, // Type: Fixed point, 1 decimal (16 bits signed)
MOVE_SetZ = 0x2022, // Type: Fixed point, 1 decimal (16 bits signed)
MOVE_Step = 0x2023, // Data: DGUS_Data::MoveDirection
MOVE_SetStep = 0x2024, // Data: DGUS_Data::StepSize
GCODE_Clear = 0x2025,
GCODE_Execute = 0x2026,
EEPROM_Reset = 0x2027, // Popup / Data: DGUS_Data::Popup
SETTINGS2_Extra = 0x2028, // Data: DGUS_Data::Extra
PID_Select = 0x2029, // Data: DGUS_Data::Heater
PID_SetTemp = 0x202A, // Type: Integer (16 bits unsigned)
PID_Run = 0x202B,
POWERLOSS_Abort = 0x202C, // Popup / Data: DGUS_Data::Popup
POWERLOSS_Resume = 0x202D, // Popup / Data: DGUS_Data::Popup
WAIT_Abort = 0x202E, // Popup / Data: DGUS_Data::Popup
WAIT_Continue = 0x202F,
// WRITE-ONLY VARIABLES
MESSAGE_Status = 0x3000, // 0x3000 - 0x301F
SD_Type = 0x3020, // 0x3020 - 0x3024 / Data: DGUS_Data::SDType
SD_FileName0 = 0x3025, // 0x3025 - 0x3044
SD_FileName1 = 0x3045, // 0x3045 - 0x3064
SD_FileName2 = 0x3065, // 0x3065 - 0x3084
SD_FileName3 = 0x3085, // 0x3085 - 0x30A4
SD_FileName4 = 0x30A5, // 0x30A5 - 0x30C4
SD_ScrollIcons = 0x30C5, // Bits: DGUS_Data::ScrollIcon
SD_SelectedFileName = 0x30C6, // 0x30C6 - 0x30E5
STATUS_PositionZ = 0x30E6, // Type: Fixed point, 1 decimal (16 bits signed)
STATUS_Ellapsed = 0x30E7, // 0x30E7 - 0x30F5
STATUS_Percent = 0x30F6, // Type: Integer (16 bits unsigned)
STATUS_Icons = 0x30F7, // Bits: DGUS_Data::StatusIcon
ADJUST_Feedrate = 0x30F8, // Type: Integer (16 bits signed)
ADJUST_Flowrate_CUR = 0x30F9, // Type: Integer (16 bits signed)
#if EXTRUDERS > 1
ADJUST_Flowrate_E0 = 0x30FA, // Type: Integer (16 bits signed)
ADJUST_Flowrate_E1 = 0x30FB, // Type: Integer (16 bits signed)
#endif
TEMP_Current_Bed = 0x30FC, // Type: Integer (16 bits signed)
TEMP_Target_Bed = 0x30FD, // Type: Integer (16 bits signed)
TEMP_Max_Bed = 0x30FE, // Type: Integer (16 bits unsigned)
TEMP_Current_H0 = 0x30FF, // Type: Integer (16 bits signed)
TEMP_Target_H0 = 0x3100, // Type: Integer (16 bits signed)
TEMP_Max_H0 = 0x3101, // Type: Integer (16 bits unsigned)
#if HOTENDS > 1
TEMP_Current_H1 = 0x3102, // Type: Integer (16 bits signed)
TEMP_Target_H1 = 0x3103, // Type: Integer (16 bits signed)
TEMP_Max_H1 = 0x3104, // Type: Integer (16 bits unsigned)
#endif
STEPPER_Status = 0x3105, // Data: DGUS_Data::Status
LEVEL_OFFSET_Current = 0x3106, // Type: Fixed point, 2 decimals (16 bits signed)
LEVEL_OFFSET_StepIcons = 0x3107, // Bits: DGUS_Data::StepIcon
LEVEL_AUTO_DisableIcon = 0x3108, // Data: DGUS_Data::Status
LEVEL_AUTO_Grid = 0x3109, // 0x3109 - 0x3121 / Type: Fixed point, 3 decimals (16 bits signed)
LEVEL_PROBING_Icons1 = 0x3122, // Type: Integer (16 bits unsigned) / Each bit represents a grid point
LEVEL_PROBING_Icons2 = 0x3123, // Type: Integer (16 bits unsigned) / Each bit represents a grid point
FILAMENT_ExtruderIcons = 0x3124, // Data: DGUS_Data::ExtruderIcon
FILAMENT_Length = 0x3125, // Type: Integer (16 bits unsigned)
MOVE_CurrentX = 0x3126, // Type: Fixed point, 1 decimal (16 bits signed)
MOVE_CurrentY = 0x3127, // Type: Fixed point, 1 decimal (16 bits signed)
MOVE_CurrentZ = 0x3128, // Type: Fixed point, 1 decimal (16 bits signed)
MOVE_StepIcons = 0x3129, // Bits: DGUS_Data::StepIcon
SETTINGS2_BLTouch = 0x312A, // Data: DGUS_Data::Status
PID_HeaterIcons = 0x312B, // Data: DGUS_Data::HeaterIcon
PID_Temp = 0x312C, // Type: Integer (16 bits unsigned)
PID_Kp = 0x312D, // Type: Fixed point, 2 decimals (32 bits signed)
PID_Ki = 0x312F, // Type: Fixed point, 2 decimals (32 bits signed)
PID_Kd = 0x3131, // Type: Fixed point, 2 decimals (32 bits signed)
INFOS_Machine = 0x3133, // 0x3133 - 0x314A
INFOS_BuildVolume = 0x314B, // 0x314B - 0x3162
INFOS_Version = 0x3163, // 0x3163 - 0x3172
INFOS_TotalPrints = 0x3173, // Type: Integer (16 bits unsigned)
INFOS_FinishedPrints = 0x3174, // Type: Integer (16 bits unsigned)
INFOS_PrintTime = 0x3175, // 0x3175 - 0x318C
INFOS_LongestPrint = 0x318D, // 0x318D - 0x31A4
INFOS_FilamentUsed = 0x31A5, // 0x31A5 - 0x31BC
WAIT_Icons = 0x31BD, // Bits: DGUS_Data::WaitIcon
// READ-WRITE VARIABLES
FAN0_Speed = 0x4000, // Type: Integer (16 bits unsigned) / Data: fan speed as percent (0-100)
GCODE_Data = 0x4001, // 0x4001 - 0x4020
PID_Cycles = 0x4021, // Type: Integer (16 bits unsigned)
VOLUME_Level = 0x4022, // Type: Integer (16 bits unsigned) / Data: volume as percent (0-100)
BRIGHTNESS_Level = 0x4023, // Type: Integer (16 bits unsigned) / Data: brightness as percent (0-100)
// SPECIAL CASES
STATUS_Percent_Complete = 0x5000, // Same as STATUS_Percent, but always 100%
INFOS_Debug = 0x5001,
};

View File

@ -0,0 +1,96 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "../../../../inc/MarlinConfigPre.h"
#include "DGUS_Addr.h"
static_assert((DGUS_LEVEL_GRID_SIZE == GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y), "DGUS_LEVEL_GRID_SIZE incompatible with current mesh.");
#ifndef DGUS_DEFAULT_VOLUME
#define DGUS_DEFAULT_VOLUME 50
#endif
#ifndef DGUS_DEFAULT_BRIGHTNESS
#define DGUS_DEFAULT_BRIGHTNESS 100
#endif
#ifndef DGUS_STATUS_EXPIRATION_MS
#define DGUS_STATUS_EXPIRATION_MS 30000
#endif
#ifndef DGUS_PRINT_BABYSTEP
#define DGUS_PRINT_BABYSTEP 0.01f
#endif
#ifndef DGUS_PLA_TEMP_HOTEND
#define DGUS_PLA_TEMP_HOTEND 200
#endif
#ifndef DGUS_PLA_TEMP_BED
#define DGUS_PLA_TEMP_BED 60
#endif
#ifndef DGUS_ABS_TEMP_HOTEND
#define DGUS_ABS_TEMP_HOTEND 240
#endif
#ifndef DGUS_ABS_TEMP_BED
#define DGUS_ABS_TEMP_BED 80
#endif
#ifndef DGUS_PETG_TEMP_HOTEND
#define DGUS_PETG_TEMP_HOTEND 240
#endif
#ifndef DGUS_PETG_TEMP_BED
#define DGUS_PETG_TEMP_BED 60
#endif
#ifndef DGUS_DEFAULT_FILAMENT_LEN
#define DGUS_DEFAULT_FILAMENT_LEN 10
#endif
#ifndef LEVEL_CORNERS_Z_HOP
#define LEVEL_CORNERS_Z_HOP 4.0
#endif
#ifndef LEVEL_CORNERS_HEIGHT
#define LEVEL_CORNERS_HEIGHT 0.0
#endif
static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration.");
#ifndef DGUS_LEVEL_CENTER_X
#define DGUS_LEVEL_CENTER_X ((X_BED_SIZE) / 2)
#endif
#ifndef DGUS_LEVEL_CENTER_Y
#define DGUS_LEVEL_CENTER_Y ((Y_BED_SIZE) / 2)
#endif
#if ENABLED(BLTOUCH)
#ifndef DGUS_RESET_BLTOUCH
#define DGUS_RESET_BLTOUCH "M999\nM280P0S160"
#endif
#endif

View File

@ -0,0 +1,50 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
enum class DGUS_Control : uint8_t {
// PRINT
FILE0 = 1, // RETURN_KEY_CODE
FILE1 = 2, // RETURN_KEY_CODE
FILE2 = 3, // RETURN_KEY_CODE
FILE3 = 4, // RETURN_KEY_CODE
FILE4 = 5, // RETURN_KEY_CODE
GO_BACK = 6, // RETURN_KEY_CODE
SCROLL_UP = 7, // RETURN_KEY_CODE
SCROLL_DOWN = 8, // RETURN_KEY_CODE
// PRINT_STATUS
PAUSE = 1, // POPUP_WINDOW
RESUME = 2, // POPUP_WINDOW
// LEVELING_AUTOMATIC
DISABLE = 5, // RETURN_KEY_CODE
// SETTINGS_MENU2
EXTRA2 = 6, // RETURN_KEY_CODE
// WAIT
ABORT = 1, // POPUP_WINDOW
CONTINUE = 2 // RETURN_KEY_CODE
};

View File

@ -0,0 +1,148 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include <inttypes.h>
namespace DGUS_Data {
// RX constants
enum class Scroll : uint8_t {
GO_BACK = 0,
UP = 1,
DOWN = 2
};
enum class Popup : uint8_t {
CONFIRMED = 1
};
enum class Adjust : uint8_t {
INCREMENT = 0,
DECREMENT = 1
};
enum class TempPreset : uint8_t {
PLA = 1,
ABS = 2,
PETG = 3
};
enum class Extruder : int8_t {
CURRENT = -1,
E0 = 0,
E1 = 1
};
enum class Heater : int8_t {
ALL = -2,
BED = -1,
H0 = 0,
H1 = 1
};
enum class Control : uint8_t {
ENABLE = 1,
DISABLE = 2
};
enum class StepSize : uint8_t {
MM10 = 0, // 10mm
MM1 = 1, // 1mm
MMP1 = 2, // 0.1mm
MMP01 = 3 // 0.01mm
};
enum class FilamentMove : uint8_t {
RETRACT = 0,
EXTRUDE = 1
};
enum class Axis : uint8_t {
X_Y_Z = 0,
X_Y = 1,
Z = 2
};
enum class MoveDirection : uint8_t {
XP = 0, // X+
XM = 1, // X-
YP = 2, // Y+
YM = 3, // Y-
ZP = 4, // Z+
ZM = 5 // Z-
};
enum class Extra : uint8_t {
BUTTON1 = 0,
BUTTON2 = 1
};
// TX constants
enum class SDType : uint16_t {
NONE = 0,
FILE = 1,
DIRECTORY = 2
};
enum class ScrollIcon : uint16_t {
GO_BACK = 1U << 0,
UP = 1U << 1,
DOWN = 1U << 2
};
enum class StatusIcon : uint16_t {
PAUSE = 1U << 0,
RESUME = 1U << 1
};
enum class Status : uint16_t {
DISABLED = 0,
ENABLED = 1
};
enum class StepIcon : uint16_t {
MM10 = 1U << 0, // 10mm
MM1 = 1U << 1, // 1mm
MMP1 = 1U << 2, // 0.1mm
MMP01 = 1U << 3 // 0.01mm
};
enum class ExtruderIcon : uint16_t {
E0 = 1U << 0,
E1 = 1U << 1
};
enum class HeaterIcon : uint16_t {
BED = 1U << 0,
H0 = 1U << 1,
H1 = 1U << 2
};
enum class WaitIcon : uint16_t {
ABORT = 1U << 0,
CONTINUE = 1U << 1
};
};

View File

@ -0,0 +1,52 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
enum class DGUS_Screen : uint8_t {
BOOT = 0,
HOME = 1,
PRINT = 2,
PRINT_STATUS = 3,
PRINT_ADJUST = 4,
PRINT_FINISHED = 5,
TEMP_MENU = 6,
TEMP_MANUAL = 7,
FAN = 8,
SETTINGS_MENU = 9,
LEVELING_MENU = 10,
LEVELING_OFFSET = 11,
LEVELING_MANUAL = 12,
LEVELING_AUTOMATIC = 13,
LEVELING_PROBING = 14,
FILAMENT = 15,
MOVE = 16,
GCODE = 17,
SETTINGS_MENU2 = 18,
PID = 19,
VOLUME = 20,
BRIGHTNESS = 21,
INFOS = 22,
DEBUG = 240,
POWERLOSS = 248,
WAIT = 249,
KILL = 250
};