SPI and pins cleanup

This commit is contained in:
Scott Lahteine 2020-12-30 22:00:36 -06:00 committed by Scott Lahteine
parent cf996949fa
commit 7a748bd565
20 changed files with 130 additions and 517 deletions

View File

@ -64,12 +64,11 @@
#include "../../../MarlinCore.h" #include "../../../MarlinCore.h"
void spiBegin(); #ifndef LCD_SPI_SPEED
void spiInit(uint8_t spiRate); #define LCD_SPI_SPEED SPI_QUARTER_SPEED
void spiSend(uint8_t b); #endif
void spiSend(const uint8_t* buf, size_t n);
#include "../../shared/Marduino.h" #include "../../shared/HAL_SPI.h"
#include "../fastio.h" #include "../fastio.h"
void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) { 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(); spiBegin();
#ifndef SPI_SPEED spiInit(LCD_SPI_SPEED);
#define SPI_SPEED SPI_FULL_SPEED // use same SPI speed as SD card
#endif
spiInit(2);
break; break;
case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */ case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */

View File

@ -59,9 +59,6 @@
#if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920) #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 "u8g_com_HAL_DUE_sw_spi_shared.h"
#include "../../shared/Marduino.h" #include "../../shared/Marduino.h"

View File

@ -37,7 +37,7 @@
#define TOUCH_SCK_PIN SCK_PIN #define TOUCH_SCK_PIN SCK_PIN
#endif #endif
#ifndef TOUCH_CS_PIN #ifndef TOUCH_CS_PIN
#define TOUCH_CS_PIN CS_PIN #define TOUCH_CS_PIN SS_PIN
#endif #endif
#ifndef TOUCH_INT_PIN #ifndef TOUCH_INT_PIN
#define TOUCH_INT_PIN -1 #define TOUCH_INT_PIN -1

View File

@ -62,9 +62,11 @@
#include <U8glib.h> #include <U8glib.h>
#include <SoftwareSPI.h> #include <SoftwareSPI.h>
#include "../../shared/Delay.h" #include "../../shared/Delay.h"
#include "../../shared/HAL_SPI.h"
#undef SPI_SPEED #ifndef LCD_SPI_SPEED
#define SPI_SPEED 3 // About 1 MHz #define LCD_SPI_SPEED SPI_EIGHTH_SPEED // About 1 MHz
#endif
static pin_t SCK_pin_ST7920_HAL, MOSI_pin_ST7920_HAL_HAL; static pin_t SCK_pin_ST7920_HAL, MOSI_pin_ST7920_HAL_HAL;
static uint8_t SPI_speed = 0; 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_SetPIOutput(u8g, U8G_PI_MOSI);
u8g_Delay(5); 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_CS, 0);
u8g_SetPILevel(u8g, U8G_PI_SCK, 0); u8g_SetPILevel(u8g, U8G_PI_SCK, 0);

View File

@ -60,9 +60,11 @@
#if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920) #if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920)
#include <SoftwareSPI.h> #include <SoftwareSPI.h>
#include "../../shared/HAL_SPI.h"
#undef SPI_SPEED #ifndef LCD_SPI_SPEED
#define SPI_SPEED 2 // About 2 MHz #define LCD_SPI_SPEED SPI_QUARTER_SPEED // About 2 MHz
#endif
#include <Arduino.h> #include <Arduino.h>
#include <algorithm> #include <algorithm>
@ -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_CS);
u8g_SetPIOutput(u8g, U8G_PI_A0); u8g_SetPIOutput(u8g, U8G_PI_A0);
if (U8G_PIN_NONE != u8g->pin_list[U8G_PI_RESET]) u8g_SetPIOutput(u8g, U8G_PI_RESET); 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_SCK, 0);
u8g_SetPILevel(u8g, U8G_PI_MOSI, 0); u8g_SetPILevel(u8g, U8G_PI_MOSI, 0);
break; break;

View File

@ -23,12 +23,14 @@
#if BOTH(HAS_MARLINUI_U8GLIB, FORCE_SOFT_SPI) #if BOTH(HAS_MARLINUI_U8GLIB, FORCE_SOFT_SPI)
#include <U8glib.h> #include <U8glib.h>
#include "../../shared/HAL_SPI.h"
#undef SPI_SPEED #ifndef LCD_SPI_SPEED
#define SPI_SPEED 0 // Fastest #define LCD_SPI_SPEED SPI_FULL_SPEED // Fastest
//#define SPI_SPEED 2 // Slower //#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) { 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) { 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) { uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
switch (msg) { switch (msg) {
case U8G_COM_MSG_INIT: case U8G_COM_MSG_INIT:
SPI_speed = swSpiInit(SPI_SPEED); SPI_speed = swSpiInit(LCD_SPI_SPEED);
break; break;
case U8G_COM_MSG_STOP: case U8G_COM_MSG_STOP:

View File

@ -37,7 +37,7 @@
#define TOUCH_SCK_PIN SCK_PIN #define TOUCH_SCK_PIN SCK_PIN
#endif #endif
#ifndef TOUCH_CS_PIN #ifndef TOUCH_CS_PIN
#define TOUCH_CS_PIN CS_PIN #define TOUCH_CS_PIN SS_PIN
#endif #endif
#ifndef TOUCH_INT_PIN #ifndef TOUCH_INT_PIN
#define TOUCH_INT_PIN -1 #define TOUCH_INT_PIN -1

View File

@ -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 - 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). - Each L6470 passes the data it saw on its SDI to its neighbor on the **NEXT** SPI cycle (8 bit delay).

View File

@ -33,7 +33,6 @@
// //
#define SERVO0_PIN P1_26 #define SERVO0_PIN P1_26
// //
// Limit Switches // Limit Switches
// //
@ -45,7 +44,6 @@
#define Z_MIN_PIN P1_22 // Z- #define Z_MIN_PIN P1_22 // Z-
#define Z_MAX_PIN P0_27 // Z+ #define Z_MAX_PIN P0_27 // Z+
// //
// Steppers // Steppers
// //
@ -106,7 +104,6 @@
#endif #endif
#endif #endif
#if HAS_TMC_UART #if HAS_TMC_UART
#define X_SERIAL_TX_PIN P1_04 #define X_SERIAL_TX_PIN P1_04
#define X_SERIAL_RX_PIN P1_04 #define X_SERIAL_RX_PIN P1_04
@ -130,8 +127,6 @@
#define TMC_BAUD_RATE 19200 #define TMC_BAUD_RATE 19200
#endif #endif
// //
// Temperature Sensors // Temperature Sensors
// //
@ -153,7 +148,6 @@
#define FAN1_PIN P1_21 #define FAN1_PIN P1_21
#define FAN2_PIN P1_24 #define FAN2_PIN P1_24
// //
// LCD / Controller // LCD / Controller
// //
@ -168,7 +162,6 @@
#define BTN_EN2 P0_01 #define BTN_EN2 P0_01
#define BTN_ENC P0_28 #define BTN_ENC P0_28
#ifndef SDCARD_CONNECTION #ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION ONBOARD #define SDCARD_CONNECTION ONBOARD
#endif #endif

View File

@ -123,16 +123,7 @@
#if HAS_WIRED_LCD #if HAS_WIRED_LCD
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
#define LCD_PINS_RS 49 // CS chip select /SS chip slave select #error "REPRAPWORLD_GRAPHICAL_LCD is not supported."
#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
#else #else
#define LCD_PINS_RS PB8 #define LCD_PINS_RS PB8
#define LCD_PINS_ENABLE PD2 #define LCD_PINS_ENABLE PD2
@ -141,144 +132,27 @@
#define LCD_PINS_D6 PB14 #define LCD_PINS_D6 PB14
#define LCD_PINS_D7 PB15 #define LCD_PINS_D7 PB15
#if !IS_NEWPANEL #if !IS_NEWPANEL
#define BEEPER_PIN 33 #error "Non-NEWPANEL LCD is not supported."
// 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
#endif #endif
#endif #endif
#if IS_NEWPANEL #if IS_NEWPANEL
#if IS_RRD_SC #if IS_RRD_SC
#error "RRD Smart Controller is not supported."
#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
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
#error "REPRAPWORLD_GRAPHICAL_LCD is not supported."
#define BTN_EN1 64
#define BTN_EN2 59
#define BTN_ENC 63
#define SD_DETECT_PIN 42
#elif ENABLED(LCD_I2C_PANELOLU2) #elif ENABLED(LCD_I2C_PANELOLU2)
#error "LCD_I2C_PANELOLU2 is not supported."
#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
#elif ENABLED(LCD_I2C_VIKI) #elif ENABLED(LCD_I2C_VIKI)
#error "LCD_I2C_VIKI is not supported."
#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
#elif ANY(VIKI2, miniVIKI) #elif ANY(VIKI2, miniVIKI)
#error "VIKI2 / miniVIKI is not supported."
#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
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
#error "ELB_FULL_GRAPHIC_CONTROLLER is not supported."
#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
#elif ENABLED(MINIPANEL) #elif ENABLED(MINIPANEL)
#error "MINIPANEL is not supported."
#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
#else #else
#error "Other generic NEWPANEL LCD is not supported."
// 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
#endif #endif
#endif // IS_NEWPANEL #endif // IS_NEWPANEL

View File

@ -188,7 +188,7 @@
* Board Display * Board Display
* _____ _____ * _____ _____
* 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) * 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) * (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) * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | (FREE)
* (BEEPER) PB6 | 9 10| PB5 (SD_DET) GND | 9 10| 5V * (BEEPER) PB6 | 9 10| PB5 (SD_DET) GND | 9 10| 5V

View File

@ -62,10 +62,10 @@
// SPI // SPI
// Note: FLSun Hispeed (clone MKS_Robin_miniV2) board is using SPI2 interface. // Note: FLSun Hispeed (clone MKS_Robin_miniV2) board is using SPI2 interface.
// //
#define SPI_DEVICE 2
#define SCK_PIN PB13 // SPI2 #define SCK_PIN PB13 // SPI2
#define MISO_PIN PB14 // SPI2 #define MISO_PIN PB14 // SPI2
#define MOSI_PIN PB15 // SPI2 #define MOSI_PIN PB15 // SPI2
#define SPI_DEVICE 2
// SPI Flash // SPI Flash
#define HAS_SPI_FLASH 1 #define HAS_SPI_FLASH 1

View File

@ -100,16 +100,7 @@
#if HAS_WIRED_LCD #if HAS_WIRED_LCD
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
#define LCD_PINS_RS 49 // CS chip select /SS chip slave select #error "REPRAPWORLD_GRAPHICAL_LCD is not supported."
#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
#else #else
#define LCD_PINS_RS PB8 #define LCD_PINS_RS PB8
#define LCD_PINS_ENABLE PD2 #define LCD_PINS_ENABLE PD2
@ -118,146 +109,30 @@
#define LCD_PINS_D6 PB14 #define LCD_PINS_D6 PB14
#define LCD_PINS_D7 PB15 #define LCD_PINS_D7 PB15
#if !IS_NEWPANEL #if !IS_NEWPANEL
#define BEEPER_PIN 33 #error "Non-NEWPANEL LCD is not supported."
// 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
#endif #endif
#endif #endif
#if IS_NEWPANEL #if IS_NEWPANEL
#if IS_RRD_SC #if IS_RRD_SC
#error "RRD Smart Controller is not supported."
#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
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
#error "REPRAPWORLD_GRAPHICAL_LCD is not supported."
#define BTN_EN1 64
#define BTN_EN2 59
#define BTN_ENC 63
#define SD_DETECT_PIN 42
#elif ENABLED(LCD_I2C_PANELOLU2) #elif ENABLED(LCD_I2C_PANELOLU2)
#error "LCD_I2C_PANELOLU2 is not supported."
#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
#elif ENABLED(LCD_I2C_VIKI) #elif ENABLED(LCD_I2C_VIKI)
#error "LCD_I2C_VIKI is not supported."
#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
#elif ANY(VIKI2, miniVIKI) #elif ANY(VIKI2, miniVIKI)
#error "VIKI2 / miniVIKI is not supported."
#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
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
#define BTN_EN1 35 #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported."
#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
#elif ENABLED(MINIPANEL) #elif ENABLED(MINIPANEL)
#error "MINIPANEL is not supported."
#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
#else #else
#error "Other generic NEWPANEL LCD is not supported."
// 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 #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 #endif
#endif
#endif // IS_NEWPANEL
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
#endif #endif

View File

@ -115,16 +115,7 @@
#if HAS_WIRED_LCD #if HAS_WIRED_LCD
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
#define LCD_PINS_RS 49 // CS chip select /SS chip slave select #error "REPRAPWORLD_GRAPHICAL_LCD is not supported."
#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
#else #else
#define LCD_PINS_RS PB8 #define LCD_PINS_RS PB8
#define LCD_PINS_ENABLE PD2 #define LCD_PINS_ENABLE PD2
@ -133,13 +124,7 @@
#define LCD_PINS_D6 PB14 #define LCD_PINS_D6 PB14
#define LCD_PINS_D7 PB15 #define LCD_PINS_D7 PB15
#if !IS_NEWPANEL #if !IS_NEWPANEL
#define BEEPER_PIN 33 #error "Non-NEWPANEL LCD is not supported."
// 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
#endif #endif
#endif #endif
@ -154,132 +139,23 @@
#elif IS_NEWPANEL #elif IS_NEWPANEL
#if IS_RRD_SC #if IS_RRD_SC
#error "RRD Smart Controller is not supported."
#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
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
#error "REPRAPWORLD_GRAPHICAL_LCD is not supported."
#define BTN_EN1 64
#define BTN_EN2 59
#define BTN_ENC 63
#define SD_DETECT_PIN 42
#elif ENABLED(LCD_I2C_PANELOLU2) #elif ENABLED(LCD_I2C_PANELOLU2)
#error "LCD_I2C_PANELOLU2 is not supported."
#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
#elif ENABLED(LCD_I2C_VIKI) #elif ENABLED(LCD_I2C_VIKI)
#error "LCD_I2C_VIKI is not supported."
#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
#elif ANY(VIKI2, miniVIKI) #elif ANY(VIKI2, miniVIKI)
#error "VIKI2 / miniVIKI is not supported."
#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
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
#error "ELB_FULL_GRAPHIC_CONTROLLER is not supported."
#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
#elif ENABLED(MINIPANEL) #elif ENABLED(MINIPANEL)
#error "MINIPANEL is not supported."
#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
#else #else
#error "Other generic NEWPANEL LCD is not supported."
// 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 #endif
#endif #endif
#endif // IS_NEWPANEL
#endif // HAS_WIRED_LCD #endif // HAS_WIRED_LCD

View File

@ -35,61 +35,61 @@
// //
// Servos // Servos
// //
#define SERVO0_PIN PD12 //confirmed #define SERVO0_PIN PD12
//#define SERVO1_PIN -1 //#define SERVO1_PIN -1
// //
// Limit Switches // Limit Switches
// //
#define X_MIN_PIN PG9 //confirmed #define X_MIN_PIN PG9
#define Y_MIN_PIN PG10 //confirmed #define Y_MIN_PIN PG10
#define Z_MIN_PIN PG11 //confirmed #define Z_MIN_PIN PG11
#define X_MAX_PIN PG12 //confirmed #define X_MAX_PIN PG12
#define Y_MAX_PIN PG13 //confirmed #define Y_MAX_PIN PG13
#define Z_MAX_PIN PG14 //confirmed #define Z_MAX_PIN PG14
// //
// Filament runout // Filament runout
// //
#define FIL_RUNOUT_PIN PC5 //confirmed #define FIL_RUNOUT_PIN PC5
// //
// Z Probe (when not Z_MIN_PIN) // Z Probe (when not Z_MIN_PIN)
// //
#ifndef Z_MIN_PROBE_PIN #ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN PG8 //confirmed #define Z_MIN_PROBE_PIN PG8
#endif #endif
// //
// Steppers // Steppers
// //
#define X_STEP_PIN PF7 //confirmed #define X_STEP_PIN PF7
#define X_DIR_PIN PF8 //confirmed #define X_DIR_PIN PF8
#define X_ENABLE_PIN PF6 //confirmed #define X_ENABLE_PIN PF6
#define Y_STEP_PIN PF10 //confirmed #define Y_STEP_PIN PF10
#define Y_DIR_PIN PF11 //confirmed #define Y_DIR_PIN PF11
#define Y_ENABLE_PIN PF9 //confirmed #define Y_ENABLE_PIN PF9
#define Z_STEP_PIN PF13 //confirmed #define Z_STEP_PIN PF13
#define Z_DIR_PIN PF14 //confirmed #define Z_DIR_PIN PF14
#define Z_ENABLE_PIN PF12 //confirmed #define Z_ENABLE_PIN PF12
#define E0_STEP_PIN PG0 //confirmed #define E0_STEP_PIN PG0
#define E0_DIR_PIN PG1 //confirmed #define E0_DIR_PIN PG1
#define E0_ENABLE_PIN PF15 //confirmed #define E0_ENABLE_PIN PF15
#define E1_STEP_PIN PG3 //confirmed #define E1_STEP_PIN PG3
#define E1_DIR_PIN PG4 //confirmed #define E1_DIR_PIN PG4
#define E1_ENABLE_PIN PG2 //confirmed #define E1_ENABLE_PIN PG2
// //
// Temperature Sensors // Temperature Sensors
// //
#define TEMP_0_PIN PC0 // See below for activation of thermistor readings #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_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. // Lergde-S can choose thermocouple/thermistor mode in software.
// For use with thermistors, these pins must be OUT/LOW. // For use with thermistors, these pins must be OUT/LOW.
@ -114,13 +114,13 @@
// //
// Heaters / Fans // Heaters / Fans
// //
#define HEATER_0_PIN PA0 //confirmed #define HEATER_0_PIN PA0
#define HEATER_1_PIN PA1 //confirmed #define HEATER_1_PIN PA1
#define HEATER_BED_PIN PA3 //confirmed #define HEATER_BED_PIN PA3
#define FAN_PIN PA15 // heater 0 fan 1 //confirmed #define FAN_PIN PA15 // heater 0 fan 1
#define FAN1_PIN PB10 // heater 1 fan 2 //confirmed #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) //confirmed #define FAN2_PIN PF5 // heater 0 fan 2 and heater 1 fan 1 (two sockets, switched together)
#ifndef E0_AUTO_FAN_PIN #ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PF5 #define E0_AUTO_FAN_PIN PF5
@ -136,19 +136,19 @@
// LED / Lighting // LED / Lighting
// //
//Lerdge-S board has two LED connectors (this is the one on the mainboard) //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 //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_R_PIN PC7 // Shared with the mainboard LED light connector (CASE_LIGHT_PIN)
#define RGB_LED_G_PIN PB0 //confirmed #define RGB_LED_G_PIN PB0
#define RGB_LED_B_PIN PB1 //confirmed #define RGB_LED_B_PIN PB1
// //
// Misc. Functions // Misc. Functions
// //
#define SDSS PC11 // SD is working using SDIO, not sure if this definition is needed? #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 LED_PIN PC6 // Mainboard soldered green LED
#define PS_ON_PIN PB2 // Board has a power module connector, confirmed #define PS_ON_PIN PB2 // Board has a power module connector
#define KILL_PIN -1 // There is no reset button on the LCD #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 #define POWER_LOSS_PIN -1 // PB2 could be used for this as well
@ -158,12 +158,12 @@
#define SDIO_SUPPORT #define SDIO_SUPPORT
#define SDIO_CLOCK 4800000 #define SDIO_CLOCK 4800000
#define SCK_PIN PC12 //confirmed working #define SCK_PIN PC12
#define MISO_PIN PC8 //confirmed working #define MISO_PIN PC8
#define MOSI_PIN PD2 //confirmed working #define MOSI_PIN PD2
#define SS_PIN PC11 //confirmed working #define SS_PIN PC11
#define SD_DETECT_PIN PG15 //confirmed #define SD_DETECT_PIN PG15
// //
// Persistent Storage // Persistent Storage
@ -190,14 +190,14 @@
// //
// The LCD is initialized in FSMC mode // The LCD is initialized in FSMC mode
#define BEEPER_PIN PD13 //confirmed #define BEEPER_PIN PD13
#define BTN_EN1 PC14 //confirmed #define BTN_EN1 PC14
#define BTN_EN2 PC15 //confirmed #define BTN_EN2 PC15
#define BTN_ENC PC13 //confirmed #define BTN_ENC PC13
#define TFT_RESET_PIN PD6 //confirmed #define TFT_RESET_PIN PD6
#define TFT_BACKLIGHT_PIN PD3 //confirmed #define TFT_BACKLIGHT_PIN PD3
#define TFT_CS_PIN PD7 // TFT works #define TFT_CS_PIN PD7 // TFT works
#define TFT_RS_PIN PD11 // TFT works #define TFT_RS_PIN PD11 // TFT works

View File

@ -69,14 +69,11 @@
#define BOARD_SPI1_MISO_PIN PA6 #define BOARD_SPI1_MISO_PIN PA6
#define BOARD_SPI1_MOSI_PIN PA7 #define BOARD_SPI1_MOSI_PIN PA7
#define BOARD_SPI2_NSS_PIN PB12 #define BOARD_SPI2_NSS_PIN PB12
#define BOARD_SPI2_SCK_PIN PB13 #define BOARD_SPI2_SCK_PIN PB13
#define BOARD_SPI2_MISO_PIN PB14 #define BOARD_SPI2_MISO_PIN PB14
#define BOARD_SPI2_MOSI_PIN PB15 #define BOARD_SPI2_MOSI_PIN PB15
#define BOARD_SPI3_NSS_PIN PA15 #define BOARD_SPI3_NSS_PIN PA15
#define BOARD_SPI3_SCK_PIN PB3 #define BOARD_SPI3_SCK_PIN PB3
#define BOARD_SPI3_MISO_PIN PB4 #define BOARD_SPI3_MISO_PIN PB4