Sfoglia il codice sorgente

Add FYSETC 2.42 inch OLED support (#18485)

George Fu 3 anni fa
parent
commit
097347b575
Nessun account collegato all'indirizzo email del committer

+ 5
- 0
Marlin/Configuration.h Vedi File

@@ -2091,6 +2091,11 @@
2091 2091
 //
2092 2092
 //#define OVERLORD_OLED
2093 2093
 
2094
+//
2095
+// FYSETC OLED 2.42" 128 × 64 FULL GRAPHICS CONTROLLER with WS2812 RGB
2096
+// Where to find : https://www.aliexpress.com/item/4000345255731.html
2097
+//#define FYSETC_242_OLED_12864   // Uses the SSD1309 controller
2098
+
2094 2099
 //=============================================================================
2095 2100
 //========================== Extensible UI Displays ===========================
2096 2101
 //=============================================================================

+ 21
- 0
Marlin/src/inc/Conditionals_LCD.h Vedi File

@@ -120,6 +120,27 @@
120 120
   #define IS_RRD_SC
121 121
   #define IS_U8GLIB_SSD1306
122 122
 
123
+#elif ENABLED(FYSETC_242_OLED_12864)
124
+      
125
+  #define IS_RRD_SC
126
+  #define U8GLIB_SH1106
127
+    
128
+  #define LED_CONTROL_MENU
129
+  #define NEOPIXEL_LED
130
+  #undef NEOPIXEL_TYPE
131
+  #define NEOPIXEL_TYPE       NEO_RGB
132
+  #if NEOPIXEL_PIXELS < 3
133
+    #undef NEOPIXELS_PIXELS
134
+    #define NEOPIXEL_PIXELS     3
135
+  #endif
136
+  #ifndef NEOPIXEL_BRIGHTNESS
137
+    #define NEOPIXEL_BRIGHTNESS 127
138
+  #endif
139
+    
140
+  #if ENABLED(PSU_CONTROL)
141
+    #define LED_BACKLIGHT_TIMEOUT 10000
142
+  #endif
143
+
123 144
 #elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1)
124 145
 
125 146
   #define FYSETC_MINI_12864

+ 1
- 1
Marlin/src/inc/Conditionals_adv.h Vedi File

@@ -208,7 +208,7 @@
208 208
   #endif
209 209
 #endif
210 210
 
211
-#if ENABLED(FYSETC_MINI_12864_2_1)
211
+#if ENABLED(FYSETC_MINI_12864_2_1, FYSETC_242_OLED_12864)
212 212
   #define LED_CONTROL_MENU
213 213
   #define LED_USER_PRESET_STARTUP
214 214
   #define LED_COLOR_PRESETS

+ 1
- 1
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp Vedi File

@@ -246,7 +246,7 @@ void MarlinUI::init_lcd() {
246 246
       OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away
247 247
     #endif
248 248
 
249
-    #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
249
+    #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864)
250 250
       SET_OUTPUT(LCD_PINS_DC);
251 251
       #ifndef LCD_RESET_PIN
252 252
         #define LCD_RESET_PIN LCD_PINS_RS

+ 12
- 0
Marlin/src/lcd/dogm/ultralcd_DOGM.h Vedi File

@@ -123,6 +123,18 @@
123 123
     #define U8G_CLASS U8GLIB_SH1106_128X64                      // 8 stripes
124 124
   #endif
125 125
 
126
+#elif ENABLED(FYSETC_242_OLED_12864)
127
+  
128
+  // FYSETC OLED 2.42" 128 × 64 FULL GRAPHICS CONTROLLER
129
+      
130
+  #define FORCE_SOFT_SPI                                        // SW-SPI
131
+  
132
+  #if ENABLED(ALTERNATIVE_LCD)
133
+    #define U8G_CLASS U8GLIB_SSD1306_128X64_2X                  // 4 stripes
134
+  #else
135
+    #define U8G_CLASS U8GLIB_SSD1306_128X64                     // 8 stripes
136
+  #endif
137
+
126 138
 #elif ENABLED(U8GLIB_SH1106)
127 139
 
128 140
   // Generic SH1106 OLED I2C LCD

+ 62
- 43
Marlin/src/pins/ramps/pins_FYSETC_F6_13.h Vedi File

@@ -211,58 +211,77 @@
211 211
 //
212 212
 // LCDs and Controllers
213 213
 //
214
-#define BEEPER_PIN                            37
215 214
 #define SD_DETECT_PIN                         49
216 215
 
217
-#if ENABLED(FYSETC_MINI_12864)
218
-  //
219
-  // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
220
-  //
221
-  #define DOGLCD_A0                           16
222
-  #define DOGLCD_CS                           17
223
-
224
-  #if ENABLED(FYSETC_GENERIC_12864_1_1)
225
-    #define LCD_BACKLIGHT_PIN                 27
226
-  #endif
227
-
228
-  #define KILL_PIN                            41
229
-  #define LCD_RESET_PIN                       23  // Must be high or open for LCD to operate normally.
230
-                                // Seems to work best if left open.
231
-
232
-  #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
233
-    #ifndef RGB_LED_R_PIN
234
-      #define RGB_LED_R_PIN                   25
235
-    #endif
236
-    #ifndef RGB_LED_G_PIN
237
-      #define RGB_LED_G_PIN                   27
216
+#if ENABLED(FYSETC_242_OLED_12864)
217
+  #define BTN_EN1                             37
218
+  #define BTN_EN2                             29
219
+  #define BTN_ENC                             35
220
+  #define BEEPER_PIN                          31
221
+
222
+  #define LCD_PINS_DC                         25
223
+  #define LCD_PINS_RS                         33
224
+  #define DOGLCD_CS                           16
225
+  #define DOGLCD_MOSI                         23
226
+  #define DOGLCD_SCK                          17
227
+  #define DOGLCD_A0                  LCD_PINS_DC
228
+
229
+  #define KILL_PIN                            -1  // NC
230
+  #define NEOPIXEL_PIN                        27
231
+
232
+#else
233
+  #define BEEPER_PIN                          37
234
+
235
+  #if ENABLED(FYSETC_MINI_12864)
236
+    //
237
+    // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
238
+    //
239
+    #define DOGLCD_A0                         16
240
+    #define DOGLCD_CS                         17
241
+
242
+    #if ENABLED(FYSETC_GENERIC_12864_1_1)
243
+      #define LCD_BACKLIGHT_PIN               27
238 244
     #endif
239
-    #ifndef RGB_LED_B_PIN
240
-      #define RGB_LED_B_PIN                   29
245
+
246
+    #define KILL_PIN                          41
247
+    #define LCD_RESET_PIN                     23  // Must be high or open for LCD to operate normally.
248
+                                  // Seems to work best if left open.
249
+
250
+    #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
251
+      #ifndef RGB_LED_R_PIN
252
+        #define RGB_LED_R_PIN                 25
253
+      #endif
254
+      #ifndef RGB_LED_G_PIN
255
+        #define RGB_LED_G_PIN                 27
256
+      #endif
257
+      #ifndef RGB_LED_B_PIN
258
+        #define RGB_LED_B_PIN                 29
259
+      #endif
260
+    #elif ENABLED(FYSETC_MINI_12864_2_1)
261
+      #define NEOPIXEL_PIN                    25
241 262
     #endif
242
-  #elif ENABLED(FYSETC_MINI_12864_2_1)
243
-    #define NEOPIXEL_PIN                      25
244
-  #endif
245 263
 
246
-#elif HAS_GRAPHICAL_LCD
264
+  #elif HAS_GRAPHICAL_LCD
247 265
 
248
-  #define LCD_PINS_RS                         16
249
-  #define LCD_PINS_ENABLE                     17
250
-  #define LCD_PINS_D4                         23
251
-  #define LCD_PINS_D5                         25
252
-  #define LCD_PINS_D6                         27
253
-  #define LCD_PINS_D7                         29
266
+    #define LCD_PINS_RS                       16
267
+    #define LCD_PINS_ENABLE                   17
268
+    #define LCD_PINS_D4                       23
269
+    #define LCD_PINS_D5                       25
270
+    #define LCD_PINS_D6                       27
271
+    #define LCD_PINS_D7                       29
254 272
 
255
-  #if ENABLED(MKS_MINI_12864)
256
-    #define DOGLCD_CS                         25
257
-    #define DOGLCD_A0                         27
258
-  #endif
273
+    #if ENABLED(MKS_MINI_12864)
274
+      #define DOGLCD_CS                       25
275
+      #define DOGLCD_A0                       27
276
+    #endif
259 277
 
260
-#endif
278
+  #endif
261 279
 
262
-#if ENABLED(NEWPANEL)
263
-  #define BTN_EN1                             31
264
-  #define BTN_EN2                             33
265
-  #define BTN_ENC                             35
280
+  #if ENABLED(NEWPANEL)
281
+    #define BTN_EN1                           31
282
+    #define BTN_EN2                           33
283
+    #define BTN_ENC                           35
284
+  #endif
266 285
 #endif
267 286
 
268 287
 #ifndef RGB_LED_R_PIN

Loading…
Annulla
Salva