5 #define ELECTRONICS "EINSy_10a"
8 #ifndef __AVR_ATmega2560__
9 #error Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu.
15 #define AMBIENT_THERMISTOR
16 #define PINDA_THERMISTOR
18 #define PRUSA_SN_SUPPORT
22 #define WATCHDOG_SOFT_RESET_VALUE WDTO_15MS
24 #define XFLASH_PIN_CS 32
26 #define X_TMC2130_CS 41
27 #define X_TMC2130_DIAG 64
33 #define X_MAX_PIN X_TMC2130_DIAG
34 #define X_ENABLE_PIN 29
38 #define Y_TMC2130_CS 39
39 #define Y_TMC2130_DIAG 69
45 #define Y_MAX_PIN Y_TMC2130_DIAG
46 #define Y_ENABLE_PIN 28
50 #define Z_TMC2130_CS 67
51 #define Z_TMC2130_DIAG 68
57 #define Z_ENABLE_PIN 27
61 #define HEATER_BED_PIN 4
62 #define TEMP_BED_PIN 2
64 #define HEATER_0_PIN 3
67 #define HEATER_1_PIN -1
70 #define HEATER_2_PIN -1
73 #define TEMP_AMBIENT_PIN 6
75 #define TEMP_PINDA_PIN 3
77 #define VOLT_PWR_PIN 4
78 #define VOLT_BED_PIN 9
85 #define E0_TMC2130_CS 66
86 #define E0_TMC2130_DIAG 65
87 #define E0_STEP_PIN 34
89 #define E0_ENABLE_PIN 26
100 #define SUICIDE_PIN -1
107 #define LCD_PINS_RS 82
108 #define LCD_PINS_ENABLE 61
109 #define LCD_PINS_D4 59
110 #define LCD_PINS_D5 70
111 #define LCD_PINS_D6 85
112 #define LCD_PINS_D7 71
119 #define SDCARDDETECT 15
124 #define IR_SENSOR_PIN 62
126 #define MMU_RST_PIN 76
130 #define LOGIC_ANALYZER_CH0 X_MIN_PIN
131 #define LOGIC_ANALYZER_CH1 Y_MIN_PIN
132 #define LOGIC_ANALYZER_CH2 53
136 #define LOGIC_ANALYZER_CH3 73
138 #define WRITE_LOGIC_ANALYZER_CH4(value) if (value) PORTK |= (1 << 0); else PORTK &= ~(1 << 0)
139 #define LOGIC_ANALYZER_CH5 16
140 #define LOGIC_ANALYZER_CH6 17
141 #define LOGIC_ANALYZER_CH7 76
143 #define LOGIC_ANALYZER_CH0_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH0); WRITE(LOGIC_ANALYZER_CH0, false); } while (0)
144 #define LOGIC_ANALYZER_CH1_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH1); WRITE(LOGIC_ANALYZER_CH1, false); } while (0)
145 #define LOGIC_ANALYZER_CH2_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH2); WRITE(LOGIC_ANALYZER_CH2, false); } while (0)
146 #define LOGIC_ANALYZER_CH3_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH3); WRITE(LOGIC_ANALYZER_CH3, false); } while (0)
147 #define LOGIC_ANALYZER_CH4_ENABLE do { DDRK |= 1 << 0; WRITE_LOGIC_ANALYZER_CH4(false); } while (0)
148 #define LOGIC_ANALYZER_CH5_ENABLE do { cbi(UCSR2B, TXEN2); cbi(UCSR2B, RXEN2); cbi(UCSR2B, RXCIE2); SET_OUTPUT(LOGIC_ANALYZER_CH5); WRITE(LOGIC_ANALYZER_CH5, false); } while (0)
149 #define LOGIC_ANALYZER_CH6_ENABLE do { cbi(UCSR2B, TXEN2); cbi(UCSR2B, RXEN2); cbi(UCSR2B, RXCIE2); SET_OUTPUT(LOGIC_ANALYZER_CH6); WRITE(LOGIC_ANALYZER_CH6, false); } while (0)
150 #define LOGIC_ANALYZER_CH7_ENABLE do { SET_OUTPUT(LOGIC_ANALYZER_CH7); WRITE(LOGIC_ANALYZER_CH7, false); } while (0)
154 #define LOGIC_ANALYZER_SERIAL_TX_ENABLE do { UBRR2H = 0; UBRR2L = 0; UCSR2B = (1 << TXEN2) | (1 << UCSZ02); UCSR2C = 0x06; } while (0)
156 #define LOGIC_ANALYZER_SERIAL_TX_WRITE_NC(C) do { if (C & 0x100) UCSR2B |= 1; else UCSR2B &= ~1; UDR2 = C; } while (0)
157 #define LOGIC_ANALYZER_SERIAL_TX_WRITE(C) do { \
159 while (!(UCSR2A & (1<<UDRE2))); \
161 LOGIC_ANALYZER_SERIAL_TX_WRITE_NC(C); \