Explorar el Código

ADAFRUIT_ST7565

Added support for new display type
Ed Boston hace 10 años
padre
commit
41f8cdb3a6

+ 4
- 2
Marlin/Conditionals.h Ver fichero

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

+ 2
- 0
Marlin/Configuration.h Ver fichero

660
 //#define VIKI2
660
 //#define VIKI2
661
 //#define miniVIKI
661
 //#define miniVIKI
662
 
662
 
663
+#define ADAFRUIT_ST7565
664
+
663
 // The RepRapDiscount Smart Controller (white PCB)
665
 // The RepRapDiscount Smart Controller (white PCB)
664
 // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
666
 // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
665
 //#define REPRAP_DISCOUNT_SMART_CONTROLLER
667
 //#define REPRAP_DISCOUNT_SMART_CONTROLLER

+ 2
- 0
Marlin/dogm_lcd_implementation.h Ver fichero

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

+ 14
- 2
Marlin/pins_RAMPS_13.h Ver fichero

180
       #define BTN_ENC -1
180
       #define BTN_ENC -1
181
       #define LCD_SDSS 53
181
       #define LCD_SDSS 53
182
       #define SDCARDDETECT 49
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
     #else
196
     #else
184
       // arduino pin which triggers an piezzo beeper
197
       // arduino pin which triggers an piezzo beeper
185
       #define BEEPER 33  // Beeper on AUX-4
198
       #define BEEPER 33  // Beeper on AUX-4
209
       #endif
222
       #endif
210
 
223
 
211
     #endif
224
     #endif
212
-
213
-  #else // Old-style panel with shift register
225
+	#else // Old-style panel with shift register
214
     // Arduino pin witch triggers an piezzo beeper
226
     // Arduino pin witch triggers an piezzo beeper
215
     #define BEEPER 33   // No Beeper added
227
     #define BEEPER 33   // No Beeper added
216
 
228
 

+ 11
- 1
Marlin/ultralcd.cpp Ver fichero

1110
 #ifdef HAS_LCD_CONTRAST
1110
 #ifdef HAS_LCD_CONTRAST
1111
   static void lcd_set_contrast() {
1111
   static void lcd_set_contrast() {
1112
     if (encoderPosition != 0) {
1112
     if (encoderPosition != 0) {
1113
+#ifdef ADAFRUIT_ST7565
1114
+      lcd_contrast += encoderPosition;
1115
+      lcd_contrast &= 0xFF;
1116
+#else
1113
       lcd_contrast -= encoderPosition;
1117
       lcd_contrast -= encoderPosition;
1114
       lcd_contrast &= 0x3F;
1118
       lcd_contrast &= 0x3F;
1119
+#endif
1115
       encoderPosition = 0;
1120
       encoderPosition = 0;
1116
       lcdDrawUpdate = 1;
1121
       lcdDrawUpdate = 1;
1117
       u8g.setContrast(lcd_contrast);
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
     if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu);
1130
     if (LCD_CLICKED) lcd_goto_menu(lcd_control_menu);
1121
   }
1131
   }
1122
 #endif // HAS_LCD_CONTRAST
1132
 #endif // HAS_LCD_CONTRAST

Loading…
Cancelar
Guardar