From d692e508f50f42b389b94a8604cca3fc5859d058 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Mon, 28 Oct 2019 16:16:59 -0700 Subject: [PATCH] Add SPI clock divider support for 120MHz SAMD boards. --- sparkfun/samd/libraries/SPI/SPI.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sparkfun/samd/libraries/SPI/SPI.h b/sparkfun/samd/libraries/SPI/SPI.h index d4ab2d64..fce636b9 100644 --- a/sparkfun/samd/libraries/SPI/SPI.h +++ b/sparkfun/samd/libraries/SPI/SPI.h @@ -163,6 +163,16 @@ class SPIClass { #define SPI_CLOCK_DIV32 96 #define SPI_CLOCK_DIV64 192 #define SPI_CLOCK_DIV128 255 -#endif +#endif /* F_CPU == 48000000 */ +#if F_CPU == 120000000 + #define SPI_CLOCK_DIV2 15 + #define SPI_CLOCK_DIV4 30 + #define SPI_CLOCK_DIV8 60 + #define SPI_CLOCK_DIV16 120 + #define SPI_CLOCK_DIV32 240 + #define SPI_CLOCK_DIV64 480 + #define SPI_CLOCK_DIV128 960 +#endif /* F_CPU == 120000000 */ + #endif