Prusa MINI Firmware overview
pins_STM32F4.h
Go to the documentation of this file.
1 /**
2  * Marlin 3D Printer Firmware
3  * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4  *
5  * Based on Sprinter and grbl.
6  * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 #pragma once
23 
24 /**
25  * To build with Arduino IDE use "Discovery F407VG"
26  * To build with PlatformIO use environment "STM32F4"
27  */
28 #if !defined(STM32F4) && !defined(STM32F4xx)
29  #error "Oops! Select an STM32F4 board in 'Tools > Board.'"
30 #elif HOTENDS > 2 || E_STEPPERS > 2
31  #error "STM32F4 supports up to 2 hotends / E-steppers."
32 #endif
33 
34 #define BOARD_INFO_NAME "Misc. STM32F4"
35 #define DEFAULT_MACHINE_NAME "STM32F407VET6"
36 
37 //#define I2C_EEPROM
38 
39 #ifndef E2END
40  #define E2END 0xFFF // 4KB
41 #endif
42 
43 // Ignore temp readings during development.
44 //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
45 
46 //
47 // Limit Switches
48 //
49 #define X_MIN_PIN PE0
50 #define X_MAX_PIN -1
51 #define Y_MIN_PIN PE1
52 #define Y_MAX_PIN -1
53 #define Z_MIN_PIN PE14
54 #define Z_MAX_PIN -1
55 
56 //
57 // Z Probe (when not Z_MIN_PIN)
58 //
59 
60 //#ifndef Z_MIN_PROBE_PIN
61 // #define Z_MIN_PROBE_PIN PA4
62 //#endif
63 
64 //
65 // Steppers
66 //
67 
68 #define X_STEP_PIN PD3
69 #define X_DIR_PIN PD2
70 #define X_ENABLE_PIN PD0
71 //#ifndef X_CS_PIN
72 // #define X_CS_PIN PD1
73 //#endif
74 
75 #define Y_STEP_PIN PE11
76 #define Y_DIR_PIN PE10
77 #define Y_ENABLE_PIN PE13
78 //#ifndef Y_CS_PIN
79 // #define Y_CS_PIN PE12
80 //#endif
81 
82 #define Z_STEP_PIN PD6
83 #define Z_DIR_PIN PD7
84 #define Z_ENABLE_PIN PD4
85 //#ifndef Z_CS_PIN
86 // #define Z_CS_PIN PD5
87 //#endif
88 
89 #define E0_STEP_PIN PB5
90 #define E0_DIR_PIN PB6
91 #define E0_ENABLE_PIN PB3
92 //#ifndef E0_CS_PIN
93 // #define E0_CS_PIN PB4
94 //#endif
95 
96 #define E1_STEP_PIN PE4
97 #define E1_DIR_PIN PE2
98 #define E1_ENABLE_PIN PE3
99 //#ifndef E1_CS_PIN
100 // #define E1_CS_PIN PE5
101 //#endif
102 
103 #define SCK_PIN PA5
104 #define MISO_PIN PA6
105 #define MOSI_PIN PA7
106 
107 //
108 // Temperature Sensors
109 //
110 
111 #define TEMP_0_PIN PC0 // Analog Input
112 #define TEMP_1_PIN PC1 // Analog Input
113 #define TEMP_BED_PIN PC2 // Analog Input
114 
115 //
116 // Heaters / Fans
117 //
118 
119 #define HEATER_0_PIN PA1
120 #define HEATER_1_PIN PA2
121 #define HEATER_BED_PIN PA0
122 
123 #ifndef FAN_PIN
124  #define FAN_PIN PC6
125 #endif
126 #define FAN1_PIN PC7
127 #define FAN2_PIN PC8
128 
129 #define ORIG_E0_AUTO_FAN_PIN FAN1_PIN // Use this by NOT overriding E0_AUTO_FAN_PIN
130 
131 //
132 // Misc. Functions
133 //
134 
135 //#define CASE_LIGHT_PIN_CI PF13
136 //#define CASE_LIGHT_PIN_DO PF14
137 //#define NEOPIXEL_PIN PF13
138 
139 //
140 // Průša i3 MK2 Multi Material Multiplexer Support
141 //
142 
143 //#define E_MUX0_PIN PG3
144 //#define E_MUX1_PIN PG4
145 
146 //
147 // Servos
148 //
149 
150 //#define SERVO0_PIN PE13
151 //#define SERVO1_PIN PE14
152 
153 
154 #define SDSS PE7
155 #define SS_PIN PE7
156 #define LED_PIN PB7 //Alive
157 #define PS_ON_PIN PA10
158 #define KILL_PIN PA8
159 #define PWR_LOSS PA4 //Power loss / nAC_FAULT
160 
161 //
162 // LCD / Controller
163 //
164 
165 #define SD_DETECT_PIN PA15
166 #define BEEPER_PIN PC9
167 #define LCD_PINS_RS PE9
168 #define LCD_PINS_ENABLE PE8
169 #define LCD_PINS_D4 PB12
170 #define LCD_PINS_D5 PB13
171 #define LCD_PINS_D6 PB14
172 #define LCD_PINS_D7 PB15
173 #define BTN_EN1 PC4
174 #define BTN_EN2 PC5
175 #define BTN_ENC PC3
176 
177 //
178 // Filament runout
179 //
180 
181 #define FIL_RUNOUT_PIN PA3
182 
183 //
184 // ST7920 Delays
185 //
186 #ifndef ST7920_DELAY_1
187  #define ST7920_DELAY_1 DELAY_NS(96)
188 #endif
189 
190 #ifndef ST7920_DELAY_2
191  #define ST7920_DELAY_2 DELAY_NS(48)
192 #endif
193 
194 #ifndef ST7920_DELAY_3
195  #define ST7920_DELAY_3 DELAY_NS(715)
196 #endif