diff options
author | Stephane D'Alu <sdalu@sdalu.com> | 2016-07-11 23:17:26 +0200 |
---|---|---|
committer | Stephane D'Alu <sdalu@sdalu.com> | 2016-07-11 23:17:26 +0200 |
commit | 194e5ec59ce0d58f82c99d17c026de64ba3f1316 (patch) | |
tree | 1e76e9986f0e0d89994d2d4961313d339a3341fc /os | |
parent | 8eabdabb052c686bb1dae89c81bcb92b7f02f413 (diff) | |
download | ChibiOS-Contrib-194e5ec59ce0d58f82c99d17c026de64ba3f1316.tar.gz ChibiOS-Contrib-194e5ec59ce0d58f82c99d17c026de64ba3f1316.tar.bz2 ChibiOS-Contrib-194e5ec59ce0d58f82c99d17c026de64ba3f1316.zip |
PSEL renamed in nrf52
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/NRF5/LLD/hal_i2c_lld.c | 7 | ||||
-rw-r--r-- | os/hal/ports/NRF5/LLD/hal_spi_lld.c | 6 |
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);
|