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

@ -1910,6 +1910,12 @@
// https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 // https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
// //
//#define FYSETC_MINI_12864 //#define FYSETC_MINI_12864
#ifdef FYSETC_MINI_12864
#define FYSETC_MINI_12864_REV_1_2 // types C, D, E & F back light is monochrome (always on) - discrete RGB signals
//#define FYSETC_MINI_12864_REV_2_0 // types A & B back light is RGB - requires LED_USER_PRESET_STARTUP - discrete RGB signals
//#define FYSETC_MINI_12864_REV_2_1 // types A & B back light is RGB - requires LED_USER_PRESET_STARTUP - RGB
//#define FYSETC_MINI_12864_REV_2_1 // types A & B back light is RGB - requires LED_USER_PRESET_STARTUP - Neopixel
#endif
// //
// Factory display for Creality CR-10 // Factory display for Creality CR-10

View file

@ -53,7 +53,7 @@
// Public functions // Public functions
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
#if ENABLED(DUE_SOFTWARE_SPI) #if EITHER(DUE_SOFTWARE_SPI, FORCE_SOFT_SPI)
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// software SPI // software SPI
@ -739,7 +739,42 @@
#define SPI_MODE_2_DUE_HW 0 #define SPI_MODE_2_DUE_HW 0
#define SPI_MODE_3_DUE_HW 1 #define SPI_MODE_3_DUE_HW 1
/**
* The DUE SPI controller is set up so the upper word of the longword
* written to the transmit data register selects which SPI Chip Select
* Register is used. This allows different streams to have different SPI
* settings.
*
* In practice it's spooky. Some combinations hang the system, while others
* upset the peripheral device.
*
* SPI mode should be the same for all streams. The FYSETC_MINI_12864 gets
* upset if the clock phase changes after chip select goes active.
*
* SPI_CSR_CSAAT should be set for all streams. If not the WHILE_TX(0)
* macro returns immediately which can result in the SPI chip select going
* inactive before all the data has been sent.
*
* The TMC2130 library uses SPI0->SPI_CSR[3].
*
* The U8G hardware SPI uses SPI0->SPI_CSR[0]. The system hangs and/or the
* FYSETC_MINI_12864 gets upset if lower baud rates are used and the SD card
* is inserted or removed.
*
* The SD card uses SPI0->SPI_CSR[3]. Efforts were made to use [1] and [2]
* but they all resulted in hangs or garbage on the LCD.
*
* The SPI controlled chip selects are NOT enabled in the GPIO controller.
* The application must control the chip select.
*
* All of the above can be avoided by defining FORCE_SOFT_SPI to force the
* display to use software SPI.
*
*/
void spiInit(uint8_t spiRate=6) { // Default to slowest rate if not specified) void spiInit(uint8_t spiRate=6) { // Default to slowest rate if not specified)
// Also sets U8G SPI rate to 4MHz and the SPI mode to 3
// 8.4 MHz, 4 MHz, 2 MHz, 1 MHz, 0.5 MHz, 0.329 MHz, 0.329 MHz // 8.4 MHz, 4 MHz, 2 MHz, 1 MHz, 0.5 MHz, 0.329 MHz, 0.329 MHz
constexpr int spiDivider[] = { 10, 21, 42, 84, 168, 255, 255 }; constexpr int spiDivider[] = { 10, 21, 42, 84, 168, 255, 255 };
if (spiRate > 6) spiRate = 1; if (spiRate > 6) spiRate = 1;
@ -760,15 +795,16 @@
// TMC2103 compatible setup // TMC2103 compatible setup
// Master mode, no fault detection, PCS bits in data written to TDR select CSR register // Master mode, no fault detection, PCS bits in data written to TDR select CSR register
SPI0->SPI_MR = SPI_MR_MSTR | SPI_MR_PS | SPI_MR_MODFDIS; SPI0->SPI_MR = SPI_MR_MSTR | SPI_MR_PS | SPI_MR_MODFDIS;
// SPI mode 0, 8 Bit data transfer, baud rate // SPI mode 3, 8 Bit data transfer, baud rate
SPI0->SPI_CSR[3] = SPI_CSR_SCBR(spiDivider[spiRate]) | SPI_CSR_CSAAT | SPI_MODE_0_DUE_HW; // use same CSR as TMC2130 SPI0->SPI_CSR[3] = SPI_CSR_SCBR(spiDivider[spiRate]) | SPI_CSR_CSAAT | SPI_MODE_3_DUE_HW; // use same CSR as TMC2130
SPI0->SPI_CSR[0] = SPI_CSR_SCBR(spiDivider[1]) | SPI_CSR_CSAAT | SPI_MODE_3_DUE_HW; // U8G default to 4MHz
} }
void spiBegin() { spiInit(); } void spiBegin() { spiInit(); }
static uint8_t spiTransfer(uint8_t data) { static uint8_t spiTransfer(uint8_t data) {
WHILE_TX(0); WHILE_TX(0);
SPI0->SPI_TDR = (uint32_t)data | 0x00070000UL; // Add TMC2130 PCS bits to every byte SPI0->SPI_TDR = (uint32_t)data | 0x00070000UL; // Add TMC2130 PCS bits to every byte (use SPI0->SPI_CSR[3])
WHILE_TX(0); WHILE_TX(0);
WHILE_RX(0); WHILE_RX(0);
return SPI0->SPI_RDR; return SPI0->SPI_RDR;

View file

@ -138,6 +138,8 @@
#elif ENABLED(MKS_MINI_12864) #elif ENABLED(MKS_MINI_12864)
#define MINIPANEL #define MINIPANEL
#define DEFAULT_LCD_CONTRAST 150
#define LCD_CONTRAST_MAX 255
#elif ENABLED(FYSETC_MINI_12864) #elif ENABLED(FYSETC_MINI_12864)
@ -153,7 +155,9 @@
#if EITHER(MAKRPANEL, MINIPANEL) #if EITHER(MAKRPANEL, MINIPANEL)
#define DOGLCD #define DOGLCD
#define ULTIPANEL #define ULTIPANEL
#ifndef DEFAULT_LCD_CONTRAST
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#endif
#endif #endif
#if ENABLED(ULTI_CONTROLLER) #if ENABLED(ULTI_CONTROLLER)

View file

@ -1786,13 +1786,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "Please select no more than one LCD controller option." #error "Please select no more than one LCD controller option."
#endif #endif
/**
* Fysetc Mini 12864 requirements
*/
#if ENABLED(FYSETC_MINI_12864) && DISABLED(LED_USER_PRESET_STARTUP)
#error "FYSETC_MINI_12864 requires LED_USER_PRESET_STARTUP to enable the backlight on startup."
#endif
/** /**
* Check existing CS pins against enabled TMC SPI drivers. * Check existing CS pins against enabled TMC SPI drivers.
*/ */

View file

@ -94,3 +94,16 @@ public:
: U8GLIB(&u8g_dev_tft_320x240_upscale_from_128x64, cs, rs, reset) : U8GLIB(&u8g_dev_tft_320x240_upscale_from_128x64, cs, rs, reset)
{ } { }
}; };
extern u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, u8g_dev_uc1701_mini12864_HAL_2x_hw_spi;
class U8GLIB_MINI12864_2X_HAL : public U8GLIB {
public:
U8GLIB_MINI12864_2X_HAL(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE)
: U8GLIB(&u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, sck, mosi, cs, a0, reset)
{ }
U8GLIB_MINI12864_2X_HAL(uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE)
: U8GLIB(&u8g_dev_uc1701_mini12864_HAL_2x_hw_spi, cs, a0, reset)
{ }
};

View file

@ -87,10 +87,15 @@ static const uint8_t u8g_dev_uc1701_mini12864_HAL_init_seq[] PROGMEM = {
0x000, /* disable */ 0x000, /* disable */
0x0AF, /* display on */ 0x0AF, /* display on */
U8G_ESC_CS(0), /* disable chip */
U8G_ESC_DLY(100), /* delay 100 ms */ U8G_ESC_DLY(100), /* delay 100 ms */
U8G_ESC_CS(1), /* enable chip */
0x0A5, /* display all points, ST7565 */ 0x0A5, /* display all points, ST7565 */
U8G_ESC_CS(0), /* disable chip */
U8G_ESC_DLY(100), /* delay 100 ms */ U8G_ESC_DLY(100), /* delay 100 ms */
U8G_ESC_DLY(100), /* delay 100 ms */ U8G_ESC_DLY(100), /* delay 100 ms */
U8G_ESC_CS(1), /* enable chip */
0x0A4, /* normal display */ 0x0A4, /* normal display */
U8G_ESC_CS(0), /* disable chip */ U8G_ESC_CS(0), /* disable chip */
U8G_ESC_END /* end of sequence */ U8G_ESC_END /* end of sequence */

View file

@ -111,8 +111,8 @@
// The MINIPanel display // The MINIPanel display
//#define U8G_CLASS U8GLIB_MINI12864 //#define U8G_CLASS U8GLIB_MINI12864
//#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes
#define U8G_CLASS U8GLIB_MINI12864_2X #define U8G_CLASS U8GLIB_MINI12864_2X_HAL
#if ENABLED(FYSETC_MINI_12864) && DOGLCD_SCK > 0 #if BOTH(FYSETC_MINI_12864, FORCE_SOFT_SPI)
#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes SW-SPI #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes SW-SPI
#else #else
#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes HW-SPI #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes HW-SPI

View file

@ -668,6 +668,7 @@ void MarlinUI::update() {
static uint16_t max_display_update_time = 0; static uint16_t max_display_update_time = 0;
static millis_t next_lcd_update_ms; static millis_t next_lcd_update_ms;
millis_t ms = millis();
#if HAS_LCD_MENU #if HAS_LCD_MENU
@ -729,11 +730,12 @@ void MarlinUI::update() {
refresh(); refresh();
init_lcd(); // May revive the LCD if static electricity killed it init_lcd(); // May revive the LCD if static electricity killed it
ms = millis();
next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; // delay LCD update until after SD activity completes
} }
#endif // SDSUPPORT && SD_DETECT_PIN #endif // SDSUPPORT && SD_DETECT_PIN
const millis_t ms = millis();
if (ELAPSED(ms, next_lcd_update_ms) if (ELAPSED(ms, next_lcd_update_ms)
#if HAS_GRAPHICAL_LCD #if HAS_GRAPHICAL_LCD
|| drawing_screen || drawing_screen

View file

@ -204,9 +204,16 @@
#if ENABLED(FYSETC_MINI_12864) #if ENABLED(FYSETC_MINI_12864)
#define DOGLCD_CS P1_18 #define DOGLCD_CS P1_18
#define DOGLCD_A0 P1_19 #define DOGLCD_A0 P1_19
#define LCD_RESET_PIN P1_20
#define LCD_BACKLIGHT_PIN -1 #define LCD_BACKLIGHT_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 #define RGB_LED
#ifndef RGB_LED_R_PIN #ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN P1_21 #define RGB_LED_R_PIN P1_21
@ -217,11 +224,23 @@
#ifndef RGB_LED_B_PIN #ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN P1_23 #define RGB_LED_B_PIN P1_23
#endif #endif
#ifndef RGB_LED_W_PIN #elif defined(FYSETC_MINI_12864_REV_2_1)
#define RGB_LED_W_PIN -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 #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) #if ENABLED(MKS_MINI_12864)
#define DOGLCD_CS P1_21 #define DOGLCD_CS P1_21
@ -234,7 +253,7 @@
#define LCD_PINS_D7 P1_23 #define LCD_PINS_D7 P1_23
#endif #endif
#endif // FYSETC_MINI_12864 #endif // !FYSETC_MINI_12864
#endif #endif

View file

@ -28,8 +28,8 @@
#error "Oops! Select 'FYSETC F6' in 'Tools > Board.'" #error "Oops! Select 'FYSETC F6' in 'Tools > Board.'"
#endif #endif
#ifdef SD_DETECT_INVERTED #if ENABLED(SD_DETECT_INVERTED)
#error "SD_DETECT_INVERTED must be disabled for the FYSETC_F6_13 board." //#error "SD_DETECT_INVERTED must be disabled for the FYSETC_F6_13 board."
#endif #endif
#define BOARD_NAME "FYSETC F6 1.3" #define BOARD_NAME "FYSETC F6 1.3"
@ -190,6 +190,17 @@
// //
#define DOGLCD_A0 16 #define DOGLCD_A0 16
#define DOGLCD_CS 17 #define DOGLCD_CS 17
#define LCD_BACKLIGHT_PIN -1
#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 #ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 25 #define RGB_LED_R_PIN 25
#endif #endif
@ -199,10 +210,21 @@
#ifndef RGB_LED_B_PIN #ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 29 #define RGB_LED_B_PIN 29
#endif #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
#define LCD_BACKLIGHT_PIN -1 #if !defined(LED_USER_PRESET_STARTUP) && EITHER(FYSETC_MINI_12864_REV_2_0, FYSETC_MINI_12864_REV_2_1)
#define LCD_RESET_PIN 23 #error "LED_USER_PRESET_STARTUP must be enabled when using FYSETC_MINI_12864 REV 2.0 and later"
#define KILL_PIN 41 #endif
#elif HAS_GRAPHICAL_LCD #elif HAS_GRAPHICAL_LCD

View file

@ -526,7 +526,6 @@
// From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 // From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
#define BEEPER_PIN 37 #define BEEPER_PIN 37
#define LCD_RESET_PIN 23
#define DOGLCD_A0 16 #define DOGLCD_A0 16
#define DOGLCD_CS 17 #define DOGLCD_CS 17
@ -537,6 +536,13 @@
#define SD_DETECT_PIN 49 #define SD_DETECT_PIN 49
#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 #ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 25 #define RGB_LED_R_PIN 25
#endif #endif
@ -546,6 +552,21 @@
#ifndef RGB_LED_B_PIN #ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 29 #define RGB_LED_B_PIN 29
#endif #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(MINIPANEL) #elif ENABLED(MINIPANEL)

View file

@ -150,32 +150,71 @@
#if ENABLED(NEWPANEL) #if ENABLED(NEWPANEL)
#define LCD_PINS_RS 16 #define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17 #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 #endif
#if ENABLED(FYSETC_MINI_12864) #if ENABLED(FYSETC_MINI_12864)
#define DOGLCD_CS LCD_PINS_ENABLE #define DOGLCD_CS LCD_PINS_ENABLE
#define DOGLCD_A0 LCD_PINS_RS #define DOGLCD_A0 LCD_PINS_RS
#elif ENABLED(MINIPANEL)
//#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_CS 25
#define DOGLCD_A0 27 #define DOGLCD_A0 27
#endif #endif
#endif
#if ANY(VIKI2, miniVIKI) #if ANY(VIKI2, miniVIKI)
#define DOGLCD_A0 16 #define DOGLCD_A0 16
#define KILL_PIN 51 #define KILL_PIN 51
#define STAT_LED_BLUE_PIN 29 #define STAT_LED_BLUE_PIN 29
#define STAT_LED_RED_PIN 23 #define STAT_LED_RED_PIN 23
#define DOGLCD_CS 17 #define DOGLCD_CS 17
#define DOGLCD_SCK 76 // SCK_PIN - These are required for DUE Hardware SPI #define DOGLCD_SCK 76 // SCK_PIN - Required for DUE Hardware SPI
#define DOGLCD_MOSI 75 // MOSI_PIN #define DOGLCD_MOSI 75 // MOSI_PIN
#define DOGLCD_MISO 74 // MISO_PIN #define DOGLCD_MISO 74 // MISO_PIN
#endif #endif
#endif // ULTRA_LCD #endif // ULTRA_LCD
#if HAS_DRIVER(TMC2208) #if HAS_DRIVER(TMC2208)
@ -201,10 +240,8 @@
// //
// M3/M4/M5 - Spindle/Laser Control // M3/M4/M5 - Spindle/Laser Control
// //
#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA) #if HOTENDS < 3 && ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA)
#if HOTENDS < 3
#define SPINDLE_LASER_ENA_PIN 45 // Use E2 ENA #define SPINDLE_LASER_ENA_PIN 45 // Use E2 ENA
#define SPINDLE_LASER_PWM_PIN 12 // MUST BE HARDWARE PWM #define SPINDLE_LASER_PWM_PIN 12 // MUST BE HARDWARE PWM
#define SPINDLE_DIR_PIN 47 // Use E2 DIR #define SPINDLE_DIR_PIN 47 // Use E2 DIR
#endif
#endif #endif

View file

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

View file

@ -202,31 +202,24 @@
// //
#if ENABLED(ULTRA_LCD) #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 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_RS 63
#define LCD_PINS_ENABLE 64 #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) #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BEEPER_PIN 62
#define LCD_PINS_RS 52 #define LCD_PINS_RS 52
#define LCD_PINS_ENABLE 53 #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 #elif HAS_SSD1306_OLED_I2C
@ -234,16 +227,57 @@
#define LCD_SDSS 10 #define LCD_SDSS 10
#define SD_DETECT_PIN 51 #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) #elif ENABLED(SPARK_FULL_GRAPHICS)
//http://doku.radds.org/dokumentation/other-electronics/sparklcd/ //http://doku.radds.org/dokumentation/other-electronics/sparklcd/
#error "Oops! SPARK_FULL_GRAPHICS not supported with RURAMPS4D." #error "Oops! SPARK_FULL_GRAPHICS not supported with RURAMPS4D."
//#define LCD_PINS_D4 29//? //#define LCD_PINS_D4 29 //?
//#define LCD_PINS_ENABLE 27//? //#define LCD_PINS_ENABLE 27 //?
//#define LCD_PINS_RS 25//? //#define LCD_PINS_RS 25 //?
//#define BTN_EN1 35//? //#define BTN_EN1 35 //?
//#define BTN_EN2 33//? //#define BTN_EN2 33 //?
//#define BTN_ENC 37//? //#define BTN_ENC 37 //?
#endif // SPARK_FULL_GRAPHICS #endif // SPARK_FULL_GRAPHICS

View file

@ -188,31 +188,24 @@
// //
#if ENABLED(ULTRA_LCD) #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 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_RS 63
#define LCD_PINS_ENABLE 64 #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) #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BEEPER_PIN 62
#define LCD_PINS_RS 52 #define LCD_PINS_RS 52
#define LCD_PINS_ENABLE 53 #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 #elif HAS_SSD1306_OLED_I2C
@ -220,6 +213,47 @@
#define LCD_SDSS 10 #define LCD_SDSS 10
#define SD_DETECT_PIN 51 #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) #elif ENABLED(MKS_MINI_12864)
#define ORIG_BEEPER_PIN 62 #define ORIG_BEEPER_PIN 62