Browse Source

🎨 Remove MKS custom pins, TinyBee cleanup (#24186)

ellensp 3 years ago
parent
commit
e197695f4c
No account linked to committer's email address
2 changed files with 37 additions and 62 deletions
  1. 7
    14
      Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp
  2. 30
    48
      Marlin/src/pins/esp32/pins_MKS_TINYBEE.h

+ 7
- 14
Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp View File

23
  */
23
  */
24
 #ifdef ARDUINO_ARCH_ESP32
24
 #ifdef ARDUINO_ARCH_ESP32
25
 
25
 
26
-#include "../../inc/MarlinConfigPre.h"
26
+#include "../../inc/MarlinConfig.h"
27
 
27
 
28
 #if EITHER(MKS_MINI_12864, FYSETC_MINI_12864_2_1)
28
 #if EITHER(MKS_MINI_12864, FYSETC_MINI_12864_2_1)
29
 
29
 
30
 #include <U8glib-HAL.h>
30
 #include <U8glib-HAL.h>
31
-#include "Arduino.h"
32
 #include "../shared/HAL_SPI.h"
31
 #include "../shared/HAL_SPI.h"
33
 #include "HAL.h"
32
 #include "HAL.h"
34
 #include "SPI.h"
33
 #include "SPI.h"
35
 
34
 
36
 static SPISettings spiConfig;
35
 static SPISettings spiConfig;
37
 
36
 
38
-#define MDOGLCD_MOSI    23
39
-#define MDOGLCD_SCK     18
40
-#define MLCD_RESET_PIN   0
41
-#define MLCD_PINS_DC     4
42
-#define MDOGLCD_CS      21
43
-#define MDOGLCD_A0       4
44
 
37
 
45
 #ifndef LCD_SPI_SPEED
38
 #ifndef LCD_SPI_SPEED
46
   #ifdef SD_SPI_SPEED
39
   #ifdef SD_SPI_SPEED
61
     case U8G_COM_MSG_STOP: break;
54
     case U8G_COM_MSG_STOP: break;
62
 
55
 
63
     case U8G_COM_MSG_INIT:
56
     case U8G_COM_MSG_INIT:
64
-      OUT_WRITE(MDOGLCD_CS, HIGH);
65
-      OUT_WRITE(MDOGLCD_A0, HIGH);
66
-      OUT_WRITE(MLCD_RESET_PIN, HIGH);
57
+      OUT_WRITE(DOGLCD_CS, HIGH);
58
+      OUT_WRITE(DOGLCD_A0, HIGH);
59
+      OUT_WRITE(LCD_RESET_PIN, HIGH);
67
       u8g_Delay(5);
60
       u8g_Delay(5);
68
       spiBegin();
61
       spiBegin();
69
       spiInit(LCD_SPI_SPEED);
62
       spiInit(LCD_SPI_SPEED);
70
       break;
63
       break;
71
 
64
 
72
     case U8G_COM_MSG_ADDRESS:           /* define cmd (arg_val = 0) or data mode (arg_val = 1) */
65
     case U8G_COM_MSG_ADDRESS:           /* define cmd (arg_val = 0) or data mode (arg_val = 1) */
73
-      WRITE(MDOGLCD_A0, arg_val ? HIGH : LOW);
66
+      WRITE(DOGLCD_A0, arg_val ? HIGH : LOW);
74
       break;
67
       break;
75
 
68
 
76
     case U8G_COM_MSG_CHIP_SELECT:       /* arg_val == 0 means HIGH level of U8G_PI_CS */
69
     case U8G_COM_MSG_CHIP_SELECT:       /* arg_val == 0 means HIGH level of U8G_PI_CS */
77
-      WRITE(MDOGLCD_CS, arg_val ? LOW : HIGH);
70
+      WRITE(DOGLCD_CS, arg_val ? LOW : HIGH);
78
       break;
71
       break;
79
 
72
 
80
     case U8G_COM_MSG_RESET:
73
     case U8G_COM_MSG_RESET:
81
-      WRITE(MLCD_RESET_PIN, arg_val);
74
+      WRITE(LCD_RESET_PIN, arg_val);
82
       break;
75
       break;
83
 
76
 
84
     case U8G_COM_MSG_WRITE_BYTE:
77
     case U8G_COM_MSG_WRITE_BYTE:

+ 30
- 48
Marlin/src/pins/esp32/pins_MKS_TINYBEE.h View File

116
 //
116
 //
117
 // ADC Reference Voltage
117
 // ADC Reference Voltage
118
 //
118
 //
119
-#define ADC_REFERENCE_VOLTAGE                2.5  // 2.5V reference VDDA
120
-
121
-//
122
-// MicroSD card
123
-//
124
-#define SD_MOSI_PIN                           23
125
-#define SD_MISO_PIN                           19
126
-#define SD_SCK_PIN                            18
127
-#define SDSS                                   5
128
-#define SD_DETECT_PIN                         34  // IO34 default is SD_DET signal (Jump to SDDET)
129
-#define USES_SHARED_SPI                           // SPI is shared by SD card with TMC SPI drivers
119
+#define ADC_REFERENCE_VOLTAGE                  2.5  // 2.5V reference VDDA
130
 
120
 
131
 /**
121
 /**
132
  *                ------                                 ------
122
  *                ------                                 ------
157
 #define EXP2_09_PIN                           18
147
 #define EXP2_09_PIN                           18
158
 #define EXP2_10_PIN                           19
148
 #define EXP2_10_PIN                           19
159
 
149
 
160
-#if HAS_WIRED_LCD
150
+//
151
+// MicroSD card
152
+//
153
+//#define SD_MOSI_PIN                EXP2_05_PIN  // uses esp32 default 23
154
+//#define SD_MISO_PIN                EXP2_10_PIN  // uses esp32 default 19
155
+//#define SD_SCK_PIN                 EXP2_09_PIN  // uses esp32 default 18
156
+#define SDSS                         EXP2_07_PIN
157
+#define SD_DETECT_PIN                EXP2_04_PIN  // IO34 default is SD_DET signal (Jump to SDDET)
158
+#define USES_SHARED_SPI                           // SPI is shared by SD card with TMC SPI drivers
161
 
159
 
162
-  #define BEEPER_PIN                         149
163
-  #define BTN_ENC                             13
164
-  #define LCD_PINS_ENABLE                     21
165
-  #define LCD_PINS_RS                          4
166
-  #define BTN_EN1                             14
167
-  #define BTN_EN2                             12
160
+#if HAS_WIRED_LCD
161
+  #define BEEPER_PIN                 EXP1_10_PIN
162
+  #define LCD_PINS_ENABLE            EXP1_08_PIN
163
+  #define LCD_PINS_RS                EXP1_07_PIN
164
+  #define BTN_ENC                    EXP1_09_PIN
165
+  #define BTN_EN1                    EXP2_08_PIN
166
+  #define BTN_EN2                    EXP2_06_PIN
168
   #define LCD_BACKLIGHT_PIN                   -1
167
   #define LCD_BACKLIGHT_PIN                   -1
169
 
168
 
170
-  // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
171
   #if ENABLED(MKS_MINI_12864)
169
   #if ENABLED(MKS_MINI_12864)
172
-
173
-    //#define LCD_BACKLIGHT_PIN               -1
174
-    //#define LCD_RESET_PIN                   -1
175
-    #define DOGLCD_A0                         15
176
-    #define DOGLCD_CS                         16
177
-    //#define DOGLCD_SCK                      19
178
-    //#define DOGLCD_MOSI                     23
179
-
180
-    // Required for MKS_MINI_12864 with this board
181
-    //#define MKS_LCD12864B
182
-
183
-  #elif ENABLED(MKS_MINI_12864_V3)
184
-
185
-    #define LCD_PINS_DC              EXP1_07_PIN
170
+  // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
171
+    #define DOGLCD_CS                EXP1_05_PIN
172
+    #define DOGLCD_A0                EXP1_04_PIN
173
+    #define LCD_RESET_PIN                     -1
174
+  #elif ENABLED(FYSETC_MINI_12864_2_1)
175
+  // MKS_MINI_12864_V3, BTT_MINI_12864_V1, FYSETC_MINI_12864_2_1
186
     #define DOGLCD_CS                EXP1_08_PIN
176
     #define DOGLCD_CS                EXP1_08_PIN
187
-    #define DOGLCD_A0                LCD_PINS_DC
188
-    #define LCD_BACKLIGHT_PIN                 -1
177
+    #define DOGLCD_A0                EXP1_07_PIN
189
     #define LCD_RESET_PIN            EXP1_06_PIN
178
     #define LCD_RESET_PIN            EXP1_06_PIN
190
     #define NEOPIXEL_PIN             EXP1_05_PIN
179
     #define NEOPIXEL_PIN             EXP1_05_PIN
191
-    #define DOGLCD_MOSI              EXP2_05_PIN
192
-    #define DOGLCD_SCK               EXP2_09_PIN
193
     #if SD_CONNECTION_IS(ONBOARD)
180
     #if SD_CONNECTION_IS(ONBOARD)
194
       #define FORCE_SOFT_SPI
181
       #define FORCE_SOFT_SPI
195
     #endif
182
     #endif
196
-
197
-  #else // !MKS_MINI_12864
198
-
199
-    #define LCD_PINS_D4                        0
183
+  #else
184
+   #define LCD_PINS_D4               EXP1_06_PIN
200
     #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
185
     #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
201
-      #define LCD_PINS_D5                     16
202
-      #define LCD_PINS_D6                     15
203
-      #define LCD_PINS_D7                     17
186
+      #define LCD_PINS_D5            EXP1_05_PIN
187
+      #define LCD_PINS_D6            EXP1_04_PIN
188
+      #define LCD_PINS_D7            EXP1_03_PIN
204
     #endif
189
     #endif
205
-
206
     #define BOARD_ST7920_DELAY_1              96
190
     #define BOARD_ST7920_DELAY_1              96
207
     #define BOARD_ST7920_DELAY_2              48
191
     #define BOARD_ST7920_DELAY_2              48
208
     #define BOARD_ST7920_DELAY_3             600
192
     #define BOARD_ST7920_DELAY_3             600
209
-
210
-  #endif // !MKS_MINI_12864
211
-
193
+  #endif
212
 #endif // HAS_WIRED_LCD
194
 #endif // HAS_WIRED_LCD

Loading…
Cancel
Save