aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/NRF5/LLD/hal_i2c_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/NRF5/LLD/hal_i2c_lld.c')
-rw-r--r--os/hal/ports/NRF5/LLD/hal_i2c_lld.c7
1 files changed, 6 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;