0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-19 08:08:25 +00:00

🧑‍💻 Fall back to SPI0 with YHCB2004 (#25856)

This commit is contained in:
Scott Lahteine 2023-05-21 17:35:41 -05:00 committed by GitHub
parent d22ce55cd5
commit ae3b00db74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 118 additions and 115 deletions

View file

@ -35,39 +35,36 @@
#include "../fastio.h" #include "../fastio.h"
// change for your board
#define DEBUG_LED DIO21
// UART // UART
#define RXD DIO0 #define RXD 0
#define TXD DIO1 #define TXD 1
// SPI // SPI
#define SCK DIO52 #define MISO 50
#define MISO DIO50 #define MOSI 51
#define MOSI DIO51 #define SCK 52
#define SS DIO53 #define SS 53
// TWI (I2C) // TWI (I2C)
#define SCL DIO21 #define SCL 21
#define SDA DIO20 #define SDA 20
// Timers and PWM // Timers and PWM
#define OC0A DIO13 #define OC0A 13
#define OC0B DIO4 #define OC0B 4
#define OC1A DIO11 #define OC1A 11
#define OC1B DIO12 #define OC1B 12
#define OC2A DIO10 #define OC2A 10
#define OC2B DIO9 #define OC2B 9
#define OC3A DIO5 #define OC3A 5
#define OC3B DIO2 #define OC3B 2
#define OC3C DIO3 #define OC3C 3
#define OC4A DIO6 #define OC4A 6
#define OC4B DIO7 #define OC4B 7
#define OC4C DIO8 #define OC4C 8
#define OC5A DIO46 #define OC5A 46
#define OC5B DIO45 #define OC5B 45
#define OC5C DIO44 #define OC5C 44
// Digital I/O // Digital I/O

View file

@ -33,32 +33,29 @@
#include "../fastio.h" #include "../fastio.h"
// change for your board
#define DEBUG_LED DIO46
// UART // UART
#define RXD DIO0 #define RXD 0
#define TXD DIO1 #define TXD 1
// SPI // SPI
#define SCK DIO10 #define SCK 10
#define MISO DIO12 #define MISO 12
#define MOSI DIO11 #define MOSI 11
#define SS DIO16 #define SS 16
// TWI (I2C) // TWI (I2C)
#define SCL DIO17 #define SCL 17
#define SDA DIO18 #define SDA 18
// Timers and PWM // Timers and PWM
#define OC0A DIO9 #define OC0A 9
#define OC0B DIO4 #define OC0B 4
#define OC1A DIO7 #define OC1A 7
#define OC1B DIO8 #define OC1B 8
#define OC2A DIO6 #define OC2A 6
#define OC3A DIO5 #define OC3A 5
#define OC3B DIO2 #define OC3B 2
#define OC3C DIO3 #define OC3C 3
// Digital I/O // Digital I/O

View file

@ -33,29 +33,27 @@
#include "../fastio.h" #include "../fastio.h"
#define DEBUG_LED AIO5
// UART // UART
#define RXD DIO0 #define RXD 0
#define TXD DIO1 #define TXD 1
// SPI // SPI
#define SCK DIO13 #define SS 10
#define MISO DIO12 #define MOSI 11
#define MOSI DIO11 #define MISO 12
#define SS DIO10 #define SCK 13
// TWI (I2C) // TWI (I2C)
#define SCL AIO5 #define SCL AIO5
#define SDA AIO4 #define SDA AIO4
// Timers and PWM // Timers and PWM
#define OC0A DIO6 #define OC0A 6
#define OC0B DIO5 #define OC0B 5
#define OC1A DIO9 #define OC1A 9
#define OC1B DIO10 #define OC1B 10
#define OC2A DIO11 #define OC2A 11
#define OC2B DIO3 #define OC2B 3
// Digital I/O // Digital I/O

View file

@ -59,34 +59,32 @@
#include "../fastio.h" #include "../fastio.h"
#define DEBUG_LED DIO0
// UART // UART
#define RXD DIO8 #define RXD 8
#define TXD DIO9 #define TXD 9
#define RXD0 DIO8 #define RXD0 8
#define TXD0 DIO9 #define TXD0 9
#define RXD1 DIO10 #define RXD1 10
#define TXD1 DIO11 #define TXD1 11
// SPI // SPI
#define SCK DIO7 #define SS 4
#define MISO DIO6 #define MOSI 5
#define MOSI DIO5 #define MISO 6
#define SS DIO4 #define SCK 7
// TWI (I2C) // TWI (I2C)
#define SCL DIO16 #define SCL 16
#define SDA DIO17 #define SDA 17
// Timers and PWM // Timers and PWM
#define OC0A DIO3 #define OC0A 3
#define OC0B DIO4 #define OC0B 4
#define OC1A DIO13 #define OC1A 13
#define OC1B DIO12 #define OC1B 12
#define OC2A DIO15 #define OC2A 15
#define OC2B DIO14 #define OC2B 14
// Digital I/O // Digital I/O

View file

@ -34,14 +34,11 @@
#include "../fastio.h" #include "../fastio.h"
// change for your board
#define DEBUG_LED DIO31 /* led D5 red */
// SPI // SPI
#define SCK DIO21 // 9 #define SS 20 // 8
#define MISO DIO23 // 11 #define SCK 21 // 9
#define MOSI DIO22 // 10 #define MOSI 22 // 10
#define SS DIO20 // 8 #define MISO 23 // 11
// Digital I/O // Digital I/O

View file

@ -189,12 +189,12 @@
*/ */
// UART // UART
#define RXD DIO0 #define RXD 0
#define TXD DIO1 #define TXD 1
// TWI (I2C) // TWI (I2C)
#define SCL DIO21 #define SCL 21
#define SDA DIO20 #define SDA 20
/** /**
* pins * pins

View file

@ -103,7 +103,23 @@
#elif ENABLED(YHCB2004) #elif ENABLED(YHCB2004)
LCD_CLASS lcd(YHCB2004_CLK, 20, 4, YHCB2004_MOSI, YHCB2004_MISO); // CLK, cols, rows, MOSI, MISO #ifndef YHCB2004_SS_PIN
#define YHCB2004_SS_PIN SS
#endif
#ifndef YHCB2004_SCK_PIN
#define YHCB2004_SCK_PIN SCK
#endif
#ifndef YHCB2004_MOSI_PIN
#define YHCB2004_MOSI_PIN MOSI
#endif
#ifndef YHCB2004_MISO_PIN
#define YHCB2004_MISO_PIN MISO
#endif
#if !PINS_EXIST(YHCB2004_SS, YHCB2004_SCK, YHCB2004_MOSI, YHCB2004_MISO)
#error "YHCB2004 display requires YHCB2004_SS_PIN, YHCB2004_SCK_PIN, YHCB2004_MOSI_PIN, and YHCB2004_MISO_PIN."
#endif
LCD_CLASS lcd(YHCB2004_SS_PIN, 20, 4, YHCB2004_SCK_PIN, YHCB2004_MOSI_PIN, YHCB2004_MISO_PIN); // SS, cols, rows, SCK, MOSI, MISO
#else #else

View file

@ -168,18 +168,10 @@
#define BEEPER_PIN 18 #define BEEPER_PIN 18
#if ENABLED(YHCB2004) #if ENABLED(YHCB2004)
#ifndef YHCB2004_CLK #define YHCB2004_MOSI_PIN 21
#define YHCB2004_CLK 5 #define YHCB2004_MISO_PIN 36
#define DIO52 YHCB2004_CLK #define YHCB2004_SCK_PIN 5
#endif #define YHCB2004_SS_PIN SS
#ifndef YHCB2004_MOSI
#define YHCB2004_MOSI 21
#define DIO50 YHCB2004_MOSI
#endif
#ifndef YHCB2004_MISO
#define YHCB2004_MISO 36
#define DIO51 YHCB2004_MISO
#endif
#elif HAS_WIRED_LCD #elif HAS_WIRED_LCD
#ifndef LCD_PINS_RS #ifndef LCD_PINS_RS
#define LCD_PINS_RS 20 #define LCD_PINS_RS 20

View file

@ -26,12 +26,16 @@
* ATmega2560 * ATmega2560
*/ */
#define LCD_PINS_RS 5 #if HAS_WIRED_LCD
#define LCD_PINS_EN 36 #define LCD_PINS_RS 5
#define LCD_PINS_D4 21 #define LCD_PINS_EN 36
#define LCD_PINS_D7 6 #define LCD_PINS_D4 21
#define LCD_PINS_D7 6
#endif
#define SPEAKER // The speaker can produce tones #ifndef SPEAKER
#define SPEAKER // The speaker can produce tones
#endif
#if IS_NEWPANEL #if IS_NEWPANEL
#define BTN_EN1 16 #define BTN_EN1 16

View file

@ -28,12 +28,16 @@
#define BOARD_INFO_NAME "GT2560 4.x" #define BOARD_INFO_NAME "GT2560 4.x"
#define LCD_PINS_RS 5 #if HAS_WIRED_LCD
#define LCD_PINS_EN 36 #define LCD_PINS_RS 5
#define LCD_PINS_D4 21 #define LCD_PINS_EN 36
#define LCD_PINS_D7 6 #define LCD_PINS_D4 21
#define LCD_PINS_D7 6
#endif
#define SPEAKER // The speaker can produce tones #ifndef SPEAKER
#define SPEAKER // The speaker can produce tones
#endif
#if IS_NEWPANEL #if IS_NEWPANEL
#define BTN_EN1 16 #define BTN_EN1 16

View file

@ -795,7 +795,7 @@
#elif MB(BLACKPILL_CUSTOM) #elif MB(BLACKPILL_CUSTOM)
#include "stm32f4/pins_BLACKPILL_CUSTOM.h" // STM32F4 env:STM32F401CD_blackpill_stlink #include "stm32f4/pins_BLACKPILL_CUSTOM.h" // STM32F4 env:STM32F401CD_blackpill_stlink
#elif MB(I3DBEEZ9_V1) #elif MB(I3DBEEZ9_V1)
#include "stm32f4/pins_I3DBEEZ9.h" // STM32F4 env:I3DBEEZ9_V1 #include "stm32f4/pins_I3DBEEZ9.h" // STM32F4 env:I3DBEEZ9_V1
// //
// ARM Cortex M7 // ARM Cortex M7

View file

@ -117,7 +117,7 @@
//#define SDIO_SUPPORT //#define SDIO_SUPPORT
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer #define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
#if SD_CONNECTION_IS(ONBOARD) #if SD_CONNECTION_IS(ONBOARD)
#define SDSS PA4 #define SDSS PA4
#define SD_SCK_PIN PA5 #define SD_SCK_PIN PA5
#define SD_MISO_PIN PA6 #define SD_MISO_PIN PA6