Support FYSETC_MINI_12864_PANEL (#13365)

This commit is contained in:
Scott Lahteine
2019-04-09 18:34:29 -05:00
committed by GitHub
parent 4900c28bf6
commit 5018fdacbe
104 changed files with 731 additions and 64 deletions

View File

@ -1893,6 +1893,12 @@
//
//#define MKS_MINI_12864
//
// FYSETC variant of the MINI12864 graphic controller with SD support
// https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
//
//#define FYSETC_MINI_12864
//
// Factory display for Creality CR-10
// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html

View File

@ -120,19 +120,28 @@ typedef struct LEDColor {
#else
#define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W)
#endif
#define LEDColorWhite() LEDColor(0, 0, 0, 255)
#else
#define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B)
#define LEDColorWhite() LEDColor(255, 255, 255)
#define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B)
#endif
#define LEDColorOff() LEDColor( 0, 0, 0)
#define LEDColorRed() LEDColor(255, 0, 0)
#if ENABLED(LED_COLORS_REDUCE_GREEN)
#define LEDColorOrange() LEDColor(255, 25, 0)
#define LEDColorYellow() LEDColor(255, 75, 0)
#else
#define LEDColorOrange() LEDColor(255, 80, 0)
#define LEDColorYellow() LEDColor(255, 255, 0)
#endif
#define LEDColorGreen() LEDColor( 0, 255, 0)
#define LEDColorBlue() LEDColor( 0, 0, 255)
#define LEDColorIndigo() LEDColor( 0, 255, 255)
#define LEDColorViolet() LEDColor(255, 0, 255)
#if HAS_WHITE_LED
#define LEDColorWhite() LEDColor( 0, 0, 0, 255)
#else
#define LEDColorWhite() LEDColor(255, 255, 255)
#endif
#define LEDColorOff() LEDColor( 0, 0, 0)
#define LEDColorRed() LEDColor(255, 0, 0)
#define LEDColorOrange() LEDColor(255, 80, 0)
#define LEDColorYellow() LEDColor(255, 255, 0)
#define LEDColorGreen() LEDColor( 0, 255, 0)
#define LEDColorBlue() LEDColor( 0, 0, 255)
#define LEDColorIndigo() LEDColor( 0, 255, 255)
#define LEDColorViolet() LEDColor(255, 0, 255)
class LEDLights {
public:

View File

@ -87,8 +87,8 @@
#define U8GLIB_LM6059_AF
#define SD_DETECT_INVERTED
#elif ENABLED(AZSMZ_12864)
#define LCD_CONTRAST_MIN 120
#define LCD_CONTRAST_MAX 255
#define LCD_CONTRAST_MIN 120
#define LCD_CONTRAST_MAX 255
#define DEFAULT_LCD_CONTRAST 190
#define U8GLIB_ST7565_64128N
#endif
@ -139,6 +139,13 @@
#define MINIPANEL
#elif ENABLED(FYSETC_MINI_12864)
#define DOGLCD
#define ULTIPANEL
#define DEFAULT_LCD_CONTRAST 255
#define LED_COLORS_REDUCE_GREEN
#endif
#if EITHER(MAKRPANEL, MINIPANEL)
@ -313,28 +320,19 @@
#define HAS_ADC_BUTTONS ENABLED(ADC_KEYPAD)
#if HAS_GRAPHICAL_LCD
/**
* Default LCD contrast for Graphical LCD displays
*/
#define HAS_LCD_CONTRAST ( \
ENABLED(MAKRPANEL) \
|| ENABLED(CARTESIO_UI) \
|| ENABLED(VIKI2) \
|| ENABLED(AZSMZ_12864) \
|| ENABLED(miniVIKI) \
|| ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
)
#if HAS_LCD_CONTRAST
#ifndef LCD_CONTRAST_MIN
#define LCD_CONTRAST_MIN 0
#endif
#ifndef LCD_CONTRAST_MAX
#define LCD_CONTRAST_MAX 63
#endif
#ifndef DEFAULT_LCD_CONTRAST
#define DEFAULT_LCD_CONTRAST 32
#endif
/**
* Default LCD contrast for Graphical LCD displays
*/
#define HAS_LCD_CONTRAST HAS_GRAPHICAL_LCD && defined(DEFAULT_LCD_CONTRAST)
#if HAS_LCD_CONTRAST
#ifndef LCD_CONTRAST_MIN
#define LCD_CONTRAST_MIN 0
#endif
#ifndef LCD_CONTRAST_MAX
#define LCD_CONTRAST_MAX 63
#endif
#ifndef DEFAULT_LCD_CONTRAST
#define DEFAULT_LCD_CONTRAST 32
#endif
#endif

View File

@ -1764,6 +1764,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
+ ENABLED(G3D_PANEL) \
+ (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \
+ ENABLED(MKS_MINI_12864) \
+ ENABLED(FYSETC_MINI_12864) \
+ (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI, ZONESTAR_LCD)) \
+ ENABLED(RIGIDBOT_PANEL) \
+ ENABLED(RA_CONTROL_PANEL) \

View File

@ -107,7 +107,7 @@
// Generic support for SSD1309 OLED I2C LCDs
#define U8G_CLASS U8GLIB_SSD1309_128X64
#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST)
#elif ENABLED(MINIPANEL)
#elif EITHER(MINIPANEL, FYSETC_MINI_12864)
// The MINIPanel display
//#define U8G_CLASS U8GLIB_MINI12864
//#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes

View File

@ -116,7 +116,6 @@
// the jumper next to the limit switch socket when using sensorless homing.
//
#if HAS_DRIVER(TMC2208)
// Software serial
#define X_SERIAL_RX_PIN 71
@ -168,18 +167,16 @@
#define PS_ON_PIN SERVO1_PIN
#endif
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 3
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN SERVO3_PIN
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 9
#endif
#ifndef RGB_LED_W_PIN
#define RGB_LED_W_PIN -1
#endif
/**
* ----- -----
* 5V/D41 | · · | GND 5V | · · | GND
* RESET | · · | D49 (SD_DETECT) (LCD_D7) D29 | · · | D27 (LCD_D6)
* (MOSI) D51 | · · | D33 (BTN_EN2) (LCD_D5) D25 | · · | D23 (LCD_D4)
* (SD_SS) D53 | · · | D31 (BTN_EN1) (LCD_RS) D16 | · · | D17 (LCD_EN)
* (SCK) D52 | · · | D50 (MISO) (BTN_ENC) D35 | · · | D37 (BEEPER)
* ----- -----
* EXP2 EXP1
*/
//
// LCDs and Controllers
@ -187,20 +184,67 @@
#define BEEPER_PIN 37
#define SD_DETECT_PIN 49
#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 23
#define LCD_PINS_D5 25
#define LCD_PINS_D6 27
#define LCD_PINS_D7 29
#if ENABLED(MKS_MINI_12864)
#define DOGLCD_A0 27
#define DOGLCD_CS 25
#endif
#if ENABLED(FYSETC_MINI_12864)
//
// See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
//
#define DOGLCD_A0 16
#define DOGLCD_CS 17
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 25
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN 27
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 29
#endif
#elif HAS_GRAPHICAL_LCD
#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 23
#define LCD_PINS_D5 25
#define LCD_PINS_D6 27
#define LCD_PINS_D7 29
#endif
#if ENABLED(NEWPANEL)
#define BTN_EN1 31
#define BTN_EN2 33
#define BTN_ENC 35
#endif
#if ENABLED(MKS_MINI_12864)
#define DOGLCD_A0 27
#define DOGLCD_CS 25
#if ENABLED(FYSETC_MINI_12864)
#define LCD_BACKLIGHT_PIN -1
#define LCD_RESET_PIN 23
#define KILL_PIN 41
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 25
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN 27
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 29
#endif
#endif
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 3
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN 4
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 9
#endif
#ifndef RGB_LED_W_PIN
#define RGB_LED_W_PIN -1
#endif

View File

@ -64,6 +64,16 @@
#define E1_MS1_PIN 57 // PF3 ** Pin94 ** A3
#define E1_MS2_PIN 4 // PG5 ** Pin1 ** PWM4
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 50
#endif
#ifndef RGB_LED_R_PIN
#define RGB_LED_G_PIN 51
#endif
#ifndef RGB_LED_R_PIN
#define RGB_LED_B_PIN 52
#endif
#include "pins_RAMPS.h"
/*

View File

@ -231,10 +231,12 @@
#define PS_ON_PIN 12
#endif
#define AUX2_PINS_FREE !( BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD) )
#if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN)
#if NUM_SERVOS <= 1 // try to use servo connector first
#define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM
#elif !(BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) // try to use AUX 2
#elif AUX2_PINS_FREE
#define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM
#endif
#endif
@ -247,13 +249,15 @@
#define SPINDLE_LASER_ENA_PIN 4 // Pin should have a pullup/pulldown!
#define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM
#define SPINDLE_DIR_PIN 5
#elif !(BOTH(ULTRA_LCD, NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) // try to use AUX 2
#elif AUX2_PINS_FREE
#define SPINDLE_LASER_ENA_PIN 40 // Pin should have a pullup/pulldown!
#define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM
#define SPINDLE_DIR_PIN 65
#endif
#endif
#undef AUX2_PINS_FREE
//
// TMC software SPI
//
@ -518,6 +522,31 @@
#define SD_DETECT_PIN 49
#define KILL_PIN 41
#elif ENABLED(FYSETC_MINI_12864) // Added in Marlin 1.1.9+
// From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
#define BEEPER_PIN 37
#define LCD_RESET_PIN 23
#define DOGLCD_A0 16
#define DOGLCD_CS 17
#define BTN_EN1 31
#define BTN_EN2 33
#define BTN_ENC 35
#define SD_DETECT_PIN 49
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 25
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN 27
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 29
#endif
#elif ENABLED(MINIPANEL)
#define BEEPER_PIN 42