MKS Robin Mini uses ONBOARD_SPI_DEVICE (#19460)

This commit is contained in:
Jason Smith 2020-09-23 13:07:34 -07:00 committed by GitHub
parent 90bc1993b6
commit 023cb54fae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 13 deletions

View file

@ -21,23 +21,23 @@
#include "fastio.h"
#if HAS_SHARED_MEDIA
#ifndef ON_BOARD_SPI_DEVICE
#define ON_BOARD_SPI_DEVICE SPI_DEVICE
#ifndef ONBOARD_SPI_DEVICE
#define ONBOARD_SPI_DEVICE SPI_DEVICE
#endif
#define ONBOARD_SD_SPI SPI
#else
SPIClass OnBoardSPI(ON_BOARD_SPI_DEVICE);
#define ONBOARD_SD_SPI OnBoardSPI
SPIClass OnboardSPI(ONBOARD_SPI_DEVICE);
#define ONBOARD_SD_SPI OnboardSPI
#endif
#if ON_BOARD_SPI_DEVICE == 1
#if ONBOARD_SPI_DEVICE == 1
#define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_4
#else
#define SPI_CLOCK_MAX SPI_BAUD_PCLK_DIV_2
#endif
#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_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 FCLK_FAST() ONBOARD_SD_SPI.setClockDivider(SPI_CLOCK_MAX)
#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 */
ONBOARD_SD_SPI.setModule(ON_BOARD_SPI_DEVICE);
ONBOARD_SD_SPI.setModule(ONBOARD_SPI_DEVICE);
ONBOARD_SD_SPI.begin();
ONBOARD_SD_SPI.setBitOrder(MSBFIRST);
ONBOARD_SD_SPI.setDataMode(SPI_MODE0);

View file

@ -288,5 +288,5 @@
#error "SD CUSTOM_CABLE is not compatible with SKR E3 DIP."
#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

View file

@ -236,5 +236,5 @@
#error "SD CUSTOM_CABLE is not compatible with SKR Mini E3."
#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

View file

@ -213,5 +213,5 @@
#define MOSI_PIN PA7
#define SS_PIN PA4
#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

View file

@ -173,7 +173,7 @@
#define SS_PIN PA4
#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
#endif

View file

@ -150,7 +150,7 @@
//
#define SD_DETECT_PIN PC7
#define SDCARD_CONNECTION ONBOARD
#define ON_BOARD_SPI_DEVICE 1
#define ONBOARD_SPI_DEVICE 1
#define ONBOARD_SD_CS_PIN PA4 // SDSS
#define SDIO_SUPPORT
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

View file

@ -126,6 +126,7 @@
#define SDIO_SUPPORT
#define SDIO_CLOCK 4500000 // 4.5 MHz
#define SD_DETECT_PIN PD12
#define ONBOARD_SPI_DEVICE 1 // SPI1
#define ONBOARD_SD_CS_PIN PC11
//