Fix and improve FYSETC LCD support (#13767)

This commit is contained in:
Bob Kuhn
2019-04-21 20:48:53 -05:00
committed by Scott Lahteine
parent 4e35e6c705
commit 81ca5a4cd4
15 changed files with 369 additions and 142 deletions

View File

@ -202,26 +202,45 @@
#define SD_DETECT_PIN P1_31 // (49) (NOT 5V tolerant)
#if ENABLED(FYSETC_MINI_12864)
#define DOGLCD_CS P1_18
#define DOGLCD_CS P1_18
#define DOGLCD_A0 P1_19
#define LCD_RESET_PIN P1_20
#define LCD_BACKLIGHT_PIN -1
#define RGB_LED
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN P1_21
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN P1_22
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN P1_23
#endif
#ifndef RGB_LED_W_PIN
#define RGB_LED_W_PIN -1
#define LCD_RESET_PIN P1_20 // Must be high or open for LCD to operate normally.
// Seems to work best if left open.
#define FYSETC_MINI_12864_REV_1_2
//#define FYSETC_MINI_12864_REV_2_0
//#define FYSETC_MINI_12864_REV_2_1
#if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
#define RGB_LED
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN P1_21
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN P1_22
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN P1_23
#endif
#elif defined(FYSETC_MINI_12864_REV_2_1)
#define NEOPIXEL_LED
#define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN P1_21 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
#define NEOPIXEL_PIXELS 3 // Number of LEDs in the strip
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
#else
#error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
#endif
#else
#if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
#error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
#endif
#else // !FYSETC_MINI_12864
#if ENABLED(MKS_MINI_12864)
#define DOGLCD_CS P1_21
@ -234,7 +253,7 @@
#define LCD_PINS_D7 P1_23
#endif
#endif // FYSETC_MINI_12864
#endif // !FYSETC_MINI_12864
#endif

View File

@ -28,8 +28,8 @@
#error "Oops! Select 'FYSETC F6' in 'Tools > Board.'"
#endif
#ifdef SD_DETECT_INVERTED
#error "SD_DETECT_INVERTED must be disabled for the FYSETC_F6_13 board."
#if ENABLED(SD_DETECT_INVERTED)
//#error "SD_DETECT_INVERTED must be disabled for the FYSETC_F6_13 board."
#endif
#define BOARD_NAME "FYSETC F6 1.3"
@ -190,20 +190,42 @@
//
#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
#define LCD_BACKLIGHT_PIN -1
#define LCD_RESET_PIN 23
#define KILL_PIN 41
#define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally.
// Seems to work best if left open.
#define FYSETC_MINI_12864_REV_1_2
//#define FYSETC_MINI_12864_REV_2_0
//#define FYSETC_MINI_12864_REV_2_1
#if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
#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 defined(FYSETC_MINI_12864_REV_2_1)
#define NEOPIXEL_LED
#define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN 25 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
#define NEOPIXEL_PIXELS 3 // Number of LEDs in the strip
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
#else
#error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
#endif
#if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
#error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
#endif
#elif HAS_GRAPHICAL_LCD
#define LCD_PINS_RS 16

View File

@ -526,7 +526,6 @@
// 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
@ -537,14 +536,36 @@
#define SD_DETECT_PIN 49
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 25
#define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally.
// Seems to work best if left open.
#define FYSETC_MINI_12864_REV_1_2
//#define FYSETC_MINI_12864_REV_2_0
//#define FYSETC_MINI_12864_REV_2_1
#if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
#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 defined(FYSETC_MINI_12864_REV_2_1)
#define NEOPIXEL_LED
#define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN 25 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
#define NEOPIXEL_PIXELS 3 // Number of LEDs in the strip
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
#else
#error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN 27
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 29
#if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
#error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
#endif
#elif ENABLED(MINIPANEL)

View File

@ -150,32 +150,71 @@
#if ENABLED(NEWPANEL)
#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(FYSETC_MINI_12864)
#define DOGLCD_CS LCD_PINS_ENABLE
#define DOGLCD_A0 LCD_PINS_RS
#elif ENABLED(MINIPANEL)
#define DOGLCD_CS 25
#define DOGLCD_A0 27
//#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes problems
#define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally.
// Seems to work best if left open.
#define FYSETC_MINI_12864_REV_1_2
//#define FYSETC_MINI_12864_REV_2_0
//#define FYSETC_MINI_12864_REV_2_1
#if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
#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 defined(FYSETC_MINI_12864_REV_2_1)
#define NEOPIXEL_LED
#define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN 25 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
#define NEOPIXEL_PIXELS 3 // Number of LEDs in the strip
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
#else
#error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
#endif
#if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
#error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
#endif
#elif ENABLED(NEWPANEL)
#define LCD_PINS_D4 23
#define LCD_PINS_D5 25
#define LCD_PINS_D6 27
#define LCD_PINS_D7 29
#if ENABLED(MINIPANEL)
#define DOGLCD_CS 25
#define DOGLCD_A0 27
#endif
#endif
#if ANY(VIKI2, miniVIKI)
#define DOGLCD_A0 16
#define KILL_PIN 51
#define STAT_LED_BLUE_PIN 29
#define STAT_LED_RED_PIN 23
#define DOGLCD_CS 17
#define DOGLCD_SCK 76 // SCK_PIN - These are required for DUE Hardware SPI
#define DOGLCD_MOSI 75 // MOSI_PIN
#define DOGLCD_MISO 74 // MISO_PIN
#define DOGLCD_A0 16
#define KILL_PIN 51
#define STAT_LED_BLUE_PIN 29
#define STAT_LED_RED_PIN 23
#define DOGLCD_CS 17
#define DOGLCD_SCK 76 // SCK_PIN - Required for DUE Hardware SPI
#define DOGLCD_MOSI 75 // MOSI_PIN
#define DOGLCD_MISO 74 // MISO_PIN
#endif
#endif // ULTRA_LCD
#if HAS_DRIVER(TMC2208)
@ -201,10 +240,8 @@
//
// M3/M4/M5 - Spindle/Laser Control
//
#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA)
#if HOTENDS < 3
#define SPINDLE_LASER_ENA_PIN 45 // Use E2 ENA
#define SPINDLE_LASER_PWM_PIN 12 // MUST BE HARDWARE PWM
#define SPINDLE_DIR_PIN 47 // Use E2 DIR
#endif
#if HOTENDS < 3 && ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA)
#define SPINDLE_LASER_ENA_PIN 45 // Use E2 ENA
#define SPINDLE_LASER_PWM_PIN 12 // MUST BE HARDWARE PWM
#define SPINDLE_DIR_PIN 47 // Use E2 DIR
#endif

View File

@ -320,6 +320,7 @@
#define DOGLCD_MOSI P0_18
#define DOGLCD_CS P1_09 // use Ethernet connector for EXP1 cable signals
#define DOGLCD_A0 P1_14
#define FORCE_SOFT_SPI // required on a Re-ARM system
#else
#define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2
#define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2

View File

@ -202,31 +202,24 @@
//
#if ENABLED(ULTRA_LCD)
#if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER)
#if ANY(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER, REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BEEPER_PIN 62
#define LCD_PINS_D4 48
#define LCD_PINS_D5 50
#define LCD_PINS_D6 52
#define LCD_PINS_D7 53
#define SD_DETECT_PIN 51
#endif
#if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER)
#define LCD_PINS_RS 63
#define LCD_PINS_ENABLE 64
#define LCD_PINS_D4 48
#define LCD_PINS_D5 50
#define LCD_PINS_D6 52
#define LCD_PINS_D7 53
#define SD_DETECT_PIN 51
#elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BEEPER_PIN 62
#define LCD_PINS_RS 52
#define LCD_PINS_ENABLE 53
#define LCD_PINS_D4 48
#define LCD_PINS_D5 50
#define LCD_PINS_D6 52
#define LCD_PINS_D7 53
#define SD_DETECT_PIN 51
#elif HAS_SSD1306_OLED_I2C
@ -234,16 +227,57 @@
#define LCD_SDSS 10
#define SD_DETECT_PIN 51
#elif ENABLED(FYSETC_MINI_12864)
#define BEEPER_PIN 62
#define DOGLCD_CS 64
#define DOGLCD_A0 63
//#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes problems
#define LCD_RESET_PIN 48 // Must be high or open for LCD to operate normally.
// Seems to work best if left open.
#define FYSETC_MINI_12864_REV_1_2
//#define FYSETC_MINI_12864_REV_2_0
//#define FYSETC_MINI_12864_REV_2_1
#if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
#define RGB_LED
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 50 // D5
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN 52 // D6
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 53 // D7
#endif
#elif defined(FYSETC_MINI_12864_REV_2_1)
#define NEOPIXEL_LED
#define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN 50 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
#define NEOPIXEL_PIXELS 3 // Number of LEDs in the strip
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
#else
#error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
#endif
#if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
#error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
#endif
#elif ENABLED(SPARK_FULL_GRAPHICS)
//http://doku.radds.org/dokumentation/other-electronics/sparklcd/
#error "Oops! SPARK_FULL_GRAPHICS not supported with RURAMPS4D."
//#define LCD_PINS_D4 29//?
//#define LCD_PINS_ENABLE 27//?
//#define LCD_PINS_RS 25//?
//#define BTN_EN1 35//?
//#define BTN_EN2 33//?
//#define BTN_ENC 37//?
//#define LCD_PINS_D4 29 //?
//#define LCD_PINS_ENABLE 27 //?
//#define LCD_PINS_RS 25 //?
//#define BTN_EN1 35 //?
//#define BTN_EN2 33 //?
//#define BTN_ENC 37 //?
#endif // SPARK_FULL_GRAPHICS

View File

@ -188,31 +188,24 @@
//
#if ENABLED(ULTRA_LCD)
#if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER)
#if ANY(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER, REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BEEPER_PIN 62
#define LCD_PINS_D4 48
#define LCD_PINS_D5 50
#define LCD_PINS_D6 52
#define LCD_PINS_D7 53
#define SD_DETECT_PIN 51
#endif
#if EITHER(RADDS_DISPLAY, REPRAP_DISCOUNT_SMART_CONTROLLER)
#define LCD_PINS_RS 63
#define LCD_PINS_ENABLE 64
#define LCD_PINS_D4 48
#define LCD_PINS_D5 50
#define LCD_PINS_D6 52
#define LCD_PINS_D7 53
#define SD_DETECT_PIN 51
#elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BEEPER_PIN 62
#define LCD_PINS_RS 52
#define LCD_PINS_ENABLE 53
#define LCD_PINS_D4 48
#define LCD_PINS_D5 50
#define LCD_PINS_D6 52
#define LCD_PINS_D7 53
#define SD_DETECT_PIN 51
#elif HAS_SSD1306_OLED_I2C
@ -220,6 +213,47 @@
#define LCD_SDSS 10
#define SD_DETECT_PIN 51
#elif ENABLED(FYSETC_MINI_12864)
#define BEEPER_PIN 62
#define DOGLCD_CS 64
#define DOGLCD_A0 63
//#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes problems
#define LCD_RESET_PIN 48 // Must be high or open for LCD to operate normally.
// Seems to work best if left open.
#define FYSETC_MINI_12864_REV_1_2
//#define FYSETC_MINI_12864_REV_2_0
//#define FYSETC_MINI_12864_REV_2_1
#if EITHER(FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0)
#define RGB_LED
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 50 // D5
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN 52 // D6
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 53 // D7
#endif
#elif defined(FYSETC_MINI_12864_REV_2_1)
#define NEOPIXEL_LED
#define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN 50 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
#define NEOPIXEL_PIXELS 3 // Number of LEDs in the strip
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.
#define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255)
#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
#else
#error "Either FYSETC_MINI_12864_REV_1_2, FYSETC_MINI_12864_REV_2_0 or FYSETC_MINI_12864_REV_2_1 must be defined"
#endif
#if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
#error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
#endif
#elif ENABLED(MKS_MINI_12864)
#define ORIG_BEEPER_PIN 62