Skip to content

Commit 6091ba3

Browse files
Merge pull request sandeepmistry#177 from rogerclarkmelbourne/master
Add support for second SPI HW device
2 parents 98444be + d5b9b1c commit 6091ba3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

libraries/SPI/SPI.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,6 @@ void SPIClass::detachInterrupt() {
247247
#if SPI_INTERFACES_COUNT > 0
248248
SPIClass SPI (NRF_SPI0, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI);
249249
#endif
250+
#if SPI_INTERFACES_COUNT > 1
251+
SPIClass SPI1(NRF_SPI1, PIN_SPI1_MISO, PIN_SPI1_SCK, PIN_SPI1_MOSI);
252+
#endif

libraries/SPI/SPI.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ void SPIClass::transfer(void *buf, size_t count)
136136
#if SPI_INTERFACES_COUNT > 0
137137
extern SPIClass SPI;
138138
#endif
139+
#if SPI_INTERFACES_COUNT > 1
140+
extern SPIClass SPI1;
141+
#endif
139142

140143
// For compatibility with sketches designed for AVR @ 16 MHz
141144
// New programs should use SPI.beginTransaction to set the SPI clock

0 commit comments

Comments
 (0)