Skip to content

Commit 28c3855

Browse files
committed
SPI: use NRF_SPI2 on nRF52 series
1 parent 81429bf commit 28c3855

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libraries/SPI/SPI.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
*/
2020

21+
#include <nrf.h>
22+
2123
#include "SPI.h"
2224
#include <Arduino.h>
2325
#include <wiring_private.h>
@@ -254,8 +256,13 @@ void SPIClass::detachInterrupt() {
254256
}
255257

256258
#if SPI_INTERFACES_COUNT > 0
259+
#if defined(NRF52_SERIES)
260+
SPIClass SPI (NRF_SPI2, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI);
261+
#else
257262
SPIClass SPI (NRF_SPI0, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI);
258263
#endif
264+
#endif
265+
259266
#if SPI_INTERFACES_COUNT > 1
260267
SPIClass SPI1(NRF_SPI1, PIN_SPI1_MISO, PIN_SPI1_SCK, PIN_SPI1_MOSI);
261268
#endif

0 commit comments

Comments
 (0)