aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/NRF5
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/NRF5')
-rw-r--r--os/hal/ports/NRF5/LLD/hal_i2c_lld.c7
-rw-r--r--os/hal/ports/NRF5/LLD/hal_spi_lld.c6
2 files changed, 12 insertions, 1 deletions
diff --git a/os/hal/ports/NRF5/LLD/hal_i2c_lld.c b/os/hal/ports/NRF5/LLD/hal_i2c_lld.c
index 6412844..fefca0c 100644
--- a/os/hal/ports/NRF5/LLD/hal_i2c_lld.c
+++ b/os/hal/ports/NRF5/LLD/hal_i2c_lld.c
@@ -299,9 +299,14 @@ void i2c_lld_start(I2CDriver *i2cp) {
(void)i2c->EVENTS_RXDREADY;
(void)i2c->EVENTS_TXDSENT;
#endif
+#if NRF_SERIES == 51
i2c->PSELSCL = cfg->scl_pad;
i2c->PSELSDA = cfg->sda_pad;
-
+#else
+ i2c->PSEL.SCL = cfg->scl_pad;
+ i2c->PSEL.SDA = cfg->sda_pad;
+#endif
+
switch (cfg->clock) {
case 100000:
i2c->FREQUENCY = TWI_FREQUENCY_FREQUENCY_K100 << TWI_FREQUENCY_FREQUENCY_Pos;
diff --git a/os/hal/ports/NRF5/LLD/hal_spi_lld.c b/os/hal/ports/NRF5/LLD/hal_spi_lld.c
index 0e90e3f..2c6ec91 100644
--- a/os/hal/ports/NRF5/LLD/hal_spi_lld.c
+++ b/os/hal/ports/NRF5/LLD/hal_spi_lld.c
@@ -204,9 +204,15 @@ void spi_lld_start(SPIDriver *spip) {
/* Configuration.*/
spip->port->CONFIG = config;
+#if NRF_SERIES == 51
spip->port->PSELSCK = spip->config->sckpad;
spip->port->PSELMOSI = spip->config->mosipad;
spip->port->PSELMISO = spip->config->misopad;
+#else
+ spip->port->PSEL.SCK = spip->config->sckpad;
+ spip->port->PSEL.MOSI = spip->config->mosipad;
+ spip->port->PSEL.MISO = spip->config->misopad;
+#endif
spip->port->FREQUENCY = spip->config->freq;
spip->port->ENABLE = (SPI_ENABLE_ENABLE_Enabled << SPI_ENABLE_ENABLE_Pos);