From a9d18f0f57d7291d862fdfd11bf0684ba414f770 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 30 Dec 2020 22:00:36 -0600 Subject: [PATCH] SPI and pins cleanup --- .../dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp | 15 +- .../HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp | 3 - Marlin/src/HAL/LPC1768/tft/xpt2046.h | 2 +- .../u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp | 8 +- .../u8g/u8g_com_HAL_LPC1768_sw_spi.cpp | 8 +- .../STM32F1/dogm/u8g_com_stm32duino_swspi.cpp | 12 +- Marlin/src/HAL/STM32F1/tft/xpt2046.h | 2 +- Marlin/src/libs/L64XX/README.md | 2 +- .../src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 2 +- Marlin/src/pins/lpc1769/pins_FLY_CDY.h | 7 - Marlin/src/pins/stm32f1/pins_BEAST.h | 146 ++--------------- .../stm32f1/pins_BTT_SKR_MINI_E3_common.h | 2 +- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 10 +- Marlin/src/pins/stm32f1/pins_STM32F1R.h | 147 ++--------------- Marlin/src/pins/stm32f1/pins_STM3R_MINI.h | 148 ++---------------- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 30 ++-- Marlin/src/pins/stm32f4/pins_LERDGE_K.h | 2 +- Marlin/src/pins/stm32f4/pins_LERDGE_S.h | 96 ++++++------ Marlin/src/pins/stm32f4/pins_LERDGE_X.h | 2 +- .../variants/CHITU_F103/board/board.h | 3 - 20 files changed, 130 insertions(+), 517 deletions(-) diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp index be4b49c0f9..d07da15ad8 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp @@ -64,12 +64,11 @@ #include "../../../MarlinCore.h" -void spiBegin(); -void spiInit(uint8_t spiRate); -void spiSend(uint8_t b); -void spiSend(const uint8_t* buf, size_t n); +#ifndef LCD_SPI_SPEED + #define LCD_SPI_SPEED SPI_QUARTER_SPEED +#endif -#include "../../shared/Marduino.h" +#include "../../shared/HAL_SPI.h" #include "../fastio.h" void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) { @@ -100,11 +99,7 @@ uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va spiBegin(); - #ifndef SPI_SPEED - #define SPI_SPEED SPI_FULL_SPEED // use same SPI speed as SD card - #endif - spiInit(2); - + spiInit(LCD_SPI_SPEED); break; case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp index ea7204fa36..890546af58 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp @@ -59,9 +59,6 @@ #if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920) -#undef SPI_SPEED -#define SPI_SPEED 2 // About 2 MHz - #include "u8g_com_HAL_DUE_sw_spi_shared.h" #include "../../shared/Marduino.h" diff --git a/Marlin/src/HAL/LPC1768/tft/xpt2046.h b/Marlin/src/HAL/LPC1768/tft/xpt2046.h index 29db0b3fc4..223985f3d2 100644 --- a/Marlin/src/HAL/LPC1768/tft/xpt2046.h +++ b/Marlin/src/HAL/LPC1768/tft/xpt2046.h @@ -37,7 +37,7 @@ #define TOUCH_SCK_PIN SCK_PIN #endif #ifndef TOUCH_CS_PIN - #define TOUCH_CS_PIN CS_PIN + #define TOUCH_CS_PIN SS_PIN #endif #ifndef TOUCH_INT_PIN #define TOUCH_INT_PIN -1 diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp index 10d8494162..61211d9d88 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp @@ -62,9 +62,11 @@ #include #include #include "../../shared/Delay.h" +#include "../../shared/HAL_SPI.h" -#undef SPI_SPEED -#define SPI_SPEED 3 // About 1 MHz +#ifndef LCD_SPI_SPEED + #define LCD_SPI_SPEED SPI_EIGHTH_SPEED // About 1 MHz +#endif static pin_t SCK_pin_ST7920_HAL, MOSI_pin_ST7920_HAL_HAL; static uint8_t SPI_speed = 0; @@ -92,7 +94,7 @@ uint8_t u8g_com_HAL_LPC1768_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t ar u8g_SetPIOutput(u8g, U8G_PI_MOSI); u8g_Delay(5); - SPI_speed = swSpiInit(SPI_SPEED, SCK_pin_ST7920_HAL, MOSI_pin_ST7920_HAL_HAL); + SPI_speed = swSpiInit(LCD_SPI_SPEED, SCK_pin_ST7920_HAL, MOSI_pin_ST7920_HAL_HAL); u8g_SetPILevel(u8g, U8G_PI_CS, 0); u8g_SetPILevel(u8g, U8G_PI_SCK, 0); diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp index ca9d6ecfbe..7f38ec54af 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp @@ -60,9 +60,11 @@ #if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920) #include +#include "../../shared/HAL_SPI.h" -#undef SPI_SPEED -#define SPI_SPEED 2 // About 2 MHz +#ifndef LCD_SPI_SPEED + #define LCD_SPI_SPEED SPI_QUARTER_SPEED // About 2 MHz +#endif #include #include @@ -145,7 +147,7 @@ uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, u8g_SetPIOutput(u8g, U8G_PI_CS); u8g_SetPIOutput(u8g, U8G_PI_A0); if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPIOutput(u8g, U8G_PI_RESET); - SPI_speed = swSpiInit(SPI_SPEED, u8g->pin_list[U8G_PI_SCK], u8g->pin_list[U8G_PI_MOSI]); + SPI_speed = swSpiInit(LCD_SPI_SPEED, u8g->pin_list[U8G_PI_SCK], u8g->pin_list[U8G_PI_MOSI]); u8g_SetPILevel(u8g, U8G_PI_SCK, 0); u8g_SetPILevel(u8g, U8G_PI_MOSI, 0); break; diff --git a/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp b/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp index 60596054e8..784a80c29f 100644 --- a/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp +++ b/Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp @@ -23,12 +23,14 @@ #if BOTH(HAS_MARLINUI_U8GLIB, FORCE_SOFT_SPI) #include +#include "../../shared/HAL_SPI.h" -#undef SPI_SPEED -#define SPI_SPEED 0 // Fastest -//#define SPI_SPEED 2 // Slower +#ifndef LCD_SPI_SPEED + #define LCD_SPI_SPEED SPI_FULL_SPEED // Fastest + //#define LCD_SPI_SPEED SPI_QUARTER_SPEED // Slower +#endif -static uint8_t SPI_speed = SPI_SPEED; +static uint8_t SPI_speed = LCD_SPI_SPEED; static inline uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t miso_pin=-1) { LOOP_L_N(i, 8) { @@ -104,7 +106,7 @@ static uint8_t swSpiInit(const uint8_t spi_speed) { uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { switch (msg) { case U8G_COM_MSG_INIT: - SPI_speed = swSpiInit(SPI_SPEED); + SPI_speed = swSpiInit(LCD_SPI_SPEED); break; case U8G_COM_MSG_STOP: diff --git a/Marlin/src/HAL/STM32F1/tft/xpt2046.h b/Marlin/src/HAL/STM32F1/tft/xpt2046.h index 29db0b3fc4..223985f3d2 100644 --- a/Marlin/src/HAL/STM32F1/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32F1/tft/xpt2046.h @@ -37,7 +37,7 @@ #define TOUCH_SCK_PIN SCK_PIN #endif #ifndef TOUCH_CS_PIN - #define TOUCH_CS_PIN CS_PIN + #define TOUCH_CS_PIN SS_PIN #endif #ifndef TOUCH_INT_PIN #define TOUCH_INT_PIN -1 diff --git a/Marlin/src/libs/L64XX/README.md b/Marlin/src/libs/L64XX/README.md index c68d8ca0ed..d28bec5e67 100644 --- a/Marlin/src/libs/L64XX/README.md +++ b/Marlin/src/libs/L64XX/README.md @@ -16,7 +16,7 @@ This software assumes that all drivers are in one SPI daisy chain. - SDO of the last device is tied to MISO of the controller -- All devices share the same `SCK` and `SS_PIN` pins. The user must supply a macro to control the `RESET_PIN`(s). +- All devices share the same `SCK_PIN` and `SS_PIN` pins. The user must supply a macro to control the `RESET_PIN`(s). - Each L6470 passes the data it saw on its SDI to its neighbor on the **NEXT** SPI cycle (8 bit delay). diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index 097a41347c..a34b70bae3 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -174,7 +174,7 @@ #define FAN1_PIN P2_02 #ifndef CONTROLLER_FAN_PIN - #define CONTROLLER_FAN_PIN FAN1_PIN + #define CONTROLLER_FAN_PIN FAN1_PIN #endif /** diff --git a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h index e9c943d4ae..5e4bea1c2b 100644 --- a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h +++ b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h @@ -33,7 +33,6 @@ // #define SERVO0_PIN P1_26 - // // Limit Switches // @@ -45,7 +44,6 @@ #define Z_MIN_PIN P1_22 // Z- #define Z_MAX_PIN P0_27 // Z+ - // // Steppers // @@ -106,7 +104,6 @@ #endif #endif - #if HAS_TMC_UART #define X_SERIAL_TX_PIN P1_04 #define X_SERIAL_RX_PIN P1_04 @@ -130,8 +127,6 @@ #define TMC_BAUD_RATE 19200 #endif - - // // Temperature Sensors // @@ -153,7 +148,6 @@ #define FAN1_PIN P1_21 #define FAN2_PIN P1_24 - // // LCD / Controller // @@ -168,7 +162,6 @@ #define BTN_EN2 P0_01 #define BTN_ENC P0_28 - #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif diff --git a/Marlin/src/pins/stm32f1/pins_BEAST.h b/Marlin/src/pins/stm32f1/pins_BEAST.h index ccb8a31ab7..bf2cf6463a 100644 --- a/Marlin/src/pins/stm32f1/pins_BEAST.h +++ b/Marlin/src/pins/stm32f1/pins_BEAST.h @@ -123,16 +123,7 @@ #if HAS_WIRED_LCD #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(IS_NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #else #define LCD_PINS_RS PB8 #define LCD_PINS_ENABLE PD2 @@ -141,144 +132,27 @@ #define LCD_PINS_D6 PB14 #define LCD_PINS_D7 PB15 #if !IS_NEWPANEL - #define BEEPER_PIN 33 - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + #error "Non-NEWPANEL LCD is not supported." #endif #endif #if IS_NEWPANEL - #if IS_RRD_SC - - #define BEEPER_PIN 37 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - + #error "RRD Smart Controller is not supported." #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - #define SD_DETECT_PIN -1 - #define KILL_PIN 41 - + #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - - #define BTN_ENC -1 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - + #error "LCD_I2C_VIKI is not supported." #elif ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN 33 - - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - - #define KILL_PIN 31 - - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - + #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - #define SD_DETECT_PIN 49 - #define LCD_SDSS 53 - #define KILL_PIN 41 - #define BEEPER_PIN 23 - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - #define LCD_BACKLIGHT_PIN 33 - + #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define SDSS 53 - - #define KILL_PIN 64 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - // The encoder and click button - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - // not connected to a pin - #define SD_DETECT_PIN 49 - + #error "MINIPANEL is not supported." #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons directly attached to AUX-2 - #if IS_RRW_KEYPAD - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #else - //#define SD_DETECT_PIN -1 // Ramps doesn't use this - #endif - + #error "Other generic NEWPANEL LCD is not supported." #endif #endif // IS_NEWPANEL diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index 9f2513cc82..ead939707f 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -188,7 +188,7 @@ * Board Display * _____ _____ * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) - * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) GLCD_CS | 3 4 | SD_CS (PA10) + * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) LCD_CS | 3 4 | SD_CS (PA10) * (FREE) PB9 | 5 6 | PA10 (SD_CS) (FREE) | 5 6 | MOSI (SPI1-MOSI) * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | (FREE) * (BEEPER) PB6 | 9 10| PB5 (SD_DET) GND | 9 10| 5V diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index e980d884a7..c52b12b26b 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -62,10 +62,10 @@ // SPI // Note: FLSun Hispeed (clone MKS_Robin_miniV2) board is using SPI2 interface. // +#define SCK_PIN PB13 // SPI2 +#define MISO_PIN PB14 // SPI2 +#define MOSI_PIN PB15 // SPI2 #define SPI_DEVICE 2 -#define SCK_PIN PB13 // SPI2 -#define MISO_PIN PB14 // SPI2 -#define MOSI_PIN PB15 // SPI2 // SPI Flash #define HAS_SPI_FLASH 1 @@ -129,7 +129,7 @@ #define Y_SERIAL_RX_PIN PA9 // TXD1 #define Z_SERIAL_TX_PIN PC7 // IO1 #define Z_SERIAL_RX_PIN PC7 // IO1 - #define TMC_BAUD_RATE 19200 + #define TMC_BAUD_RATE 19200 #else // Motor current PWM pins #define MOTOR_CURRENT_PWM_XY_PIN PA6 // VREF2/3 CONTROL XY @@ -210,7 +210,7 @@ */ //#define SW_DIO PA13 //#define SW_CLK PA14 -//#define SW_RST NRST // (14) +//#define SW_RST NRST // (14) // // Power Supply Control diff --git a/Marlin/src/pins/stm32f1/pins_STM32F1R.h b/Marlin/src/pins/stm32f1/pins_STM32F1R.h index 6f252fbef6..d666755c6f 100644 --- a/Marlin/src/pins/stm32f1/pins_STM32F1R.h +++ b/Marlin/src/pins/stm32f1/pins_STM32F1R.h @@ -100,16 +100,7 @@ #if HAS_WIRED_LCD #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(IS_NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #else #define LCD_PINS_RS PB8 #define LCD_PINS_ENABLE PD2 @@ -118,145 +109,29 @@ #define LCD_PINS_D6 PB14 #define LCD_PINS_D7 PB15 #if !IS_NEWPANEL - #define BEEPER_PIN 33 - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + #error "Non-NEWPANEL LCD is not supported." #endif #endif #if IS_NEWPANEL - #if IS_RRD_SC - - #define BEEPER_PIN 37 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - + #error "RRD Smart Controller is not supported." #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - #define SD_DETECT_PIN -1 - #define KILL_PIN 41 - + #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - - #define BTN_ENC -1 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - + #error "LCD_I2C_VIKI is not supported." #elif ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN 33 - - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - - #define KILL_PIN 31 - - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - + #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - #define SD_DETECT_PIN 49 - #define LCD_SDSS 53 - #define KILL_PIN 41 - #define BEEPER_PIN 23 - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - #define LCD_BACKLIGHT_PIN 33 - + #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define SDSS 53 - - #define KILL_PIN 64 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - // The encoder and click button - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - // not connected to a pin - #define SD_DETECT_PIN 49 - + #error "MINIPANEL is not supported." #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons directly attached to AUX-2 - #if IS_RRW_KEYPAD - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #else - //#define SD_DETECT_PIN -1 // Ramps doesn't use this - #endif - + #error "Other generic NEWPANEL LCD is not supported." #endif - #endif // IS_NEWPANEL + #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder diff --git a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h index ef82b71f56..4f8183caf4 100644 --- a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h @@ -115,16 +115,7 @@ #if HAS_WIRED_LCD #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock - #elif BOTH(IS_NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE PD2 - #define LCD_PINS_D4 PB12 - #define LCD_PINS_D5 PB13 - #define LCD_PINS_D6 PB14 - #define LCD_PINS_D7 PB15 + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #else #define LCD_PINS_RS PB8 #define LCD_PINS_ENABLE PD2 @@ -133,13 +124,7 @@ #define LCD_PINS_D6 PB14 #define LCD_PINS_D7 PB15 #if !IS_NEWPANEL - #define BEEPER_PIN 33 - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK 38 - //#define SHIFT_LD 42 - //#define SHIFT_OUT 40 - //#define SHIFT_EN 17 + #error "Non-NEWPANEL LCD is not supported." #endif #endif @@ -154,132 +139,23 @@ #elif IS_NEWPANEL #if IS_RRD_SC - - #define BEEPER_PIN 37 - - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 - - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - - #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 - #endif - + #error "RRD Smart Controller is not supported." #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SD_DETECT_PIN 42 - + #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #elif ENABLED(LCD_I2C_PANELOLU2) - - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 - #define LCD_SDSS 53 - #define SD_DETECT_PIN -1 - #define KILL_PIN 41 - + #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) - - #define BTN_EN1 22 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. - - #define BTN_ENC -1 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 - + #error "LCD_I2C_VIKI is not supported." #elif ANY(VIKI2, miniVIKI) - - #define BEEPER_PIN 33 - - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 45 - #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 22 - #define BTN_EN2 7 - #define BTN_ENC 39 - - #define SDSS 53 - #define SD_DETECT_PIN -1 // Pin 49 for display sd interface, 72 for easy adapter board - - #define KILL_PIN 31 - - #define STAT_LED_RED_PIN 32 - #define STAT_LED_BLUE_PIN 35 - + #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 - #define SD_DETECT_PIN 49 - #define LCD_SDSS 53 - #define KILL_PIN 41 - #define BEEPER_PIN 23 - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 - #define LCD_BACKLIGHT_PIN 33 - + #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." #elif ENABLED(MINIPANEL) - - #define BEEPER_PIN 42 - // Pins for DOGM SPI LCD Support - #define DOGLCD_A0 44 - #define DOGLCD_CS 66 - #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define SDSS 53 - - #define KILL_PIN 64 - // GLCD features - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - // The encoder and click button - #define BTN_EN1 40 - #define BTN_EN2 63 - #define BTN_ENC 59 - // not connected to a pin - #define SD_DETECT_PIN 49 - + #error "MINIPANEL is not supported." #else - - // Beeper on AUX-4 - #define BEEPER_PIN 33 - - // Buttons directly attached to AUX-2 - #if IS_RRW_KEYPAD - #define BTN_EN1 64 - #define BTN_EN2 59 - #define BTN_ENC 63 - #define SHIFT_OUT 40 - #define SHIFT_CLK 44 - #define SHIFT_LD 42 - #elif ENABLED(PANEL_ONE) - #define BTN_EN1 59 // AUX2 PIN 3 - #define BTN_EN2 63 // AUX2 PIN 4 - #define BTN_ENC 49 // AUX3 PIN 7 - #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 - #else - //#define SD_DETECT_PIN -1 // Ramps doesn't use this - #endif - + #error "Other generic NEWPANEL LCD is not supported." #endif - #endif // IS_NEWPANEL + + #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h index d594e3ca49..d8a6e453fe 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -63,39 +63,39 @@ // Limit Switches // #ifdef X_STALL_SENSITIVITY - #define X_STOP_PIN X_DIAG_PIN + #define X_STOP_PIN X_DIAG_PIN #if X_HOME_DIR < 0 - #define X_MAX_PIN E0_DIAG_PIN // X+ + #define X_MAX_PIN E0_DIAG_PIN // X+ #else - #define X_MIN_PIN E0_DIAG_PIN // X+ + #define X_MIN_PIN E0_DIAG_PIN // X+ #endif #else - #define X_MIN_PIN X_DIAG_PIN // X- - #define X_MAX_PIN E0_DIAG_PIN // X+ + #define X_MIN_PIN X_DIAG_PIN // X- + #define X_MAX_PIN E0_DIAG_PIN // X+ #endif #ifdef Y_STALL_SENSITIVITY - #define Y_STOP_PIN Y_DIAG_PIN + #define Y_STOP_PIN Y_DIAG_PIN #if Y_HOME_DIR < 0 - #define Y_MAX_PIN E1_DIAG_PIN // Y+ + #define Y_MAX_PIN E1_DIAG_PIN // Y+ #else - #define Y_MIN_PIN E1_DIAG_PIN // Y+ + #define Y_MIN_PIN E1_DIAG_PIN // Y+ #endif #else - #define Y_MIN_PIN Y_DIAG_PIN // Y- - #define Y_MAX_PIN E1_DIAG_PIN // Y+ + #define Y_MIN_PIN Y_DIAG_PIN // Y- + #define Y_MAX_PIN E1_DIAG_PIN // Y+ #endif #ifdef Z_STALL_SENSITIVITY - #define Z_STOP_PIN Z_DIAG_PIN + #define Z_STOP_PIN Z_DIAG_PIN #if Z_HOME_DIR < 0 - #define Z_MAX_PIN E2_DIAG_PIN // Z+ + #define Z_MAX_PIN E2_DIAG_PIN // Z+ #else - #define Z_MIN_PIN E2_DIAG_PIN // Z+ + #define Z_MIN_PIN E2_DIAG_PIN // Z+ #endif #else - #define Z_MIN_PIN Z_DIAG_PIN // Z- - #define Z_MAX_PIN E2_DIAG_PIN // Z+ + #define Z_MIN_PIN Z_DIAG_PIN // Z- + #define Z_MAX_PIN E2_DIAG_PIN // Z+ #endif // diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h index ef96eecd74..688c321c72 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h @@ -142,7 +142,7 @@ // SD support // #define SDIO_SUPPORT -#define SDIO_CLOCK 4800000 +#define SDIO_CLOCK 4800000 // // Misc. Functions diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h index bd4d1f6618..8775847738 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_S.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_S.h @@ -35,61 +35,61 @@ // // Servos // -#define SERVO0_PIN PD12 //confirmed +#define SERVO0_PIN PD12 //#define SERVO1_PIN -1 // // Limit Switches // -#define X_MIN_PIN PG9 //confirmed -#define Y_MIN_PIN PG10 //confirmed -#define Z_MIN_PIN PG11 //confirmed +#define X_MIN_PIN PG9 +#define Y_MIN_PIN PG10 +#define Z_MIN_PIN PG11 -#define X_MAX_PIN PG12 //confirmed -#define Y_MAX_PIN PG13 //confirmed -#define Z_MAX_PIN PG14 //confirmed +#define X_MAX_PIN PG12 +#define Y_MAX_PIN PG13 +#define Z_MAX_PIN PG14 // // Filament runout // -#define FIL_RUNOUT_PIN PC5 //confirmed +#define FIL_RUNOUT_PIN PC5 // // Z Probe (when not Z_MIN_PIN) // #ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN PG8 //confirmed + #define Z_MIN_PROBE_PIN PG8 #endif // // Steppers // -#define X_STEP_PIN PF7 //confirmed -#define X_DIR_PIN PF8 //confirmed -#define X_ENABLE_PIN PF6 //confirmed +#define X_STEP_PIN PF7 +#define X_DIR_PIN PF8 +#define X_ENABLE_PIN PF6 -#define Y_STEP_PIN PF10 //confirmed -#define Y_DIR_PIN PF11 //confirmed -#define Y_ENABLE_PIN PF9 //confirmed +#define Y_STEP_PIN PF10 +#define Y_DIR_PIN PF11 +#define Y_ENABLE_PIN PF9 -#define Z_STEP_PIN PF13 //confirmed -#define Z_DIR_PIN PF14 //confirmed -#define Z_ENABLE_PIN PF12 //confirmed +#define Z_STEP_PIN PF13 +#define Z_DIR_PIN PF14 +#define Z_ENABLE_PIN PF12 -#define E0_STEP_PIN PG0 //confirmed -#define E0_DIR_PIN PG1 //confirmed -#define E0_ENABLE_PIN PF15 //confirmed +#define E0_STEP_PIN PG0 +#define E0_DIR_PIN PG1 +#define E0_ENABLE_PIN PF15 -#define E1_STEP_PIN PG3 //confirmed -#define E1_DIR_PIN PG4 //confirmed -#define E1_ENABLE_PIN PG2 //confirmed +#define E1_STEP_PIN PG3 +#define E1_DIR_PIN PG4 +#define E1_ENABLE_PIN PG2 // // Temperature Sensors // #define TEMP_0_PIN PC0 // See below for activation of thermistor readings #define TEMP_1_PIN PC1 // See below for activation of thermistor readings -#define TEMP_BED_PIN PC3 //confirmed +#define TEMP_BED_PIN PC3 // Lergde-S can choose thermocouple/thermistor mode in software. // For use with thermistors, these pins must be OUT/LOW. @@ -114,13 +114,13 @@ // // Heaters / Fans // -#define HEATER_0_PIN PA0 //confirmed -#define HEATER_1_PIN PA1 //confirmed -#define HEATER_BED_PIN PA3 //confirmed +#define HEATER_0_PIN PA0 +#define HEATER_1_PIN PA1 +#define HEATER_BED_PIN PA3 -#define FAN_PIN PA15 // heater 0 fan 1 //confirmed -#define FAN1_PIN PB10 // heater 1 fan 2 //confirmed -#define FAN2_PIN PF5 // heater 0 fan 2 and heater 1 fan 1 (two sockets, switched together) //confirmed +#define FAN_PIN PA15 // heater 0 fan 1 +#define FAN1_PIN PB10 // heater 1 fan 2 +#define FAN2_PIN PF5 // heater 0 fan 2 and heater 1 fan 1 (two sockets, switched together) #ifndef E0_AUTO_FAN_PIN #define E0_AUTO_FAN_PIN PF5 @@ -136,19 +136,19 @@ // LED / Lighting // //Lerdge-S board has two LED connectors (this is the one on the mainboard) -#define CASE_LIGHT_PIN PC7 //confirmed +#define CASE_LIGHT_PIN PC7 //on the dual extrusion addon board is a RGB connector -#define RGB_LED_R_PIN PC7 // Shared with the mainboard LED light connector (CASE_LIGHT_PIN), confirmed -#define RGB_LED_G_PIN PB0 //confirmed -#define RGB_LED_B_PIN PB1 //confirmed +#define RGB_LED_R_PIN PC7 // Shared with the mainboard LED light connector (CASE_LIGHT_PIN) +#define RGB_LED_G_PIN PB0 +#define RGB_LED_B_PIN PB1 // // 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, confirmed -#define PS_ON_PIN PB2 // Board has a power module connector, confirmed +#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 #define POWER_LOSS_PIN -1 // PB2 could be used for this as well @@ -158,12 +158,12 @@ #define SDIO_SUPPORT #define SDIO_CLOCK 4800000 -#define SCK_PIN PC12 //confirmed working -#define MISO_PIN PC8 //confirmed working -#define MOSI_PIN PD2 //confirmed working -#define SS_PIN PC11 //confirmed working +#define SCK_PIN PC12 +#define MISO_PIN PC8 +#define MOSI_PIN PD2 +#define SS_PIN PC11 -#define SD_DETECT_PIN PG15 //confirmed +#define SD_DETECT_PIN PG15 // // Persistent Storage @@ -190,14 +190,14 @@ // // The LCD is initialized in FSMC mode -#define BEEPER_PIN PD13 //confirmed +#define BEEPER_PIN PD13 -#define BTN_EN1 PC14 //confirmed -#define BTN_EN2 PC15 //confirmed -#define BTN_ENC PC13 //confirmed +#define BTN_EN1 PC14 +#define BTN_EN2 PC15 +#define BTN_ENC PC13 -#define TFT_RESET_PIN PD6 //confirmed -#define TFT_BACKLIGHT_PIN PD3 //confirmed +#define TFT_RESET_PIN PD6 +#define TFT_BACKLIGHT_PIN PD3 #define TFT_CS_PIN PD7 // TFT works #define TFT_RS_PIN PD11 // TFT works diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h index c8f52d6987..ebf7120a44 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h @@ -127,7 +127,7 @@ // #define SDIO_SUPPORT #define SD_DETECT_PIN PA8 -#define SDIO_CLOCK 4800000 +#define SDIO_CLOCK 4800000 // // LCD / Controller diff --git a/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h b/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h index 20fd9d379f..a1e3346743 100755 --- a/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h +++ b/buildroot/share/PlatformIO/variants/CHITU_F103/board/board.h @@ -69,14 +69,11 @@ #define BOARD_SPI1_MISO_PIN PA6 #define BOARD_SPI1_MOSI_PIN PA7 - - #define BOARD_SPI2_NSS_PIN PB12 #define BOARD_SPI2_SCK_PIN PB13 #define BOARD_SPI2_MISO_PIN PB14 #define BOARD_SPI2_MOSI_PIN PB15 - #define BOARD_SPI3_NSS_PIN PA15 #define BOARD_SPI3_SCK_PIN PB3 #define BOARD_SPI3_MISO_PIN PB4