|
@@ -72,7 +72,7 @@
|
72
|
72
|
#define ST7565_ON(N) (0xAE | ((N) & 0x1))
|
73
|
73
|
#define ST7565_OUT_MODE(N) (0xC0 | ((N) & 0x1) << 3)
|
74
|
74
|
#define ST7565_POWER_CONTROL(N) (0x28 | (N))
|
75
|
|
-#define ST7565_V0_RATIO(N) (0x20 | ((N) & 0x7))
|
|
75
|
+#define ST7565_V0_RATIO(N) (0x10 | ((N) & 0x7)) // Specific to Displaytech 64128N? (ST7565 is 0x20 | N)
|
76
|
76
|
#define ST7565_CONTRAST(N) (0x81), (N)
|
77
|
77
|
|
78
|
78
|
#define ST7565_COLUMN_ADR(N) (0x10 | (((N) >> 4) & 0xF)), ((N) & 0xF)
|
|
@@ -91,14 +91,14 @@ static const uint8_t u8g_dev_st7565_64128n_HAL_init_seq[] PROGMEM = {
|
91
|
91
|
ST7565_BIAS_MODE(0), // 0xA2: LCD bias 1/9 (according to Displaytech 64128N datasheet)
|
92
|
92
|
ST7565_ADC_REVERSE(0), // Normal ADC Select (according to Displaytech 64128N datasheet)
|
93
|
93
|
|
94
|
|
- ST7565_OUT_MODE(1), // common output mode: set scan direction normal operation/SHL Select, 0x0C0 --> SHL = 0, normal, 0x0C8 --> SHL = 1
|
|
94
|
+ ST7565_OUT_MODE(1), // common output mode: set scan direction normal operation/SHL Select, 0xC0 --> SHL = 0, normal, 0xC8 --> SHL = 1
|
95
|
95
|
ST7565_START_LINE(0), // Display start line for Displaytech 64128N
|
96
|
96
|
|
97
|
|
- //0x028 | 0x04, // power control: turn on voltage converter
|
98
|
|
- //U8G_ESC_DLY(50), // delay 50 ms
|
|
97
|
+ ST7565_POWER_CONTROL(0x4), // power control: turn on voltage converter
|
|
98
|
+ U8G_ESC_DLY(50), // delay 50 ms
|
99
|
99
|
|
100
|
|
- //0x028 | 0x06, // power control: turn on voltage regulator
|
101
|
|
- //U8G_ESC_DLY(50), // delay 50 ms
|
|
100
|
+ ST7565_POWER_CONTROL(0x6), // power control: turn on voltage regulator
|
|
101
|
+ U8G_ESC_DLY(50), // delay 50 ms
|
102
|
102
|
|
103
|
103
|
ST7565_POWER_CONTROL(0x7), // power control: turn on voltage follower
|
104
|
104
|
U8G_ESC_DLY(50), // delay 50 ms
|
|
@@ -131,7 +131,7 @@ static const uint8_t u8g_dev_st7565_64128n_HAL_sleep_on[] PROGMEM = {
|
131
|
131
|
U8G_ESC_ADR(0), // instruction mode
|
132
|
132
|
U8G_ESC_CS(1), // enable chip
|
133
|
133
|
ST7565_SLEEP_MODE(), // static indicator off
|
134
|
|
- //0x000, // indicator register set (not sure if this is required)
|
|
134
|
+ //0x00, // indicator register set (not sure if this is required)
|
135
|
135
|
ST7565_ON(0), // display off
|
136
|
136
|
ST7565_ALL_PIX(1), // all points on
|
137
|
137
|
U8G_ESC_CS(0), // disable chip, bugfix 12 nov 2014
|
|
@@ -168,7 +168,7 @@ uint8_t u8g_dev_st7565_64128n_HAL_fn(u8g_t *u8g, u8g_dev_t *dev, const uint8_t m
|
168
|
168
|
case U8G_DEV_MSG_CONTRAST:
|
169
|
169
|
u8g_SetChipSelect(u8g, dev, 1);
|
170
|
170
|
u8g_SetAddress(u8g, dev, 0); /* instruction mode */
|
171
|
|
- u8g_WriteByte(u8g, dev, 0x081);
|
|
171
|
+ u8g_WriteByte(u8g, dev, 0x81);
|
172
|
172
|
u8g_WriteByte(u8g, dev, (*(uint8_t *)arg) >> 2);
|
173
|
173
|
u8g_SetChipSelect(u8g, dev, 0);
|
174
|
174
|
return 1;
|
|
@@ -209,7 +209,7 @@ uint8_t u8g_dev_st7565_64128n_HAL_2x_fn(u8g_t *u8g, u8g_dev_t *dev, const uint8_
|
209
|
209
|
case U8G_DEV_MSG_CONTRAST:
|
210
|
210
|
u8g_SetChipSelect(u8g, dev, 1);
|
211
|
211
|
u8g_SetAddress(u8g, dev, 0); /* instruction mode */
|
212
|
|
- u8g_WriteByte(u8g, dev, 0x081);
|
|
212
|
+ u8g_WriteByte(u8g, dev, 0x81);
|
213
|
213
|
u8g_WriteByte(u8g, dev, (*(uint8_t *)arg) >> 2);
|
214
|
214
|
u8g_SetChipSelect(u8g, dev, 0);
|
215
|
215
|
return 1;
|