Explorar el Código

Lerdge K EEPROM and TFT (#21812)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
sanek88lbl hace 3 años
padre
commit
f95f18c8e5
No account linked to committer's email address

+ 1
- 0
.github/workflows/test-builds.yml Ver fichero

@@ -86,6 +86,7 @@ jobs:
86 86
         - FLYF407ZG
87 87
         - rumba32
88 88
         - LERDGEX
89
+        - LERDGEK
89 90
         - mks_robin_nano35_stm32
90 91
         - NUCLEO_F767ZI
91 92
         - REMRAM_V1

+ 8
- 2
Marlin/src/HAL/shared/eeprom_if_i2c.cpp Ver fichero

@@ -30,11 +30,17 @@
30 30
 #if ENABLED(I2C_EEPROM)
31 31
 
32 32
 #include "eeprom_if.h"
33
-#include <Wire.h>
33
+
34
+#if ENABLED(SOFT_I2C_EEPROM)
35
+  #include <SlowSoftWire.h>
36
+  SlowSoftWire Wire = SlowSoftWire(I2C_SDA_PIN, I2C_SCL_PIN, true);
37
+#else
38
+  #include <Wire.h>
39
+#endif
34 40
 
35 41
 void eeprom_init() {
36 42
   Wire.begin(
37
-    #if PINS_EXIST(I2C_SCL, I2C_SDA)
43
+    #if PINS_EXIST(I2C_SCL, I2C_SDA) && DISABLED(SOFT_I2C_EEPROM)
38 44
       uint8_t(I2C_SDA_PIN), uint8_t(I2C_SCL_PIN)
39 45
     #endif
40 46
   );

+ 3
- 1
Marlin/src/lcd/tft_io/st7796s.h Ver fichero

@@ -154,6 +154,9 @@ static const uint16_t st7796s_init[] = {
154 154
 
155 155
 static const uint16_t lerdge_st7796s_init[] = {
156 156
   DATASIZE_8BIT,
157
+  ESC_REG(ST7796S_SWRESET), ESC_DELAY(100),
158
+  ESC_REG(ST7796S_SLPOUT), ESC_DELAY(20),
159
+
157 160
   ESC_REG(ST7796S_CSCON), 0x00C3,  // enable command 2 part I
158 161
   ESC_REG(ST7796S_CSCON), 0x0096,  // enable command 2 part II
159 162
 
@@ -165,7 +168,6 @@ static const uint16_t lerdge_st7796s_init[] = {
165 168
 
166 169
   ESC_REG(ST7796S_PWR2), 0x0015,
167 170
   ESC_REG(ST7796S_PWR3), 0x00AF,
168
-  ESC_REG(0xC3), 0x0009,       // Register not documented in datasheet
169 171
   ESC_REG(ST7796S_VCMPCTL), 0x0022,
170 172
   ESC_REG(ST7796S_VCMOST), 0x0000,
171 173
   ESC_REG(ST7796S_DOCA), 0x0040, 0x008A, 0x0000, 0x0000, 0x0029, 0x0019, 0x00A5, 0x0033,

+ 44
- 18
Marlin/src/pins/stm32f4/pins_LERDGE_K.h Ver fichero

@@ -28,7 +28,14 @@
28 28
 #define BOARD_INFO_NAME      "Lerdge K"
29 29
 #define DEFAULT_MACHINE_NAME "LERDGE"
30 30
 
31
-#define I2C_EEPROM
31
+// EEPROM
32
+#if NO_EEPROM_SELECTED
33
+  #define I2C_EEPROM
34
+  #define SOFT_I2C_EEPROM                         // Force the use of Software I2C
35
+  #define I2C_SCL_PIN                       PG14
36
+  #define I2C_SDA_PIN                       PG13
37
+  #define MARLIN_EEPROM_SIZE             0x10000
38
+#endif
32 39
 
33 40
 // USB Flash Drive support
34 41
 #define HAS_OTG_USB_HOST_SUPPORT
@@ -36,7 +43,7 @@
36 43
 //
37 44
 // Servos
38 45
 //
39
-//#define SERVO0_PIN                        PB11
46
+#define SERVO0_PIN                          PB11
40 47
 
41 48
 //
42 49
 // Limit Switches
@@ -96,6 +103,13 @@
96 103
 //  #define E1_CS_PIN                       PE4
97 104
 //#endif
98 105
 
106
+//#define E2_STEP_PIN                       PF4  // best guess
107
+//#define E2_DIR_PIN                        PF3  // best guess
108
+//#define E2_ENABLE_PIN                     PF5  // best guess
109
+//#ifndef E2_CS_PIN
110
+//  #define E2_CS_PIN                       PB2  // best guess
111
+//#endif
112
+
99 113
 #if HAS_TMC_UART
100 114
   /**
101 115
    * TMC2208/TMC2209 stepper drivers
@@ -163,13 +177,19 @@
163 177
 #ifndef FAN_PIN
164 178
   #define FAN_PIN                           PF7
165 179
 #endif
180
+
166 181
 #define FAN1_PIN                            PF6
167
-#define FAN2_PIN                            PF8
168 182
 
169 183
 #ifndef E0_AUTO_FAN_PIN
170
-  #define E0_AUTO_FAN_PIN                   PF6
184
+  #define E0_AUTO_FAN_PIN                   PB1
185
+#endif
186
+
187
+#ifndef E1_AUTO_FAN_PIN
188
+  #define E1_AUTO_FAN_PIN                   PB0
171 189
 #endif
172 190
 
191
+#define CONTROLLER_FAN_PIN                  PF8
192
+
173 193
 //
174 194
 // LED / Lighting
175 195
 //
@@ -177,10 +197,10 @@
177 197
 //#define CASE_LIGHT_PIN_DO                 -1
178 198
 //#define NEOPIXEL_PIN                      -1
179 199
 #ifndef RGB_LED_R_PIN
180
-  #define RGB_LED_R_PIN                     PB7
200
+  #define RGB_LED_R_PIN                     PB8   // swap R and G pin for compatibility with real wires
181 201
 #endif
182 202
 #ifndef RGB_LED_G_PIN
183
-  #define RGB_LED_G_PIN                     PB8
203
+  #define RGB_LED_G_PIN                     PB7
184 204
 #endif
185 205
 #ifndef RGB_LED_B_PIN
186 206
   #define RGB_LED_B_PIN                     PB9
@@ -197,7 +217,7 @@
197 217
 //
198 218
 #define SDSS                                PC11
199 219
 #define LED_PIN                             PA15  // Alive
200
-#define PS_ON_PIN                           -1
220
+#define PS_ON_PIN                           PA4
201 221
 #define KILL_PIN                            -1
202 222
 #define POWER_LOSS_PIN                      PA4   // Power-loss / nAC_FAULT
203 223
 
@@ -213,17 +233,23 @@
213 233
 // LCD / Controller
214 234
 //
215 235
 
216
-#define TFT_RESET_PIN                       PD6
217
-#define TFT_BACKLIGHT_PIN                   PD3
236
+#if HAS_FSMC_TFT
237
+  //#define TFT_DRIVER             LERDGE_ST7796
218 238
 
219
-#define TFT_CS_PIN                          PD7
220
-#define TFT_RS_PIN                          PD11
239
+  #define TFT_RESET_PIN                     PD6
240
+  #define TFT_BACKLIGHT_PIN                 PD3
221 241
 
222
-#define TOUCH_CS_PIN                        PG15
223
-#define TOUCH_SCK_PIN                       PB3
224
-#define TOUCH_MOSI_PIN                      PB5
225
-#define TOUCH_MISO_PIN                      PB4
242
+  #define TFT_CS_PIN                        PD7
243
+  #define TFT_RS_PIN                        PD11
226 244
 
227
-#define BTN_EN1                             PG10
228
-#define BTN_EN2                             PG11
229
-#define BTN_ENC                             PG9
245
+  #define TOUCH_CS_PIN                      PG15
246
+  #define TOUCH_SCK_PIN                     PB3
247
+  #define TOUCH_MOSI_PIN                    PB5
248
+  #define TOUCH_MISO_PIN                    PB4
249
+#endif
250
+
251
+#if IS_NEWPANEL
252
+  #define BTN_EN1                           PG10
253
+  #define BTN_EN2                           PG11
254
+  #define BTN_ENC                           PG9
255
+#endif

+ 18
- 0
buildroot/tests/LERDGEK Ver fichero

@@ -0,0 +1,18 @@
1
+#!/usr/bin/env bash
2
+#
3
+# Build tests for LERDGEK environment
4
+#
5
+
6
+# exit on first failure
7
+set -e
8
+
9
+#
10
+# Build with the typical configuration
11
+#
12
+restore_configs
13
+opt_set MOTHERBOARD BOARD_LERDGE_K SERIAL_PORT 1
14
+opt_enable TFT_GENERIC TFT_INTERFACE_FSMC TFT_COLOR_UI
15
+exec_test $1 $2 "LERDGE K with Generic FSMC TFT with ColorUI" "$3"
16
+
17
+# clean up
18
+restore_configs

+ 1
- 0
ini/features.ini Ver fichero

@@ -41,6 +41,7 @@ HAS_(FSMC|SPI|LTDC)_TFT                = src_filter=+<src/HAL/STM32/tft> +<src/H
41 41
 HAS_FSMC_TFT                           = src_filter=+<src/HAL/STM32/tft/tft_fsmc.cpp> +<src/HAL/STM32F1/tft/tft_fsmc.cpp>
42 42
 HAS_SPI_TFT                            = src_filter=+<src/HAL/STM32/tft/tft_spi.cpp> +<src/HAL/STM32F1/tft/tft_spi.cpp>
43 43
 I2C_EEPROM                             = src_filter=+<src/HAL/shared/eeprom_if_i2c.cpp>
44
+SOFT_I2C_EEPROM                        = SlowSoftI2CMaster, SlowSoftWire=https://github.com/felias-fogg/SlowSoftWire/archive/master.zip
44 45
 SPI_EEPROM                             = src_filter=+<src/HAL/shared/eeprom_if_spi.cpp>
45 46
 HAS_GRAPHICAL_TFT                      = src_filter=+<src/lcd/tft>
46 47
 DWIN_CREALITY_LCD                      = src_filter=+<src/lcd/dwin>

+ 1
- 2
ini/stm32f4.ini Ver fichero

@@ -308,8 +308,7 @@ build_flags       = ${stm_flash_drive.build_flags}
308 308
 platform             = ${lerdge_common.platform}
309 309
 extends              = lerdge_common
310 310
 board_build.firmware = Lerdge_K_firmware_force.bin
311
-build_flags          = ${lerdge_common.build_flags}
312
-  -DLERDGEK
311
+build_flags          = ${lerdge_common.build_flags} -DLERDGEK
313 312
 
314 313
 #
315 314
 # Lerdge K with USB Flash Drive Support

Loading…
Cancelar
Guardar