Skip to content

Commit 601181c

Browse files
Merge pull request #54 from kisom/master
Add SPI clock divider support for 120MHz SAMD boards.
2 parents cee0af4 + d692e50 commit 601181c

File tree

1 file changed

+11
-1
lines changed
  • sparkfun/samd/libraries/SPI

1 file changed

+11
-1
lines changed

sparkfun/samd/libraries/SPI/SPI.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ class SPIClass {
163163
#define SPI_CLOCK_DIV32 96
164164
#define SPI_CLOCK_DIV64 192
165165
#define SPI_CLOCK_DIV128 255
166-
#endif
166+
#endif /* F_CPU == 48000000 */
167+
#if F_CPU == 120000000
168+
#define SPI_CLOCK_DIV2 15
169+
#define SPI_CLOCK_DIV4 30
170+
#define SPI_CLOCK_DIV8 60
171+
#define SPI_CLOCK_DIV16 120
172+
#define SPI_CLOCK_DIV32 240
173+
#define SPI_CLOCK_DIV64 480
174+
#define SPI_CLOCK_DIV128 960
175+
#endif /* F_CPU == 120000000 */
176+
167177

168178
#endif

0 commit comments

Comments
 (0)