🔨 Enhance Lerdge pins, TFTs, and variants (#22658)

This commit is contained in:
Tanguy Pruvot
2021-09-02 01:55:36 +02:00
committed by Scott Lahteine
parent 105fd73c28
commit 61364906b3
28 changed files with 233 additions and 222 deletions

View File

@ -427,10 +427,10 @@
#define TFT_DRIVER ST7796
#endif
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION 63934
#define XPT2046_X_CALIBRATION 63934
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION 63598
#define XPT2046_Y_CALIBRATION 63598
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET -1

View File

@ -72,42 +72,43 @@
#define X_DIR_PIN PB10
#define X_ENABLE_PIN PG0
//#ifndef X_CS_PIN
// #define X_CS_PIN PE0
// #define X_CS_PIN PB2
//#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 PE2
//#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 PE3
//#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 PE4
//#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 PE1
//#endif
//#define E2_STEP_PIN PF4 // best guess
//#define E2_DIR_PIN PF3 // best guess
//#define E2_ENABLE_PIN PF5 // best guess
//#ifndef E2_CS_PIN
// #define E2_CS_PIN PB2 // best guess
//#define Z2_STEP_PIN PF4
//#define Z2_DIR_PIN PF3
//#define Z2_ENABLE_PIN PF5
//#define Z2_STOP_PIN PG2
//#ifndef Z2_CS_PIN
// #define Z2_CS_PIN PE0
//#endif
#if HAS_TMC_UART
@ -144,12 +145,17 @@
#ifndef E1_SERIAL_RX_PIN
#define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
#endif
// Ex-motor can be any... X2/Y2/Z2 or E2
#ifndef EX_SERIAL_TX_PIN
#define E2_SERIAL_TX_PIN PE0
#define EX_SERIAL_TX_PIN PE0
#endif
#ifndef EX_SERIAL_RX_PIN
#define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
#define EX_SERIAL_RX_PIN EX_SERIAL_TX_PIN
#endif
//#define Z2_SERIAL_RX_PIN EX_SERIAL_RX_PIN
//#define Z2_SERIAL_TX_PIN EX_SERIAL_TX_PIN
//#define E2_SERIAL_RX_PIN EX_SERIAL_RX_PIN
//#define E2_SERIAL_TX_PIN EX_SERIAL_TX_PIN
// Reduce baud rate to improve software serial reliability
#define TMC_BAUD_RATE 19200
#endif
@ -193,8 +199,8 @@
//
// LED / Lighting
//
//#define CASE_LIGHT_PIN_CI -1
//#define CASE_LIGHT_PIN_DO -1
#define LED_PIN PA15 // Status LED
//#define CASE_LIGHT_PIN PB6 // LED Ribbon Connector (PWM TIM4_CH1)
//#define NEOPIXEL_PIN -1
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN PB8 // swap R and G pin for compatibility with real wires
@ -211,44 +217,54 @@
//
#define SDIO_SUPPORT
#define SDIO_CLOCK 4800000
#define SD_DETECT_PIN PA8
#if DISABLED(SDIO_SUPPORT)
#define SOFTWARE_SPI
#define SD_SCK_PIN PC12
#define SD_MISO_PIN PC8
#define SD_MOSI_PIN PD2
#define SD_SS_PIN PC11
#define SDSS PC11
#endif
//
// Misc. Functions
//
#define SDSS PC11
#define LED_PIN PA15 // Alive
#define PS_ON_PIN PA4
#define KILL_PIN -1
#define POWER_LOSS_PIN PA4 // Power-loss / nAC_FAULT
#define SD_SCK_PIN PC12
#define SD_MISO_PIN PC8
#define SD_MOSI_PIN PD2
#define SD_SS_PIN PC11
#define SD_DETECT_PIN PA8
#define BEEPER_PIN PC7
//
// TFT with FSMC interface
//
#if HAS_FSMC_TFT
//#define TFT_DRIVER LERDGE_ST7796
#ifndef TFT_DRIVER
#define TFT_DRIVER ST7796
#endif
#define ST7796S_INVERTED
#define TFT_RESET_PIN PD6
#define TFT_BACKLIGHT_PIN PD3
#define TFT_CS_PIN PD7
#define TFT_RS_PIN PD11
#define FSMC_CS_PIN PD7
#define FSMC_RS_PIN PD11
#define TFT_CS_PIN FSMC_CS_PIN
#define TFT_RS_PIN FSMC_RS_PIN
#define TOUCH_CS_PIN PG15
#define TOUCH_SCK_PIN PB3
#define TOUCH_MOSI_PIN PB5
#define TOUCH_MISO_PIN PB4
#define TOUCH_INT_PIN PG12
#endif
#if IS_NEWPANEL
#define BTN_EN1 PG10
#define BTN_EN2 PG11
#define BEEPER_PIN PC7
#define BTN_EN1 PG11
#define BTN_EN2 PG10
#define BTN_ENC PG9
#ifndef ENCODER_STEPS_PER_MENU_ITEM
#define ENCODER_STEPS_PER_MENU_ITEM 2
#endif
#endif

View File

@ -31,8 +31,6 @@
#define STEP_TIMER 4
#define TEMP_TIMER 2
//#define I2C_EEPROM
// USB Flash Drive support
#define HAS_OTG_USB_HOST_SUPPORT
@ -150,7 +148,6 @@
//
// Misc. Functions
//
#define SDSS PC11 // SD is working using SDIO, not sure if this definition is needed?
#define LED_PIN PC6 // Mainboard soldered green LED
#define PS_ON_PIN PB2 // Board has a power module connector
#define KILL_PIN -1 // There is no reset button on the LCD
@ -161,23 +158,25 @@
//
#define SDIO_SUPPORT
#define SDIO_CLOCK 4800000
#define SD_SCK_PIN PC12
#define SD_MISO_PIN PC8
#define SD_MOSI_PIN PD2
#define SD_SS_PIN PC11
#define SD_DETECT_PIN PG15
#if DISABLED(SDIO_SUPPORT)
#define SOFTWARE_SPI
#define SD_SCK_PIN PC12
#define SD_MISO_PIN PC8
#define SD_MOSI_PIN PD2
#define SD_SS_PIN PC11
#define SDSS PC11
#endif
//
// Persistent Storage
// If no option is selected below the SD Card will be used
// (this section modelled after pins_LONGER3D_LK.h)
// Warning: Not tested yet! Pins traced with multimeter, mistakes are possible
//#define SPI_EEPROM
// Prefer the I2C option (F-RAM) to store Marlin settings, SPI option is not working yet
#if ENABLED(SPI_EEPROM)
// Lerdge has an SPI EEPROM Winbond W25Q128 (128Mbits) https://www.pjrc.com/teensy/W25Q128FV.pdf
//#define SPI_EEPROM
//#define I2C_EEPROM
#if ENABLED(SPI_EEPROM) // SPI EEPROM Winbond W25Q128 (128Mbits) https://www.pjrc.com/teensy/W25Q128FV.pdf
#define SPI_CHAN_EEPROM1 1
#define SPI_EEPROM1_CS_PIN PB12 // datasheet: /CS pin, found with multimeter, not tested
#define EEPROM_SCK_PIN PB13 // datasheet: CLK pin, found with multimeter, not tested
@ -185,29 +184,45 @@
#define EEPROM_MOSI_PIN PB15 // datasheet: DI pin, found with multimeter, not tested
#define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet)
#define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64KB for now...
#elif ENABLED(I2C_EEPROM) // FM24CL64BG (CYP1813) 64Kbit F-RAM
#define SOFT_I2C_EEPROM // Force the use of Software I2C
#define I2C_SDA_PIN PG13
#define I2C_SCL_PIN PG14 // To be confirmed on the Lerdge S, but probably same as the K
#define MARLIN_EEPROM_SIZE 0x10000
#else
#define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM
#endif
//
// LCD / Controller
// TFT with FSMC interface
//
#if HAS_FSMC_TFT
#ifndef TFT_DRIVER
#define TFT_DRIVER ST7796
#endif
#define ST7796S_INVERTED
// The LCD is initialized in FSMC mode
#define BEEPER_PIN PD13
#define TFT_RESET_PIN PD6
#define TFT_BACKLIGHT_PIN PD3
#define BTN_EN1 PC14
#define BTN_EN2 PC15
#define BTN_ENC PC13
#define FSMC_CS_PIN PD7
#define FSMC_RS_PIN PD11
#define TFT_RESET_PIN PD6
#define TFT_BACKLIGHT_PIN PD3
#define TFT_CS_PIN FSMC_CS_PIN
#define TFT_RS_PIN FSMC_RS_PIN
#define TFT_CS_PIN PD7 // TFT works
#define TFT_RS_PIN PD11 // TFT works
#define TOUCH_CS_PIN PB6
#define TOUCH_SCK_PIN PB3
#define TOUCH_MOSI_PIN PB5
#define TOUCH_MISO_PIN PB4
#endif
// There is touch, but calibration is off
#define TOUCH_CS_PIN PB6
#define TOUCH_SCK_PIN PB3
#define TOUCH_MOSI_PIN PB5
#define TOUCH_MISO_PIN PB4
#if IS_NEWPANEL
#define BEEPER_PIN PD13
#define BTN_EN1 PC15
#define BTN_EN2 PC14
#define BTN_ENC PC13
#ifndef ENCODER_STEPS_PER_MENU_ITEM
#define ENCODER_STEPS_PER_MENU_ITEM 2
#endif
#endif

View File

@ -113,10 +113,24 @@
//#define CASE_LIGHT_PIN_DO -1
//#define NEOPIXEL_PIN -1
//
// SD support (On board)
//
#define SDIO_SUPPORT
#define SD_DETECT_PIN PA8
#define SDIO_CLOCK 4800000
#if DISABLED(SDIO_SUPPORT)
#define SOFTWARE_SPI
#define SD_SCK_PIN PC12
#define SD_MISO_PIN PC8
#define SD_MOSI_PIN PD2
#define SD_SS_PIN PC11
#define SDSS PC11
#endif
//
// Misc. Functions
//
#define SDSS PC11
#define LED_PIN PC7 // Alive
#define PS_ON_PIN -1
#define KILL_PIN -1
@ -124,36 +138,36 @@
// Lerdge supports auto-power off and power loss sense through a single pin.
#define POWER_LOSS_PIN PC14 // Power-loss / nAC_FAULT
#define SD_SCK_PIN PC12
#define SD_MISO_PIN PC8
#define SD_MOSI_PIN PD2
#define SD_SS_PIN PC11
//
// SD support
// TFT with FSMC interface
//
#define SDIO_SUPPORT
#define SD_DETECT_PIN PA8
#define SDIO_CLOCK 4800000
#if HAS_FSMC_TFT
#ifndef TFT_DRIVER
#define TFT_DRIVER ST7796
#endif
#define ST7796S_INVERTED
//
// LCD / Controller
//
#define FSMC_CS_PIN PD7
#define FSMC_RS_PIN PD11
// The LCD is initialized in FSMC mode
#define BEEPER_PIN PD12
#define TFT_RESET_PIN PD6
#define TFT_BACKLIGHT_PIN PD3
#define BTN_EN1 PE3
#define BTN_EN2 PE4
#define BTN_ENC PE2
#define TFT_CS_PIN FSMC_CS_PIN
#define TFT_RS_PIN FSMC_RS_PIN
#define TFT_RESET_PIN PD6
#define TFT_BACKLIGHT_PIN PD3
#define TOUCH_CS_PIN PB6
#define TOUCH_SCK_PIN PB3
#define TOUCH_MOSI_PIN PB5
#define TOUCH_MISO_PIN PB4
#endif
#define TFT_CS_PIN PD7
#define TFT_RS_PIN PD11
#define TOUCH_CS_PIN PB6
#define TOUCH_SCK_PIN PB3
#define TOUCH_MOSI_PIN PB5
#define TOUCH_MISO_PIN PB4
#if IS_NEWPANEL
#define BEEPER_PIN PD12
#define BTN_EN1 PE4
#define BTN_EN2 PE3
#define BTN_ENC PE2
#ifndef ENCODER_STEPS_PER_MENU_ITEM
#define ENCODER_STEPS_PER_MENU_ITEM 2
#endif
#endif