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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -103,7 +103,23 @@
#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

View file

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

View file

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

View file

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