Browse Source

ADAFRUIT_ST7565

Added support for new display type
Ed Boston 10 years ago
parent
commit
41f8cdb3a6
5 changed files with 33 additions and 5 deletions
  1. 4
    2
      Marlin/Conditionals.h
  2. 2
    0
      Marlin/Configuration.h
  3. 2
    0
      Marlin/dogm_lcd_implementation.h
  4. 14
    2
      Marlin/pins_RAMPS_13.h
  5. 11
    1
      Marlin/ultralcd.cpp

+ 4
- 2
Marlin/Conditionals.h View File

@@ -22,15 +22,17 @@
22 22
     #define NEWPANEL
23 23
   #endif
24 24
 
25
-  #if defined(miniVIKI) || defined(VIKI2)
25
+  #if defined(miniVIKI) || defined(VIKI2) || defined(ADAFRUIT_ST7565)
26 26
     #define ULTRA_LCD  //general LCD support, also 16x2
27 27
     #define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
28 28
     #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
29 29
 
30 30
     #ifdef miniVIKI
31 31
       #define DEFAULT_LCD_CONTRAST 95
32
-    #else
32
+    #elif defined(VIKI2)
33 33
       #define DEFAULT_LCD_CONTRAST 40
34
+	#elif defined(ADAFRUIT_ST7565)
35
+	  #define DEFAULT_LCD_CONTRAST 110
34 36
     #endif
35 37
 
36 38
     #define ENCODER_PULSES_PER_STEP 4

+ 2
- 0
Marlin/Configuration.h View File

@@ -660,6 +660,8 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
660 660
 //#define VIKI2
661 661
 //#define miniVIKI
662 662
 
663
+#define ADAFRUIT_ST7565
664
+
663 665
 // The RepRapDiscount Smart Controller (white PCB)
664 666
 // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
665 667
 //#define REPRAP_DISCOUNT_SMART_CONTROLLER

+ 2
- 0
Marlin/dogm_lcd_implementation.h View File

@@ -126,6 +126,8 @@
126 126
 #elif defined(VIKI2) || defined(miniVIKI)
127 127
   // Mini Viki and Viki 2.0 LCD, ST7565 controller as well
128 128
   U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
129
+#elif defined(ADAFRUIT_ST7565)
130
+	U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0);
129 131
 #else
130 132
   // for regular DOGM128 display with HW-SPI
131 133
   U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);  // HW-SPI Com: CS, A0

+ 14
- 2
Marlin/pins_RAMPS_13.h View File

@@ -180,6 +180,19 @@
180 180
       #define BTN_ENC -1
181 181
       #define LCD_SDSS 53
182 182
       #define SDCARDDETECT 49
183
+	#elif defined(ADAFRUIT_ST7565)
184
+      #define BTN_EN1 35
185
+      #define BTN_EN2 37
186
+      #define BTN_ENC 31
187
+      #define SDCARDDETECT 49
188
+	  #define SDCARDDETECTINVERTED
189
+	  #define SDSLOW
190
+      #define LCD_SDSS 53
191
+      #define KILL_PIN 41
192
+      #define BEEPER 23
193
+      #define DOGLCD_CS 29
194
+      #define DOGLCD_A0 27
195
+      #define LCD_PIN_BL 33
183 196
     #else
184 197
       // arduino pin which triggers an piezzo beeper
185 198
       #define BEEPER 33  // Beeper on AUX-4
@@ -209,8 +222,7 @@
209 222
       #endif
210 223
 
211 224
     #endif
212
-
213
-  #else // Old-style panel with shift register
225
+	#else // Old-style panel with shift register
214 226
     // Arduino pin witch triggers an piezzo beeper
215 227
     #define BEEPER 33   // No Beeper added
216 228
 

+ 11
- 1
Marlin/ultralcd.cpp View File

@@ -1110,13 +1110,23 @@ static void lcd_control_volumetric_menu() {
1110 1110
 #ifdef HAS_LCD_CONTRAST
1111 1111
   static void lcd_set_contrast() {
1112 1112
     if (encoderPosition != 0) {
1113
+#ifdef ADAFRUIT_ST7565
1114
+      lcd_contrast += encoderPosition;
1115
+      lcd_contrast &= 0xFF;
1116
+#else
1113 1117
       lcd_contrast -= encoderPosition;
1114 1118
       lcd_contrast &= 0x3F;
1119
+#endif
1115 1120
       encoderPosition = 0;
1116 1121
       lcdDrawUpdate = 1;
1117 1122
       u8g.setContrast(lcd_contrast);
1118 1123
     }
1119
-    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast));
1124
+    if (lcdDrawUpdate) 
1125
+#ifdef ADAFRUIT_ST7565
1126
+      lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr3(lcd_contrast));
1127
+#else
1128
+      lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast));
1129
+#endif
1120 1130
     if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu);
1121 1131
   }
1122 1132
 #endif // HAS_LCD_CONTRAST

Loading…
Cancel
Save