Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added WYH L12864 LCD from Alfawise Ex8 printer. Resolves #22856 #22863

Merged
merged 5 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,11 @@
//#define VIKI2
//#define miniVIKI

//
// Alfawise Ex8 printer LCD marked as WYH L12864 COG
//
//#define WYH_L12864

//
// MakerLab Mini Panel with graphic
// controller and SD support - https://reprap.org/wiki/Mini_panel
Expand Down
7 changes: 5 additions & 2 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
#define IS_ULTIPANEL 1
#define ENCODER_PULSES_PER_STEP 2

#elif ANY(miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864)
#elif ANY(miniVIKI, VIKI2, WYH_L12864, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864)

#define DOGLCD
#define IS_ULTIPANEL 1
Expand All @@ -108,6 +108,9 @@
#define U8GLIB_ST7565_64128N
#elif ENABLED(VIKI2)
#define U8GLIB_ST7565_64128N
#elif ENABLED(WYH_L12864)
#define U8GLIB_ST7565_64128N
#define ST7565_XOFFSET 0x04
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
#define U8GLIB_LM6059_AF
#elif ENABLED(AZSMZ_12864)
Expand Down Expand Up @@ -417,7 +420,7 @@
#define STD_ENCODER_PULSES_PER_STEP 2
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1

#elif ANY(IS_RRD_SC, miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, OLED_PANEL_TINYBOY2, BQ_LCD_SMART_CONTROLLER, LCD_I2C_PANELOLU2)
#elif ANY(IS_RRD_SC, miniVIKI, VIKI2, WYH_L12864, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, OLED_PANEL_TINYBOY2, BQ_LCD_SMART_CONTROLLER, LCD_I2C_PANELOLU2)

#define STD_ENCODER_PULSES_PER_STEP 4
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@
#define _LCD_CONTRAST_MAX 115
#elif ENABLED(VIKI2)
#define _LCD_CONTRAST_INIT 140
#elif ENABLED(WYH_L12864)
#define _LCD_CONTRAST_INIT 190
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
#define _LCD_CONTRAST_MIN 90
#define _LCD_CONTRAST_INIT 110
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -2672,6 +2672,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
+ COUNT_ENABLED(MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, ANET_ET4_TFT28, ANET_ET5_TFT35) \
+ COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \
+ COUNT_ENABLED(VIKI2, miniVIKI) \
+ COUNT_ENABLED(WYH_L12864) \
+ COUNT_ENABLED(ZONESTAR_12864LCD, ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) \
+ COUNT_ENABLED(ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING) \
+ ENABLED(AZSMZ_12864) \
Expand Down
5 changes: 4 additions & 1 deletion Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
#define WIDTH 128
#define HEIGHT 64
#define PAGE_HEIGHT 8
#ifndef ST7565_XOFFSET
#define ST7565_XOFFSET 0x00
#endif

#define ST7565_ADC_REVERSE(N) ((N) ? 0xA1 : 0xA0)
#define ST7565_BIAS_MODE(N) ((N) ? 0xA3 : 0xA2)
Expand Down Expand Up @@ -123,7 +126,7 @@ static const uint8_t u8g_dev_st7565_64128n_HAL_init_seq[] PROGMEM = {
static const uint8_t u8g_dev_st7565_64128n_HAL_data_start[] PROGMEM = {
U8G_ESC_ADR(0), // instruction mode
U8G_ESC_CS(1), // enable chip
ST7565_COLUMN_ADR(0x00), // high 4 bits to 0, low 4 bits to 0. Changed for DisplayTech 64128N
ST7565_COLUMN_ADR(ST7565_XOFFSET), // high 4 bits to 0, low 4 bits to 0. Changed for DisplayTech 64128N
U8G_ESC_END // end of sequence
};

Expand Down
35 changes: 34 additions & 1 deletion Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,13 @@
#error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING only applies to the ANET 1.0 board."

#elif ENABLED(ANET_FULL_GRAPHICS_LCD)

#error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. Comment out this line to continue."

/**
* 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way.
* 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!)
* 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because this pin is open drain.)
* 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because it is open drain.)
* 4. A wire is needed to connect the Reset switch at J3 (LCD Pin7) to EXP2 (Pin3) on the board.
*
* !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!!
Expand All @@ -252,6 +253,38 @@
#define LCD_PINS_ENABLE EXP1_05_PIN
#define LCD_PINS_D4 EXP1_07_PIN

#elif ENABLED(WYH_L12864)

#error "CAUTION! WYH_L12864 requires wiring modifications. Comment out this line to continue."

/**
* 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way.
* 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!)
* 3. Swap the LCD's MOSI (Pin9) and empty (Pin10) wires because Pin9 is open drain.
*
* !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!!
*
* The WYH_L12864 connector plug:
*
* BEFORE AFTER
* ______ ______
* GND | 1 2 | 5V 5V | 1 2 | GND
* CS | 3 4 | BTN_EN2 CS | 3 4 | BTN_EN2
* SID | 5 6 BTN_EN1 SID | 5 6 BTN_EN1
* SCK | 7 8 | BTN_ENC SCK | 7 8 | BTN_ENC
* MOSI | 9 10 | open | 9 10 | MOSI
* ------ ------
* LCD LCD
*/
#define BTN_EN1 EXP1_06_PIN
#define BTN_EN2 EXP1_04_PIN
#define BTN_ENC EXP1_08_PIN
#define DOGLCD_CS EXP1_03_PIN
#define DOGLCD_A0 EXP1_05_PIN
#define DOGLCD_SCK EXP1_07_PIN
#define DOGLCD_MOSI EXP1_10_PIN
#define LCD_BACKLIGHT_PIN -1

#elif ENABLED(CR10_STOCKDISPLAY)

#define LCD_PINS_RS EXP1_04_PIN
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
/**
* 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way.
* 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!)
* 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because this pin is open drain.)
* 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because it is open drain.)
* 4. A wire is needed to connect the Reset switch at J3 (LCD Pin7) to EXP2 (Pin3) on the board.
*
* !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!!
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#define IS_RAMPS_SF
#endif

#if !(BOTH(IS_ULTRA_LCD, IS_NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD))
#if !(BOTH(IS_ULTRA_LCD, IS_NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, WYH_L12864, MINIPANEL, REPRAPWORLD_KEYPAD))
#define HAS_FREE_AUX2_PINS 1
#endif

Expand Down
33 changes: 33 additions & 0 deletions Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,39 @@
#define BTN_EN1 EXP2_08_PIN
#define BTN_EN2 EXP2_06_PIN

#elif ENABLED(WYH_L12864)

#error "CAUTION! WYH_L12864 requires wiring modifications. Comment out this line to continue."

/**
* 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way.
* 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires.
*
* !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!!
*
* The WYH_L12864 connector plug:
*
* BEFORE AFTER
* ______ ______
* GND | 1 2 | 5V 5V | 1 2 | GND
* CS | 3 4 | BTN_EN2 CS | 3 4 | BTN_EN2
* SID | 5 6 BTN_EN1 SID | 5 6 BTN_EN1
* SCK | 7 8 | BTN_ENC SCK | 7 8 | BTN_ENC
* MOSI | 9 10 | MOSI | 9 10 |
* ------ ------
* LCD LCD
*/
#undef BEEPER_PIN
#undef BTN_ENC
#define BTN_EN1 EXP1_06_PIN
#define BTN_EN2 EXP1_04_PIN
#define BTN_ENC EXP1_08_PIN
#define DOGLCD_CS EXP1_03_PIN
#define DOGLCD_A0 EXP1_05_PIN
#define DOGLCD_SCK EXP1_07_PIN
#define DOGLCD_MOSI EXP1_09_PIN
#define LCD_BACKLIGHT_PIN -1

#else

#define LCD_PINS_RS EXP1_07_PIN
Expand Down