Skip to content

Commit 6f51f19

Browse files
strnkthinkyhead
authored andcommitted
🩹 Fix ST7565 LCD contrast init (#24457)
1 parent 56974af commit 6f51f19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
#define ST7565_ON(N) ((N) ? 0xAF : 0xAE)
7575
#define ST7565_OUT_MODE(N) ((N) ? 0xC8 : 0xC0)
7676
#define ST7565_POWER_CONTROL(N) (0x28 | (N))
77-
#define ST7565_V0_RATIO(N) (0x10 | ((N) & 0x7))
7877
#define ST7565_V5_RATIO(N) (0x20 | ((N) & 0x7))
7978
#define ST7565_CONTRAST(N) (0x81), (N)
8079

@@ -106,11 +105,14 @@ static const uint8_t u8g_dev_st7565_64128n_HAL_init_seq[] PROGMEM = {
106105
ST7565_POWER_CONTROL(0x7), // power control: turn on voltage follower
107106
U8G_ESC_DLY(50), // delay 50 ms
108107

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
110112

111113
ST7565_INVERTED(0), // display normal, bit val 0: LCD pixel off.
112114

113-
ST7565_CONTRAST(0x1E), // Contrast value. Setting for controlling brightness of Displaytech 64128N
115+
ST7565_CONTRAST(0x1E), // Contrast value for Displaytech 64128N
114116

115117
ST7565_ON(1), // display on
116118

0 commit comments

Comments
 (0)