MKS Robin Mini uses ONBOARD_SPI_DEVICE (#19460)
This commit is contained in:
parent
90bc1993b6
commit
023cb54fae
|
@ -21,23 +21,23 @@
|
||||||
#include "fastio.h"
|
#include "fastio.h"
|
||||||
|
|
||||||
#if HAS_SHARED_MEDIA
|
#if HAS_SHARED_MEDIA
|
||||||
#ifndef ON_BOARD_SPI_DEVICE
|
#ifndef ONBOARD_SPI_DEVICE
|
||||||
#define ON_BOARD_SPI_DEVICE SPI_DEVICE
|
#define ONBOARD_SPI_DEVICE SPI_DEVICE
|
||||||
#endif
|
#endif
|
||||||
#define ONBOARD_SD_SPI SPI
|
#define ONBOARD_SD_SPI SPI
|
||||||
#else
|
#else
|
||||||
SPIClass OnBoardSPI(ON_BOARD_SPI_DEVICE);
|
SPIClass OnboardSPI(ONBOARD_SPI_DEVICE);
|
||||||
#define ONBOARD_SD_SPI OnBoardSPI
|
#define ONBOARD_SD_SPI OnboardSPI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ON_BOARD_SPI_DEVICE == 1
|
#if ONBOARD_SPI_DEVICE == 1
|
||||||
#define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_4
|
#define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_4
|
||||||
#else
|
#else
|
||||||
#define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_2
|
#define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CS_LOW() WRITE(ONBOARD_SD_CS_PIN, LOW) /* Set OnBoardSPI cs low */
|
#define CS_LOW() WRITE(ONBOARD_SD_CS_PIN, LOW) /* Set OnboardSPI cs low */
|
||||||
#define CS_HIGH() WRITE(ONBOARD_SD_CS_PIN, HIGH) /* Set OnBoardSPI cs high */
|
#define CS_HIGH() WRITE(ONBOARD_SD_CS_PIN, HIGH) /* Set OnboardSPI cs high */
|
||||||
|
|
||||||
#define FCLK_FAST() ONBOARD_SD_SPI.setClockDivider(SPI_CLOCK_MAX)
|
#define FCLK_FAST() ONBOARD_SD_SPI.setClockDivider(SPI_CLOCK_MAX)
|
||||||
#define FCLK_SLOW() ONBOARD_SD_SPI.setClockDivider(SPI_BAUD_PCLK_DIV_256)
|
#define FCLK_SLOW() ONBOARD_SD_SPI.setClockDivider(SPI_BAUD_PCLK_DIV_256)
|
||||||
|
@ -152,7 +152,7 @@ static int select() { /* 1:OK, 0:Timeout */
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
static void power_on() { /* Enable SSP module and attach it to I/O pads */
|
static void power_on() { /* Enable SSP module and attach it to I/O pads */
|
||||||
ONBOARD_SD_SPI.setModule(ON_BOARD_SPI_DEVICE);
|
ONBOARD_SD_SPI.setModule(ONBOARD_SPI_DEVICE);
|
||||||
ONBOARD_SD_SPI.begin();
|
ONBOARD_SD_SPI.begin();
|
||||||
ONBOARD_SD_SPI.setBitOrder(MSBFIRST);
|
ONBOARD_SD_SPI.setBitOrder(MSBFIRST);
|
||||||
ONBOARD_SD_SPI.setDataMode(SPI_MODE0);
|
ONBOARD_SD_SPI.setDataMode(SPI_MODE0);
|
||||||
|
|
|
@ -288,5 +288,5 @@
|
||||||
#error "SD CUSTOM_CABLE is not compatible with SKR E3 DIP."
|
#error "SD CUSTOM_CABLE is not compatible with SKR E3 DIP."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ON_BOARD_SPI_DEVICE 1 // SPI1
|
#define ONBOARD_SPI_DEVICE 1 // SPI1
|
||||||
#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
|
#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
|
||||||
|
|
|
@ -236,5 +236,5 @@
|
||||||
#error "SD CUSTOM_CABLE is not compatible with SKR Mini E3."
|
#error "SD CUSTOM_CABLE is not compatible with SKR Mini E3."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ON_BOARD_SPI_DEVICE 1 // SPI1
|
#define ONBOARD_SPI_DEVICE 1 // SPI1
|
||||||
#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
|
#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
|
||||||
|
|
|
@ -213,5 +213,5 @@
|
||||||
#define MOSI_PIN PA7
|
#define MOSI_PIN PA7
|
||||||
#define SS_PIN PA4
|
#define SS_PIN PA4
|
||||||
#endif
|
#endif
|
||||||
#define ON_BOARD_SPI_DEVICE 1 // SPI1
|
#define ONBOARD_SPI_DEVICE 1 // SPI1
|
||||||
#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
|
#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
|
||||||
|
|
|
@ -173,7 +173,7 @@
|
||||||
#define SS_PIN PA4
|
#define SS_PIN PA4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ON_BOARD_SPI_DEVICE 1 // SPI1
|
#define ONBOARD_SPI_DEVICE 1 // SPI1
|
||||||
#define ONBOARD_SD_CS_PIN PA4 // Chip select for SD-NAND
|
#define ONBOARD_SD_CS_PIN PA4 // Chip select for SD-NAND
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -150,7 +150,7 @@
|
||||||
//
|
//
|
||||||
#define SD_DETECT_PIN PC7
|
#define SD_DETECT_PIN PC7
|
||||||
#define SDCARD_CONNECTION ONBOARD
|
#define SDCARD_CONNECTION ONBOARD
|
||||||
#define ON_BOARD_SPI_DEVICE 1
|
#define ONBOARD_SPI_DEVICE 1
|
||||||
#define ONBOARD_SD_CS_PIN PA4 // SDSS
|
#define ONBOARD_SD_CS_PIN PA4 // SDSS
|
||||||
#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
|
||||||
|
|
|
@ -126,6 +126,7 @@
|
||||||
#define SDIO_SUPPORT
|
#define SDIO_SUPPORT
|
||||||
#define SDIO_CLOCK 4500000 // 4.5 MHz
|
#define SDIO_CLOCK 4500000 // 4.5 MHz
|
||||||
#define SD_DETECT_PIN PD12
|
#define SD_DETECT_PIN PD12
|
||||||
|
#define ONBOARD_SPI_DEVICE 1 // SPI1
|
||||||
#define ONBOARD_SD_CS_PIN PC11
|
#define ONBOARD_SD_CS_PIN PC11
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue