summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarturo182 <arturo182@tlen.pl>2018-01-31 23:50:20 +0100
committerarturo182 <arturo182@tlen.pl>2018-02-02 20:31:47 +0100
commitd0b451be9400ae38655a7f73098c0e6eaa4170e8 (patch)
treeb008164b7284149973939bbc5e171d6811813f17
parenta776c2a51c28825f9dcd33f73286d27b9b98e4fc (diff)
nrf: Use the right SPI registers on nRF52840
-rw-r--r--ports/nrf/common-hal/busio/SPI.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c
index 32ebbf53a..efce3568e 100644
--- a/ports/nrf/common-hal/busio/SPI.c
+++ b/ports/nrf/common-hal/busio/SPI.c
@@ -69,10 +69,15 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) {
return;
}
+#ifdef NRF52840_XXAA
+ self->spi->PSEL.SCK = SPI_PSEL_SCK_CONNECT_Disconnected;
+ self->spi->PSEL.MOSI = SPI_PSEL_MOSI_CONNECT_Disconnected;
+ self->spi->PSEL.MISO = SPI_PSEL_MISO_CONNECT_Disconnected;
+#else
self->spi->PSELSCK = SPI_PSEL_SCK_PSELSCK_Disconnected;
self->spi->PSELMOSI = SPI_PSEL_MOSI_PSELMOSI_Disconnected;
self->spi->PSELMISO = SPI_PSEL_MISO_PSELMISO_Disconnected;
-
+#endif
// reset_pin(self->clock_pin);
// reset_pin(self->MOSI_pin);
// reset_pin(self->MISO_pin);