From eeb4611606625a7330b2d2adbf0fc51ae70af2a9 Mon Sep 17 00:00:00 2001 From: Jeffrey Li Date: Mon, 16 Oct 2017 00:33:07 -0700 Subject: [PATCH] Add proper support for the AZSMZ 12864 LCD on a SMART RAMPS --- Marlin/Configuration.h | 6 ++++++ Marlin/src/inc/Conditionals_LCD.h | 9 ++++++++- Marlin/src/inc/Conditionals_post.h | 4 ++-- Marlin/src/inc/SanityCheck.h | 5 +++++ Marlin/src/pins/pins_RAMPS_SMART.h | 20 ++------------------ 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b29e693a0..51d3cdcfb 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1552,6 +1552,12 @@ // //#define MKS_12864OLED +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// +//#define AZSMZ_12864 + //============================================================================= //=============================== Extra Features ============================== //============================================================================= diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index ab7a47b4a..099b80e60 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -64,7 +64,7 @@ #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER #define LONG_FILENAME_HOST_SUPPORT - #elif ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) + #elif ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) || ENABLED(AZSMZ_12864) #define ULTRA_LCD //general LCD support, also 16x2 #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) @@ -86,6 +86,11 @@ #define DEFAULT_LCD_CONTRAST 110 #define U8GLIB_LM6059_AF #define SD_DETECT_INVERTED + #elif ENABLED(AZSMZ_12864) + #define LCD_CONTRAST_MIN 120 + #define LCD_CONTRAST_MAX 255 + #define DEFAULT_LCD_CONTRAST 190 + #define U8GLIB_ST7565_64128N #endif #elif ENABLED(OLED_PANEL_TINYBOY2) @@ -224,6 +229,7 @@ #elif ENABLED(miniVIKI) || ENABLED(VIKI2) \ || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ + || ENABLED(AZSMZ_12864) \ || ENABLED(OLED_PANEL_TINYBOY2) \ || ENABLED(BQ_LCD_SMART_CONTROLLER) \ || ENABLED(LCD_I2C_PANELOLU2) \ @@ -327,6 +333,7 @@ ENABLED(MAKRPANEL) \ || ENABLED(CARTESIO_UI) \ || ENABLED(VIKI2) \ + || ENABLED(AZSMZ_12864) \ || ENABLED(miniVIKI) \ || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ ) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index ae4ddb7a6..a5d7c575a 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -869,9 +869,9 @@ #endif /** - * VIKI2 and miniVIKI require DOGLCD_SCK and DOGLCD_MOSI to be defined. + * VIKI2, miniVIKI, and AZSMZ_12864 require DOGLCD_SCK and DOGLCD_MOSI to be defined. */ - #if ENABLED(VIKI2) || ENABLED(miniVIKI) + #if ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(AZSMZ_12864) #ifndef DOGLCD_SCK #define DOGLCD_SCK SCK_PIN #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index d53955706..c4a0755c7 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1155,6 +1155,7 @@ static_assert(1 >= 0 * miniVIKI => ULTIMAKERCONTROLLER * VIKI2 => ULTIMAKERCONTROLLER * ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER + * AZSMZ_12864 => ULTIMAKERCONTROLLER * PANEL_ONE => ULTIMAKERCONTROLLER */ static_assert(1 >= 0 @@ -1163,6 +1164,7 @@ static_assert(1 >= 0 && DISABLED(miniVIKI) \ && DISABLED(VIKI2) \ && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ + && DISABLED(AZSMZ_12864) \ && DISABLED(PANEL_ONE) \ && DISABLED(MKS_12864OLED) + 1 @@ -1208,6 +1210,9 @@ static_assert(1 >= 0 #if ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) + 1 #endif + #if ENABLED(AZSMZ_12864) + + 1 + #endif #if ENABLED(G3D_PANEL) + 1 #endif diff --git a/Marlin/src/pins/pins_RAMPS_SMART.h b/Marlin/src/pins/pins_RAMPS_SMART.h index e7abd24ae..8f1b3ebaf 100644 --- a/Marlin/src/pins/pins_RAMPS_SMART.h +++ b/Marlin/src/pins/pins_RAMPS_SMART.h @@ -84,30 +84,14 @@ // // LCD / Controller // -// Support for AZSMZ 12864 LCD with SD Card 3D printer smart controller control panel (not tested) -#if ENABLED(VIKI2) - #undef BEEPER_PIN +// Support for AZSMZ 12864 LCD with SD Card 3D printer smart controller control panel +#if ENABLED(AZSMZ_12864) #define BEEPER_PIN 66 - - // Pins for DOGM SPI LCD Support - #undef DOGLCD_A0 #define DOGLCD_A0 59 - - #undef DOGLCD_A0 #define DOGLCD_CS 44 - - #undef BTN_EN1 #define BTN_EN1 58 - - #undef BTN_EN2 #define BTN_EN2 40 - - #undef BTN_ENC #define BTN_ENC 67 - - #undef SD_DETECT_PIN #define SD_DETECT_PIN 49 // Pin 49 for display sd interface, 72 for easy adapter board - - #undef KILL_PIN #define KILL_PIN 42 #endif