Browse Source

MKS Robin Mini uses ONBOARD_SPI_DEVICE (#19460)

vanilla_fb_2.0.x
Jason Smith 4 years ago
committed by Scott Lahteine
parent
commit
632ac54440
  1. 16
      Marlin/src/HAL/STM32F1/onboard_sd.cpp
  2. 2
      Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h
  3. 2
      Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h
  4. 2
      Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h
  5. 2
      Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h
  6. 2
      Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
  7. 1
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h

16
Marlin/src/HAL/STM32F1/onboard_sd.cpp

@ -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);

2
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h

@ -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

2
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h

@ -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

2
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h

@ -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

2
Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h

@ -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

2
Marlin/src/pins/stm32f1/pins_CREALITY_V4.h

@ -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

1
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h

@ -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
//

Loading…
Cancel
Save