浏览代码

FYSETC Mini 12864 for HAL_STM32 (#14639)

Karl Andersson 6 年前
父节点
当前提交
d472934a70
共有 2 个文件被更改,包括 60 次插入22 次删除
  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 查看文件

40
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn
40
     #define U8G_COM_HAL_HW_SPI_FN u8g_com_arduino_hw_spi_fn
41
     uint8_t u8g_com_arduino_st7920_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
41
     uint8_t u8g_com_arduino_st7920_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
42
     #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_arduino_st7920_spi_fn
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
   #else
50
   #else
44
     uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
51
     uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
45
     #define U8G_COM_HAL_SW_SPI_FN  u8g_com_HAL_AVR_sw_sp_fn // AVR ?
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 查看文件

43
 //
43
 //
44
 // Limit Switches
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
 // Z Probe (when not Z_MIN_PIN)
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
 // Steppers
65
 // Steppers
85
 
89
 
86
 #define E0_STEP_PIN        PB5
90
 #define E0_STEP_PIN        PB5
87
 #define E0_DIR_PIN         PB6
91
 #define E0_DIR_PIN         PB6
88
-#define E0_CS_PIN          PB4
89
-
90
 #ifdef ARMED_V1_1
92
 #ifdef ARMED_V1_1
91
   #define E0_ENABLE_PIN    PC12
93
   #define E0_ENABLE_PIN    PC12
92
 #else
94
 #else
93
   #define E0_ENABLE_PIN    PB3
95
   #define E0_ENABLE_PIN    PB3
94
 #endif
96
 #endif
97
+#define E0_CS_PIN          PB4
95
 
98
 
96
 #ifdef ARMED_SWAP_X_E1
99
 #ifdef ARMED_SWAP_X_E1
97
   #define E1_STEP_PIN      PD3
100
   #define E1_STEP_PIN      PD3
137
 //
140
 //
138
 #define SD_DETECT_PIN      PA15
141
 #define SD_DETECT_PIN      PA15
139
 #define BEEPER_PIN         PC9
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
 #define BTN_EN1            PC4
182
 #define BTN_EN1            PC4
147
 #define BTN_EN2            PC5
183
 #define BTN_EN2            PC5
148
 #define BTN_ENC            PC3
184
 #define BTN_ENC            PC3
149
 
185
 
150
 //
186
 //
151
-// Filament runout detection
152
-//
153
-#define FIL_RUNOUT_PIN     PA3
154
-
155
-//
156
 // Extension pins
187
 // Extension pins
157
 //
188
 //
158
 #define EXT0_PIN           PB0
189
 #define EXT0_PIN           PB0

正在加载...
取消
保存