2017-07-31 08:31:14 +02:00
/**
* Marlin 3 D Printer Firmware
2019-06-28 06:57:50 +02:00
* Copyright ( c ) 2019 MarlinFirmware [ https : //github.com/MarlinFirmware/Marlin]
2017-07-31 08:31:14 +02:00
*
* Based on Sprinter and grbl .
2019-06-28 06:57:50 +02:00
* Copyright ( c ) 2011 Camiel Gubbels / Erik van der Zalm
2017-07-31 08:31:14 +02:00
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
*
*/
2019-07-05 05:44:12 +02:00
# pragma once
2017-07-31 08:31:14 +02:00
/**
* Test Arduino Due specific configuration values for errors at compile - time .
*/
/**
2018-04-07 05:22:30 +02:00
* HARDWARE VS . SOFTWARE SPI COMPATIBILITY
*
* DUE selects hardware vs . software SPI depending on whether one of the hardware - controllable SDSS pins is in use .
*
* The hardware SPI controller doesn ' t allow software SPIs to control any shared pins .
*
* When DUE software SPI is used then Trinamic drivers must use the TMC softSPI .
*
* When DUE hardware SPI is used then a Trinamic driver can use either its hardware SPI or , if there are no shared
* pins , its software SPI .
*
* Usually the hardware SPI pins are only available to the LCD . This makes the DUE hard SPI used at the same time
* as the TMC2130 soft SPI the most common setup .
2017-07-31 08:31:14 +02:00
*/
2018-04-08 06:29:00 +02:00
# define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == MOSI_PIN || TMC_SW_##P == MISO_PIN || TMC_SW_##P == SCK_PIN))
2018-04-05 03:13:27 +02:00
2018-07-14 13:13:06 +02:00
# if ENABLED(SDSUPPORT) && HAS_DRIVER(TMC2130)
2018-04-07 05:22:30 +02:00
# if ENABLED(TMC_USE_SW_SPI)
2018-04-08 06:29:00 +02:00
# if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK))
2018-04-07 05:22:30 +02:00
# error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs."
# endif
# elif ENABLED(DUE_SOFTWARE_SPI)
# error "DUE software SPI is required but is incompatible with TMC2130 hardware SPI. Enable TMC_USE_SW_SPI to fix."
2018-04-05 03:13:27 +02:00
# endif
# endif
2019-03-26 07:03:23 +01:00
# if ENABLED(FAST_PWM_FAN)
# error "FAST_PWM_FAN is not yet implemented for this platform."
# endif
2020-01-02 04:51:15 +01:00
# if TMC_HAS_SW_SERIAL
# error "TMC220x Software Serial is not supported on this platform."
# endif