Skip to content

Commit

Permalink
Add Lerdge S,X,K (#18302)
Browse files Browse the repository at this point in the history
  • Loading branch information
xC0000005 authored Jul 6, 2020
1 parent af8be58 commit 6f14d2d
Show file tree
Hide file tree
Showing 29 changed files with 1,778 additions and 160 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
- rumba32
- mks_robin_pro
- STM32F103RET6_creality
- LERDGEX

# Put lengthy tests last

Expand Down
11 changes: 6 additions & 5 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,12 @@
#define BOARD_BTT_BTT002_V1_0 4211 // BigTreeTech BTT002 v1.0 (STM32F407VG)
#define BOARD_BTT_GTR_V1_0 4212 // BigTreeTech GTR v1.0 (STM32F407IGT)
#define BOARD_LERDGE_K 4213 // Lerdge K (STM32F407ZG)
#define BOARD_LERDGE_X 4214 // Lerdge X (STM32F407VE)
#define BOARD_VAKE403D 4215 // VAkE 403D (STM32F446VET6)
#define BOARD_FYSETC_S6 4216 // FYSETC S6 board
#define BOARD_FLYF407ZG 4217 // FLYF407ZG board (STM32F407ZG)
#define BOARD_MKS_ROBIN2 4218 // MKS_ROBIN2 (STM32F407ZE)
#define BOARD_LERDGE_S 4214 // Lerdge S (STM32F407VE)
#define BOARD_LERDGE_X 4215 // Lerdge X (STM32F407VE)
#define BOARD_VAKE403D 4216 // VAkE 403D (STM32F446VET6)
#define BOARD_FYSETC_S6 4217 // FYSETC S6 board
#define BOARD_FLYF407ZG 4218 // FLYF407ZG board (STM32F407ZG)
#define BOARD_MKS_ROBIN2 4219 // MKS_ROBIN2 (STM32F407ZE)

//
// ARM Cortex M7
Expand Down
10 changes: 9 additions & 1 deletion Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,12 +1598,20 @@ void Temperature::init() {
#if MB(RUMBA)
// Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
#define _AD(N) ANY(HEATER_##N##_USES_AD595, HEATER_##N##_USES_AD8495)
#if _AD(0) || _AD(1) || _AD(2) || _AD(BED) || _AD(CHAMBER)
#if _AD(0) || _AD(1) || _AD(2) || _AD(BED) || _AD(CHAMBER)
MCUCR = _BV(JTD);
MCUCR = _BV(JTD);
#endif
#endif

// Thermistor activation by MCU pin
#if PIN_EXISTS(TEMP_0_TR_ENABLE_PIN)
OUT_WRITE(TEMP_0_TR_ENABLE_PIN, ENABLED(HEATER_0_USES_MAX6675));
#endif
#if PIN_EXISTS(TEMP_1_TR_ENABLE_PIN)
OUT_WRITE(TEMP_1_TR_ENABLE_PIN, ENABLED(HEATER_1_USES_MAX6675));
#endif

#if BOTH(PIDTEMP, PID_EXTRUSION_SCALING)
last_e_position = 0;
#endif
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,10 @@
#include "stm32f4/pins_BTT_BTT002_V1_0.h" // STM32F4 env:BIGTREE_BTT002
#elif MB(LERDGE_K)
#include "stm32f4/pins_LERDGE_K.h" // STM32F4 env:STM32F4
#elif MB(LERDGE_S)
#include "stm32f4/pins_LERDGE_S.h" // STM32F4 env:LERDGE_S
#elif MB(LERDGE_X)
#include "stm32f4/pins_LERDGE_X.h" // STM32F4 env:STM32F4
#include "stm32f4/pins_LERDGE_X.h" // STM32F4 env:LERDGE_X
#elif MB(VAKE403D)
#include "stm32f4/pins_VAKE403D.h" // STM32F4 env:STM32F4
#elif MB(FYSETC_S6)
Expand Down
95 changes: 45 additions & 50 deletions Marlin/src/pins/stm32f4/pins_LERDGE_K.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@

#define I2C_EEPROM

// Ignore temp readings during develpment.
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000

//
// Servos
//
//#define SERVO0_PIN PD12
//#define SERVO0_PIN PB11

//
// Limit Switches
Expand All @@ -48,14 +45,14 @@
// Z Probe (when not Z_MIN_PIN)
//
//#ifndef Z_MIN_PROBE_PIN
// #define Z_MIN_PROBE_PIN PB15
// #define Z_MIN_PROBE_PIN PG6
//#endif

//
// Filament runout
//
#define FIL_RUNOUT_PIN PE6
#define FIL_RUNOUT2_PIN PE7
#define FIL_RUNOUT_PIN PE5
#define FIL_RUNOUT2_PIN PE6

//
// Steppers
Expand All @@ -64,35 +61,35 @@
#define X_DIR_PIN PB10
#define X_ENABLE_PIN PG0
//#ifndef X_CS_PIN
// #define X_CS_PIN PE0
// #define X_CS_PIN PE0
//#endif

#define Y_STEP_PIN PF14
#define Y_DIR_PIN PF15
#define Y_ENABLE_PIN PF13
//#ifndef Y_CS_PIN
// #define Y_CS_PIN PE1
// #define Y_CS_PIN PE1
//#endif

#define Z_STEP_PIN PF11
#define Z_DIR_PIN PF12
#define Z_ENABLE_PIN PC5
//#ifndef Z_CS_PIN
// #define Z_CS_PIN PE2
// #define Z_CS_PIN PE2
//#endif

#define E0_STEP_PIN PC14
#define E0_DIR_PIN PC13
#define E0_ENABLE_PIN PC15
//#ifndef E0_CS_PIN
// #define E0_CS_PIN PE3
// #define E0_CS_PIN PE3
//#endif

#define E1_STEP_PIN PF1
#define E1_DIR_PIN PF0
#define E1_ENABLE_PIN PF2
//#ifndef E1_CS_PIN
// #define E1_CS_PIN PE4
// #define E1_CS_PIN PE4
//#endif

//
Expand All @@ -102,6 +99,12 @@
#define TEMP_1_PIN PC2 // Analog Input
#define TEMP_BED_PIN PC0 // Analog Input

// Lergde-K can choose thermocouple/thermistor mode in software.
// For use with thermistors, these pins must be OUT/LOW.
// This is done automatically.
#define TEMP_0_TR_ENABLE_PIN PF10
#define TEMP_1_TR_ENABLE_PIN PF9

//
// Heaters / Fans
//
Expand All @@ -110,10 +113,10 @@
#define HEATER_BED_PIN PA2

#ifndef FAN_PIN
#define FAN_PIN PC15
#define FAN_PIN PF7
#endif
#define FAN1_PIN PF6
#define FAN2_PIN PF7
#define FAN2_PIN PF8

#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PF6
Expand All @@ -125,12 +128,15 @@
//#define CASE_LIGHT_PIN_CI -1
//#define CASE_LIGHT_PIN_DO -1
//#define NEOPIXEL_PIN -1

//
// Prusa i3 MK2 Multi-Material Multiplexer Support
//
//#define E_MUX0_PIN -1
//#define E_MUX1_PIN -1
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN PB7
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN PB8
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN PB9
#endif

//
// SD support
Expand All @@ -141,45 +147,34 @@
// Misc. Functions
//
#define SDSS PC11
#define LED_PIN PC7 // Alive
#define LED_PIN PA15 // Alive
#define PS_ON_PIN -1
#define KILL_PIN -1
#define POWER_LOSS_PIN -1 // Power-loss / nAC_FAULT
#define POWER_LOSS_PIN PA4 // Power-loss / nAC_FAULT

#define SCK_PIN PC12
#define MISO_PIN PC8
#define MOSI_PIN PD2
#define SS_PIN PC11

#define SD_DETECT_PIN PA8
#define BEEPER_PIN PC7

//
// LCD / Controller
//

// TODO: Replace these with the correct FSMC pins, once known
#define SD_DETECT_PIN -1
#define BEEPER_PIN PD12
#define LCD_PINS_RS -1
#define LCD_PINS_ENABLE -1
#define LCD_PINS_D4 -1
#define LCD_PINS_D5 -1
#define LCD_PINS_D6 -1
#define LCD_PINS_D7 -1

#define BTN_EN1 PE3
#define BTN_EN2 PE4
#define BTN_ENC PE2

//
// ST7920 Delays
//
#if HAS_GRAPHICAL_LCD
#ifndef BOARD_ST7920_DELAY_1
#define BOARD_ST7920_DELAY_1 DELAY_NS(96)
#endif
#ifndef BOARD_ST7920_DELAY_2
#define BOARD_ST7920_DELAY_2 DELAY_NS(48)
#endif
#ifndef BOARD_ST7920_DELAY_3
#define BOARD_ST7920_DELAY_3 DELAY_NS(715)
#endif
#endif
#define TFT_RESET_PIN PD6
#define TFT_BACKLIGHT_PIN PD3

#define TFT_CS_PIN PD7
#define TFT_RS_PIN PD11

#define TOUCH_CS_PIN PG15
#define TOUCH_SCK_PIN PB3
#define TOUCH_MOSI_PIN PB5
#define TOUCH_MISO_PIN PB4

#define BTN_EN1 PG10
#define BTN_EN2 PG11
#define BTN_ENC PG9
Loading

0 comments on commit 6f14d2d

Please sign in to comment.