Skip to content

Commit

Permalink
♻️ Migrate FYSETC_MINI_12864_2_1
Browse files Browse the repository at this point in the history
Co-Authored-By: ellensp <530024+ellensp@users.noreply.github.com>
  • Loading branch information
thinkyhead and ellensp committed Jul 24, 2024
1 parent aa73bde commit 8d70ce2
Show file tree
Hide file tree
Showing 25 changed files with 546 additions and 727 deletions.
37 changes: 18 additions & 19 deletions Marlin/src/pins/esp32/pins_MKS_TINYBEE.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,32 +168,31 @@
// MKS MINI12864 / LCD12864B. For MKS LCD12864A remove the RPK2 resistor!

// Migrated to pins/lcd
#define LCD_RESET_PIN -1
#define LCD_RESET_PIN -1

#elif ENABLED(FYSETC_MINI_12864_2_1)

// Migrated to pins/lcd

#if SD_CONNECTION_IS(ONBOARD)
#define FORCE_SOFT_SPI
#endif
#if ALL(MKS_MINI_12864_V3, HAS_MEDIA)
#define PAUSE_LCD_FOR_BUSY_SD
#endif

#elif HAS_WIRED_LCD

#define BEEPER_PIN EXP1_01_PIN
#define LCD_PINS_EN EXP1_03_PIN
#define LCD_PINS_RS EXP1_04_PIN
#define BTN_ENC EXP1_02_PIN
#define BTN_EN1 EXP2_03_PIN
#define BTN_EN2 EXP2_05_PIN

#if ENABLED(FYSETC_MINI_12864_2_1)
// MKS_MINI_12864_V3, BTT_MINI_12864, FYSETC_MINI_12864_2_1, BEEZ_MINI_12864
#define DOGLCD_CS EXP1_03_PIN
#define DOGLCD_A0 EXP1_04_PIN
#define LCD_RESET_PIN EXP1_05_PIN
#define NEOPIXEL_PIN EXP1_06_PIN
#if SD_CONNECTION_IS(ONBOARD)
#define FORCE_SOFT_SPI
#endif
#if ALL(MKS_MINI_12864_V3, HAS_MEDIA)
#define PAUSE_LCD_FOR_BUSY_SD
#endif
#else
#define LCD_PINS_D4 EXP1_05_PIN
#define BOARD_ST7920_DELAY_1 96
#define BOARD_ST7920_DELAY_2 48
#define BOARD_ST7920_DELAY_3 600
#endif
#define LCD_PINS_D4 EXP1_05_PIN
#define BOARD_ST7920_DELAY_1 96
#define BOARD_ST7920_DELAY_2 48
#define BOARD_ST7920_DELAY_3 600

#endif // HAS_WIRED_LCD
119 changes: 119 additions & 0 deletions Marlin/src/pins/lcd/FYSETC_MINI_12864.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 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 <https://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* pins/lcd/FYSETC_MINI_12864.h
*/

/**
* NOTES:
*
* All these are the same with different backlight options.
*
* FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default
* FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on)
* FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight
* FYSETC_MINI_12864_2_1 // Type A/B. NeoPixel RGB Backlight
* FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight
*
* NOTE: MKS_MINI_12864_V3 and BTT_MINI_12864_V1 are the same as FYSETC_MINI_12864_2_1 with plugs rotated 180 degrees
*
* Custom adapters are required for these boards:
* pins_BTT_SKR_E3_DIP.h ADAPTER_CUSTOM_E3_DIP_TFT
* pins_BTT_SKR_MINI_E3_common.h ADAPTER_CUSTOM_MINI_E3_TFT
* pins_CREALITY_V4.h ADAPTER_CUSTOM_CREALITY_V4_DEBUG_HEADER
* pins_BTT_SKR_MINI_E3_V3_0.h ADAPTER_CUSTOM_E3_V3_NEO
* ADAPTER_SKR_MINI_SCREEN
*/

// U8GLIB_MINI12864_2X_HAL : u8g_dev_uc1701_mini12864_HAL_sw_spi, u8g_dev_uc1701_mini12864_HAL_hw_spi

// FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1
// FYSETC_MINI_12864
// DOGLCD
// HAS_MARLINUI_U8GLIB
// IS_ULTIPANEL
// HAS_WIRED_LCD
// HAS_DISPLAY
// HAS_STATUS_MESSAGE
// IS_NEWPANEL
// HAS_MARLINUI_MENU
// HAS_MANUAL_MOVE_MENU
// LED_COLORS_REDUCE_GREEN

/**
* FYSETC Mini 12864 https://wiki.fysetc.com/Mini12864_Panel/
*
* EXP1 EXP2
*
* GND GLED LRST LCS BEEP GND CD EN2 EN1 MISO
* 9 7 5 3 1 9 7 5 3 1
* 10 8 (6) 4 2 10 8 (6) 4 2
* VCC BLED RLED LRS ENC SCK RST MOSI SDSS SCK
* (DIN)
*
*/

#define BEEPER_PIN LCD1_01_PIN

#define BTN_ENC LCD1_02_PIN
#define BTN_EN1 LCD2_03_PIN
#define BTN_EN2 LCD2_05_PIN

#define DOGLCD_CS LCD1_03_PIN
#define DOGLCD_A0 LCD1_04_PIN

#define DOGLCD_MISO LCD2_01_PIN
#define DOGLCD_SCK LCD2_02_PIN
#define DOGLCD_MOSI LCD2_06_PIN

#define LCD_RESET_PIN LCD1_05_PIN
#define KILL_PIN LCD2_08_PIN

#if ENABLED(FYSETC_MINI_12864_2_1)
#define LCD_NEOPIXEL_PIN LCD1_06_PIN
#elif ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN LCD1_06_PIN
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN LCD1_07_PIN
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN LCD1_08_PIN
#endif
#elif ENABLED(FYSETC_GENERIC_12864_1_1)
#define LCD_BACKLIGHT_PIN LCD1_07_PIN
#endif

#if HAS_MEDIA
#ifndef SDSS
#define SDSS LCD2_04_PIN
#endif
#ifndef SD_DETECT_PIN
#define SD_DETECT_PIN LCD2_07_PIN
#endif
#endif

// Default LCD appearance
#define LCD_CONTRAST_INIT 255
Loading

0 comments on commit 8d70ce2

Please sign in to comment.