Browse Source

fix lcd selection

Thomas Buck 4 years ago
parent
commit
e595e99538
3 changed files with 5 additions and 409 deletions
  1. 5
    5
      Marlin/Configuration.h
  2. 0
    151
      Marlin/dogm_font_data_ISO10646_SK.h
  3. 0
    253
      Marlin/ultralcd_st7565_u8glib_VIKI.h

+ 5
- 5
Marlin/Configuration.h View File

@@ -1210,15 +1210,15 @@
1210 1210
  */
1211 1211
 //#define AUTO_BED_LEVELING_3POINT
1212 1212
 //#define AUTO_BED_LEVELING_LINEAR
1213
-//#define AUTO_BED_LEVELING_BILINEAR
1214
-#define AUTO_BED_LEVELING_UBL
1213
+#define AUTO_BED_LEVELING_BILINEAR
1214
+//#define AUTO_BED_LEVELING_UBL
1215 1215
 //#define MESH_BED_LEVELING
1216 1216
 
1217 1217
 /**
1218 1218
  * Normally G28 leaves leveling disabled on completion. Enable
1219 1219
  * this option to have G28 restore the prior leveling state.
1220 1220
  */
1221
-//#define RESTORE_LEVELING_AFTER_G28
1221
+#define RESTORE_LEVELING_AFTER_G28
1222 1222
 
1223 1223
 /**
1224 1224
  * Enable detailed logging of G28, G29, M48, etc.
@@ -1786,7 +1786,7 @@
1786 1786
 //
1787 1787
 // ULTIMAKER Controller.
1788 1788
 //
1789
-//#define ULTIMAKERCONTROLLER
1789
+#define ULTIMAKERCONTROLLER
1790 1790
 
1791 1791
 //
1792 1792
 // ULTIPANEL as seen on Thingiverse.
@@ -2009,7 +2009,7 @@
2009 2009
 // A clone of the RepRapDiscount full graphics display but with
2010 2010
 // different pins/wiring (see pins_ANET_10.h).
2011 2011
 //
2012
-#define ANET_FULL_GRAPHICS_LCD
2012
+//#define ANET_FULL_GRAPHICS_LCD
2013 2013
 
2014 2014
 //
2015 2015
 // AZSMZ 12864 LCD with SD

+ 0
- 151
Marlin/dogm_font_data_ISO10646_SK.h View File

@@ -1,151 +0,0 @@
1
-/*
2
-  Fontname: ISO10646_SK
3
-  Copyright: A. Hardtung, modified by Roman Moravcik
4
-  Capital A Height: 7, '1' Height: 7
5
-  Calculated Max Values w= 6 h= 9 x= 2 y= 7 dx= 6 dy= 0 ascent= 8 len= 9
6
-  Font Bounding box     w= 6 h= 9 x= 0 y=-2
7
-  Calculated Min Values           x= 0 y=-1 dx= 0 dy= 0
8
-  Pure Font   ascent = 7 descent=-1
9
-  X Font      ascent = 7 descent=-1
10
-  Max Font    ascent = 8 descent=-1
11
-*/
12
-#include <U8glib.h>
13
-const u8g_fntpgm_uint8_t ISO10646_SK[2203] U8G_SECTION(".progmem.ISO10646_SK") = {
14
-  0,6,9,0,254,7,1,146,3,33,32,255,255,8,255,7,
15
-  255,0,0,0,6,0,0,1,7,7,6,2,0,128,128,128,
16
-  128,128,0,128,3,2,2,6,1,5,160,160,5,7,7,6,
17
-  0,0,80,80,248,80,248,80,80,5,7,7,6,0,0,32,
18
-  120,160,112,40,240,32,5,7,7,6,0,0,192,200,16,32,
19
-  64,152,24,5,7,7,6,0,0,96,144,160,64,168,144,104,
20
-  2,3,3,6,1,4,192,64,128,3,7,7,6,1,0,32,
21
-  64,128,128,128,64,32,3,7,7,6,1,0,128,64,32,32,
22
-  32,64,128,5,5,5,6,0,1,32,168,112,168,32,5,5,
23
-  5,6,0,1,32,32,248,32,32,2,3,3,6,2,255,192,
24
-  64,128,5,1,1,6,0,3,248,2,2,2,6,2,0,192,
25
-  192,5,5,5,6,0,1,8,16,32,64,128,5,7,7,6,
26
-  0,0,112,136,136,136,136,136,112,3,7,7,6,1,0,64,
27
-  192,64,64,64,64,224,5,7,7,6,0,0,112,136,8,112,
28
-  128,128,248,5,7,7,6,0,0,248,16,32,16,8,8,240,
29
-  5,7,7,6,0,0,16,48,80,144,248,16,16,5,7,7,
30
-  6,0,0,248,128,240,8,8,136,112,5,7,7,6,0,0,
31
-  112,128,128,240,136,136,112,5,7,7,6,0,0,248,8,16,
32
-  32,32,32,32,5,7,7,6,0,0,112,136,136,112,136,136,
33
-  112,5,7,7,6,0,0,112,136,136,120,8,8,112,2,5,
34
-  5,6,2,0,192,192,0,192,192,2,6,6,6,2,255,192,
35
-  192,0,192,64,128,4,7,7,6,0,0,16,32,64,128,64,
36
-  32,16,5,3,3,6,0,2,248,0,248,4,7,7,6,1,
37
-  0,128,64,32,16,32,64,128,5,7,7,6,0,0,112,136,
38
-  8,16,32,0,32,5,7,7,6,0,0,112,136,8,104,168,
39
-  168,112,5,7,7,6,0,0,112,136,136,248,136,136,136,5,
40
-  7,7,6,0,0,240,136,136,240,136,136,240,5,7,7,6,
41
-  0,0,112,136,128,128,128,136,112,5,7,7,6,0,0,240,
42
-  136,136,136,136,136,240,5,7,7,6,0,0,248,128,128,240,
43
-  128,128,248,5,7,7,6,0,0,248,128,128,240,128,128,128,
44
-  5,7,7,6,0,0,112,136,128,184,136,136,112,5,7,7,
45
-  6,0,0,136,136,136,248,136,136,136,1,7,7,6,2,0,
46
-  128,128,128,128,128,128,128,5,7,7,6,0,0,56,16,16,
47
-  16,16,144,96,5,7,7,6,0,0,136,144,160,192,160,144,
48
-  136,5,7,7,6,0,0,128,128,128,128,128,128,248,5,7,
49
-  7,6,0,0,136,216,168,136,136,136,136,5,7,7,6,0,
50
-  0,136,136,200,168,152,136,136,5,7,7,6,0,0,112,136,
51
-  136,136,136,136,112,5,7,7,6,0,0,240,136,136,240,128,
52
-  128,128,5,7,7,6,0,0,112,136,136,136,168,144,104,5,
53
-  7,7,6,0,0,240,136,136,240,160,144,136,5,7,7,6,
54
-  0,0,120,128,128,112,8,8,240,5,7,7,6,0,0,248,
55
-  32,32,32,32,32,32,5,7,7,6,0,0,136,136,136,136,
56
-  136,136,112,5,7,7,6,0,0,136,136,136,136,136,80,32,
57
-  5,7,7,6,0,0,136,136,136,136,136,168,80,5,7,7,
58
-  6,0,0,136,136,80,32,80,136,136,5,7,7,6,0,0,
59
-  136,136,136,80,32,32,32,5,7,7,6,0,0,248,8,16,
60
-  32,64,128,248,3,7,7,6,1,0,224,128,128,128,128,128,
61
-  224,5,5,5,6,0,1,128,64,32,16,8,3,7,7,6,
62
-  1,0,224,32,32,32,32,32,224,5,3,3,6,0,4,32,
63
-  80,136,5,1,1,6,0,0,248,2,2,2,6,2,5,128,
64
-  64,5,5,5,6,0,0,112,8,120,136,120,5,7,7,6,
65
-  0,0,128,128,176,200,136,136,240,5,5,5,6,0,0,112,
66
-  128,128,136,112,5,7,7,6,0,0,8,8,104,152,136,136,
67
-  120,5,5,5,6,0,0,112,136,248,128,112,5,7,7,6,
68
-  0,0,48,72,224,64,64,64,64,5,6,6,6,0,255,112,
69
-  136,136,120,8,112,5,7,7,6,0,0,128,128,176,200,136,
70
-  136,136,1,7,7,6,2,0,128,0,128,128,128,128,128,3,
71
-  8,8,6,1,255,32,0,32,32,32,32,160,64,4,7,7,
72
-  6,0,0,128,128,144,160,192,160,144,3,7,7,6,1,0,
73
-  192,64,64,64,64,64,224,5,5,5,6,0,0,208,168,168,
74
-  168,168,5,5,5,6,0,0,176,200,136,136,136,5,5,5,
75
-  6,0,0,112,136,136,136,112,5,6,6,6,0,255,240,136,
76
-  136,240,128,128,5,6,6,6,0,255,120,136,136,120,8,8,
77
-  5,5,5,6,0,0,176,200,128,128,128,5,5,5,6,0,
78
-  0,112,128,112,8,240,4,7,7,6,0,0,64,64,224,64,
79
-  64,64,48,5,5,5,6,0,0,136,136,136,152,104,5,5,
80
-  5,6,0,0,136,136,136,80,32,5,5,5,6,0,0,136,
81
-  136,168,168,80,5,5,5,6,0,0,136,80,32,80,136,5,
82
-  6,6,6,0,255,136,136,136,120,8,112,5,5,5,6,0,
83
-  0,248,16,32,64,248,3,7,7,6,1,0,32,64,64,128,
84
-  64,64,32,1,7,7,6,2,0,128,128,128,128,128,128,128,
85
-  3,7,7,6,1,0,128,64,64,32,64,64,128,5,2,2,
86
-  6,0,2,104,144,0,0,0,6,0,0,5,8,8,6,0,
87
-  0,16,32,112,136,136,248,136,136,5,8,8,6,0,0,80,
88
-  0,112,136,136,248,136,136,5,8,8,6,0,0,8,16,248,
89
-  128,128,240,128,248,3,8,8,6,1,0,32,64,224,64,64,
90
-  64,64,224,5,8,8,6,0,0,16,32,112,136,136,136,136,
91
-  112,5,8,8,6,0,0,32,80,112,136,136,136,136,112,5,
92
-  8,8,6,0,0,16,32,136,136,136,136,136,112,5,8,8,
93
-  6,0,0,16,32,136,136,80,32,32,32,5,8,8,6,0,
94
-  0,16,32,0,112,8,120,136,120,5,7,7,6,0,0,80,
95
-  0,112,8,120,136,120,5,8,8,6,0,0,16,32,0,112,
96
-  136,248,128,112,2,8,8,6,2,0,64,128,0,128,128,128,
97
-  128,128,5,8,8,6,0,0,16,32,0,112,136,136,136,112,
98
-  5,8,8,6,0,0,32,80,0,112,136,136,136,112,5,8,
99
-  8,6,0,0,16,32,0,136,136,136,152,104,5,9,9,6,
100
-  0,255,16,32,0,136,136,136,120,8,112,5,8,8,6,0,
101
-  0,80,32,112,136,128,128,136,112,5,8,8,6,0,0,80,
102
-  32,0,112,128,128,136,112,5,8,8,6,0,0,80,32,240,
103
-  136,136,136,136,240,6,8,8,6,0,0,4,20,24,112,144,
104
-  144,144,112,5,8,8,6,0,0,16,32,128,128,128,128,128,
105
-  248,3,8,8,6,1,0,32,64,0,192,64,64,64,224,5,
106
-  8,8,6,0,0,16,144,160,128,128,128,128,248,5,8,8,
107
-  6,1,0,8,200,80,64,64,64,64,224,5,8,8,6,0,
108
-  0,80,32,136,200,168,152,136,136,5,8,8,6,0,0,80,
109
-  32,0,176,200,136,136,136,5,8,8,6,0,0,16,32,240,
110
-  136,240,160,144,136,5,8,8,6,0,0,16,32,0,176,200,
111
-  128,128,128,5,8,8,6,0,0,80,32,120,128,128,112,8,
112
-  240,5,8,8,6,0,0,80,32,0,112,128,112,8,240,5,
113
-  8,8,6,0,0,80,32,248,32,32,32,32,32,6,8,8,
114
-  6,0,0,4,68,72,224,64,64,64,48,5,8,8,6,0,
115
-  0,80,32,248,8,48,64,128,248,5,8,8,6,0,0,80,
116
-  32,0,248,16,32,64,248,0,0,0,6,0,0,0,0,0,
117
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
118
-  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
119
-  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
120
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
121
-  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
122
-  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
123
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
124
-  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
125
-  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
126
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
127
-  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
128
-  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
129
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
130
-  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
131
-  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
132
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
133
-  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
134
-  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
135
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
136
-  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
137
-  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
138
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
139
-  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
140
-  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
141
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
142
-  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
143
-  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
144
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
145
-  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
146
-  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
147
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
148
-  0,0,6,0,0,0,0,0,6,0,0,0,0,0,6,0,
149
-  0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,
150
-  6,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,
151
-  0,0,6,0,0,0,0,0,6,0,0};

+ 0
- 253
Marlin/ultralcd_st7565_u8glib_VIKI.h View File

@@ -1,253 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (C) 2016, 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
- *
5
- * Based on Sprinter and grbl.
6
- * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation, either version 3 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
-
23
-#ifndef ULCDST7565_H
24
-#define ULCDST7565_H
25
-
26
-#include <U8glib.h>
27
-
28
-#define ST7565_CLK_PIN  DOGLCD_SCK
29
-#define ST7565_DAT_PIN  DOGLCD_MOSI
30
-#define ST7565_CS_PIN   DOGLCD_CS
31
-#define ST7565_A0_PIN   DOGLCD_A0
32
-
33
-#define LCD_PIXEL_WIDTH 128
34
-#define LCD_PIXEL_HEIGHT 64
35
-#define PAGE_HEIGHT 8
36
-
37
-//set optimization so ARDUINO optimizes this file
38
-#pragma GCC optimize (3)
39
-
40
-// If you want you can define your own set of delays in Configuration.h
41
-//#define ST7565_DELAY_1 DELAY_0_NOP
42
-//#define ST7565_DELAY_2 DELAY_0_NOP
43
-//#define ST7565_DELAY_3 DELAY_0_NOP
44
-
45
-/*
46
-#define ST7565_DELAY_1 u8g_10MicroDelay()
47
-#define ST7565_DELAY_2 u8g_10MicroDelay()
48
-#define ST7565_DELAY_3 u8g_10MicroDelay()
49
-*/
50
-
51
-#if F_CPU >= 20000000
52
-  #define CPU_ST7565_DELAY_1 DELAY_0_NOP
53
-  #define CPU_ST7565_DELAY_2 DELAY_0_NOP
54
-  #define CPU_ST7565_DELAY_3 DELAY_1_NOP
55
-#elif (MOTHERBOARD == BOARD_3DRAG) || (MOTHERBOARD == BOARD_K8200) || (MOTHERBOARD == BOARD_K8400)
56
-  #define CPU_ST7565_DELAY_1 DELAY_0_NOP
57
-  #define CPU_ST7565_DELAY_2 DELAY_3_NOP
58
-  #define CPU_ST7565_DELAY_3 DELAY_0_NOP
59
-#elif (MOTHERBOARD == BOARD_MINIRAMBO)
60
-  #define CPU_ST7565_DELAY_1 DELAY_0_NOP
61
-  #define CPU_ST7565_DELAY_2 DELAY_4_NOP
62
-  #define CPU_ST7565_DELAY_3 DELAY_0_NOP
63
-#elif (MOTHERBOARD == BOARD_RAMBO)
64
-  #define CPU_ST7565_DELAY_1 DELAY_0_NOP
65
-  #define CPU_ST7565_DELAY_2 DELAY_0_NOP
66
-  #define CPU_ST7565_DELAY_3 DELAY_0_NOP
67
-#elif F_CPU == 16000000
68
-  #define CPU_ST7565_DELAY_1 DELAY_0_NOP
69
-  #define CPU_ST7565_DELAY_2 DELAY_0_NOP
70
-  #define CPU_ST7565_DELAY_3 DELAY_1_NOP
71
-#else
72
-  #error "No valid condition for delays in 'ultralcd_st7565_u8glib_VIKI.h'"
73
-#endif
74
-
75
-#ifndef ST7565_DELAY_1
76
-  #define ST7565_DELAY_1 CPU_ST7565_DELAY_1
77
-#endif
78
-#ifndef ST7565_DELAY_2
79
-  #define ST7565_DELAY_2 CPU_ST7565_DELAY_2
80
-#endif
81
-#ifndef ST7565_DELAY_3
82
-  #define ST7565_DELAY_3 CPU_ST7565_DELAY_3
83
-#endif
84
-
85
-#if ENABLED(SHARED_SPI)  // Re-ARM requires that the LCD and the SD card share a single SPI
86
-
87
-  #define ST7565_WRITE_BYTE(a)                 { spiSend((uint8_t)a); U8G_DELAY(); }
88
-  #define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i <  count; i++) {spiSend( *ptr++);} DELAY_10US; }
89
-
90
-#else
91
-  #define ST7565_SND_BIT \
92
-    WRITE(ST7565_CLK_PIN, LOW);        ST7565_DELAY_1; \
93
-    WRITE(ST7565_DAT_PIN, val & 0x80); ST7565_DELAY_2; \
94
-    WRITE(ST7565_CLK_PIN, HIGH);       ST7565_DELAY_3; \
95
-    WRITE(ST7565_CLK_PIN, LOW);\
96
-    val <<= 1
97
-
98
-  static void ST7565_SWSPI_SND_8BIT(uint8_t val) {
99
-    ST7565_SND_BIT; // 1
100
-    ST7565_SND_BIT; // 2
101
-    ST7565_SND_BIT; // 3
102
-    ST7565_SND_BIT; // 4
103
-    ST7565_SND_BIT; // 5
104
-    ST7565_SND_BIT; // 6
105
-    ST7565_SND_BIT; // 7
106
-    ST7565_SND_BIT; // 8
107
-  }
108
-
109
-  #define ST7565_WRITE_BYTE(a)                 { ST7565_SWSPI_SND_8BIT((uint8_t)a); U8G_DELAY(); }
110
-  #define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i <  count; i++) {ST7565_SWSPI_SND_8BIT( *ptr++);} DELAY_10US; }
111
-#endif
112
-
113
-#if defined(DOGM_SPI_DELAY_US) && DOGM_SPI_DELAY_US > 0
114
-  #define U8G_DELAY() delayMicroseconds(DOGM_SPI_DELAY_US)
115
-#else
116
-  #define U8G_DELAY() u8g_10MicroDelay()
117
-#endif
118
-
119
-#define ST7565_CS()                          { WRITE(ST7565_CS_PIN,1); U8G_DELAY(); }
120
-#define ST7565_NCS()                         { WRITE(ST7565_CS_PIN,0); }
121
-#define ST7565_A0()                          { WRITE(ST7565_A0_PIN,1); U8G_DELAY(); }
122
-#define ST7565_NA0()                         { WRITE(ST7565_A0_PIN,0); }
123
-
124
-
125
-uint8_t u8g_dev_st7565_64128n_2x_VIKI_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {
126
-  switch (msg) {
127
-    case U8G_DEV_MSG_INIT: {
128
-      OUT_WRITE(ST7565_CS_PIN, LOW);
129
-      #if ENABLED(SHARED_SPI)
130
-        u8g_Delay(250);
131
-        spiBegin();
132
-        #ifndef SPI_SPEED
133
-          #define SPI_SPEED SPI_FULL_SPEED  // use same SPI speed as SD card
134
-        #endif
135
-        spiInit(SPI_SPEED);
136
-      #else
137
-        OUT_WRITE(ST7565_DAT_PIN, LOW);
138
-        OUT_WRITE(ST7565_CLK_PIN, LOW);
139
-      #endif
140
-      OUT_WRITE(ST7565_A0_PIN, LOW);
141
-
142
-      ST7565_CS();                      /* disable chip */
143
-      ST7565_NA0();                     /* instruction mode */
144
-      ST7565_NCS();                     /* enable chip */
145
-
146
-      ST7565_WRITE_BYTE(0x0A2);         /* 0x0A2: LCD bias 1/9 (according to Displaytech 64128N datasheet) */
147
-      ST7565_WRITE_BYTE(0x0A0);         /* Normal ADC Select (according to Displaytech 64128N datasheet) */
148
-
149
-      ST7565_WRITE_BYTE(0x0C8);         /* common output mode: set scan direction normal operation/SHL Select; 0x0C0 --> SHL = 0; normal; 0x0C8 --> SHL = 1 */
150
-      ST7565_WRITE_BYTE(0x040);         /* Display start line for Displaytech 64128N */
151
-
152
-      ST7565_WRITE_BYTE(0x028 | 0x04);  /* power control: turn on voltage converter */
153
-      //U8G_ESC_DLY(50);                /* delay 50 ms - hangs after a reset if used */
154
-
155
-      ST7565_WRITE_BYTE(0x028 | 0x06);  /* power control: turn on voltage regulator */
156
-      //U8G_ESC_DLY(50);                /* delay 50 ms - hangs after a reset if used */
157
-
158
-      ST7565_WRITE_BYTE(0x028 | 0x07);  /* power control: turn on voltage follower */
159
-      //U8G_ESC_DLY(50);                /* delay 50 ms - hangs after a reset if used */
160
-
161
-      ST7565_WRITE_BYTE(0x010);         /* Set V0 voltage resistor ratio. Setting for controlling brightness of Displaytech 64128N */
162
-
163
-      ST7565_WRITE_BYTE(0x0A6);         /* display normal, bit val 0: LCD pixel off. */
164
-
165
-      ST7565_WRITE_BYTE(0x081);         /* set contrast */
166
-      ST7565_WRITE_BYTE(0x01E);         /* Contrast value. Setting for controlling brightness of Displaytech 64128N */
167
-
168
-      ST7565_WRITE_BYTE(0x0AF);         /* display on */
169
-
170
-      U8G_ESC_DLY(100);                 /* delay 100 ms */
171
-      ST7565_WRITE_BYTE(0x0A5);         /* display all points; ST7565 */
172
-      U8G_ESC_DLY(100);                 /* delay 100 ms */
173
-      U8G_ESC_DLY(100);                 /* delay 100 ms */
174
-      ST7565_WRITE_BYTE(0x0A4);         /* normal display */
175
-      ST7565_CS();                      /* disable chip */
176
-    }                                   /* end of sequence */
177
-    break;
178
-
179
-    case U8G_DEV_MSG_STOP: break;
180
-
181
-    case U8G_DEV_MSG_PAGE_NEXT: {
182
-      u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
183
-      ST7565_CS();                      /* disable chip */
184
-      ST7565_NA0();                     /* instruction mode */
185
-      ST7565_NCS();                     /* enable chip */
186
-      ST7565_WRITE_BYTE(0x010);         /* set upper 4 bit of the col adr to 0x10 */
187
-      ST7565_WRITE_BYTE(0x000);         /* set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N */
188
-                                        /* end of sequence */
189
-      ST7565_WRITE_BYTE(0x0B0 | (2*pb->p.page));; /* select current page (ST7565R) */
190
-      ST7565_A0();                      /* data mode */
191
-      ST7560_WriteSequence( (uint8_t) pb->width, (uint8_t *)pb->buf);
192
-      ST7565_CS();                      /* disable chip */
193
-      ST7565_NA0();                     /* instruction mode */
194
-      ST7565_NCS();                     /* enable chip */
195
-      ST7565_WRITE_BYTE(0x010);         /* set upper 4 bit of the col adr to 0x10 */
196
-      ST7565_WRITE_BYTE(0x000);         /* set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N */
197
-                                        /* end of sequence */
198
-      ST7565_WRITE_BYTE(0x0B0 | (2*pb->p.page+1)); /* select current page (ST7565R) */
199
-      ST7565_A0();                      /* data mode */
200
-      ST7560_WriteSequence( (uint8_t) pb->width, (uint8_t *)(pb->buf)+pb->width);
201
-      ST7565_CS();                      /* disable chip */
202
-    }
203
-    break;
204
-
205
-    case U8G_DEV_MSG_CONTRAST:
206
-      ST7565_NCS();
207
-      ST7565_NA0();                     /* instruction mode */
208
-      ST7565_WRITE_BYTE(0x081);
209
-      ST7565_WRITE_BYTE((*(uint8_t *)arg) >> 2);
210
-      ST7565_CS();                      /* disable chip */
211
-      return 1;
212
-
213
-    case U8G_DEV_MSG_SLEEP_ON:
214
-      ST7565_NA0();                     /* instruction mode */
215
-      ST7565_NCS();                     /* enable chip */
216
-      ST7565_WRITE_BYTE(0x0AC);         /* static indicator off */
217
-      ST7565_WRITE_BYTE(0x000);         /* indicator register set (not sure if this is required) */
218
-      ST7565_WRITE_BYTE(0x0AE);         /* display off */
219
-      ST7565_WRITE_BYTE(0x0A5);         /* all points on */
220
-      ST7565_CS();                      /* disable chip , bugfix 12 nov 2014 */
221
-                                        /* end of sequence */
222
-      return 1;
223
-
224
-    case U8G_DEV_MSG_SLEEP_OFF:
225
-      ST7565_NA0();                     /* instruction mode */
226
-      ST7565_NCS();                     /* enable chip */
227
-      ST7565_WRITE_BYTE(0x0A4);         /* all points off */
228
-      ST7565_WRITE_BYTE(0x0AF);         /* display on */
229
-      U8G_ESC_DLY(50);                  /* delay 50 ms */
230
-      ST7565_CS();                      /* disable chip ,  bugfix 12 nov 2014 */
231
-                                        /* end of sequence */
232
-      return 1;
233
-  }
234
-  return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg);
235
-}
236
-
237
-uint8_t u8g_dev_st7565_64128n_2x_VIKI_buf[LCD_PIXEL_WIDTH*2] U8G_NOCOMMON;
238
-u8g_pb_t u8g_dev_st7565_64128n_2x_VIKI_pb = {{16, LCD_PIXEL_HEIGHT, 0, 0, 0}, LCD_PIXEL_WIDTH, u8g_dev_st7565_64128n_2x_VIKI_buf};
239
-u8g_dev_t u8g_dev_st7565_64128n_2x_VIKI_sw_spi = {u8g_dev_st7565_64128n_2x_VIKI_fn, &u8g_dev_st7565_64128n_2x_VIKI_pb, &u8g_com_null_fn};
240
-
241
-class U8GLIB_ST7565_64128n_2x_VIKI : public U8GLIB {
242
-  public:
243
-  U8GLIB_ST7565_64128n_2x_VIKI(uint8_t dummy)
244
-    : U8GLIB(&u8g_dev_st7565_64128n_2x_VIKI_sw_spi)
245
-    {  }
246
-  U8GLIB_ST7565_64128n_2x_VIKI(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE)
247
-    : U8GLIB(&u8g_dev_st7565_64128n_2x_VIKI_sw_spi)
248
-    {  }
249
-};
250
-
251
-#pragma GCC reset_options
252
-
253
-#endif // ULCDST7565_H

Loading…
Cancel
Save