Browse Source

🩹 Fix ST7565 LCD contrast init (#24457)

Christophe Huriaux 1 year ago
parent
commit
58048e7748

+ 6
- 0
Marlin/Configuration.h View File

@@ -2631,6 +2631,12 @@
2631 2631
 //
2632 2632
 //#define SILVER_GATE_GLCD_CONTROLLER
2633 2633
 
2634
+//
2635
+// eMotion Tech LCD with SD
2636
+// https://www.reprap-france.com/produit/1234568748-ecran-graphique-128-x-64-points-2-1
2637
+//
2638
+//#define EMOTION_TECH_LCD
2639
+
2634 2640
 //=============================================================================
2635 2641
 //==============================  OLED Displays  ==============================
2636 2642
 //=============================================================================

+ 4
- 1
Marlin/src/inc/Conditionals_LCD.h View File

@@ -99,7 +99,7 @@
99 99
   #define IS_ULTIPANEL 1
100 100
   #define STD_ENCODER_PULSES_PER_STEP 2
101 101
 
102
-#elif ANY(miniVIKI, VIKI2, WYH_L12864, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864)
102
+#elif ANY(miniVIKI, VIKI2, WYH_L12864, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, EMOTION_TECH_LCD)
103 103
 
104 104
   #define DOGLCD
105 105
   #define IS_DOGM_12864 1
@@ -116,6 +116,9 @@
116 116
     #define IS_U8GLIB_LM6059_AF 1
117 117
   #elif ENABLED(AZSMZ_12864)
118 118
     #define IS_U8GLIB_ST7565_64128N 1
119
+  #elif ENABLED(EMOTION_TECH_LCD)
120
+    #define IS_U8GLIB_ST7565_64128N 1
121
+    #define ST7565_VOLTAGE_DIVIDER_VALUE 0x07
119 122
   #endif
120 123
 
121 124
 #elif ENABLED(OLED_PANEL_TINYBOY2)

+ 5
- 3
Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp View File

@@ -74,7 +74,6 @@
74 74
 #define ST7565_ON(N)             ((N) ? 0xAF : 0xAE)
75 75
 #define ST7565_OUT_MODE(N)       ((N) ? 0xC8 : 0xC0)
76 76
 #define ST7565_POWER_CONTROL(N)  (0x28 | (N))
77
-#define ST7565_V0_RATIO(N)       (0x10 | ((N) & 0x7))
78 77
 #define ST7565_V5_RATIO(N)       (0x20 | ((N) & 0x7))
79 78
 #define ST7565_CONTRAST(N)       (0x81), (N)
80 79
 
@@ -106,11 +105,14 @@ static const uint8_t u8g_dev_st7565_64128n_HAL_init_seq[] PROGMEM = {
106 105
   ST7565_POWER_CONTROL(0x7),  // power control: turn on voltage follower
107 106
   U8G_ESC_DLY(50),            // delay 50 ms
108 107
 
109
-  ST7565_V0_RATIO(0),         // Set V0 voltage resistor ratio. Setting for controlling brightness of Displaytech 64128N
108
+  #ifdef ST7565_VOLTAGE_DIVIDER_VALUE
109
+                              // Set V5 voltage resistor ratio. Affects brightness of Displaytech 64128N
110
+    ST7565_V5_RATIO(ST7565_VOLTAGE_DIVIDER_VALUE),
111
+  #endif
110 112
 
111 113
   ST7565_INVERTED(0),         // display normal, bit val 0: LCD pixel off.
112 114
 
113
-  ST7565_CONTRAST(0x1E),      // Contrast value. Setting for controlling brightness of Displaytech 64128N
115
+  ST7565_CONTRAST(0x1E),      // Contrast value for Displaytech 64128N
114 116
 
115 117
   ST7565_ON(1),               // display on
116 118
 

Loading…
Cancel
Save