Skip to content

Commit f81f69c

Browse files
committed
[zero/SPI] Adding default values for SPI custom definitions
1 parent faa6490 commit f81f69c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

libraries/SPI/SPI.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,21 @@ void SPIClass::detachInterrupt() {
204204

205205
#if SPI_INTERFACES_COUNT > 0
206206

207+
/* In case new variant doesn't define these macros,
208+
* we put here the ones for Arduino Zero.
209+
*
210+
* These values should be different on some variants!
211+
*
212+
* The SPI PAD values can be found in cores/arduino/SERCOM.h:
213+
* - SercomSpiTXPad
214+
* - SercomRXPad
215+
*/
216+
#ifndef PERIPH_SPI
217+
#define PERIPH_SPI sercom4
218+
#define PAD_SPI_TX SPI_PAD_2_SCK_3
219+
#define PAD_SPI_RX SERCOM_RX_PAD_0
220+
#endif // PERIPH_SPI
221+
207222
SPIClass SPI( &PERIPH_SPI, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI, PAD_SPI_TX, PAD_SPI_RX );
208223

209224
#endif // SPI_INTERFACES_COUNT > 0

0 commit comments

Comments
 (0)