From 194e5ec59ce0d58f82c99d17c026de64ba3f1316 Mon Sep 17 00:00:00 2001 From: Stephane D'Alu Date: Mon, 11 Jul 2016 23:17:26 +0200 Subject: PSEL renamed in nrf52 --- os/hal/ports/NRF5/LLD/hal_i2c_lld.c | 7 ++++++- os/hal/ports/NRF5/LLD/hal_spi_lld.c | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'os/hal/ports/NRF5/LLD') 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); -- cgit v1.2.3