PSEL renamed in nrf52
This commit is contained in:
parent
8eabdabb05
commit
194e5ec59c
|
@ -299,8 +299,13 @@ void i2c_lld_start(I2CDriver *i2cp) {
|
||||||
(void)i2c->EVENTS_RXDREADY;
|
(void)i2c->EVENTS_RXDREADY;
|
||||||
(void)i2c->EVENTS_TXDSENT;
|
(void)i2c->EVENTS_TXDSENT;
|
||||||
#endif
|
#endif
|
||||||
|
#if NRF_SERIES == 51
|
||||||
i2c->PSELSCL = cfg->scl_pad;
|
i2c->PSELSCL = cfg->scl_pad;
|
||||||
i2c->PSELSDA = cfg->sda_pad;
|
i2c->PSELSDA = cfg->sda_pad;
|
||||||
|
#else
|
||||||
|
i2c->PSEL.SCL = cfg->scl_pad;
|
||||||
|
i2c->PSEL.SDA = cfg->sda_pad;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (cfg->clock) {
|
switch (cfg->clock) {
|
||||||
case 100000:
|
case 100000:
|
||||||
|
|
|
@ -204,9 +204,15 @@ void spi_lld_start(SPIDriver *spip) {
|
||||||
|
|
||||||
/* Configuration.*/
|
/* Configuration.*/
|
||||||
spip->port->CONFIG = config;
|
spip->port->CONFIG = config;
|
||||||
|
#if NRF_SERIES == 51
|
||||||
spip->port->PSELSCK = spip->config->sckpad;
|
spip->port->PSELSCK = spip->config->sckpad;
|
||||||
spip->port->PSELMOSI = spip->config->mosipad;
|
spip->port->PSELMOSI = spip->config->mosipad;
|
||||||
spip->port->PSELMISO = spip->config->misopad;
|
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->FREQUENCY = spip->config->freq;
|
||||||
spip->port->ENABLE = (SPI_ENABLE_ENABLE_Enabled << SPI_ENABLE_ENABLE_Pos);
|
spip->port->ENABLE = (SPI_ENABLE_ENABLE_Enabled << SPI_ENABLE_ENABLE_Pos);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue