Browse Source

FYSETC Mini 12864 for HAL_STM32 (#14639)

Karl Andersson 6 years ago
parent
commit
d472934a70
2 changed files with 60 additions and 22 deletions
  1. 7
    0
      Marlin/src/lcd/dogm/HAL_LCD_com_defines.h
  2. 53
    22
      Marlin/src/pins/stm32/pins_ARMED.h

+ 7
- 0
Marlin/src/lcd/dogm/HAL_LCD_com_defines.h View File

@@ -40,6 +40,13 @@
40 40
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn
41 41
     uint8_t u8g_com_arduino_st7920_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
42 42
     #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn
43
+  #elif defined(ARDUINO_ARCH_STM32)
44
+    uint8_t u8g_com_arduino_std_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
45
+    #define U8G_COM_HAL_SW_SPI_FN u8g_com_arduino_std_sw_spi_fn    
46
+    uint8_t u8g_com_stm32duino_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);   
47
+    #define U8G_COM_HAL_HW_SPI_FN u8g_com_stm32duino_hw_spi_fn
48
+    uint8_t u8g_com_arduino_st7920_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
49
+    #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn    
43 50
   #else
44 51
     uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
45 52
     #define U8G_COM_HAL_SW_SPI_FN  u8g_com_HAL_AVR_sw_sp_fn // AVR ?

+ 53
- 22
Marlin/src/pins/stm32/pins_ARMED.h View File

@@ -43,19 +43,23 @@
43 43
 //
44 44
 // Limit Switches
45 45
 //
46
-#define X_MIN_PIN          PE0
47
-#define X_MAX_PIN          -1
48
-#define Y_MIN_PIN          PE1
49
-#define Y_MAX_PIN          -1
50
-#define Z_MIN_PIN          PE14
51
-#define Z_MAX_PIN          -1
46
+#define X_STOP_PIN         PE0
47
+#define Y_STOP_PIN         PE1
48
+#define Z_STOP_PIN         PE14
52 49
 
53 50
 //
54 51
 // Z Probe (when not Z_MIN_PIN)
55 52
 //
56
-// #ifndef Z_MIN_PROBE_PIN
57
-//   #define Z_MIN_PROBE_PIN  PA4
58
-// #endif
53
+//#ifndef Z_MIN_PROBE_PIN
54
+//  #define Z_MIN_PROBE_PIN  PA4
55
+//#endif
56
+
57
+//
58
+// Filament Runout Sensor
59
+//
60
+#ifndef FIL_RUNOUT_PIN
61
+  #define FIL_RUNOUT_PIN   PA3
62
+#endif
59 63
 
60 64
 //
61 65
 // Steppers
@@ -85,13 +89,12 @@
85 89
 
86 90
 #define E0_STEP_PIN        PB5
87 91
 #define E0_DIR_PIN         PB6
88
-#define E0_CS_PIN          PB4
89
-
90 92
 #ifdef ARMED_V1_1
91 93
   #define E0_ENABLE_PIN    PC12
92 94
 #else
93 95
   #define E0_ENABLE_PIN    PB3
94 96
 #endif
97
+#define E0_CS_PIN          PB4
95 98
 
96 99
 #ifdef ARMED_SWAP_X_E1
97 100
   #define E1_STEP_PIN      PD3
@@ -137,22 +140,50 @@
137 140
 //
138 141
 #define SD_DETECT_PIN      PA15
139 142
 #define BEEPER_PIN         PC9
140
-#define LCD_PINS_RS        PE9
141
-#define LCD_PINS_ENABLE    PE8
142
-#define LCD_PINS_D4        PB12
143
-#define LCD_PINS_D5        PB13
144
-#define LCD_PINS_D6        PB14
145
-#define LCD_PINS_D7        PB15
143
+
144
+#if ENABLED(FYSETC_MINI_12864)
145
+  //
146
+  // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8
147
+  //
148
+  #define DOGLCD_A0        PE9
149
+  #define DOGLCD_CS        PE8
150
+
151
+  #define LCD_BACKLIGHT_PIN -1
152
+
153
+  #define LCD_RESET_PIN    PB12   // Must be high or open for LCD to operate normally.
154
+
155
+  #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
156
+    #ifndef RGB_LED_R_PIN
157
+      #define RGB_LED_R_PIN PB13
158
+    #endif
159
+    #ifndef RGB_LED_G_PIN
160
+      #define RGB_LED_G_PIN PB14
161
+    #endif
162
+    #ifndef RGB_LED_B_PIN
163
+      #define RGB_LED_B_PIN PB15
164
+    #endif
165
+  #elif ENABLED(FYSETC_MINI_12864_2_1)
166
+    #define NEOPIXEL_PIN   PB13
167
+  #endif
168
+#else
169
+  #define LCD_PINS_RS      PE9
170
+  #define LCD_PINS_ENABLE  PE8
171
+  #define LCD_PINS_D4      PB12
172
+  #define LCD_PINS_D5      PB13
173
+  #define LCD_PINS_D6      PB14
174
+  #define LCD_PINS_D7      PB15
175
+
176
+  #if ENABLED(MKS_MINI_12864)
177
+    #define DOGLCD_CS      PB13
178
+    #define DOGLCD_A0      PB14
179
+  #endif
180
+#endif
181
+
146 182
 #define BTN_EN1            PC4
147 183
 #define BTN_EN2            PC5
148 184
 #define BTN_ENC            PC3
149 185
 
150 186
 //
151
-// Filament runout detection
152
-//
153
-#define FIL_RUNOUT_PIN     PA3
154
-
155
-//
156 187
 // Extension pins
157 188
 //
158 189
 #define EXT0_PIN           PB0

Loading…
Cancel
Save